SQL injection is a technique used to take advantage of non-validated input vulnerabilities to pass SQL commands through a Web application for execution by a backend database.

learn more… | top users | synonyms

104
votes
12answers
17k views

SQL injection is 17 years old. Why is it still around?

I'm no techie and would like your expertise in understanding this. I recently read a detailed article on SQLi for a research paper. It strikes me as odd. Why do so many data breaches still happen ...
16
votes
5answers
9k views

Would removing spaces in a string protect against SQL injection?

I was curious if it's possible to protect against an SQL injection attack by removing all spaces from an String input? I have been reading up on SQL Injection at OWASP, but they don't mention ...
5
votes
1answer
72 views

PHP SQL Injection Vulnerability In UPDATE Statements

Take the following SQL query as an example: UPDATE `sqlinjection2` SET `$vote`=`$vote`+1 Our goal is to increment the vote count by more than one, in one request. We cannot access the code itself. ...
2
votes
3answers
69 views

SQLMap deleted database items

While doing test on my website, SQLMap deleted data in my database tables. Everything is corrupt. What is a safe way of using this tool without touching other items on a live server? How do you use ...
47
votes
2answers
27k views

Are prepared statements 100% safe against SQL injection?

Are prepared statements actually 100% safe against SQL injection, assuming all user-provided parameters are passed as query bound parameters? Whenever I see people using the old mysql_ functions on ...
0
votes
2answers
112 views

Can an SQL injection attack happen if the input is only allowed to be hexadecimal characters?

I've set up a login system that works more or less like this: 1) The user enters the data 2) The data is hashed locally using SHA256 (To reduce the risk of someone stealing the password through a ...
3
votes
1answer
59 views

Blind SQL Injection using OOB DNS Practical Sniffing Help

I was looking at Excellent Article from Defcon 15's which was Data retrieval over DNS during SQL Injection Attacks. (https://www.youtube.com/watch?v=iQDw0hK_eFw). In this the speaker demonstrated the ...
13
votes
2answers
3k views

Is the injection in a NoSQL database architecture also called SQL injection?

Is the injection in a NoSQL database architecture also called SQL injection and is it still part of the OWASP 2013 Top 10, category A1 Injection? For example an injection in code that communicates ...
0
votes
1answer
58 views

Detecting datasets that were affected by SQL injection

Assuming that I know that one of my applications was attacked by an SQL injection, how can I identify edited or selected data sets? On obvious source are webserver logs. This should allow us to ...
-1
votes
0answers
96 views

How can a WHERE clause with an SQLi vulnerability be exploited?

We will assume that we have an SQL injection relative to: http://mysite.com/?id=3 We could also assume that DB system is MySQL. The SQL request could look like this well known example: SELECT * ...
0
votes
0answers
21 views

Is there a way to check a CGI SQL Injection using sqlmap?

I got this finding from Nessus: 51973 - CGI Generic SQL Injection (Parameters Names) And the correspondent GET request: https://myhost/folder/b?'+convert(int,convert(varchar,0x7b5d))+'=1 As you ...
6
votes
4answers
100 views

How can releasing the text of an SQL query compromise security?

I have asked a government agency, under Freedom of Information legislation, to release two SQL queries they ran to produce a table which they published in a report. That is, the agency published ...
4
votes
1answer
119 views

Exploiting MD5/Salt Vulnerability in this PHP form?

I've been practicing security-related subjects and this challenge has befuddled me. Note: I can't access any PHP source code, nor can I edit it. I'm only able to view it. The following is given: I ...
4
votes
2answers
136 views

Is this PHP code vulnerable SQL injection?

