|
||||||
| PHP Forum Use this forum to discuss all aspects of PHP Development. PHP is a server-side, cross-platform, HTML embedded scripting language that lets you create dynamic web pages. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
| Sponsored Links |
|
|
|
|||||
|
Everything looks good and vulnerable here. How are you calling your script? You should call it as:
http://domain/script.php?admin=OR 1&password=anything The OR 1 will cause a clause in the execution of your SQL Query that always equals true. Also, I'm not entirely sure that the above statement will actually return any rows. This would cause the mysql_num_rows not to return anything. You could try doing: http://domain/script.php?admin=admin&password=OR 1 Which would cause the SQL to return the row with the username of admin. Sidewinder should be able to help more once he sees this. He is fairly good with security and PHP.
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog The CodeCall Wiki is now fully integrated with vBulletin users! Check it out and add some new pages! |
|
|||||
|
So you suggest the use of the GET method, as opposed to POST? I'll try that out...perhaps that's what I've been doing wrong all along. You may well be correct about mysql_num_rows() returning nothing; since that's where some problems appear to originate from.
Well thanks very much, I'll try that out. Edit: I'm afraid those suggestions didn't work, the input seems to go through fine but I still get the invalid username/password error. Anything else I could try?
__________________
Last edited by shibbythestoner; 12-15-2007 at 07:35 PM. Reason: fail @ spelling. |
|
|||||
|
Thanks to the "Similar Threads" feature I happened upon, I found the answer in v0id's post on Sidewinder's thread,
PHP: SQL Injections Trying this: Code:
' OR '1' = '1
__________________
|
|
|||||
|
It's really all about how crappy you write your code, when I wrote a my tutorial on SQL injections [PHP: SQL Injections], I couldn't for the life of me get a functional demo to work. However, you inspired me to give it another shot, and I managed to get it to work. I'm not really in the mood for explaining [tutorial does most of it] it so I'll just post my code and you can figure it out yourself.
Database: injectiontest SQL Code:
File: login.php PHP Code:
Quote:
Quote:
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum | My Blog Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall |
| Sponsored Links |
|
|
|
|||||
|
Nice work Sidewinder!
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog The CodeCall Wiki is now fully integrated with vBulletin users! Check it out and add some new pages! |
|
|||||
|
It feels weird being complemented for providing a script with poor standards, horrible security measures, and completely senseless code - but thanks
![]()
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum | My Blog Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| VB 6.0: Tutorial, How to Make Glass2K!! | TcM | VB Tutorials | 12 | 09-28-2008 12:53 PM |
| PHP: SQL Injections | John | Security Tutorials | 11 | 08-18-2008 01:43 PM |
| VB 6.0: Tutorial, How to make a GIF in your application | TcM | VB Tutorials | 17 | 07-01-2008 04:26 PM |
| How to make Dumplings | ahsan16 | The Lounge | 2 | 01-11-2007 11:55 PM |
| WingedPanther | ........ | 2753.6 |
| Xav | ........ | 2704 |
| Brandon W | ........ | 1702.32 |
| John | ........ | 1207.73 |
| marwex89 | ........ | 1175.24 |
| morefood2001 | ........ | 966.05 |
| dcs | ........ | 655.75 |
| Steve.L | ........ | 475.59 |
| orjan | ........ | 418.58 |
| Aereshaa | ........ | 383.54 |
Goal: 100,000 Posts
Complete: 97%