View Single Post
  #158  
Old 26th May 2009, 10:22
swizzles swizzles is offline
Member
 
Join Date: Apr 2009
P2P
Posts: 3
Default
Quote:
Originally Posted by Bigjoos View Post
Linux or windows ? - Default userclasses or added anymore ? - As the function looks for your minimum staff class and also covers the max class on the site which prevents account hijack to super class or staff period if not authorized, which will be 4 and 7 on the default release which you set on bittorrent.php - If its saving those changes and you have the usernames for max class and userid's for under max class only then the system should work perfectly - The function can be changed - the ip ban can be removed from it by commenting it out and the disablement could be changed to a warning only by changing the query - Post the block if you dont understand the changes needed or even better join my test server - Fynnon posted the url few pages back - from there we can help you better and you learn more about the source direct from me.
Sorry, Its Linux, and ty for your prompt answer. I will attempt to interpret the code:

PHP Code:
function maxcoder ()
{
    global 
$CURUSER;
    
$lmaxclass = 7;
    
$filename = ROOT_PATH . "settings/STAFFNAMES";
    
$filename2 = ROOT_PATH . "settings/STAFFIDS";
    if (
$CURUSER['class'] >= $lmaxclass) {
        
$fp = fopen($filename, 'r');
        while (!
feof($fp)) {
            
$staffnames = fgets($fp);
            
$results = explode(' ', $staffnames);
        }
        
$added = sqlesc(get_date_time());
        if (!
in_array($CURUSER['username'], $results, true)) { // /////== true for strict comparison - super class detection .. not in array = disable the fuckers and ban the ip
            
sql_query("UPDATE users set enabled='no' WHERE id=$CURUSER[id]");
            
$ban_ip = sqlesc(trim(ip2long($_SERVER['REMOTE_ADDR'])));
            
$comment = sqlesc('Super User Hack Attempt');
            
$added = sqlesc(get_date_time());
            
sql_query("INSERT INTO bans (added, addedby, first, last, comment) VALUES ($added, '0', $ban_ip, $ban_ip, $comment)") or sqlerr(__FILE__, __LINE__);
            
$subject = sqlesc("Alert Super User Has been Detected");
            
$body = sqlesc("User " . $CURUSER["username"] . " has attempted to hack the tracker using a super class - the account has been disabled");
            
auto_post($subject , $body);
            
$msg = "Hack Attempt Detected - now go to ip bans in staff tools and cache the ban : Username: " . $CURUSER["username"] . " - UserID: " . $CURUSER["id"] . " - UserIP : " . getip();
            
sql_query("INSERT INTO messages (poster, sender, receiver, added, subject, msg) VALUES(0, 0, '1', '" . get_date_time() . "', " . $subject . " , " . sqlesc($msg) . ")") or sqlerr(__FILE__, __LINE__);
            
write_log($msg);
            
fclose($fp);
            
stderr("Access Denied!", "Ha Ha you retard - Did you honestly think you could pull that one off !");
        }
        
fclose($fp);
    }
    
define ('UC_STAFF', 4); ///////== Minumum Staff Level (4=UC_MODERATOR)
    
if ($CURUSER['class'] >= UC_STAFF) {
        
$fp2 = fopen($filename2, 'r');
        while (!
feof($fp2)) {
            
$staffids = fgets($fp2);
            
$results2 = explode(' ', $staffids);
        }
        if (!
in_array($CURUSER['id'], $results2, true)) { // ////== true for strict comparison if there not in the array disable the fuckers and ban the ip :)
            
sql_query("UPDATE users set enabled='no' WHERE id=$CURUSER[id]");
            
$ban_ip = sqlesc(trim(ip2long($_SERVER['REMOTE_ADDR'])));
            
$comment = sqlesc('Unauthorized Staff Account Hack');
            
$added = sqlesc(get_date_time());
            
sql_query("INSERT INTO bans (added, addedby, first, last, comment) VALUES ($added, '0', $ban_ip, $ban_ip, $comment)") or sqlerr(__FILE__, __LINE__);
            
$subject = sqlesc("Staff Account Hack Detected");
            
$body = sqlesc("User " . $CURUSER["username"] . " has attempted to hack the tracker using an unauthorized account- the account has been disabled");
            
auto_post($subject , $body);
            
$msg = "Fake Account Detected now go to ip bans in staff tools and cache the ban : Username: " . $CURUSER["username"] . " - UserID: " . $CURUSER["id"] . " - UserIP : " . getip();
            
sql_query("INSERT INTO messages (poster, sender, receiver, added, subject, msg) VALUES(0, 0, '1', '" . get_date_time() . "', " . $subject . " , " . sqlesc($msg) . ")") or sqlerr(__FILE__, __LINE__);
            
write_log($msg);
            
fclose($fp2);
            
stderr("Access Denied!", "Sorry but your not an authorized staff member - nice try your banned !");
        }
        
fclose($fp2);
    }
    return 
true;
} 
I know the next function called is if you try to login it'll issue the

Code:
403 Forbidden</h1>Unauthorized IP address.
if the above is followed:

From what you are saying the function is still in default, so in theory it should work, however its still banning any user that gets promoted. My staff are logging as users and its when i try to promote that causes the problem. I have tried to change it in the Sql DB, but this as I suspected was also picked up as a hack..lol

Can you tell me whats needed, and yes i will join the test site ty.

swizzles
Reply With Quote