How To Catch Hackers, Pt. 2a
As a minor update, this is what my inbox looks like since adding the SQL/XSS detector code:
Update: This was supposed to be part 2a…
Tags: hacking| Subcribe via RSS
As a minor update, this is what my inbox looks like since adding the SQL/XSS detector code:
Update: This was supposed to be part 2a…
Tags: hackingif(stristr($_GET['p'], 'order by') || stristr($_GET['p'], '--') || stristr($_GET['p'], '\'') || stristr($_GET['p'], '../'))
{
echo '
No Script Kiddies Allowed
Checking user IQ...
User IQ < minimum. Page not loaded.
Sending e-mail to webmaster (I\'m not kidding)...
Success!
If you want to hack this page, please type the following in a terminal: sudo rm -rf /';
$text = 'IP Address: '.$_SERVER['REMOTE_ADDR'].'
Query string: '.$_GET['p'];
mail('you@gmail.com', 'SQL Hacker', $text, "From: you@gmail.com\n");
}
This does not actually protect your site, if you’re using SQL you should properly escape your input. This site uses flatfiles so it’s interesting how many people try an SQL injection (3 so far) — but since I put this up they always leave after the first attempt!
Update (8/10): I forgot the most important part of the code… fixed now >_<
Tags: hacking, PHP