当前位置:网站首页>[HITCON 2017]SSRFme
[HITCON 2017]SSRFme
2022-07-27 00:49:00 【A new reading of the tea classic】
[HITCON 2017]SSRFme
Come to the point , Enter the page and give it directly php Code :
10.244.80.206 <?php
if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$http_x_headers = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
$_SERVER['REMOTE_ADDR'] = $http_x_headers[0];
}
echo $_SERVER["REMOTE_ADDR"];
$sandbox = "sandbox/" . md5("orange" . $_SERVER["REMOTE_ADDR"]);
@mkdir($sandbox);
@chdir($sandbox);
$data = shell_exec("GET " . escapeshellarg($_GET["url"]));
$info = pathinfo($_GET["filename"]);
$dir = str_replace(".", "", basename($info["dirname"]));
@mkdir($dir);
@chdir($dir);
@file_put_contents(basename($info["basename"]), $data);
highlight_file(__FILE__);The audit code knows , Back to my ip, And orange Combine md5 Encrypted to get sandbox route

Path is :/sandbox/2eeed2f9aeae6311b507ada8fb98809e/
adopt url Input will GET Command execution , After execution, it will be saved to us with filename In named file , Try to read the root directory , And create a file :payload:/?url=/&filename=a, Then return to the path to view the content , Found out flag and readflag, It should be through readflag To read flag

GET The bottom layer actually uses open function ,open Function can execute commands , In short, if we want to use GET file:|id, You have to meet id This file exists . We need to implement /readflag, So you need to create a /readflag file , structure payload:/?url=/&filename=|/readflag
![]()
And then use it file Function executes the command to construct again payload:/?url=file:|/readflag&filename=a, After execution, return to the path again to check flag
![]()
![]()
![]()
边栏推荐
猜你喜欢

C language to find prime numbers, leap years and minimum common multiples and maximum common divisors

Medical data of more than 4000 people has been exposed for 16 years

JSCORE day_03(7.4)
![[NCTF2019]SQLi](/img/a9/e103ccbbbb7dcf5ed20eb2bada528f.png)
[NCTF2019]SQLi

Based on the theoretical principle and simulation results of MATLAB spherical decoding, compare 2norm spherical decoding, infinite norm spherical decoding, ML detection

Linux系统中安装Redis-7.0.4
![[leetcode] no duplicate longest string](/img/97/bf8c9b019136ab372ce2c43cddbb2c.jpg)
[leetcode] no duplicate longest string

【4.10 博弈论详解】

JSCORE day_ 05(7.6)

postman的使用
随机推荐
【Codeforces Round #807 (Div 2.) A·B·C】
【3. Vim 操作】
C语言 关机小程序
5_ Linear regression
[HFCTF2020]EasyLogin
关于Redis问题的二三事
【3. 基础搜索与图论初识】
[4.4 detailed explanation of fast power and inverse element of fast power]
Based on the theoretical principle and simulation results of MATLAB spherical decoding, compare 2norm spherical decoding, infinite norm spherical decoding, ML detection
DOM day_02(7.8)网页制作流程、图片src属性、轮播图、自定义属性、标签栏、输入框事件、勾选操作、访问器语法
Matlab simulation of inverted pendulum control system based on qlearning reinforcement learning
Install redis-7.0.4 in Linux system
Openharmony quick start
[qt] container class, iterator, foreach keyword
[4.10 detailed explanation of game theory]
[3. Basic search and first knowledge of graph theory]
【AtCoder Beginner Contest 261 (A·B·C·D)】
Alibaba internal "shutter" core advanced notes~
[CISCN2019 华东南赛区]Double Secret
[b01lers2020]Welcome to Earth