当前位置:网站首页>【Try to Hack】vulnhub DC2
【Try to Hack】vulnhub DC2
2022-06-29 14:40:00 【Happy star】
Blog home page : Happy star The blog home page of
Series column :Try to Hack
Welcome to focus on the likes collection ️ Leaving a message.
Starting time :2022 year 6 month 29 Japan
The author's level is very limited , If an error is found , Please let me know , thank !
Target aircraft knowledge points :
1、hosts file
2、dirb Scan directory
3、wpscan Enumerate user names
4、cewl Crawl password
5、ssh Service login
6、rbash The escape
7、git Raise the right

The first is the bridging mode
It should be noted that this range is not static IP, that 192.168.0.145 Just an example , Tell us how to set up hosts Of documents
Download the target as usual , It defaults to the bridge mode 
No need to change
kali The attacker also sets the bridge mode ( I did it like this )
netdiscover Host discovery
Because the target is not in bridge mode , And our kali It may not be in the same segment arp-scan -l Can only scan and kali Hosts in the same network segment 
This is our target plane , because VMare,Inc
Port scanning namp -sV -p- 192.168.0.131
80 Port open , visit 192.168.0.131
This is the result
According to the description of the topic at the beginning , Go set up hostsvim /etc/hosts

Successful visit 
Prompt us to use cewlwhatweb 192.168.0.131
yes wordpress
dirb http://192.168.0.131
Directory scanning 
http://192.168.0.131/wp-admin/
It may be backstage , Visit 
Is, indeed, , Account and password required
Now we use cewl Well
Crawling website content , Generate Dictionary
cewl dc-2 > dc-2.txt
This is the password dictionary
We use wpscan Get username wpscan --url http://dc-2 -e u

Save as user.txt
wpscan --url http://dc-2 --usernames user.txt --passwords dc-2.txt
use bp It's fine too 
Sign in jerry, Just look for it 

Remind us not to use wordpress A loophole in the

I thought I could write shell Of
Log in with two accounts and passwords ssh
ssh -p 7744 [email protected]192.168.0.131
ssh -p 7744 [email protected]192.168.0.131

Log in , Also found that flag3 了
But the command to read the file is ban 了
See what commands you can use
echo $PATH
echo /home/tom/usr/bin/*

vi flag3.txt
I saw it flag
see wp understand , Let's use it tom The user switches to jerry
Need to use su

rbash The escape
rbash With the general shell The difference is that it limits some behaviors , Make some commands impossible to execute .
【 Penetration test 】— rbash Brief description of escape methods
stay vi Of : You can put /bin/bash Copy to shellvi
Input ::set shell=/bin/sh
Input again ::shell
obtain shell 了
After the switch is completed, add environment variables . to $PATH Add two paths to the variable , Used to find commands
export PATH=$PATH:/bin/
export PATH=$PATH:/usr/bin/

succeed
Look for flag
Tips git
git Raise the right
Method 1
sudo git help config
!/bin/bash or !‘sh’
Method 2
sudo git -p help
!/bin/bash

边栏推荐
猜你喜欢

微信小程序:全新獨家雲開發微群人脈

微信小程序:装B神器P图修改微信流量主小程序源码下载趣味恶搞图制作免服务器域名

Swagger2的配置教程

leetcode:226. Flip binary tree

部署搭建decentraland流程讲解

第五届中国软件开源创新大赛 | openGauss赛道直播培训
![[top] blog instructions, bulletin board, message board, about bloggers](/img/3a/6100ae88874cad57305decce41c1e7.png)
[top] blog instructions, bulletin board, message board, about bloggers

微信小程序:(更新)云开发微群人脉

uniApp问题清单与经验

By proxy, by buyout, the wild era of domestic end-to-end travel is waiting for the next "eternal robbery"
随机推荐
MySQL数据库:存储引擎
一次mysql的.ibd文件过大处理过程记录
Persistence mechanism of redis
《canvas》之第5章 文本操作
微信小程序:修复采集接口版云开发表情包
Applet Wechat: un nouveau réseau exclusif de microgroupes de développement de Cloud
Navicat连接MySQL8.0的正确方法(亲测有效)
Introduction to veeambackup & replication
MySQL数据库:分区Partition
JUC multithreading: creation and working principle of thread pool
布隆过滤器Bloom Filter简介
你还在用命令看日志?快用 Kibana 吧,一张图胜过千万行日志
redis在window和Linux环境下的安装
golang代码规范整理
Class template case - array class encapsulation
【烹饪记录】--- 酸辣白菜
传输层 用户数据报协议(UDP)
Analysis of istio -- observability
Introduction to bloom filter
Installation and removal of cover for CPU protection on desktop motherboard