- Finding Exploit offline using Searchsploit in Kali Linux
- Using SearchSploit:
- How to Search the Exploit by Terminal Using Searchsploit in Kali Linux
- 1) How to Install SearchSploit
- 2) Updating SearchSploit
- 3) Using SearchSploit
- Help Screen
- Basic Searching
- Title Searching
- Removing Unwanted Results
- Colour Output
- Copy To Clipboard
- Copy To Folder
- Exploit-DB Online
- Статья Metasploit Exploitation Framework и searchsploit — как искать и как использовать эксплойты
Finding Exploit offline using Searchsploit in Kali Linux
SearchSploit is a command-line search tool for Exploit-DB that allows you to take a copy of the Exploit Database with you. Searchsploit is included in the Exploit Database repository on GitHub. SearchSploit is very useful for security assessments when you don’t have Internet access because it gives you the power to perform detailed offline searches for exploits in the saved Exploit-DB.
Installing SearchSploit – To run SearchSploit in Kali Linux, open the terminal and type “searchsploit” to run SearchSploit as “exploitdb” package is already included in Kali Linux. However, if you are using the Kali Light variant or your custom-build ISO then you can install SearchSploit manually using the below-mentioned command.
Updating SearchSploit: In order to update SearchSploit, run the following command:
Using SearchSploit:
1. Basic Search – You can add any number of search terms you wish to look for. In the below image, we are searching for exploits containing the term “oracle” and “windows”.
In case you need help just type “searchsploit -h” in the terminal. By using -h, you can see all the options and features that are available to you:
2. Title Searching in SearchSploit: If you are performing Basic Search, searchsploit will check for both the path and the title of the exploit. Searches can be restricted to the titles by using the -t option as follows:
In the above search, we are looking for the exploits related to Oracle based on Windows OS.
3. Copying Exploit to Clipboard and Directory: If you want to copy the exploit to clipboard use ‘-p’. For example – ” searchsploit -p XYZ ” , here XYZ is the exploit ID. If you want to copy the exploit in your current working directory use ‘-m’. For example – ” searchsploit -m XYZ “, where XYZ is the exploit ID.
4. Examine an Exploit: If you want to examine an exploit or want to study an exploit, use ‘–examine’. For example – “searchsploit XYZ –examine” , where XYZ is the exploit ID.
5. Eliminate Unwanted Results: If you want to eliminate unwanted results from your search simply use ‘–exclude’. You can also remove multiple terms by separating the terms with a “|” (pipe). For example – searchsploit –exclude “PoC”.
Источник
How to Search the Exploit by Terminal Using Searchsploit in Kali Linux
Jul 21, 2020 · 4 min read
Exploit-DB is a website that provides a collection of several vulnerabilities and code exploits from around the world. Over time, exploit-DB developers have created opensource tools to facilitate Exploit-DB users so that the user can easily access without entering the Exploit-DB website.
“Searchsploit” is a command-line search tool for Exploit-D B , which also allows you to bring a copy of Exploit-DB with you.
SearchSploit provides you with the ability to perform detailed offline searches in locally saved repositories. This capability is particularly useful for security assessment of the network without Internet access. Many vulnerabilities contain links to binary files that are not included in the standard repository but can be found in our Exploit-DB binaries.
In short, Searchsploit is an opensource security tool that stores exploit files that are in the exploit-DB, so we can easily access exploits in the exploit-DB without entering the exploit-DB site
1) How to Install SearchSploit
“If you are using the standard GNOME build of kali-Linux, the exploit-DB package is already included by default”, However, if you are using the Kali Light variant or your own custom-build ISO, you can install the package manually as follows:
2) Updating SearchSploit
If you are using Kali Linux, you can expect the exploit-DB package to be updated weekly.
3) Using SearchSploit
Help Screen
By using -h , you can see all the features and options that are available to you:
Basic Searching
Title Searching
By default, searchsploit will check BOTH the title of the exploit as well as the path. Depending on the search criteria, this may bring up false positives (especially when searching for terms that match platforms and version numbers). Searches can be restricted to the titles by using the -t option:
Removing Unwanted Results
We can remove unwanted results by using the —exclude option. We are also able to remove multiple terms by separating the value with a | (pipe). This can be demonstrated by the following:
You may have also noticed, “3.2” isn’t always visible in the results. That is because SearchSploit by default, will try to detect the version, and then search between any ranges in the title. This behavior can be disabled by doing -s .
Pro Tip: By doing:
$ searchsploit linux kernel —exclude=»(PoC)|/dos/» | grep ‘ 3.2’
(space before the version), you’ll get even «cleaner» output (sorted based on the version without any heading/footers).
Colour Output
By default, searchsploit highlights the search terms in the results when they are displayed to the user. This works by inserting invisible characters into the output before and after the color changes.
Now, if you were to pipe the output (for example, into grep) and try to match a phrase of both highlighted and non-highlighted text in the output, it would not be successful. This can be solved by using the —colour option ( —color works as well).
Copy To Clipboard
So now that we have found the exploit we are looking for, there are various ways to access it quickly.
By using -p , we are able to get some more information about the exploit, as well as copy the complete path to the exploit onto the clipboard:
Now, run this command:
Copy To Folder
We recommend that you do not alter the exploits in your local copy of the database. Instead, make a copy of ones that are of interest and use them from a working directory. By using the -m option, we are able to select as many exploits we like to be copied into the same folder that we are currently in:
You do not have to give the exact EDB-ID value (such as “39446”); SearchSploit is able to automatically extract it from a path given to it (such as “39525”).
Exploit-DB Online
The Exploit Database Repository is the main core of Exploit-DB, making SearchSploit efficient and easy to use. However, some of the exploit metadata (such as screenshots, setup files, tags, and vulnerability mappings) are not included. To access them, you will need to check the website.
You can quickly generate the links to exploits of interest by using the -w option:
Источник
Статья Metasploit Exploitation Framework и searchsploit — как искать и как использовать эксплойты
Metasploit Exploitation Framework — это инструмент для тестирования на проникновение. Он содержит большую базу эксплойтов, позволяет использовать их прямо из Metasploit. Существует две версии Metasploit, в этом уроке я рассматриваю бесплатную версию.
searchsploit — это инструмент для поиска эксплойтов. Содержит базу, по моим наблюдениям, более обширную, чем Metasploit. Но не содержит функции использования эксплойтов.
На всякий случай, разберёмся с терминологией. Эксплойт – это готовая программа, которая, используя конкретную уязвимость, автоматизирует процесс проникновения или повышения прав или другое несанкционированное действие, которое является следствием уязвимости.
Обе программы не сложны, но нужно знать, что и как там делать. Обе эти программы включены в Kali Linux «из коробки». Поэтому, возможно, вас также заинтересуют статьи:
- Как запустить Metasploit Framework в Kali Linux
- Как установить Kali Linux: подробная инструкция для установки на компьютер и в виртуальную машину
Я буду рассматривать работу с этими программами в Kali Linux, но на самом деле, эти утилиты можно установить на любой Linux.
Это программа только для поиска известных эксплойтов. Чтобы вывести справку по ней, наберите в командной строке:
Всё просто как 5 копеек:
Ключ -c для выполнения чувствительного к регистру поиска.
Ключ -v для подробного вывода, линии с описанием могут переполнять их колонки.
На мой взгляд, обе опции не несут ничего интересного. Для поиска просто набираете searchsploit и ключевые слова (можно несколько), разделённые пробелом:
Думаю, идея понятна. Можете искать по конкретным приложениям (и их версиям), операционным системам, плагинам и т. д.
Давайте посмотрим внимательно на вывод: есть файлы следующих типов: .c, .pl, .txt, .sh, .php, .rb, .py, .zip, .java, .asm, .htm и др.
Файлы с расширением .txt можно только читать — открывайте его любым блокнотом и читай об уязвимости. Содержимое этих файлов, обычно, следующее: описание уязвимости, пример использования, источник, информация о подверженных уязвимости версиях и т. д.
Файлы с расширением .rb написаны на языке Ruby, запускать их нужно так:
ruby + пробел + расположение файла.
Некоторые файлы .rb выдернуты из Metasploit. Если при обычном запуске программа жалуется на отсутствие чего-то, а в коде программы встречается строка
то самый простой способ запуска — найти этот же плагин в Metasploit и запустить его оттуда
Файлы .c нужно компилировать.
Файлы .php запускать из командной строки. При чём если Ruby может выводить диалоговые окна для ввода данных, то в PHP нужно сразу задавать необходимые аргументы в командной строке через пробелы после имени файла (ну или прописывать в коде скрипта, если это предусмотрено).
Файлы .pl написаны на языке Perl, перед именем файла, для запуска, нужно ставить perl. Аргументы передаются в командной строке (или вписываются в исходный код) как и с PHP.
Думаю, с поиском всё предельно просто. С конкретным применением — зависит от конкретного эксплойта. Переходим к Metasploit.
Программа Metasploit расположена в меню в двух местах. Самый быстрый способ — это найти её среди 10 самых популярных приложений. Там она называется Metasploit Framework. Запуск каждый раз занимает какое-то время, поэтому просто ждём:
Если программа пишет вам что-то про базу данных и про медленный поиск, то воспользуйтесь этой инструкцией. А также можете вручную пересобрать кэш:
Расширьте окно терминала, как это сделал я, иначе ничего непонятно.
В выводе должно быть всё понятно: первый столбец — расположение эксплойта, второй — дата, третий — ранг (насколько хороший среднестатистический результат), четвёртый — краткое описание.
Думаю, хакеры не любят WordPress за его автообновления, т. к. все известные уязвимости протухают в первый же день.
Я выбрал, например, этот:
Нужно скопировать его расположение — exploit/unix/webapp/wp_downloadmanager_upload
И теперь набираем команду use и после пробела расположение эксплойта.
(работает для всех эксплойтов — отображает варианты настойки).
Как минимум, нам нужно задать удалённый хост. Все настройки делаются через команду set
В данном эксплойте можно больше ничего не менять. Но обратите внимание на TARGETURI. В отдельных эксплоитах, например, для phpMyAdmin, этот параметр изначально задан как phpmyadmin и если целевой скрипт находится в другом каталоге, то эксплойт просто не найдёт адрес.
Для начала выполнения эксплойта наберите
Думаю, общие принципы работы понятны.
Порекомендую ещё одну команду, чтобы было понятно, в какую сторону нужно копать, для чего искать эксплойты, какие порты открыты и для каких служб и т. д. Это команда nmap. Применять так:
Ну и, конечно, для того чтобы знать, какие эксплойты использовать, нужно знать работающие на целевой машине программы и их версии. Определённую помощь в этом может оказать вам статья “Обзор разделов инструментов Kali Linux 1.0.9a. Часть 2. Инструменты для сбора информации“.
Скажу честно, базы эксплойтов меня разочаровали: я слежу за обновлениями самых популярных веб-приложений (phpMyAdmin, WordPress, Drupal и т. д.) и за последние месяцы в списках изменений мелькало достаточно много закрытых уязвимостей. Под большинство из них я не нашёл эксплойтов. Возможно, это касается только эксплойтов для веб-приложений. Вполне возможно, что для операционных систем и программ всё намного интереснее. Отсутствие в паблике эксплойтов на свежие версии популярных веб-приложений я связываю с тем, что: а) не так уж и просто потенциальную уязвимость раскрутить, хотя бы, до работающего концепта; б) самые интересные эксплойты собраны в закрытых базах, возможно, доступных за плату или только для определённого круга лиц.
Источник