Skip to content

Commit 81a069d

Browse files
committed
Merge pull request #1 from wvu-r7/pr/4361
Merging changes. Thanks for all the help!
2 parents 8dd5da9 + 8394cc1 commit 81a069d

File tree

1 file changed

+35
-26
lines changed

1 file changed

+35
-26
lines changed
Lines changed: 35 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,49 @@
11
require 'msf/core'
22

3-
class Metasploit3 < Msf::Auxiliary
3+
class Metasploit4 < Msf::Auxiliary
44

55
include Msf::Exploit::Remote::Tcp
66
include Msf::Auxiliary::Scanner
77
include Msf::Auxiliary::Report
88

9-
def initialize
10-
super(
11-
'Name' => 'Kippo SSH Honeypot Detector',
12-
'Description' => %q{This module will detect if an SSH server is running a Kippo
13-
honeypot. This is done by issuing unexpected data to the SSH service and checking
14-
the response returned for two particular non-standard error messages.},
15-
'References' =>
16-
[
17-
[ 'URL', 'https://cultofthedyingsun.wordpress.com/2014/09/12/death-by-magick-number-fingerprinting-kippo-2014/' ],
18-
[ 'URL', 'http://morris.guru/detecting-kippo-ssh-honeypots/' ],
19-
],
20-
'Author' => 'Andrew Morris <andrew[at]morris.guru>',
21-
'License' => MSF_LICENSE
22-
)
23-
register_options(
24-
[
25-
Opt::RPORT(22)
26-
], self.class)
9+
def initialize(info = {})
10+
super(update_info(info,
11+
'Name' => 'Kippo SSH Honeypot Detector',
12+
'Description' => %q{
13+
This module will detect if an SSH server is running a Kippo honeypot.
14+
This is done by issuing unexpected data to the SSH service and checking
15+
the response returned for two particular non-standard error messages.
16+
},
17+
'Author' => 'Andrew Morris <andrew[at]morris.guru>',
18+
'References' => [
19+
['URL', 'https://cultofthedyingsun.wordpress.com/2014/09/12/death-by-magick-number-fingerprinting-kippo-2014/'],
20+
['URL', 'http://morris.guru/detecting-kippo-ssh-honeypots/']
21+
],
22+
'License' => MSF_LICENSE
23+
))
24+
25+
register_options([
26+
Opt::RPORT(22)
27+
])
2728
end
2829

2930
def run_host(ip)
3031
connect
31-
banner = sock.get_once(1024)
32-
sock.put(banner+"\n"*8)
33-
response = sock.get(1024)
34-
if response == "Protocol mismatch.\n" or response.include? "bad packet length 168430090"
35-
print_status("#{ip}:#{rport} - Kippo honeypot detected!")
36-
report_service(:host => rhost, :port => rport, :name => "ssh", :info => "Kippo SSH Honeypot")
32+
banner = sock.get_once
33+
sock.put(banner + "\n" * 8)
34+
response = sock.get_once
35+
36+
if response =~ /(?:^Protocol mismatch\.\n$|bad packet length)/
37+
print_good("#{ip}:#{rport} - Kippo detected!")
38+
report_service(
39+
:host => ip,
40+
:port => rport,
41+
:name => 'ssh',
42+
:info => 'Kippo SSH honeypot'
43+
)
44+
else
45+
vprint_status("#{ip}:#{rport} - #{banner.strip} detected")
3746
end
3847
end
39-
end
4048

49+
end

0 commit comments

Comments
 (0)