Register for your free account! | Forgot your password?

You last visited: Today at 00:27

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

Advertisement



SQL Injection

Discussion on SQL Injection within the Web Development forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 67
Join Date: Aug 2012
Posts: 188
Received Thanks: 18
SQL Injection

Hey,

ich hab letztens mein Forum durch eine sqlinjection aufgeben können... ganze liste mit user & pwds wurde online gestellt -zum glück "nur" 51 ...

da ich dies jetzt verhindern will wollt ich meie homepage testen...

so sieht meine abfrage aus (im quellcode):

Quote:
SELECT * FROM Benutzer WHERE User = $User AND Pwd= $Pwd
Wenn ich nun aber versuche dies zu 'Hacken' mit:

Quote:
localhost/user=' OR 1=1
dann funktioniert es nicht, da ja die pwd abfrage noch den fuß in der tür hat.

aber wie kann ich nun das ganze vervollständigen ?

mfg
dercoder is offline  
Old 10/08/2012, 16:17   #2
 
NotEnoughForYou's Avatar
 
elite*gold: 0
Join Date: Jun 2010
Posts: 3,406
Received Thanks: 2,024
indem du den Rest des Querys auskommentierst. Wenn man aber $User und $Pwd entsprechend filtert kommt es erst gar nicht zu einer Sqlinjection.
NotEnoughForYou is offline  
Old 10/08/2012, 16:48   #3
 
BlackTrader's Avatar
 
elite*gold: 170
Join Date: Mar 2010
Posts: 369
Received Thanks: 187
Prepared Statement
ansonsten mysql_real_escape_string

passwörter als sha256 + salt speichern
das mit den emails ist immer so ne sache... am besten garnicht verlangen

sicherheit geht vor
BlackTrader is offline  
Old 10/08/2012, 16:49   #4
 
PseudoPsycho's Avatar
 
elite*gold: 1715
Join Date: Dec 2011
Posts: 672
Received Thanks: 207
Code:
SELECT * FROM Benutzer WHERE User = $User AND Pwd= $Pwd
Sowas macht man auch nicht mehr. Wegen sowas gibt es ja moderne Techniken wie MySQLi. Besser wäre so:
PHP Code:
$db=new mysqli('localhost''user''pass''database');
// ...
$get=$db->prepare('SELECT `id`, `User`, `Pwd`, `etc` FROM `Benutzer` WHERE `User=? AND `Pwd`=? LIMIT 1');
$get->bind_param('ss'$db->real_escape_string($User), $db->real_escape_string($Pwd));
// ... 
Edit: BlackTrader ist mir wohl zuvorgekommen.
PseudoPsycho is offline  
Old 10/10/2012, 22:51   #5
 
JacK le chilla's Avatar
 
elite*gold: 2
Join Date: May 2011
Posts: 448
Received Thanks: 110
"real_escape_string" ? heißt doch. mysql_real_escape_string
JacK le chilla is offline  
Old 10/10/2012, 22:56   #6
 
NotEnoughForYou's Avatar
 
elite*gold: 0
Join Date: Jun 2010
Posts: 3,406
Received Thanks: 2,024
Quote:
Originally Posted by JacK le chilla View Post
"real_escape_string" ? heißt doch. mysql_real_escape_string
das ist die Methode von mysqli ....
NotEnoughForYou is offline  
Old 10/11/2012, 09:11   #7

 
boxxiebabee's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 1,222
Received Thanks: 500
Quote:
Originally Posted by NotEnoughForYou View Post
das ist die Methode von mysqli ....
Ne, für mysqli ist es:
mysqli_real_escape_string

real_escape_string gibt es nicht.
boxxiebabee is offline  
Old 10/11/2012, 10:43   #8

 
マルコ's Avatar
 
elite*gold: 1329
Join Date: Jun 2009
Posts: 1,873
Received Thanks: 960
Sagt mal, meint ihr das alle jetzt ernst??? Seid ihr eigentlich alle blind oder stellt ihr euch nur doof?^^

Da steht doch

$db = new mysqli(/*..*/);
$db->real_escape_string(/*..*/);

real_escape_string gibt es und es ist die MySQLi Funktion im OO Ansatz.
マルコ is offline  
Thanks
3 Users
Old 10/11/2012, 14:53   #9
 
NotEnoughForYou's Avatar
 
elite*gold: 0
Join Date: Jun 2010
Posts: 3,406
Received Thanks: 2,024
Quote:
Originally Posted by マルコ View Post
Sagt mal, meint ihr das alle jetzt ernst??? Seid ihr eigentlich alle blind oder stellt ihr euch nur doof?^^

Da steht doch

$db = new mysqli(/*..*/);
$db->real_escape_string(/*..*/);

real_escape_string gibt es und es ist die MySQLi Funktion im OO Ansatz.
Eben ...
NotEnoughForYou is offline  
Old 10/12/2012, 13:54   #10
 
elite*gold: 0
Join Date: Sep 2012
Posts: 8
Received Thanks: 1
Wer sagt das real_escape_string nicht gibt kann mal gar nix ... wenn ihr nichts wisst würde ich mal auf php.net nachsehen

$ѕтяιηg_тσ_єѕcαρє is offline  
Old 10/12/2012, 14:12   #11
 
PseudoPsycho's Avatar
 
elite*gold: 1715
Join Date: Dec 2011
Posts: 672
Received Thanks: 207
Quote:
Originally Posted by $ѕтяιηg_тσ_єѕcαρє View Post
Wer sagt das real_escape_string nicht gibt kann mal gar nix ...
Durchaus möglich, dass die sich auch einfach verlesen haben.
Die Funktion real_escape_string() gibt es ja so auch nicht.
Spätestens bei dem Kommentar
Quote:
Originally Posted by NotEnoughForYou
das ist die Methode von mysqli ....
und einem flüchtigen Blick nach oben hätte das aber klar sein sollen
PseudoPsycho is offline  
Reply


Similar Threads Similar Threads
SQL Injection
07/31/2012 - DarkOrbit - 20 Replies
Hallo, ich habe glaube ich eine SQL Injection-Lücke gefunden. Ich wollte nun fragen ob mir dabei jemand helfen kann, diese auszunutzten. English: Hello, I believe I found a SQL Injection in DarkOrbit. Now I wanted to ask if someone can help me to use this.
SQL injection
12/25/2009 - Silkroad Online - 19 Replies
can someone please tell me how, or give me a site that can teach me how to perform SQL injection? it will be greatly appericated.
[TIP] SQL Injection
02/11/2009 - RFO Hacks, Bots, Cheats, Exploits & Guides - 6 Replies
This is for someone here that knows the basic use of SQL Injection... You can edit the website's database and make tweaks on that particular page... i hope you get what I mean ^_^ This is very favorable to private servers. Already done it and hell it rocked the RF World! Peace out and I know you guys can do what i meant.. ^_^
SQL injection.
02/12/2008 - Zero - 0 Replies
Hi all, This is a curious topic because i have found numerous occasions where this has happened on the chinese version of the game. Also i was wondering if anyone knows of any occasions where it has been done on the English servers? I've been researching into this and apparently it requires tracing the packets back to the DB server then using a program (once you have the address) to inject your own SQL code into the database indefinitely editing your character to what ever your choosing...
DLL Injection
06/12/2007 - Planetside - 2 Replies
???



All times are GMT +1. The time now is 00:28.


Powered by vBulletin®
Copyright ©2000 - 2025, 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 ©2025 elitepvpers All Rights Reserved.