Created
June 19, 2017 23:51
-
-
Save null-dev/59d219649670d81b65348c7abf4dd13b to your computer and use it in GitHub Desktop.
1fichier.com direct link generator (PHP)
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
<?php | |
if(!isset($_GET['a'])) { | |
die('<form action="" method="get"><input type="text" name="a"/><input type="submit"/></form>'); | |
} | |
$url = "https://1fichier.com/?" . urlencode($_GET['a']) . "?auth=1&inline"; | |
stream_context_set_default(array( | |
'http' => array( | |
'method' => 'GET', | |
'header' => 'Authorization: Basic ' . '[BASE64 encoded login credentials. Format: "user:pass" (without quotes)]' | |
) | |
)); | |
$headers = get_headers($url, 1); | |
if ($headers !== false && isset($headers['Location'])) { | |
$loc = $headers['Location']; | |
$loc = str_replace("https://", "http://", $loc); | |
header('Location: ' . $loc, true, 302); | |
} else { | |
echo "Failed to unarchive file!"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment