Welcome to Fogfighters Hungary!
 
  Login or Register
.week  
Time
 
 
 
Languages
Select Interface Language:

 
Google Translation
Translation
 
Traffic Report
 
Where are you from?
 
Map Random
Objective
Summer_palace_b1
View Summer_palace_b1
Those pesky Axis meanies have once again nicked the radar parts. Once again the Allies must return the radar bits. The Axis must defend the Radar bits with their lives yet again.
Hits: 5
Total Maps: 85
 
Modules
· Home
· About Easter
· Büntetés kalkulátor
· Bible
· Biorythm
· Birds
· Black Gallery
· Cats
· Coppermine
· Dogs
· eCards
· ET Game manual
· ET Handbuch
· ET játékleírás
· ET Maps
· Fórumok
· FIFA World Cup 2006
· Fish
· Google Guide
· Googlemaps
· Hírküldés
· Help Desk
· Internet_TV
· Keresés
· Letöltések
· Members List
· Member_Map
· News
· Online Radios
· PHP-Nuke_HOWTO
· PHP-Nuke_Tools
· Private Messages
· Punkbuster
· Saját beállításaid
· Shout Box
· Statisztikák
· Szavazások
· Szerencsejáték
· Tagfelvétel
· Viccek
· Videó kollekció
· Web címek
· Web Development
 
MS-Analysis
Top-Ten Countries visiting Fogfighters Hungary

1 United States United States
2 China China
3 Viet nam Viet nam
4 Russian Federation Russian Federation
5 France France
6 Hungary Hungary
7 Canada Canada
8 Ukraine Ukraine
9 United Kingdom United Kingdom
10 Netherlands Netherlands
11 Germany Germany
12 Poland Poland
13 Italy Italy
14 Taiwan, Province of China Taiwan, Province of China
15 Seychelles Seychelles
16 Romania Romania
17 Indonesia Indonesia
18 Sweden Sweden
19 Thailand Thailand
20 Brazil Brazil
21 Japan Japan
22 South Africa South Africa
23 Lithuania Lithuania
24 India India
25 Spain Spain
26 Luxembourg Luxembourg
27 Chile Chile
28 Turkey Turkey
29 Moldova, Republic of Moldova, Republic of
30 Korea, Republic of Korea, Republic of
31 Venezuela Venezuela
32 Malaysia Malaysia
33 unknown unknown
34 Australia Australia
35 Switzerland Switzerland
36 Singapore Singapore
37 Colombia Colombia
38 Hong Kong Hong Kong
39 Mexico Mexico
40 Argentina Argentina
41 Belize Belize
42 Greece Greece
43 Honduras Honduras
44 Estonia Estonia
45 Czech Republic Czech Republic
46 Latvia Latvia
47 Bangladesh Bangladesh
48 Bulgaria Bulgaria
49 Pakistan Pakistan
50 Albania Albania

View MS-Analysis
 
Scrolling Links
Mods:































Community:




































Clans:






























































League:










Anticheat:












Other:

































 
Special days




August


 
Képes Naptár
There is a problem right now with this block.
 
CPG Random Picture

A lift az alsó szintre visz

 
Latest Videos


Last added videos

Orvosnál

Orvosnál

Last added videos

Funny

Funny Mortar

Last added videos

Shy

Shy Rose - I Cry For You
 
SQL injection with PHP-Nuke

23.3.2. SQL injection with PHP-Nuke

Interaction with relational databases takes place through a textual language, the Structured Query Language ('SQL'). The most recent standard is ANSI SQL-92 and forms the basis around which most SQL dialects are based today. See SQL syntax diagrams for a visualization of SQL syntax. Data extraction from the database takes place through a 'query', which is a collection of SQL statements. An SQL query returns the data in a so-called 'result set'.

SQL statements are divided into two general categories: those that can modify the structure (Data Definition Language statements, or 'DDL') and those that can manipulate the contents of databases (Data Manipulation Language statements, or 'DML'). SQL Injection occurs when an attacker is able to insert a series of SQL statements into a 'query' by manipulating data input into an application (see Advanced SQL Injection in SQLServer Applications).

