Kali linux oracle database

Инструменты 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.

Автор: 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 нужно запускать следующим образом:

Источник

Kali Linux Oracle Support

Table of Contents

EDIT This guide has been updated to accomodate a few changes (see here)

Recently I have had to get Oracle support sorted in my Kali Linux install. I will try not to rant about the reasons why it doesn’t just work out of the box and just get the steps written down quickly. Typically, when you try to use a module such as oracle_login , metasploit may error out with:

The link provided seems a little out of date, so here is an updated guide.

getting started

First, if you dont have an account at oracle.com, you will unfortunately need one here. If you don’t want to create one, don’t worry, a temp email works as well as you luckily don’t have to confirm ownership of it before you can download.

sorting oracle first

Anyways. Create yourself a directory /opt/oracle and cd there. In a browser, navigate to the instant client downloads url and choose your architecture. If you hate 32bit Kali, choose Linux x86, and 64bit Kali choose Linux x86-64.

Next, download the following packages and save them to /opt/oracle :

  • instantclient-basic-linux-12.1.0.1.0.zip
  • instantclient-sqlplus-linux-12.1.0.1.0.zip
  • instantclient-sdk-linux-12.1.0.1.0.zip

With those downloaded, extract the archives with the unzip command. This should leave you with a directory /opt/oracle/instantclient_12_1/ . This is all the files needed to at least get the sqlplus client going. However, when we build the ruby stuff needed for Metasploit, we will need to hax a .so. Do this with:

The last step is to configure the environment so that your shell is… oracle aware. We do this by setting a few environment variables. I have chosen to just append the lines to the end of my .bashrc file

Done! Log out and back and check that these are present in the output of env .

sorting out metasploit

The last thing we need to do is setup the metasploit part. For this we need to download ruby-oci8. In /opt/oracle , download it:

Next, move to the extracted directory and install the ruby-dev and libgmp-dev packages if you have not already done so:

Next, ensure that the ruby interpreter that you will be use is the same as that of Metasploit with

Ensure that you are using the correct version of ruby

Lastly, we will make && make install . Logout and back in and test that the oracle tools in metasploit are functional 🙂

Источник

Читайте также:  Switching from windows phone to android phone
Оцените статью