Paul Evans Posted January 24, 2011 Posted January 24, 2011 Things you do in the past catch up with you (it wasn't that long ago). Quote
Kieran-R Posted January 24, 2011 Posted January 24, 2011 The code posted by Kieran-R isn't my code.. I claimed it as mine at the time because I was a money hungry bastard.. I got the code from a different game that I was helping. So, if you could secure good, then why would you show me an example that isnt even yours? If you also even had the slightest bit of knowledge with PHP you would have known that that code wasnt secured, and most of it was a pile fo shit. Whether you were a "money hungy basterd" or not, that doesnt explain why you sent me a code that clearly was a pile of shit? Just kind of proovs that you cant secure shit... Quote
bladewolf2010 Posted January 24, 2011 Posted January 24, 2011 At the time, I thought it did. <?php include (DIRNAME(__FILE__) . '/globals.php'); if (isset($_GET['delete']) AND !is_numeric($_GET['delete'])) { echo 'Please make sure it\'s a valid event ID!'; exit($h->endpage); } else { echo '[b]Event ID has been deleted![/b]'; $db->query('DELETE FROM `events` WHERE `evID` = '.$_GET['delete'].' AND `evUSER` = `'.$_SESSION['userid'].'`'); } if (isset($_GET['delall']) AND !ctype_digit($_GET['delall']) { echo 'You have no events.'; exit($h->endpage); } else { echo 'This will delete all your events. Are you sure? <a href = "events.php?delall2=1">Yes</a> - <a href = "index.php">No</a>'; exit($h->endpage); } if (isset($_GET['delall2']) AND !ctype_digit($_GET['delall2']) { echo 'You have no events.'; exit($h->endpage); } else { echo '[b]All event\'s have been deleted![/b]'; $db->query("DELETE FROM `events` WHERE `evUSER` = `".$_SESSION['userid']."`"); exit($h->endpage); } echo '[b]Latest 10 events[/b]'; echo "<a href = 'events.php?delall=1'>Delete All Events</a>"; echo "<table width = '75%' cellpadding = '1' class = 'table'> <tr><th>Time</th><th>Event</th><th>Links</th></tr>"; $QUERYGET = $db->query("SELECT `evUSER` , `evTIME` , `evID` , `evREAD` FROM `events` WHERE `evUSER` = `".$_SESSION['userid']."` ORDER BY `evTIME` DESC LIMIT 10"); while ($EV = mysql_fetch_row($QUERYGET)) { echo "<tr><td>".date('F j Y, g:i:s a',$EV->evTIME); if(!$EV->evREAD) { echo ' [b]New![/b]'; } echo "</td><td>".$EV->evTEXT."</td><td><a href = 'events.php?delete=".$EV['evID']."'>Delete</a></td></tr>"; } echo '</table>'; if ($ir->new_events => 1) { $db->query("UPDATE `events` SET `evREAD` = 1 WHERE `evUSER` = `".$_SESSION['userid']."`"); $db->query("UPDATE `users` SET `new_events` = 0 WHERE `userid` = `".$_SESSION['userid']."`"); } $h->endpage(); ?> Quote
Paul Evans Posted January 24, 2011 Posted January 24, 2011 i like that reminds me of PHP nuke coding. Quote
rulerofzu Posted January 24, 2011 Posted January 24, 2011 Now correct your errors. TBH this is what I expected and it really doesnt show that you can actually code. Shows you can copy n paste but hey even my 8yr old can do that ;) Quote
bladewolf2010 Posted January 24, 2011 Posted January 24, 2011 You wanted to see something I secured I showed you. You didn't ask for something that works.. Now it'd be better if it worked.. But it doesn't don't like it then oh well. Quote
Danny696 Posted January 24, 2011 Posted January 24, 2011 I think they mean the security doesnt work, so threrefore you stil owe something... Quote
Djkanna Posted January 24, 2011 Posted January 24, 2011 i like that reminds me of PHP nuke coding. Well they never were praised on their 'readable' code. :P Quote
Paul Evans Posted January 24, 2011 Posted January 24, 2011 Got a point there DJK php nuke coding was quite difficult to read i mean echo on each line... overkill or what `".$_SESSION['userid']."` Epic Fail ;) Quote
Djkanna Posted January 24, 2011 Posted January 24, 2011 while ($EV = mysql_fetch_row($QUERYGET)) { echo "<tr><td>".date('F j Y, g:i:s a',$EV->evTIME); if(!$EV->evREAD) { echo ' [b]New![/b]'; } echo "</td><td>".$EV->evTEXT."</td><td><a href = 'events.php?delete=".$EV['evID']."'>Delete</a></td></tr>"; } Notice anything wrong? I think someone needs to look up arrays and objects :O Quote
Joshua Posted January 24, 2011 Posted January 24, 2011 you mean while ($EV = mysql_fetch_row($QUERYGET)) lol Quote
Djkanna Posted January 24, 2011 Posted January 24, 2011 you mean while ($EV = mysql_fetch_row($QUERYGET)) lol *Claps* He's a genius! :whistling: Quote
Paul Evans Posted January 24, 2011 Posted January 24, 2011 http://makewebgames.io/index.php?page=RMarketplaceEntry&entryID=290&commentID=767#comment767 :P genius Quote
bladewolf2010 Posted January 24, 2011 Posted January 24, 2011 I think they mean the security doesnt work, so threrefore you stil owe something... something secure? <tt>Site Offline</tt> Quote
Joshua Posted January 24, 2011 Posted January 24, 2011 Exploit it ;-) A long time ago, ('we are talking 6 months to a year) when i made the mod I did not properly secure the $_POST variable It was secured as an INT but due to firebug you could change the int to any number you wanted. That's been long since secured :p Quote
Joshua Posted January 24, 2011 Posted January 24, 2011 The only place any information is entered for the race option to be exploited is in register.php $_POST['race'] = abs((int) $_POST['race']); $allowed = array('1', '2', '3'); if (!in_array($_POST['race'], $allowed)) { echo 'This is not allowed!'; exit; } Insure it's an int, yes i used abs((int) as i'm only using 3-5 digits max so int works fine. The array checks to make sure it's only the ones allowed. Prey tell how is it not secured :P Quote
Paul Evans Posted January 24, 2011 Posted January 24, 2011 yeah the customer bought it off you like this month or last... anyways $_POST['race'] = ( isset($_POST['race'])&&in_array($_POST['race'], array(1,2,3)) )?$_POST['race']:''; if ( empty($_POST['race']) ) { echo 'Error!'; die($h->endpage()); // note $h->endpage() will not work on register } Quote
Joshua Posted January 24, 2011 Posted January 24, 2011 Eh either way should work just fine. may need to go over the isset bit though. :edit: I think i've sold 2-3 copies in the last week and that's about it other than months and months ago. :edit: again: Just realized, the array will check if it isset. So the theory i use works fine. It may be an old old customer of mine who just recently used it, pm me there name and I can tell you. I know who all bought it within the past week Also, The above code you pasted...that's not my work :\ Quote
lucky3809 Posted January 28, 2011 Posted January 28, 2011 Here is a site that may help beginers understand some security with php, I would honestly learn security yourself you have a better chance at securing it then someone off the streets or someone off the internet whom you may not even know their work ethics...It pays to learn it yourself, then when a problem exist you can handle the matter without needing to wait to hire someone to do it for you, also there are many other great websites out there just use google and look for them! http://www.ibm.com/developerworks/opensource/library/os-php-secure-apps/index.html Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.