-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhikvision_detect.rb
55 lines (48 loc) · 1.26 KB
/
hikvision_detect.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
class MetasploitModule < Msf::Auxiliary
include Msf::Exploit::Remote::HttpClient
include Msf::Auxiliary::Scanner
def initialize(info = {})
super(update_info(info,
'Name' => 'Hikvision Device Scanner',
'Description' => %q{
This module scans for Hikvision devices by requesting specific URLs and
looking for specific keywords in the response body.
},
'Author' => ['K3ysTr0K3R'],
'License' => MSF_LICENSE
))
register_options(
[
Opt::RPORT(80),
OptInt.new('THREADS', [true, 'The number of concurrent threads', 10])
]
)
end
def run_host(ip)
paths = [
'/favicon.ico',
'/doc/page/login.asp'
]
found = false
paths.each do |path|
break if found
res = send_request_cgi({
'method' => 'GET',
'uri' => path
})
if res && res.body && res.body.include?('Hikvision Digital Technology')
print_good("Hikvision device found at #{ip}")
note = {
host: ip,
port: datastore['RPORT'],
proto: 'tcp',
sname: 'http',
desc: 'Hikvision device detected',
data: res.body
}
report_note(note)
found = true
end
end
end
end