Jump to content
MakeWebGames

Help with Auto-Fed, For all users.


Joshua

Recommended Posts

This isn't going to stop ALL hacks, but it helps stop some of the beginners.

 

I'm trying to take the click click boom mod and make it where it Auto Feds users when they try and inject

 

Only problem I'm having is It won't update the FedJail sentence. Anyone help me out here?

 

if($_GET['ID'] != abs(@intval($_GET['ID'])))
{
die("For attempting a known sql injection, your IP and Name has been banned.  Nice attempt, Enjoy your Fed jail sentence.");
$db->query("INSERT INTO fedjail VALUES('',{$_GET['ID']}, 300, $userid, 'Hack Attempt')");
} 
Link to comment
Share on other sites

It's because you have a die command before the mysql statement is ran, Try this

if($_GET['ID'] != abs(@intval($_GET['ID'])))
{
$db->query("INSERT INTO fedjail VALUES('',{$_GET['ID']}, 300, $userid, 'Hack Attempt')");
die("For attempting a known sql injection, your IP and Name has been banned.  Nice attempt, Enjoy your Fed jail sentence.");
}
Link to comment
Share on other sites

RE: Help with Auto-Fed, For all users.

 

if($_GET['ID'] != abs(@intval($_GET['ID'])))
{$db->query("INSERT INTO fedjail VALUES('',{$_GET['ID']}, 300, $userid, 'Hack Attempt')");
die("For attempting a known sql injection, your IP and Name has been banned.  Nice attempt, Enjoy your Fed jail sentence.");
} 

 

change to

 

if($_GET['ID'] != abs(@intval($_GET['ID'])))
{$db->query("INSERT INTO fedjail VALUES('',{$_GET['ID']}, 300, $userid, 'Hack Attempt')");$db->query("UPDATE users SET fedjail=1 WHERE userid=$userid");
die("For attempting a known sql injection, your IP and Name has been banned. Nice attempt, Enjoy your Fed jail sentence.");
} 

 

that should work.

Link to comment
Share on other sites

WRONG!

if($_GET['ID'] != abs(@intval($_GET['ID'])))
{
$db->query("INSERT INTO fedjail VALUES('',{$_GET['ID']}, 300, $userid, 'Hack Attempt')");
$db->query("UPDATE users SET fedjail=300 WHERE userid={$_GET['ID']}");
die("For attempting a known sql injection, your IP and Name has been banned. Nice attempt, Enjoy your Fed jail sentence.");
}
Link to comment
Share on other sites

Just something which came to my mind. If $_GET["ID"] is not a number, then putting it into a sql like:

$db->query("INSERT INTO fedjail VALUES('',{$_GET['ID']}, 300, $userid, 'Hack Attempt')");

Is certainly bad. So replace with:

$db->query("INSERT INTO fedjail VALUES('',".($_GET['ID']+0).", 300, $userid, 'Hack Attempt')");
Link to comment
Share on other sites

You could also use a function, then its eiser than typing it all out. heres one i made before (blue peter FTW!!)

function fedjail($id,$days,$reason)

{

global $ir,$db;

$reason=$db->escape($reason):

$db->query("UPDATE users SET fedjail=$days WHERE userid=$id");

$db->query("INSERT INTO fedjail VALUES('', $id, $days, {$ir['userid']}, '{$reason}')");

return 1;

}

in use:

fedjail($userid,365,'Attempted SQL injection');

Thats one that i made. Only for v2 tho.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...