Class: Dvash::Honeyport
- Inherits:
-
Core
- Object
- Core
- Dvash::Honeyport
show all
- Defined in:
- lib/dvash/honeyports/ipv4/rdp.rb,
lib/dvash/honeyports/ipv4/ssh.rb,
lib/dvash/honeyports/ipv6/rdp.rb,
lib/dvash/honeyports/ipv6/ssh.rb,
lib/dvash/honeyports/ipv4/http.rb,
lib/dvash/honeyports/ipv6/http.rb,
lib/dvash/honeyports/ipv4/telnet.rb
Overview
Main Honeyport class to simulate daemons
Instance Method Summary
collapse
Methods inherited from Core
#client_ip, #load_conf, #load_honeyport, #random_data, #valid_ip?, #valid_user?, #validate_os
Instance Method Details
#ipv4_http ⇒ Object
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/dvash/honeyports/ipv4/http.rb', line 17
def ipv4_http
server = TCPServer.new(80)
loop do
Thread.fork(server.accept) do |client|
if valid_ip?(client_ip(client)) then
client.puts(random_data)
@@os.block_ip(client_ip(client))
end
client.close
end
end
end
|
#ipv4_rdp ⇒ Object
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/dvash/honeyports/ipv4/rdp.rb', line 17
def ipv4_rdp
server = TCPServer.new(3389)
loop do
Thread.fork(server.accept) do |client|
if valid_ip?(client_ip(client)) then
client.puts(random_data)
@@os.block_ip(client_ip(client))
end
client.close
end
end
end
|
#ipv4_ssh ⇒ Object
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/dvash/honeyports/ipv4/ssh.rb', line 17
def ipv4_ssh
server = TCPServer.new(22)
loop do
Thread.fork(server.accept) do |client|
if valid_ip?(client_ip(client)) then
client.puts(random_data)
@@os.block_ip(client_ip(client))
end
client.close
end
end
end
|
#ipv4_telnet ⇒ Object
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/dvash/honeyports/ipv4/telnet.rb', line 17
def ipv4_telnet
server = TCPServer.new(23)
loop do
Thread.fork(server.accept) do |client|
if valid_ip?(client_ip(client)) then
client.puts(random_data)
@@os.block_ip(client_ip(client))
end
client.close
end
end
end
|
#ipv6_http ⇒ Object
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/dvash/honeyports/ipv6/http.rb', line 17
def ipv6_http
server = TCPServer.new('::', 80)
loop do
Thread.fork(server.accept) do |client|
if valid_ip?(client_ip(client)) then
client.puts(random_data)
@@os.block_ip(client_ip(client))
end
client.close
end
end
end
|
#ipv6_rdp ⇒ Object
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/dvash/honeyports/ipv6/rdp.rb', line 17
def ipv6_rdp
server = TCPServer.new('::', 3389)
loop do
Thread.fork(server.accept) do |client|
if valid_ip?(client_ip(client)) then
client.puts(random_data)
@@os.block_ip(client_ip(client))
end
client.close
end
end
end
|
#ipv6_ssh ⇒ Object
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/dvash/honeyports/ipv6/ssh.rb', line 17
def ipv6_ssh
server = TCPServer.new('::', 22)
loop do
Thread.fork(server.accept) do |client|
if valid_ip?(client_ip(client)) then
client.puts(random_data)
@@os.block_ip(client_ip(client))
end
client.close
end
end
end
|