Register for your free account! | Forgot your password?

You last visited: Today at 11:05

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



xBlubbs Website Exploit Fix

Discussion on xBlubbs Website Exploit Fix within the Flyff PServer Guides & Releases forum part of the Flyff Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jan 2013
Posts: 7
Received Thanks: 8
xBlubbs Website Exploit Fix

So for the majority of the community out there using xBlubb's website and all of the scripts, there's an exploit that can be done using the login function. It's done by modifying the User-Agent header and then injecting code into the database.

I'm here to publicly release a fix to prevent anyone selling it and to ensure the community is safe. Not patching this exploit leaves you wide open to SQL Injection attacks.

There are two ways to patch this exploit.

1. Stop collecting the User-Agent data.

The proper way to do this would be to modify the LOG_LOGIN table and remove the "browser" field, then go into xinc_login and change the INSERT query to look like this:
PHP Code:
                    INSERT INTO WEBSITE_DBF.dbo.[LOG_LOGIN] (
                        [
account],
                        [
ip],
                        [
host],
                        [
timestamp]
                    ) 
VALUES (
                        \
'' $strPostAccount '\',
                        \'' 
$ServerIPAddr '\',
                        \'' 
gethostbyaddr($_SERVER['REMOTE_HOST']) . '\',
                        ' 
time() . 
2. Check the integrity of the data coming from User-Agent by running it through a filter and checking for key words like UPDATE, SHUTDOWN, DROP, INSERT, DELETE.

For my method, I used a function.

xinc_function.php
PHP Code:
function checkdata($data) {                  
        
$badchars = array("DROP""DELETE""TRUNCATE""TABLE""UPDATE""SELECT""INSERT");
        foreach (
$badchars as $key => $value
        {          
            if (
strpos(strtoupper($data), $value$offset 0) !== FALSE
            {
                
$detection $value;
            } 
            else
            {
                
$detection 0;
            }
        }      
        
        return 
$detection;                  
  } 
xinc_login.php Under
PHP Code:
            if(md5($_CONFIG['allg_svr_salt'].$strPostPassword) != [MENTION=311501]ODB[/MENTION]c_result($intValidateLoginInformation'password')) {
                
$strOutputErrorArray[] = $_LANG['error_wrong_password'];
            } 
Add this:
PHP Code:
            if(checkdata($_SERVER['HTTP_USER_AGENT']) !== 0){
                
$strOutputErrorArray[] = 'SQL INJECTION ATTEMPT!';
            } 
Enjoy!
Alexsh is offline  
Thanks
4 Users
Old 02/17/2020, 07:14   #2
 
Burdenz2007's Avatar
 
elite*gold: 0
Join Date: Mar 2009
Posts: 477
Received Thanks: 218
Thank you for the support for the FlyFF Community. You have my best respect.
Burdenz2007 is offline  
Old 02/17/2020, 14:28   #3
 
xTwiLightx's Avatar
 
elite*gold: 0
Join Date: Jan 2009
Posts: 1,738
Received Thanks: 1,669
What about...

- use filter_var or filter_input:
Code:
$userAgent = $_SERVER['HTTP_USER_AGENT'];
$userAgent = filter_var($userAgent, FILTER_SANITIZE_SPECIAL_CHARS);
Code:
$userAgent = filter_input(INPUT_SERVER, 'HTTP_USER_AGENT', FILTER_SANITIZE_SPECIAL_CHARS);
- use prepared statements with PDO, mysqli or odbc_prepare and combine it with filter_ functions?
Code:
$qryLogLogin = 'INSERT INTO ' . $_CONFIG['db_databases']['web'] . '.dbo.LOG_LOGIN'
                . ' ([account], [ip], [host], [browser], [timestamp])'
                . ' VALUES (:account, :ip, :host, :browser, :logintime)';

$strPostAccount = filter_input(INPUT_POST, 'loginAccount', FILTER_SANITIZE_SPECIAL_CHARS);
$userAgent = filter_input(INPUT_SERVER, 'HTTP_USER_AGENT', FILTER_SANITIZE_SPECIAL_CHARS);

try {
                $stmt = $dbCon->prepare($qryLogLogin);
                $stmt->bindValue(':account', $strPostAccount);
                $stmt->bindValue(':ip', $ServerIPAddr);
                $stmt->bindValue(':host', gethostbyaddr($ServerIPAddr));
                $stmt->bindValue(':browser', $userAgent);
                $stmt->bindValue(':logintime', time(), PDO::PARAM_INT);
                $stmt->execute();
            } catch (\Exception $e) {
                error_log($e->getMessage());
                error_log($e->getTraceAsString());
            }
Nonetheless, great job sharing this exploit and a potential fix here.
xTwiLightx is offline  
Old 02/17/2020, 14:37   #4

 
netHoxInc's Avatar
 
elite*gold: 2
Join Date: Jan 2008
Posts: 776
Received Thanks: 978
Was an amusing thing to use xD

Also im not quite sure why u need to log the HTTP user agent at all anyways, removing it would be a simple enough fix in my eyes. xD
netHoxInc is offline  
Thanks
1 User
Old 02/17/2020, 15:46   #5
 
elite*gold: 0
Join Date: Jan 2013
Posts: 7
Received Thanks: 8
Quote:
Originally Posted by xTwiLightx View Post
What about...

- use filter_var or filter_input:
Code:
$userAgent = $_SERVER['HTTP_USER_AGENT'];
$userAgent = filter_var($userAgent, FILTER_SANITIZE_SPECIAL_CHARS);
Code:
$userAgent = filter_input(INPUT_SERVER, 'HTTP_USER_AGENT', FILTER_SANITIZE_SPECIAL_CHARS);
- use prepared statements with PDO, mysqli or odbc_prepare and combine it with filter_ functions?
Code:
$qryLogLogin = 'INSERT INTO ' . $_CONFIG['db_databases']['web'] . '.dbo.LOG_LOGIN'
                . ' ([account], [ip], [host], [browser], [timestamp])'
                . ' VALUES (:account, :ip, :host, :browser, :logintime)';

$strPostAccount = filter_input(INPUT_POST, 'loginAccount', FILTER_SANITIZE_SPECIAL_CHARS);
$userAgent = filter_input(INPUT_SERVER, 'HTTP_USER_AGENT', FILTER_SANITIZE_SPECIAL_CHARS);

try {
                $stmt = $dbCon->prepare($qryLogLogin);
                $stmt->bindValue(':account', $strPostAccount);
                $stmt->bindValue(':ip', $ServerIPAddr);
                $stmt->bindValue(':host', gethostbyaddr($ServerIPAddr));
                $stmt->bindValue(':browser', $userAgent);
                $stmt->bindValue(':logintime', time(), PDO::PARAM_INT);
                $stmt->execute();
            } catch (\Exception $e) {
                error_log($e->getMessage());
                error_log($e->getTraceAsString());
            }
Nonetheless, great job sharing this exploit and a potential fix here.
Yeah, there's a bunch of ways to go about it. Preparing and binding works as well, but most people don't go that route. Thanks for the added input and contribution.
Alexsh is offline  
Reply


Similar Threads Similar Threads
Pornstar Files von xBlubbs
03/03/2014 - Flyff Private Server - 8 Replies
Hat noch irgendjemand die Pornstar Files von xBlubbs und kann sie reuploaden? Wäre voll nice :D
[Fix]How to fix the Exploit Change Name from Database
10/06/2013 - 4Story - 5 Replies
EDIT:
[04.09.13] GigaByte v2.6 [FIX, FIX, FIX, FIX AND FIX]
09/11/2013 - WarRock Hacks, Bots, Cheats & Exploits - 79 Replies
http://www.elitepvpers.com/forum/warrock-hacks-bot s-cheats-exploits/2843300-11-09-gigabyte-public-v2 -7-a.html



All times are GMT +2. The time now is 11:05.


Powered by vBulletin®
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2023 elitepvpers All Rights Reserved.