Author Topic: Need help in SQL  (Read 2877 times)

0 Members and 1 Guest are viewing this topic.

Offline Kinez

  • /dev/null
  • *
  • Posts: 9
  • Cookies: -1
    • View Profile
Need help in SQL
« on: November 14, 2013, 05:29:49 pm »
I scan a site with uniscan on backtrack 5 and find 2 vulnerabilities on section Blind SQL-i: http://website.com/search_apps/industry/index.html?N=D+AND+1=1 and don't know how to get some database from that. I try mysql and sqlbrute but it didn't work for me. Can someone help me with this i will be very helpful  :)
« Last Edit: November 14, 2013, 05:41:44 pm by ande »

Offline ande

  • Owner
  • Titan
  • *
  • Posts: 2664
  • Cookies: 256
    • View Profile
Re: Need help in SQL
« Reply #1 on: November 14, 2013, 05:45:31 pm »
I would normally delete this. But the question is not that bad, and you are not using an actual page, but a hypothetical URL, which is good. Nor is your English that bad.

Best solution: Lean SQL and SQL injection and perhaps some sort of web oriented language like PHP and you will understand this easily. However I do understand that you might not want to learn all of this just to do this little injection. Or maybe you do, in which case great!

Asap solution (booooo!): Check out sqlmap (http://sqlmap.org/). Its a automated SQL injection tool that will do all the work for you. I don't normally advice people to use tools without knowing the workings behind it, but oh well.
if($statement) { unless(!$statement) { // Very sure } }
https://evilzone.org/?hack=true

Offline Kinez

  • /dev/null
  • *
  • Posts: 9
  • Cookies: -1
    • View Profile
Re: Need help in SQL
« Reply #2 on: November 14, 2013, 05:54:43 pm »
i'm very thankfull for your answer. My biggest problem is that when i try to use sqlmap in backtrack it needs url vith php?id=5 for example. But i only have as you see .html  and  i trying for 3 days to get it but i don't.

Offline ande

  • Owner
  • Titan
  • *
  • Posts: 2664
  • Cookies: 256
    • View Profile
Re: Need help in SQL
« Reply #3 on: November 14, 2013, 05:57:13 pm »
i'm very thankfull for your answer. My biggest problem is that when i try to use sqlmap in backtrack it needs url vith php?id=5 for example. But i only have as you see .html  and  i trying for 3 days to get it but i don't.

You can just as well use .index.html?n=D. SQLmap doesn't care about the file extension.
« Last Edit: November 14, 2013, 05:58:01 pm by ande »
if($statement) { unless(!$statement) { // Very sure } }
https://evilzone.org/?hack=true

Offline Kinez

  • /dev/null
  • *
  • Posts: 9
  • Cookies: -1
    • View Profile
Re: Need help in SQL
« Reply #4 on: November 14, 2013, 06:11:52 pm »
HOW!! in sqlmap i write  python sqlmap.py -u www.website.com/search_apps/industry/index.html?n=D -dbs      and got this error   invalid target details, valid syntax is for instance 'mysql://USER:PASSWORD@DBMS_IP:DBMS_PORT/DATABASE_NAME'

Offline ande

  • Owner
  • Titan
  • *
  • Posts: 2664
  • Cookies: 256
    • View Profile
Re: Need help in SQL
« Reply #5 on: November 14, 2013, 06:21:42 pm »
HOW!! in sqlmap i write  python sqlmap.py -u www.website.com/search_apps/industry/index.html?n=D -dbs      and got this error   invalid target details, valid syntax is for instance 'mysql://USER:PASSWORD@DBMS_IP:DBMS_PORT/DATABASE_NAME'

python sqlmap.py -u http://www.website.com/search_apps/industry/index.html?n=D --dbs

Works fine. You probably missed the http:// (not sure if its required, but one always uses http:// to describe a URL). and the --dbs instead of -dbs
if($statement) { unless(!$statement) { // Very sure } }
https://evilzone.org/?hack=true

Offline hppd

  • Knight
  • **
  • Posts: 163
  • Cookies: 7
    • View Profile
Re: Need help in SQL
« Reply #6 on: November 14, 2013, 06:24:35 pm »
Do you know any SQL? It's best to learn some basic SQL and php before trying injection. And if you want to dive straight into injecting, maybe try this ebook? It has some nice info http://www.mediafire.com/download/6psj7siy595gp1e/Advance+SQLI+e-book.pdf

Offline Kinez

  • /dev/null
  • *
  • Posts: 9
  • Cookies: -1
    • View Profile
Re: Need help in SQL
« Reply #7 on: November 14, 2013, 06:29:49 pm »
Ande I do that and i got 3 errors   1:using unescaped version of the test because of zero knowledge of the back-end DBMS 
2:GET Parametar N is not injectable

3:(CRITICAL) all parametars appear to be not injectable.

Offline ande

  • Owner
  • Titan
  • *
  • Posts: 2664
  • Cookies: 256
    • View Profile
Re: Need help in SQL
« Reply #8 on: November 14, 2013, 06:30:40 pm »
Do you know any SQL? It's best to learn some basic SQL and php before trying injection. And if you want to dive straight into injecting, maybe try this ebook? It has some nice info http://www.mediafire.com/download/6psj7siy595gp1e/Advance+SQLI+e-book.pdf

Please use our dedicated upload service for better speeds and less crap (http://upload.evilzone.org).

On a related note: http://evilzone.org/tutorials/sql-injection/





Ande I do that and i got 3 errors   1:using unescaped version of the test because of zero knowledge of the back-end DBMS 
2:GET Parametar N is not injectable

3:(CRITICAL) all parametars appear to be not injectable.



Then I guess it's not injectable. sqlmap is actually pretty accurate, however all tools can be wrong. Do you have anything to back up that the n parameter is in fact vulnerable?
« Last Edit: November 14, 2013, 06:32:31 pm by ande »
if($statement) { unless(!$statement) { // Very sure } }
https://evilzone.org/?hack=true

Offline hppd

  • Knight
  • **
  • Posts: 163
  • Cookies: 7
    • View Profile
Re: Need help in SQL
« Reply #9 on: November 14, 2013, 06:32:27 pm »
Ok thanks I'm going to use that in the future. It was already uploaded by someone else just retrieved it from my bookmarks :D

Offline Kinez

  • /dev/null
  • *
  • Posts: 9
  • Cookies: -1
    • View Profile
Re: Need help in SQL
« Reply #10 on: November 14, 2013, 06:37:56 pm »
Nothing man i try with level 5 and risk 3 but nothing get. If it is not injectable why then uniscan found that url?

Offline ande

  • Owner
  • Titan
  • *
  • Posts: 2664
  • Cookies: 256
    • View Profile
Re: Need help in SQL
« Reply #11 on: November 14, 2013, 06:40:42 pm »
Nothing man i try with level 5 and risk 3 but nothing get. If it is not injectable why then uniscan found that url?

Because, again, tools can be wrong. Its called false positives. Its why you cant trust tools 100% and why people (you) need to learn how it actually works in order to be sure.
if($statement) { unless(!$statement) { // Very sure } }
https://evilzone.org/?hack=true

Offline Kinez

  • /dev/null
  • *
  • Posts: 9
  • Cookies: -1
    • View Profile
Re: Need help in SQL
« Reply #12 on: November 14, 2013, 06:48:12 pm »
ok man i will try to learn more. Thanks for your help  :D

Offline BrokenSyntax

  • /dev/null
  • *
  • Posts: 10
  • Cookies: 2
    • View Profile
Re: Need help in SQL
« Reply #13 on: November 14, 2013, 11:11:44 pm »
As mentioned by others I would strongly suggest that you learn some basics of sql injection. There's a lot of really good vulnerable by design web applications made for exactly this purpose. Another thing you should learn is filter evasion. Things like replacing 1 = 1 with 1 LIKE 1 etc.

When you run sqlmap I suggest you also add the verbosity (-v) option with at least value 3. This will print out all the queries and is really good for educational reasons. Dissect the queries and understand what each part is doing by reading about them in the database documentation. I've learned a lot about manual injections doing this.

Some vulnerable web applications:
- Damn Vulnerable Web Application (DVWA): http://www.dvwa.co.uk/
- Exploit KB Vulnerable Web App: http://exploit.co.il/projects/vuln-web-app/
- SQLi-Labs: https://github.com/Audi-1/sqli-labs
- Mutillidae: http://www.irongeek.com/i.php?page=mutillidae/mutillidae-deliberately-vulnerable-php-owasp-top-10