Created
July 30, 2019 20:27
-
-
Save celestora/665b4c5a2010f953f50976f606c2af2b to your computer and use it in GitHub Desktop.
Renderer info sniffer for OTVET-215732916
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 $dbh = new PDO('sqlite:logs.db'); ?> | |
<?php | |
if($_SERVER["REQUEST_METHOD"] === "POST") { | |
$stt = $dbh->prepare("INSERT INTO logs VALUES(:ip, :renderer)", [PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY]); | |
$stt->execute([ | |
"ip" => $_SERVER["HTTP_X_REAL_IP"] ?? $_SERVER["REMOTE_ADDR"], | |
"renderer" => file_get_contents("php://input"), | |
]); | |
exit(header("HTTP/1.1 202 Accepted")); | |
} | |
?> | |
<?php if($_SERVER["QUERY_STRING"] === "logs"): ?> | |
<?php $logs = $dbh->query("SELECT * FROM logs"); ?> | |
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css" /> | |
<script src="https://code.jquery.com/jquery-git.js"></script> | |
<script>$.isArray = Array.isArray</script> | |
<script src="https://code.jquery.com/jquery-migrate-3.0.1.js"></script> | |
<script src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script> | |
<script> | |
$(document).ready(_ => $('#xk').DataTable()); | |
</script> | |
<table id="xk"> | |
<thead> | |
<th>UID</th> | |
<th>Info</th> | |
</thead> | |
<tbody> | |
<?php foreach($logs as $log): ?> | |
<tr> | |
<td><?= hash("adler32", $log["addr"]) ?></td> | |
<td><?= $log["renderer"] ?></td> | |
</tr> | |
<?php endforeach; ?> | |
</tbody> | |
</table> | |
<?php exit; ?> | |
<?php endif; ?> | |
<script> | |
let $$ = () => { | |
let gl = document.createElement('canvas').getContext('webgl2'); | |
if (!gl) throw new DOMException("Нет поддержки WebGL!"); | |
if(debugInfo = gl.getExtension('WEBGL_debug_renderer_info')) return gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL); | |
throw new DOMException("Браузер скрыл информацию!"); | |
} | |
</script> | |
<script> | |
let xhr = new XMLHttpRequest(); | |
xhr.open("POST", "./index.php", false); | |
xhr.send(`Graphicboard full name: ${$$()}; CPU cores: ${navigator.hardwareConcurrency}`); | |
window.location.href = "<?= hex2bin($_GET["_"]) ?>"; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment