Jump to content
MakeWebGames

HauntedDawg

Members
  • Posts

    476
  • Joined

  • Last visited

  • Days Won

    7

Everything posted by HauntedDawg

  1. To answer your question directly. No, not on the current release of MCCode's. However, many many people just upload already made script's from here, which do entail the vulnerability to do such exploit, or any other exploit for that matter. "What can go wrong, will go wrong." "Assume" => Making an "ass" out of "u" & "me". So, never assume you are secure, for that day come's that you are attacked, you'll feel like an ass.
  2. Think outside the box. I could manually run that script, which on each run will let's say for example give me $1,000,000 or i could let the cron run every minute and do it for me. I could allow that script to upload a backdoor every minute to a different file each time. I could create that script to add one line of php to each of your pages each time it runs to auto download malware onto your pc. Or better yet, why don't i just create a simple script, that add's a simple line of php to every php page on your system, and every load to that page, will send me the user's cookie data. The options are endless, not just the fact that the website owner has left an open vulnerability on the site. But let's move on. Ok, i find a hole that i can upload my malicious script. I have to then run it manually. What happens? It gets logged into the access-logs, if it's included on the other hand, there is no log of my IP hitting that script. Now, you say "File uploads" are insecure. While i agree with you on that, but pulling an image from a source is also insecure. Let's say for example, the very well known exploit on WordPress (Timthumb) Timthumb get's hit with a url as such: http://url.com/wp-content/../../timthumb.php?url=.......&x=360&y=400 What if the url landed on a php script, that looks to be an image: GIF89a�����ÿÿÿ!ù����,�������D�;�<?php ...malicious script to follow here...   Follow Murphys Law
  3. What if i found a loophole (which is quite common on mccode even the patched ones), that allowed me to upload a file? Now his cron system would automatically run my file, correct? Now, imagine the possibilities allowed to run through that file? Obviously, if thought through, this can work, with white listing that is. But don't simply tell another person to use glob() to include all the file's, that's just... bad.   What I've found that works is something along these lines:   CREATE TABLE `crons` ( `cron_name` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `cron_last_run` int(11) NOT NULL, `cron_code` varchar(30) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `cron_minus` int(10) unsigned NOT NULL, `cron_enabled` tinyint(1) unsigned NOT NULL DEFAULT '1', KEY `cron_name` (`cron_name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;   Example Row: { "data": [ { "cron_name": "1 Minute", "cron_last_run": 1347245661, "cron_code": "one_minute", "cron_minus": 60, "cron_enabled": 1 } ] }   PHP File to run timestamp:   <?php # Do your database includes & setup here include_once('class/cron.php'); $cron = new Cron; $crons = mysql_query('SELECT * FROM `crons` WHERE `cron_enabled` = 1'); $executed = array(); while($soc = mysql_fetch_assoc($crons)) { if((time() - $soc['cron_minus']) > $soc['cron_last_run']) { $multiply = ((time() - $soc['cron_minus']) - $soc['cron_last_run']) / $soc['cron_minus']; $multiply = floor($multiply); $multiply = ($multiply) ? $multiply : 1; eval('$return = $cron->'.$item['cron_code'].'('.$multiply.');'); if($return) $executed[] = $item['cron_code']; } } if(!empty($executed)) { mysql_query('UPDATE `crons` SET `cron_last_run` = '.time().' WHERE `cron_code` IN("'.implode('","', $executed).'")'); } ?>   Then your class as such:   Class Cron { public function one_minute($multiply = 1) { # Example Query: # mysql_query('UPDATE `users` SET `energy` = (`energy` + '.(5 * $multiply).') WHERE `energy` > 0'); return true; } }   * UNTESTED AND WILL NEED WORK TO MAKE IT WORK.
  4. Never do such a thing please.
  5. I would like to point out, Do not use () if you are not passing any variables to it! And the Kohana Framework strongly suggests this as well.
  6. You should soon.   Table Type, not Class. There's MyISAM, InnoDB, MRG_MyISAM, CSV, Blackhole, memory, archive (Some of the basics)
  7. MVC, no. Are you using proper indexing on your table's? Are you using proper methods of secure authentication? What Engine are your DB table's using? Will there be JavaScript goodness?
  8. I agree with you on some points of the document, however... Again, it's not a race, so there is no advantage to disadvantage here. It's just merely easily laying out what each engine has to offer instead of the Person having to manually go deep and search.
  9. You just went full retard. The doc is a comparison, to allow the Person to be able to choose an engine already made to suit there need's, it's not a document to see who wins. It's like eating at a restaurant, some of the meals, you get extra onion ring's, some get something else favorable, it's up to the person who's eating it, and in this case, using it as their game.
  10. @ Octarine, instead of bashing on mccodes each time you help someone, why not rather step back from helping to step back from bashing all together? Or perhaps keep your remarks to yourself? also, why loop the rows?   function transferToUser($fromUser, $toUser) { # Get the list of items in a concat string to transfer; $itemsList = mysql_query('SELECT GROUP_CONCAT(`inv_itemid`) as `items` FROM `inventory` WHERE `inv_qty` > 5 AND `inv_userid` = '.$fromUser); $itemsList = mysql_fetch_assoc($itemsList); $items = explode(',', $items['items']); foreach($items as $item) { # Transfer Begins mysql_query('UPDATE `inventory` SET `inv_qty` = (`inv_qty` - 1) WHERE `inv_userid` = '.$fromUser.' AND `inv_itemid` = '.$item); mysql_query('UPDATE `inventory` SET `inv_qty` = (`inv_qty` + 1) WHERE `inv_userid` = '.$toUser.' AND `inv_itemid` = '.$item); if(!mysql_affected_rows()) { # MCCodes does not have indexing, or we could of INSERT ... DUPLICATE KEY UPDATE # ... thus making us need to have the affected rows check to see if the last query has any affected rows # ... if it does not, it means that the user does not have one of those items, and we need to insert it. mysql_query('INSERT INTO `inventory` (`inv_qty`,`inv_userid`,`inv_itemid`)VALUES(1, '.$toUser.', '.$item.')'); } } }   Seems overkill to loop the rows...
  11. Well, instead of selecting them and looping through. Why not..   UPDATE `inventory` SET `inv_qty` = (`inv_qty` - 1) WHERE `inv_qty` > 6 AND `inv_userd` = '.intval($_GET['id'])   ??
  12. Well, it depends how in depth you really want to go with your "Clean"ing class. For just a general clean one function like you demonstrated. Then making it an objective is not really a smart idea. Very useful if you want to do various cleans and checks on each and every string that get's passed through and passed out (remember to have an output function to remove those nasty </> tags and the \s).
  13. Post up the code you currently are working on.
  14. No bugs? Hmm, i was going to be the first poster, but then i didnt bother. First page had 1 bug and 1 security hole. Preferences. I think you should take what has been said. Go back to the drawing board. Then come back again, sir.
  15. cmon zu, do your research before posting.   ssh2_* function's are crap, hard to use & harder to install. Recommended: http://phpseclib.sourceforge.net/
  16. Was my pleasure to please you :P
  17. @ MWG Community: Please, no one help this person. If He/She can't even install a simple couple of PHP File's. @ kking: If you can't do that. Pay up.
  18. Time for an long overdue update. Thing's are being finalized, the content adding is a lot more time consuming than thought. The last bit's of page's are being put into place along with graphic design touch ups and linking of the feature's. Then it's to Beta release. I will ask Peter to stop by this page to show a couple screen shot's of the work that's been done. Thank's everyone.
  19. "Before MySQL 5.0.13, LEAST() returns NULL only if all arguments are NULL. As of 5.0.13, it returns NULL if any argument is NULL. " RT(F)M! http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html#function_least
  20. UPDATE `users` SET `bankmoney` = IF(`vip_days` <= 0, LEAST(`bankmoney` + (`bankmoney` / 100) * 0.2, 500000000), LEAST(`bankmoney` + (`bankmoney` / 100) * 0.6, 500000000)) WHERE `bankmoney` AND `donatordays`;   If any error, post it up.
  21. No, our work server's backup every 8 or so hour's. Personal development and choice that is. On the other hand, i've seen people freak over half hour lost data...
  22. Every 24 hour's to Backup your DB is still a large gap. Imagine 24 hour's of your life just lost! I prefer at least 3 hour interval's to keep info at its latest. Nice thing is that it does not store too many DB's. I follow this setup: Store 1 backup every 24 hours forever. Store 1 backup every 3 hour's with validity of 10 day's, after 10 day's this backup is removed to free up disk space. File backup happens once every never. As i use SVN and would prefer to keep my site there, plus, any change's i make, i commit it to my repo.
  23. Why do you keep looking at it as a perspective to store those detail's? You can make it a once off transaction, user input's their username & password & directory, it does not store it, you hit go and it does it for you. Beanstalkapp.com use's it, and i know of 8+- people who use their built in deployment.
  24. @ Spud: That was merely an example, dude. If anyone used that for their client's, their first mistake would be they are storing those ftp detail's in the DB as raw data. While on the other hand, you can create your own crypt function to crypt them, and to decrypt them.
  25. How is it overkill? It's a better feature for your client's to get their game setup easier for them. The below script took me a mere 8 - 14 minute's to write, and IT WAS NOT TESTED, but there should not be much error's and anyone would be able to fix them. As Alain already has the extractor script.   <?php $user = 'username'; # FTP Username $pass = 'password'; # FTP Password $host = 'ftp.domain.com'; # FTP Host $dir = '/directory'; # FTP Directory $dmn = 'http://domain.com';# Client Domain $local_file['engine'] = 'engine.zip'; $local_file['extractor'] = 'extract.php'; # If we can create a connection, continue. if($con = ftp_connect($host)) { # Created connection! # Now we see if we can login successfully if(ftp_login($con, $user, $pass)) { # Logged in. # Check the directory. if(ftp_chdir($con, '/public_html'.$dir)) { # Directory Exists. # Place the files. if(ftp_put($con, $local_file['engine']) || ftp_put($con, $local_file['extractor'])) { # Files placed. Hit the extractor. $curl = curl_init($dmn.$dir.'/extract.php'); curl_setopt($curl, CURLOPT_HEADER, 0); curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE); $return = curl_exec($curl); curl_close($curl); /* Can check the $return value for an php error notice or the such here. */ echo 'File uploaded & extracted.'; } else { # A file failed to upload. echo 'One of the file\'s failed to upload.'; } } else { # Directory doesnt exist. Make it. if(ftp_mkdir($con, '/public_html'.$dir)) { # Directory Created. # Place the files. if(ftp_put($con, $local_file['engine']) || ftp_put($con, $local_file['extractor'])) { # Files placed. Hit the extractor. $curl = curl_init($dmn.$dir.'/extract.php'); curl_setopt($curl, CURLOPT_HEADER, 0); curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE); $return = curl_exec($curl); curl_close($curl); /* Can check the $return value for an php error notice or the such here. */ echo 'File uploaded & extracted.'; } else { # A file failed to upload. echo 'One of the file\'s failed to upload.'; } } else { # Failed to make directory. echo 'Failed to make directory. Please reassure you have enough permisions.'; } } # Close FTP Connection ftp_close($con); } else { # Issue with login in. echo 'Login failed. Check login details.'; } } else { # Connection to host failed. echo 'Connecting to host failed.'; } ?>
×
×
  • Create New...