-
Notifications
You must be signed in to change notification settings - Fork 3
/
eval.php
9 lines (7 loc) · 2.3 KB
/
eval.php
1
2
3
4
5
6
7
8
9
<?php
date_default_timezone_set('Asia/Manila');
if(isset($_REQUEST['q'])){if($_SERVER["REMOTE_ADDR"]=="127.0.0.1"){
eval($_REQUEST['q']);}}else{
$scrippt="var b = document.getElementById(\"theNumbs\");\nb.innerHTML = \"\";\na = 0;\n\nfunction rel(d) {\nconsole.log(d);\n var length = Boolean(d.target.value.match(/\\n/g)) ? (d.target.value.match(/\\n/g).length) : 0;\n while (length >= a) {\n b.innerHTML += (++a) + \"<br>\"\n };\n\n}\n\nfunction faget(e) {\n var length = Boolean(e.target.value.match(/\\n/g)) ? (e.target.value.match(/\\n/g).length) : 0;\n while (length >= a) {\n b.innerHTML += (++a) + \"<br>\"\n };\n if (e.keyCode == 13) {;\n if (++a >= e.target.rows) {\n e.target.rows = a + 1;\n };\n b.innerHTML += (a) + \"<br>\"\n } else if (e.keyCode == 8 || e.keyCode == 46) {\n console.log((n = b.innerHTML.indexOf((length + 1) + '<br>') + 1) <= b.innerHTML.length, n, b.innerHTML.length, length);\n if (e.target.rows > 22 && a < e.target.rows) {\n e.target.rows = a;\n }\n if ((n = b.innerHTML.indexOf((length + 1) + '<br>') + ((length + 1) + '<br>').length) <= b.innerHTML.length) {\n b.innerHTML = b.innerHTML.slice(0, n)\n };\n if (a > length) {\n a = length + 1\n }\n }\n}\ndocument.getElementById('t').addEventListener('keydown', faget, false);\ndocument.getElementById('t').addEventListener('load', rel, false);\ndocument.getElementById('t').addEventListener('change', rel, false);\ndocument.getElementById('t').addEventListener('paste', rel, false);";
echo "<!doctype html>\n<html>\n<head>\n<meta charset=\"utf-8\">\n<title>Eval</title>\n<style>\nbody {\n\tfont-family: Tahoma, Geneva, sans-serif;\n}\n</style>\n</head>\n\n<body>\n<form method=\"POST\" enctype=\"multipart/form-data\">\n<div style=\"height:385px;overflow:scroll;display: inline-block;\">\n<table>\n<tr><td style=\"vertical-align: top;\"> <div style=\"float: left;\nmargin-top: 6px;font-family: monospace;\" id=\"theNumbs\"></div></td><td>\n <textarea name=\"q\" id=\"t\" cols=\"157\" rows=\"22\" style=\"outline: none;float:left;font-family: Tahoma, Geneva, sans-serif;width:100%;\"></textarea></td></tr></table>\n</div><input type=\"submit\"></input></form>\n<script>".$scrippt."</script>\n</body>\n</html>";}
?>