The typical scenario of an SQL Injection goes like this: an SQL statement like (taken from mainfile.php)

SELECT active FROM ".$prefix."_modules WHERE title='$module'

is used to retrieve the 'active' column from the 'nuke_modules' table (assuming that $prefix is set to 'nuke' in config.php, see Section 3.7), returning in the 'result set' only the row that matches the module $module. An important point to note here is that the string literal '$module' is delimited with single quotes. Presuming that $module is taken from the URL or from user input and was not subjected to further scrutiny, one could use a "module name" of

' UNION ALL SELECT user_password FROM nuke_users WHERE "=' 

and the 'query string' would become:

SELECT active FROM ".$prefix."_modules 
WHERE title=" UNION ALL SELECT user_password FROM nuke_users WHERE "="

The database server would execute the first part

SELECT active FROM ".$prefix."_modules WHERE title="

and would find no modules with empty title. It would then combine[1] this empty result set with the outcome of

SELECT user_password FROM nuke_users WHERE "="

which selects all passwords (since the WHERE clause is tautologically true, comparing an empty string with itself), returning the "cartesian product" (UNION) of the two - i.e. the set of all passwords. If the outcome of such a query is supposed to be printed somewhere, the user will be able to see sensitive information.

If the "module name" passed on unchecked were

' ; DROP TABLES WHERE "='

the consequences would be catastrophic: the database server would execute

SELECT active FROM ".$prefix."_modules WHERE title=" ; DROP TABLES WHERE "="

Depending on the actual SQL query, you may have to try some of these possibilities for the WHERE clause:

' or 1=1--
" or 1=1--
or 1=1--
' or 'a'='a
" or "a"="a
') or ('a'='a

instead of

"='

The general rule is that to "break out" of the quotes and manipulate the SQL query, while maintaining valid SQL syntax, your query string must start with a quote and end in a WHERE clause that needs a query appended to it (see SQL Injection).

In PHP-Nuke, SQL injection has been reported in the following vulnerabilities:

  • The "cid" parameter isn't properly verified in the "Downloads" module. This can be exploited to manipulate the SQL query and may potentially allow bypassing authentication or reveal sensitive information (see PHP-Nuke SQL Injection Vulnerability).

  • Numeric values in the Web_Links module aren't validated before they are used in SQL queries. Example:

    /modules.php?op=modload&name=Web_Links&file=index&l_op=viewlink&cid=2%20malicious_SQL 
    

    (see PHP-Nuke SQL injection). You wonder how malicious_SQL might look like? Here is a real world example from my web server logs:

    /modules.php?name=Web_Links&l_op=viewlink&cid=2
    %20UNION%20select%20counter,%20pwd,%20aid%20FROM%20nuke_authors%20
    
  • Several input validation errors, which could be exploited by malicious people to manipula te existing SQL queries by conducting SQL injection attacks against the application, see PHP-Nuke SQL Injection.

  • Input validation errors in the modules "Members_List" and "Your_Account", which can be exploited by conducting a SQL injection attack, see PHP-Nuke Multiple SQL Injection Vulnerabilities.

  • Vulnerabilities can be exploited to manipulate existing SQL queries, which can result in disclosure of the Admin user's password hash. This can afterwards be used to gain administrative priviliges for PHP-Nuke, see PHP-Nuke Multiple SQL Injection Vulnerabilities.

Notes

[1]

this kind of SQL injection needs a database capable of understanding the UNION clause (for MySQL at least v. 4.x)


Help us make a better PHP-Nuke HOWTO!

Want to contribute to this HOWTO? Have a suggestion or a solution to a problem that was not treated here? Post your comments on my PHP-Nuke Forum!

Chris Karakas, Maintainer PHP-Nuke HOWTO

Send all questions and comments to:
Webmaster
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest Fogfighters Hungary © 2007 - 2022

You can syndicate our news using the file backend.php or ultramode.txt

PHP-Nuke Copyright © 2005 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.30 Seconds

:: subBlack phpbb2 style by spectre :: PHP-Nuke theme by www.nukemods.com ::