Image
 
linkedin_logo.png rss_logo.jpg
twitter_logo.png youtube_logo.jpg
Latest Additions
 
EH-Net Login
Welcome Guest.






Lost Password?
No account yet? Register
Who's Online
We have 75 guests and 2 members online
 
Free Business and Tech Magazines and eBooks

You are here: Home arrow Ethical Hacking Discussions and Related Certificationsarrow Web Applicationsarrow [question]understanding parameterized queries ?
EH-Net
May 24, 2013, 12:48:54 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Go back to The Ethical Hacker Network Online Magazine Home Page
 
   Home   Help Calendar Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: [question]understanding parameterized queries ?  (Read 2028 times)
0 Members and 1 Guest are viewing this topic.
manoj9372
Jr. Member
**
Offline Offline

Posts: 72


View Profile
« on: February 27, 2013, 02:12:59 AM »

hi guys,
i have some questions as usual,so tought of asking here

i am trying to understand the parameterized query

here is the simple source link i had used
Code:
http://www.lavamunky.com/2011/11/why-parameterized-queries-stop-sql.html

Now let me explain my understanding,correct me where ever i am wrong

say there is a query logic exists in the application like this

sqlQuery='SELECT * FROM custTable WHERE User=' + Username + ' AND Pass=' + password

and say a user supplies a arbitrary query with the user name it gets executed in the db,(right?)

like this


sqlQuery='SELECT * FROM custTable WHERE User='' OR 1=1-- ' AND PASS=' + password

and say there is a code for parameterized query in the application like this

parameters.add("User", username)
parameters.add("Pass", password)


sqlQuery='SELECT * FROM custTable WHERE User=? AND Pass=?'

And the application sends the username and password from the parameters "user" and "pass" right ?

and even if the user submits the query like this

sqlQuery='SELECT * FROM custTable WHERE User=Nobody OR 1=1'-- AND Pass=?'

(the article says)it wont get executed as a query,i am confused at this point,


i)why this query didn't produce the results that i expect ?

ii) or does the application stores whatever we supply in the"user" and "pass" as a string instead of query in the db?

iii)how secure the parameterized queries are ? and how we can bypass it ?


Logged
MaXe
Hero Member
*****
Offline Offline

Posts: 669


I've just upgraded myself to a cyborg muahahaa!!1


View Profile WWW
« Reply #1 on: February 27, 2013, 03:57:04 AM »

You should consider posting your message on one forum first, and then wait a bit, before posting it across multiple forums. I've already replied on InterN0T.
Logged

I'm an InterN0T'er
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!
Page created in 0.065 seconds with 22 queries.
 
Exclusive Deal

sansfire13_245x90_cw90.jpg
SANSFIRE 2013
June 15 - 22

5% Off w/ Code: EHN_5

SANS Deals 4 EH-Netters
5% OFF Any SANS Course in Any Format!
Coupon Code: EHN_5 Including SANS Rocky Mountain 2013 & SANS Boston 2013
Polls
Compared to this year, 2013 will be:
 
Recent Forum Topics
EH-Net News Feeds
Latest Additions
 
         
Advertisement

© 2013 The Ethical Hacker Network
Joomla! is Free Software released under the GNU/GPL License.