Pain Posted November 27, 2012 Share Posted November 27, 2012 (edited) Not sure if it is a good place to ask, but I'll do it anyway. if i have a following query: $query2 = mysql_query("SELECT * FROM testas WHERE username = '$username'); How do i drop the table by injecting sql? have tried this x’; DROP TABLE testas; -- but nothing happened:D Edited November 27, 2012 by Pain Quote Link to comment https://forums.phpfreaks.com/topic/271251-dropping-the-table/ Share on other sites More sharing options...
mrMarcus Posted November 27, 2012 Share Posted November 27, 2012 Where's Bobby tables when you need him... Quote Link to comment https://forums.phpfreaks.com/topic/271251-dropping-the-table/#findComment-1395570 Share on other sites More sharing options...
PFMaBiSmAd Posted November 27, 2012 Share Posted November 27, 2012 The mysql_query statement specifically doesn't support multiple queries because too many php 'coders' don't validate the external data they stuff into query statements. Quote Link to comment https://forums.phpfreaks.com/topic/271251-dropping-the-table/#findComment-1395575 Share on other sites More sharing options...
Pain Posted November 27, 2012 Author Share Posted November 27, 2012 (edited) What statement should i use instead of mysql_query. I want to test this injecton. Edited November 27, 2012 by Pain Quote Link to comment https://forums.phpfreaks.com/topic/271251-dropping-the-table/#findComment-1395630 Share on other sites More sharing options...
Pikachu2000 Posted November 27, 2012 Share Posted November 27, 2012 Are you testing security? If you are, why would you test it with anything other than what your code actually uses? If you use mysql_query(), that's what it should be tested with, and you've already verified that it failed to drop the table. Disclaimer: if it's simply a learning exercise, the above is not applicable. Quote Link to comment https://forums.phpfreaks.com/topic/271251-dropping-the-table/#findComment-1395632 Share on other sites More sharing options...
Pain Posted November 27, 2012 Author Share Posted November 27, 2012 I would like to display this in my uni presentation:) Quote Link to comment https://forums.phpfreaks.com/topic/271251-dropping-the-table/#findComment-1395633 Share on other sites More sharing options...
PFMaBiSmAd Posted November 27, 2012 Share Posted November 27, 2012 Then why not re-search to find the php query functions that would allow multiple queries? Quote Link to comment https://forums.phpfreaks.com/topic/271251-dropping-the-table/#findComment-1395639 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.