File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed
modules/auxiliary/scanner/ssh Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change
1
+ require 'msf/core'
2
+
3
+ class Metasploit4 < Msf ::Auxiliary
4
+
5
+ include Msf ::Exploit ::Remote ::Tcp
6
+ include Msf ::Auxiliary ::Scanner
7
+ include Msf ::Auxiliary ::Report
8
+
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
+ ] )
28
+ end
29
+
30
+ def run_host ( ip )
31
+ connect
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" )
46
+ end
47
+ end
48
+
49
+ end
You can’t perform that action at this time.
0 commit comments