Skip to content

Instantly share code, notes, and snippets.

@ThoundsN
Last active July 4, 2021 12:07
Show Gist options
  • Save ThoundsN/76a9481f104968469d4c1c862c291fc0 to your computer and use it in GitHub Desktop.
Save ThoundsN/76a9481f104968469d4c1c862c291fc0 to your computer and use it in GitHub Desktop.
<?php
ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');
error_reporting(E_ALL);
$indicesServer = array('REQUEST_URI',
'REMOTE_ADDR',
'HTTP_USER_AGENT') ;
echo '<table cellpadding="10">' ;
foreach ($indicesServer as $arg) {
if (isset($_SERVER[$arg])) {
echo '<tr><td>'.$arg.'</td><td>' . $_SERVER[$arg] . '</td></tr>' ;
}
else {
echo '<tr><td>'.$arg.'</td><td>-</td></tr>' ;
}
}
echo '</table>' ;
if(isset($_GET['u'])){
echo $_GET['u'];
}
$useragent = $_SERVER['REQUEST_URI'];
$ip_address = $_SERVER['REMOTE_ADDR'];
$request_uri= $_SERVER['HTTP_USER_AGENT'];
try {
$dsn = 'mysql:host=mysql;dbname=ssrf;charset=utf8;port=3306';
$pdo = new PDO($dsn, 'root', 'dsadadsada');
$stmt = $pdo->prepare("INSERT INTO ssrf_records (useragent, ip_address, request_uri) VALUES (
'$useragent' ,
'$ip_address' ,
'$request_uri' )");
$stmt->execute(array(
':useragent' => $useragent,
':ip_address' => $ip_address,
':request_uri' => $request_uri)
);
} catch (PDOException $e) {
echo $e->getMessage();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment