先看端口,看到了一个dvr的服务,老规矩只要有服务就先去看看
PORT STATE SERVICE VERSION
22/tcp open ssh Bitvise WinSSHD 8.48 (FlowSsh 8.48; protocol 2.0; non-commercial use)
| ssh-hostkey:
| 3072 21:25:f0:53:b4:99:0f:34:de:2d:ca:bc:5d:fe:20:ce (RSA)
|_ 384 e7:96:f3:6a:d8:92:07:5a:bf:37:06:86:0a:31:73:19 (ECDSA)
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
445/tcp open microsoft-ds?
5040/tcp open unknown
8080/tcp open http-proxy
|_http-title: Argus Surveillance DVR
|_http-generator: Actual Drawing 6.0 (http://www.pysoft.com) [PYSOFTWARE]
| fingerprint-strings:
| GetRequest, HTTPOptions:
| HTTP/1.1 200 OK
| Connection: Keep-Alive
| Keep-Alive: timeout=15, max=4
| Content-Type: text/html
| Content-Length: 985
| <HTML>
| <HEAD>
| <TITLE>
| Argus Surveillance DVR
| </TITLE>
| <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
| <meta name="GENERATOR" content="Actual Drawing 6.0 (http://www.pysoft.com) [PYSOFTWARE]">
| <frameset frameborder="no" border="0" rows="75,*,88">
| <frame name="Top" frameborder="0" scrolling="auto" noresize src="CamerasTopFrame.html" marginwidth="0" marginheight="0">
| <frame name="ActiveXFrame" frameborder="0" scrolling="auto" noresize src="ActiveXIFrame.html" marginwidth="0" marginheight="0">
| <frame name="CamerasTable" frameborder="0" scrolling="auto" noresize src="CamerasBottomFrame.html" marginwidth="0" marginheight="0">
| <noframes>
| <p>This page uses frames, but your browser doesn't support them.</p>
|_ </noframes>
49664/tcp open msrpc Microsoft Windows RPC
49665/tcp open msrpc Microsoft Windows RPC
49666/tcp open msrpc Microsoft Windows RPC
49667/tcp open msrpc Microsoft Windows RPC
49668/tcp open msrpc Microsoft Windows RPC
49669/tcp open msrpc Microsoft Windows RPC
1 service unrecognized despite returning data. If you know the service/version, please submit the following fingerprint at https://nmap.org/cgi-bin/submit.cgi?new-service :
SF-Port8080-TCP:V=7.95%I=7%D=6/9%Time=68464679%P=x86_64-pc-linux-gnu%r(Get
SF:Request,451,"HTTP/1\.1\x20200\x20OK\r\nConnection:\x20Keep-Alive\r\nKee
SF:p-Alive:\x20timeout=15,\x20max=4\r\nContent-Type:\x20text/html\r\nConte
SF:nt-Length:\x20985\r\n\r\n<HTML>\r\n<HEAD>\r\n<TITLE>\r\nArgus\x20Survei
SF:llance\x20DVR\r\n</TITLE>\r\n\r\n<meta\x20http-equiv=\"Content-Type\"\x
SF:20content=\"text/html;\x20charset=ISO-8859-1\">\r\n<meta\x20name=\"GENE
SF:RATOR\"\x20content=\"Actual\x20Drawing\x206\.0\x20\(http://www\.pysoft\
SF:.com\)\x20\[PYSOFTWARE\]\">\r\n\r\n<frameset\x20frameborder=\"no\"\x20b
SF:order=\"0\"\x20rows=\"75,\*,88\">\r\n\x20\x20<frame\x20name=\"Top\"\x20
SF:frameborder=\"0\"\x20scrolling=\"auto\"\x20noresize\x20src=\"CamerasTop
SF:Frame\.html\"\x20marginwidth=\"0\"\x20marginheight=\"0\">\x20\x20\r\n\x
SF:20\x20<frame\x20name=\"ActiveXFrame\"\x20frameborder=\"0\"\x20scrolling
SF:=\"auto\"\x20noresize\x20src=\"ActiveXIFrame\.html\"\x20marginwidth=\"0
SF:\"\x20marginheight=\"0\">\r\n\x20\x20<frame\x20name=\"CamerasTable\"\x2
SF:0frameborder=\"0\"\x20scrolling=\"auto\"\x20noresize\x20src=\"CamerasBo
SF:ttomFrame\.html\"\x20marginwidth=\"0\"\x20marginheight=\"0\">\x20\x20\r
SF:\n\x20\x20<noframes>\r\n\x20\x20\x20\x20<p>This\x20page\x20uses\x20fram
SF:es,\x20but\x20your\x20browser\x20doesn't\x20support\x20them\.</p>\r\n\x
SF:20\x20</noframes>\r")%r(HTTPOptions,451,"HTTP/1\.1\x20200\x20OK\r\nConn
SF:ection:\x20Keep-Alive\r\nKeep-Alive:\x20timeout=15,\x20max=4\r\nContent
SF:-Type:\x20text/html\r\nContent-Length:\x20985\r\n\r\n<HTML>\r\n<HEAD>\r
SF:\n<TITLE>\r\nArgus\x20Surveillance\x20DVR\r\n</TITLE>\r\n\r\n<meta\x20h
SF:ttp-equiv=\"Content-Type\"\x20content=\"text/html;\x20charset=ISO-8859-
SF:1\">\r\n<meta\x20name=\"GENERATOR\"\x20content=\"Actual\x20Drawing\x206
SF:\.0\x20\(http://www\.pysoft\.com\)\x20\[PYSOFTWARE\]\">\r\n\r\n<framese
SF:t\x20frameborder=\"no\"\x20border=\"0\"\x20rows=\"75,\*,88\">\r\n\x20\x
SF:20<frame\x20name=\"Top\"\x20frameborder=\"0\"\x20scrolling=\"auto\"\x20
SF:noresize\x20src=\"CamerasTopFrame\.html\"\x20marginwidth=\"0\"\x20margi
SF:nheight=\"0\">\x20\x20\r\n\x20\x20<frame\x20name=\"ActiveXFrame\"\x20fr
SF:ameborder=\"0\"\x20scrolling=\"auto\"\x20noresize\x20src=\"ActiveXIFram
SF:e\.html\"\x20marginwidth=\"0\"\x20marginheight=\"0\">\r\n\x20\x20<frame
SF:\x20name=\"CamerasTable\"\x20frameborder=\"0\"\x20scrolling=\"auto\"\x2
SF:0noresize\x20src=\"CamerasBottomFrame\.html\"\x20marginwidth=\"0\"\x20m
SF:arginheight=\"0\">\x20\x20\r\n\x20\x20<noframes>\r\n\x20\x20\x20\x20<p>
SF:This\x20page\x20uses\x20frames,\x20but\x20your\x20browser\x20doesn't\x2
SF:0support\x20them\.</p>\r\n\x20\x20</noframes>\r");
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running (JUST GUESSING): Microsoft Windows 10|2019|11 (97%)
OS CPE: cpe:/o:microsoft:windows_10 cpe:/o:microsoft:windows_server_2019 cpe:/o:microsoft:windows_11
Aggressive OS guesses: Microsoft Windows 10 1803 (97%), Microsoft Windows 10 1903 - 21H1 (97%), Microsoft Windows 10 1809 (93%), Microsoft Windows 10 1909 (92%), Microsoft Windows 10 1909 - 2004 (92%), Windows Server 2019 (92%), Microsoft Windows 10 20H2 (89%), Microsoft Windows 11 (88%), Microsoft Windows 10 20H2 - 21H1 (88%), Microsoft Windows 10 21H2 (88%)
No exact OS matches for host (test conditions non-ideal).
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows
Host script results:
| smb2-time:
| date: 2025-06-09T02:29:43
|_ start_date: N/A
|_clock-skew: -1s
| smb2-security-mode:
| 3:1:1:
|_ Message signing enabled but not required
在kali的漏洞库先去看看有没有可以利用的exp(平常是通常会省掉这一步,但是这个服务的一些漏洞挺有意思于是我就截一下图),这不查不知道,一查吓一跳,这个服务的4.0存在一堆漏洞,有文件读取的,有弱口令破解的,还有提权的,这就很有意思了,按照我们现在的大致猜想,肯定先从文件读取那里搞起。,因为其他的几个exp的前置条件都不满足。
打开这个exp的文件,看看他的利用手法,发现是通过是这种构造方式进行文件读取
直接照葫芦画瓢,复制上去,发现可以读取这个ini文件,由于这个windows主机开放了22端口,那我们肯定要去尝试读一下用户的私钥,尝试看能不能进行密钥登录(但是密钥读取需要用户名所以我们后续要去找这个目标主机的用户,然后再进一步读取)
好巧不巧,这个服务有user.html界面,可以看到目标主机可能存在两个用户,至于是否存在其他用户我不关心,直接来一下刚才的文件读取尝试
测试发现这个viewer用户可以读取到密钥,那看来administrtor就是我们要提权的下一个用户了,为什么呢因为一个是名字的原因,一个是我们刚才获取的可以破解弱口令的exp,所以结合一下就可以大致猜测一下
然后由于浏览器打印出来的密钥格式有点问题,所以这里我们用curl命令进行读取,效果是一样的
也是成功登录到了viewer账户(鼓掌👏)
然后就是winpeas信息收集了,这个是必不可少的,但是我们发现在这个shell下面,winpeas倒是能运行但不是彩色的,所以我们用一下nc.exe换一个shell
这里下载好nc.exe直接连我们的kali
再次运行winpeas,这个时候输出结果就是彩色的了,但是跑完一遍之后并没有发现什么好玩的
然后还记得我们原先的想法吗,找一下这个administrtor用户的加密密码,在浏览器搜索之后发现了一个破解密码的py脚本,而且还给出了这个界面的用户密码存在哪里的目录,这个时候其实就是更加肯定了我之前的想法
果断直接进入这个目录底下查看这个ini文件
也是得到了administrator用户加密密码,这个时候其实感觉已经可以宣布结束了,但是还是去破解一下,确认一下
然后这里我们有两个选择一个用kali上的exp进行破解,但是最后一个字符破解不出来需要穷举特殊符号,一个就是用我们在浏览器上面找到的python脚本去跑,人家那个的规则库比kali自带的全太多了,可以省去穷举的那一步,所以我就选择了第二种(这也是提醒大家,在kali上面得到的exp可能是有效的,但是最好再去浏览器上面看看是不是有利用更简单的更完善的exp,双管齐下才是最优的选择)
这里大家对比也是可以看到了第二种,可以直接破解出来密码
得到秘密之后,在windows主机上面使用runas命令进行横向登录,或者使用上一篇文章中runas的powershell脚本
这里也是成功拿到了管理员的权限,顺利结束👏
总结:
难度不大,重点是不是可以联想到这几步,尤其是在发现一个服务版本存在多种不同的exp可以联想到组合破解,然后这里面为啥不直接读取viewer用户的密码然后ssh登录,原因是这个22端口直接受密钥登录,所以只能去读密钥,其他我就没想到啥了,挺简单的一个靶机,可以锻炼思维
链接:
s3l33/CVE-2022-25012: Updated version of this weak password encryption script