当前位置:网站首页>MOMENTUM: 2 vulnhub walkthrough
MOMENTUM: 2 vulnhub walkthrough
2022-08-02 03:25:00 【xdeclearn】
信息
Momentum2.ova (Size: 698 MB)
Download (Mirror): https://download.vulnhub.com/momentum/Momentum2.ova
Download (Torrent): https://download.vulnhub.com/momentum/Momentum2.ova.torrent ( Magnet)
端口扫描和目录扫描
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
访问80端口,没发现什么有价值的东西。
于是进行目录扫描,这里使用gobuster进行目录遍历。
* gobuster-linux-amd64 ./gobuster dir -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -u http://192.168.143.183 -x php,php.bak,html,txt
===============================================================
Gobuster v3.1.0
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url: http://192.168.143.183
[+] Method: GET
[+] Threads: 10
[+] Wordlist: /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
[+] Negative Status codes: 404
[+] User Agent: gobuster/3.1.0
[+] Extensions: php,php.bak,html,txt
[+] Timeout: 10s
===============================================================
2021/07/19 08:45:42 Starting gobuster in directory enumeration mode
===============================================================
/index.html (Status: 200) [Size: 1428]
/img (Status: 301) [Size: 316] [--> http://192.168.143.183/img/]
/css (Status: 301) [Size: 316] [--> http://192.168.143.183/css/]
/ajax.php (Status: 200) [Size: 0]
/ajax.php.bak (Status: 200) [Size: 357]
/manual (Status: 301) [Size: 319] [--> http://192.168.143.183/manual/]
/js (Status: 301) [Size: 315] [--> http://192.168.143.183/js/]
/dashboard.html (Status: 200) [Size: 513]
/owls (Status: 301) [Size: 317] [--> http://192.168.143.183/owls/]
/server-status (Status: 403) [Size: 280]
访问dashboard.html,发现可以进行文件上传,上传处理为ajax.php,但是这里做了一些限制,具体查看ajax.php.bak。
//The boss told me to add one more Upper Case letter at the end of the cookie
if(isset($_COOKIE['admin']) && $_COOKIE['admin'] == '&[email protected]&Ms'){
//[+] Add if $_POST['secure'] == 'val1d'
$valid_ext = array("pdf","php","txt");
}
else{
$valid_ext = array("txt");
}
// Remember success upload returns 1
可以看到上传需要添加参数secure和cookie,但是cookie需要在其后添加一个大写字母进行遍历测试,为了方便,直接使用burp的intruder模块。

成功实现文件上传。
获取shell,root提权
curl访问页面获取反弹shell。
进入/home/athena,发现了第一个flag和一个密码提示文件。
按照提示得到了用户athena的密码myvulnerableapp*。切换到该用户,查看sudo -l。
看看cookie-gen.py
import random
import os
import subprocess
print('~ Random Cookie Generation ~')
print('[!] for security reasons we keep logs about cookie seeds.')
chars = '@#$ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefgh'
seed = input("Enter the seed : ")
random.seed = seed
cookie = ''
for c in range(20):
cookie += random.choice(chars)
print(cookie)
cmd = "echo %s >> log.txt" % seed
subprocess.Popen(cmd, shell=True)
很简单,直接一个命令拼接反弹shell搞定,成功获取root权限。

边栏推荐
- IO流、 编码表、 字符流、 字符缓冲流
- [league/flysystem] An elegant and highly supported file operation interface
- Eric靶机渗透测试通关全教程
- 轮播图详解(完整代码在最后)
- (6) 学生信息管理系统设计
- 每日五道面试题总结 22/7/21
- js 之 Object.defineProperty()
- The Error in the render: "TypeError: always read the properties of null '0' (reading)" Error solution
- 4.表单与输入
- DVWA靶机安装教程
猜你喜欢

(1) print()函数、转义字符、二进制与字符编码 、变量、数据类型、input()函数、运算符

hackmyvm: juggling walkthrough

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

SQL分类、DQL(数据查询语言)、以及相应SQL查询语句演示

如何根据地图上的两个坐标点来确定方向

DVWA靶机安装教程

MySql Advanced -- Constraints

TypeScript error error TS2469, error TS2731 solution

SQL classification, DQL (Data Query Language), and corresponding SQL query statement demonstration

js eventLoop 事件循环机制
随机推荐
14. JS Statements and Comments, Variables and Data Types
1.初识PHP
1.8今日学习
Baidu positioning js API
SQL classification, DQL (Data Query Language), and corresponding SQL query statement demonstration
kali安装IDEA
Advanced Operations on Arrays
MySql Advanced -- Constraints
[sebastian/diff]一个比较两段文本的历史变化扩展库
js 之 Object.defineProperty()
12. What is JS
ES6数组的扩展方法map、filter、reduce、fill和数组遍历for…in for…of arr.forEach
easyswoole uses redis to perform geoRadiusByMember Count invalid fix
(2) Thinkphp6 template engine ** tag
PHP的几个有趣的打开方式:从基本到变态
hackmyvm-hopper walkthrough
使用PHPMailer发送邮件
QR code generation API interface, which can be directly connected as an A tag
ES6迭代器解释举例
2. PHP variables, output, EOF, conditional statements