Im given control over the $vote variable (in the "challenge" function) Is there any way to sql inject the query? (BTW I can see/read whatever the challenge function returns e.g. the sql errors. I ...
-4
votes
0answers
44 views

How do I report if I find a security exploit? [duplicate]

A while ago I found a pretty bad SQLi in a phpMyAdmin in a site and I dont know how to report it without risking my self. Any ideas?
473
votes
20answers
62k views

How can I explain SQL injection without technical jargon?

I need to explain SQL injection to someone without technical training or experience. Can you suggest any approaches that have worked well?
0
votes
0answers
24 views

SQLite table discovery by injection

Background: Simple SQL Injection For an injection exercise i need to get the password of a person out of a database. I've got one input field which accepts most of the chars (expect from ',", OR, ...
1
vote
2answers
81 views

Simple SQL Injection

I'm training my SQLInjection knowledge on a training tool made by my university. In a certain lvl there is this simple product viewer which gets a row based on a id. So the query should me something ...
2
votes
2answers
143 views

PHP security hacking question, may be more than just PHP

I have an input box for for INSERTing into the database. It is written in PHP PDO. Some one typed in: <"'> and also: ' onClick='alert(1); I'm assuming they were in two different input ...
0
votes
1answer
165 views

Sqlmap doesn't exploit verified SQL injection

Right now I'm tinkering with the Hackxor VM (a pentesting training enviroment) and I'm trying to use sqlmap to exploit a vulnerability which I can exploit manually. The vulnerability is in the ...
-4
votes
1answer
81 views

Safest SQL database [closed]

I am going to run a Tor Hidden Service on a Linux server. My site will have an SQL database. This DB contains user login, and a few other basic details. If it makes a difference depending on the ...
0
votes
0answers
74 views

What does this injected query achieve?

On this very good link you can see some SQL injection expressions for MySQL. Quick Detection Error Based SQLi For integer inputs: (select 1 and row(1,1)>(select count(*),concat(...
6
votes
4answers
324 views

Why is using SQL injection to extract passwords or password hashes from a login database (that should never legitimately disclose them) even possible?

(Okay, so I'll confess upfront that while I'm trying to educate myself the current state of my knowledge on web applications security is still pretty shallow. So I appreciate your patience if the way ...
0
votes
0answers
63 views

SQL injection in find_by Active Record RoR 4

I was trying to understand the possibility of SQLi in a Rails Application, that I am currently auditing for a client, that uses Active Record 4.2.0. Now, I have limited experience with RoR so please ...
1
vote
1answer
44 views

SQLi with comment filter: dumping the database

The following SQLi (MySQL) filter is from SQLi-Labs: ... $reg = "/#/" $reg1 ="/--/" $replace ="" $id=preg_replace($reg,$replace,$id); $id=preg_replace($reg1,$replace,$id); .... $sql = "SELECT *...
1
vote
1answer
62 views

How do I exploit with vunerability in special format with sqlmap?

I used ZAP proxy to determine that login was injectable with GET request as login" AND "1"="1 was injectable, but it returned the url to me in this format: https://example.com/login%22%20AND%20%221%...
5
votes
2answers
349 views

SQL Injection query error with backslash

I have a sql injection vulnerable site which works well if i input query like this qq' -- // or qq' -- ; . But when i inject without slash or semi-colon it throws following error "You have an error in ...
6
votes
2answers
218 views

What's the best way to test for SQL Injection vulnerabilities? Manual or SQLMap?

As part of my job I test for web application vulnerabilities regularly. When it comes to SQL Injection, my methodology is to start by manually browsing the website and spidering it, then, sending the ...
0
votes
1answer
44 views

mySQL into outfile strange behaviour

I have sql-injection with file_priv=Y (root user) but I can only create file in /tmp and /var/tmp directories even when i have 777 permissions to destination folder - mysql server just won't create ...
2
votes
2answers
101 views

Explaining information leak to Lead dev

Our lead dev tells me that this information leak from our website is "no vulnerability. Just an ugly error UI." It looks to me that the leaked information could be used to aid an attack. Does it ...
5
votes
1answer
7k views

Understanding Boolean Based SQL Injection

I am trying to understand the concept of Boolean Based Blind SQL Injection. I have gone through OWASP Guide To SQLi to understand it. However I am confused with how exactly does it work. Below id ...
1
vote
2answers
12k views

1'or'1'='1 help

When I put Username:anything and Password : 1'or'1'='1 Then my database retrieves the first row in the mysql table. But I want to retrieve the row corresponding to Username:anything row. How should I ...
0
votes
1answer
112 views

What SQL payloads can be injected for a numeric field?

I have a parameter (pi_apk_version_code) that seems to be vulnerable to SQL Injection (the team is divided on this). The database column corresponding to this parameter accepts only numeric values. ...
1
vote
1answer
60 views

Does fuzz testing produce different output compared to manual testing?

I am testing an API and one parameter is vulnerable to SQL injection. When I run OWASP ZAP's fuzzer on this parameter, the input "; or 1=1" results in a successful exploit of SQL injection. However, ...
1
vote
0answers
73 views

Dumping Large table using Sqlmap

I am learning/working on sqlmap and I was trying to dump a large table with 11K entries on my localhost. The command I used is: python sqlmap.py -u "http://localhost/searchre.php" --data="search=' ...
-6
votes
2answers
140 views

SQL injection using only Scala syntax?

Is there a way to perform an SQL injection using only Scala syntax (not importing any Java)? From what I've seen online all the examples (like this) were based on importing Java things and then using ...
0
votes
1answer
53 views

sqlmap not finding a proven vulnerability

I'm testing a wordpress site with the jetpack plugin installed. According to: https://www.exploit-db.com/exploits/18126/ this plugin should be vulnerable to SQL injection (found with sqlmap) but when ...
0
votes
0answers
20 views

Can someone provide some examples of boolean based SQLi tests?

I've seen tests ' or 1=1-- or ' and '1'='1. I was looking for some more boolean based tests. One of the sites I'm testing has WAF blocking a lot of tests, but simple boolean tests, like above, have ...
0
votes
1answer
35 views

Getting Operating System Username using MySQL SQLi

Suppose I have a website which has SQL injection vulnerability and I got the database schema etc. Is there any means by which I can get the operating system username or the SSH username? Asking from ...
0
votes
0answers
44 views

Fortify scan flagging “SQL Injection: MyBatis Mapper for <if> tags”

A Fortify SCA scan has flagged 8 instances of SQL Injection: MyBatis Mapper in our code. The following query get's flagged at the <if> line: <select id="getByBusinessId" ...
3
votes
2answers
1k views

What makes a SQL Injection count as blind injection?

Firstly, from what I have read so far, boolean-based blind SQL injection is when you can't see any error messages and rely on true or false responses to queries to milk the database. For example, you ...
0
votes
2answers
159 views

SQL Injection Attack - Permissions Defenses

SQL injection attacks work by the attacker putting valid SQL into the text that goes back from the page to the server; something like "Delete * from tblAccounts where 1=1" What I cannot understand is ...
0
votes
1answer
116 views

Dumping custom query via SQL injection when output is in the die() function?

On my localhost I have a PHP link like this abc.com/index.php?q=XYZ where XYZ is a base64encoded parameter that I have verified is injectable. When I try abc.com/index.php?q=XYZ' it returns You ...
0
votes
0answers
53 views

MySQL SQL Injection - Get User Password

I've used SQLMAP to check for SQL injection. I've managed to retrieve the name of just one database (dbInfo) However, using SQLMAP I can't enumerate anything else - where it is tables within the DB ...
0
votes
3answers
84 views

Is it a good idea to let a database do a password check?

Setup A server running a PostgreSQL database and an Apache with several php applications. Access to db is over the loopback interface. The db contains a table with the username and SHA-512-CRYPT ...
1
vote
1answer
59 views

Are sqlcmd parameters inherently at risk of SQL injection?

The command line utility sqlcmd has a feature to allow parameter substitution, from command line parameters and environment variables. https://msdn.microsoft.com/en-us/library/ms188714.aspx If an ...
1
vote
1answer
36 views

How to extract data from hackyourself legal site with table and column information?

I am following the Pluralsight SQL injection tutorial. The instructor did not go over actually extracting the data. http://hackyourselffirst.troyhunt.com/CarsByCylinders?Cylinders=V12'AND 1=(SELECT ...
2
votes
1answer
135 views

SQL injection vulnerability when using prepared statements in PHP

I've been studying prepared statements and implemented it in my first login. I used a prepared statement for the SQL query and am wondering if this is enough to ward off most SQL injections? Since ...