Конвертация файлов hccap в формат cap
convert cap to hccapx Solve the problem “Old hccap file format detected! You need to update
If you crack WiFi password in Hashcat, then you know that Hashcat cannot work directly with network capture files (.cap or .pcap), these files need to be converted to a special Hashcat format. For conversion to the format in the .hccap format, a bunch of wpaclean programs (for cleaning extra data) and aircrack-ng (for the conversion itself) were usually used.
But in the new version of Hashcat, when trying to find the password to the .hccap file, we are met with an error:
Old hccap file format detected! You need to update
Let’s start with a little background. The aircrack-ng and cap2hcap programs that are commonly used to convert handshakes to Hashcat format do not check the repeat counter attribute, which is used to distinguish different WPA handshakes for the same access point and station. At least they don’t do it right. The result is what may turn out to be a .hccap file that looks correct, but will never be hacked, even if your dictionary contains the correct password.
Especially if you launch a deauthentication attack to speed up the process of capturing a handshake, then it is possible to launch several simultaneous WPA handshakes in parallel (and their capture) from the same TD and Station. Each of them will have different nonce (random data), which are part of the calculation that hashcat performs to verify whether the password candidate is correct or not. To perform a successful verification, it is important to use the correct nonce, and for this to be so, it is important to correctly check the consistency of the handshake packages.
Since this ticket was opened 8 years ago and the last changes to cap2hccap were made 3 years ago, atom decided to write its own converter. At the moment, the converter is finished and is called ” cap2hccapx “. It has been added as a new tool in hashcat-utils .
cap2hccapx checks if a handshake has been made up of several.
To break the password, as is known, the captured so-called four-stage handshake (handshake). It consists of four elements. But not all of these items are required to crack a password. Now hashcat can crack and incomplete handshakes (the so-called WPA2 Half Handshake).
In general, several new entries were added to allow hashcat to determine if the handshake file was valid (“HCPX” was added to the beginning of the file), a version about the format was added and, of course, information about whether the authentication was successful and, therefore, The third message is captured (the third element of the handshake). If the handshake is complete, then hashcat will crack two types of records from the handshake. This does not require additional costs, since all verification is done after the slow part of PBKDF-HMAC-SHA1.
The hccapx format is new. Of course you have a lot of .hccap files in the archives. But without the changes made, it was impossible to be sure even that the data converted into a hash can be compromised altogether due to missing checks and incorrect matching algorithms. For this reason, it makes absolutely no sense to convert from hccap to hccapx.
If you prefer to convert the capture files (handshakes) to hashcat format on your computer, then let’s take a closer look at the cap2hccapx utility . As already mentioned, it is part of the hashcat-utils package .
The tool is used to generate .hccapx files from network capture files (.cap or .pcap) for hacking WPA / WPA2 authentication. The .hccapx files are used as input for the hash type -m 2500 = WPA / WPA2.
Additional options allow you to specify a network name (ESSID) to filter unwanted networks and to provide cap2hccapx network name prompts (ESSID) and MAC address of the access point (BSSID) if no beacons were captured. Using:
After downloading, just unpack the archive and run the required * .bin or .exe files for Windows.
Or install from source codes.
If the capture file (saved with the name RT-726940.cap) contains only one handshake and I want to convert it into hashcat format to crack the Wi-Fi password into a file called output.RT-726940.hccapx, then my command looks like:
The program will write something like:
Consider another case – when there are several handshakes in the capture file (/home/mial/autopwner.cap)
You can see that there are handshakes for access points RT-714241 and for RT-727674.
If I am interested in a handshake only for the access point RT-714241 and I want to save the hash to crack the password in the file output.RT-714241.hccapx , then my command will look like this:
Accordingly, if I am interested in handshakes only for RT-727674, then the team turns into:
Этичный хакинг и тестирование на проникновение, информационная безопасность
Если вы взламываете пароль Wi-Fi в Hashcat, то вы знаете, что Hashcat не может работать напрямую с файлами сетевого захвата (.cap или .pcap), эти файлы нужно конвертировать в специальный формат Hashcat. Для конвертации в формат в формат .hccap обычно использовалась связка из программ wpaclean (для очистки лишних данных) и aircrack-ng (для самой конвертации). Но в новых версия Hashcat при попытке подобрать пароль к файлу .hccap нас встречает ошибка:
Начнём с небольшой предыстории. Обычно используемые для конвертации файлов рукопожатий в формат Hashcat программы aircrack-ng и cap2hcap не проверяют атрибут счетчика повторов, который используется для различения разных рукопожатий WPA для одной и той же точки доступа и станции. По крайней мере, они не делают это правильно. Результатом становится то, что может получиться .hccap файл, который выглядит корректным, но никогда не будет взломам, даже если в вашем словаре имеется верный пароль.
Особенно если вы запускаете атаку деаутентификации для ускорения процесса захвата рукопожатия, то возможен параллельный запуск нескольких одновременных WPA рукопожатий (и их захват) от одной и той же ТД и Станции. Каждое из них будет иметь различные nonce (случайные данные), которые являются частью расчёта, которые выполняет hashcat для верификации, является ли кандидат в пароли корректным или нет. Для осуществления успешной верификации важно использовать корректный nonce , а чтобы это было так, важно правильно проверить соответствие пакетов рукопожатия.
Поскольку этот тикет открыт 8 лет назад и последние изменения в cap2hccap делались 3 года назад, atom решил написать его собственный конвертер. В данный момент конвертер закончен и называется "cap2hccapx". Он добавлен в качестве нового инструмента в hashcat-utils.
cap2hccapx делает проверку, не было ли составлено рукопожатие из нескольких.
Для взлома пароля, как известно, применяется захваченное т.н. четырёхэтапное рукопожатие (хендшейк). Оно состоит из четырёх элементов. Но не все эти элементы являются обязательным для взлома пароля. Теперь hashcat умеет взламывать и неполные хендшейки (так называемые WPA2 Half Handshake).
Формат hccapx является новым. Конечно у вас в архивах много файлов .hccap. Но без сделанных изменений нельзя было быть уверенным даже в том, что конвертированные в хеш данные вообще поддаются взлому из-за отсутствующих проверок и неправильных алгоритмов сопоставления. По этой причине абсолютно не имеет смысла конвертировать из hccap в hccapx.
Если вы предпочитаете конвертировать файлы захвата (рукопожатия) в формат hashcat у себя на компьютере, то давайте познакомимся поближе с утилитой cap2hccapx. Как уже было сказано, она является частью пакета hashcat-utils.
Инструмент используется для генерации файлов .hccapx из файлов сетевого захвата (.cap или .pcap) для взлома WPA/WPA2 аутентификаций. Файлы .hccapx используются как ввод для типа хеша -m 2500 = WPA/WPA2.
Дополнительные опции позволяют вам указать имя сети (ESSID) для фильтрации нежелательных сетей и для предоставления cap2hccapx подсказки о имени сети (ESSID) и MAC адресе точки доступа (BSSID) если не было захвачено маячков (beacon).
В Kali Linux и в BlackArch hashcat-utils утилиты имеются в стандартных репозиториях и даже предустановлены в системы. Тем не менее, на момент написания там присутствуют старые версии, в которых программа cap2hccapx ещё не добавлена.
Пакет hashcat-utils является портативным и кроссплатформенным.
После скачивания достаточно распаковать архив и запускать требуемые файлы *.bin или .exe для Windows.
Либо установить из исходных кодов.
Если в файле захвата (сохранён с именем RT-726940.cap) содержится только одно рукопожатие и я хочу конвертировать его в формат hashcat для взлома Wi-Fi пароля в файл с именем output.RT-726940.hccapx, то моя команда выглядит:
Программа напишет что-то вроде:
Рассмотрим другой случай – когда в файле захвата (/home/mial/autopwner.cap) присутствует несколько рукопожатий
Можно увидеть, что имеется рукопожатия для точек доступа RT-714241 и для RT-727674.
Если меня интересует рукопожатие только для точки доступа RT-714241 и я хочу сохранить хеш для взлома пароля в файл output.RT-714241.hccapx, то моя команда будет выглядеть так:
Соответственно, если меня интересуют рукопожатия только для RT-727674, то команда превращается в:
Если мне нужны все хеши рукопожатий, то это можно сделать так:
Как в aircrack-ng конвертировать в формат Hashcat
aircrack-ng имеет две опции для конвертации в старый и новый формат Hashcat:
Команда для конвертации имеет вид:
Обратите внимание, что первым идёт имя хеша, в который будет сконвертирован хендшейк. Причём указывать расширение .hccapx не нужно — оно будет добавлено автоматически.
Следующая команда конвертирует захваченное рукопожатие RT-725140.pcap в носовую версию хеша для взлома в последних Hashcat и сохранит его в файл с именем RT-725140.hccapx:
Связанные статьи:
факультете информационной безопасности от GeekBrains? Комплексная годовая программа практического обучения с охватом всех основных тем, а также с дополнительными курсами в подарок. По итогам обучения выдаётся свидетельство установленного образца и сертификат. По этой ссылке специальная скидка на любые факультеты и курсы!
hashcat Forum › Misc › User Contributions
New hccapx format explained
atom
Administrator
After some debugging it was clear what is the problem. It's the tools he used to convert the .cap file to .hccap!
- aircrack-ng (latest version from GitHub)
- cap2hcap (latest version from SVN)
Especially if you run a deauth attack to accelerate the handshake capture process, it's possible that there's multiple WPA handshakes running in parallel (and getting captured) from the same AP and Station. Each of them will have different nonce's (random data) which is part of the calculation that hashcat is doing to verify if a password candidate is correct or not. To do a successfull verification it's important to use the correct nonce's and to do this it's important to match the handshake packets correctly.
While we were implementing cap2hccapx we learned a bit better about the information exchanged in the so-called 4-way WPA handshake and from which packets we can obtain valuable information. There's basically two possible combinations of messages (also called exchanges) in the handshake process that can be used to crack the authentication, not just one.
- The 1st one: packet from the access point (AP) to the client (STA) which initiate the connection request
- The 3rd one: packet from the access point (AP) to the client (STA) which is a response to the message number 2
On the other hand, if we only are in possession of the 1st and 2nd one, we can't tell for sure if the connection was established or even if the password was correct. However, it has it's own usecase. For example whenever you see a Client probing for his AP this typically also shows you the ESSID. As an attacker, you can now simply setup an AP with exactly this ESSID. If the Client does not verify the MAC address (most clients don't do this), it will try to connect to your AP. Of course this will fail, because you AP doesn't use the same Password as the Client does. However, the Client will have used the correct Password. This so called "non-authenticated" Handshake can get cracked with hashcat now, too. If you succeed to crack it, you can re-setup your AP with the cracked password and the connection with the Client will be successful giving you access to the Client from a more "internal" network position or to do any man-in-the-middle attack. Alternatively, you could also connect to the real AP, in case you know where it is located.
All in all, we added several additional entries that help hashcat to know if the file is a valid one (because we added a file magic "HCPX" at the start of the file), we added a format version number and of course the information about whether the authentication was successful (see the "authenticated" entry) and therefore if message 3 was captured too. If your .hccapx file contains both types, hashcat will try to crack both. This will create no additional cost because all the verification is done after the slow PBKDF-HMAC-SHA1 part. IOW, you get this features for free.
The hccapx is a new format and we know that you might have some old .hccap files in your archives. But believe us, the changes were needed and we love them. Without these changes we can't ensure that the converted data is even crackable (because as you already know, output from other tools might not be crackable at all, because of the missing checks and faulty matching algorithm). Therefore it also doesn't make any sense to write a converter from hccap to hccapx.
Finally, with these changes in hashcat-utils and hashcat, we expect to get much fewer problem reports and hopefully you will crack more WPA/WPA2 networks too.
- Convert CAP files to HCCAP files
- Convert HCCAP files back to CAP files
- Preview and edit the contents of an HCCAP file
It does not require any external programs or dependencies to be installed (such as Wireshark, WinPcap or libpcap). It directly reads and writes the raw bytes of the files.
Before converting it is recommended that you clean your caps first manually using Wireshark or with pyrit using the command.
pyrit -r INPUT.CAP -o OUTPUT.CAP strip
to only contain one handshake for one network but even if you don't this program will still make it's best attempt at extracting the correct WPA handshake information.
How to Convert CAP to HCCAP
- Press the "Open CAP. " button to open a .CAP file
- Verify the hash information looks correct in the "HCCAP Info" box
- Press the "Save As HCCAP. " button to save the information to an .HCCAP file
How to Convert HCCAP to CAP
- Press the "Open HCCAP. " button to open a .HCCAP file
- Verify the hash information looks correct in the "HCCAP Info" box
- Press the "Save As CAP. " button to save the information to a .CAP file
Background
Cracking WPA/WPA2 with oclHashcat requires the use of an HCCAP file which is a custom file format designed specifically for hashcat. Typically this file is created using aircrack-ng (v1.2-beta1 or later) using the command.
aircrack-ng -J HCCAP_FILE CAP_FILE.CAP
or by using this online converter (which is powered by cap2hccap). However if you aren't comfortable with either of those options this program allows you to perform your CAP-to-HCCAP conversions offline with a familiar Windows interface.
This program effectively merges together the functionality and adds a GUI to these existing projects:
Список инструментов для тестирования на проникновение и их описание
Hashcat — это самый быстрый в мире восстановитель (взломщик) паролей.
В настоящее время, Hashcat объединила в себе две ранее существовавшие отдельные ветки программы. Одна так и называлась Hashcat, а вторая называлась oclHashcat (а ещё раньше oclHashcat была разделена на собственно oclHashcat и cudaHashcat). В настоящее время абсолютно все версии слиты в одну, которая при восстановлении паролей использует центральный процессор и видеокарту.
- Самый быстрый в мире взломщик
- Первый и единственный в мире внутриядерный движок правил
- Бесплатная
- Открытый исходный код (лицензия MIT)
- Мультиплатформенная (Linux, Windows и OSX)
- Мультиплатформенная (CPU, GPU, DSP, FPGA и т.д., всё, что поставляется со средой выполнения OpenCL)
- Множество хешей (одновременный взлом множества хешей)
- Задействует несколько устройств (использует множество устройств на одной системе)
- Задействует устройства разных типов (использует устройства разных типов на одной системе)
- Поддержка распределённых систем взлома (с помощью дополнительного сегмента)
- Поддерживает распределённый взлом по сети (используя оверлей)
- Интерактивная поддержка паузы / возобновления
- Поддержка сессий
- Поддержка восстановления
- Поддержка чтения кандидатов в пароли из файла и стандартного ввода
- Поддержка шестнадцатеричных солей и шестнадцатеричных наборов символов
- Поддержка автоматической тонкой настройки производительности
- Поддержка автоматического поорядка пространства ключей цепей Маркова
- Встроенная система бенчмарков
- Интегрированный тепловой сторож
- 350+ реализованных с мыслью о производительности типов хешей
- … и многое другое
Справка по Hashcat
Опции и справочная информация:
Руководство по Hashcat
Примеры запуска Hashcat
Запуск бенчмарка -b
Взлом WPA2 WPA рукопожатий с Hashcat
Очистка ваших файлов .cap программой wpaclean
Конвертируем файл .cap в формат, который будет понятен oclHashcat. Для ручной конвертации .cap используйте следующие команды в Kali Linux.
Обратите внимание, что, вопреки логике, сначала идёт выходной файл, а потом входной . Казалось бы, логичнее было . Запомните это, чтобы не терять время на выяснение проблемы.
В моём случае команда выглядит так:
Конвертация файлов .cap в формат .hccap
Нам нужно конвертировать этот файл в формат, понятный oclHashcat.
Для его конвертирования в формат .hccap с помощью aircrack-ng нам нужно использовать опцию -J
Обратите внимание -J это заглавная J, а не маленькая j.
В моём случае команда следующая:
Атака по словарю на рукопожатие:
Атака брутфорсом на рукопожатие:
Установка Hashcat
Программа предустановлена в Kali Linux.
Установка Hashcat в другие Linux
Далее перейдите на официальный сайт и скачайте архив.
Запустите файл hashcat64.bin или hashcat32.bin в зависимости от битности вашей системы.
Установка в Windows
Скачайте архив с официального сайта, распакуйте его.
Для запуска используйте файл hashcat64.exe или hashcat32.exe в зависимости от битности вашей системы.
Программу нужно запускать в командной строке. Для этого откройте окно командной строки (Win+X – выберите «Командная строка») и перетащите туда исполняемый файл.
Либо в открывшемся окне командой строки перейдите в требуемую папку:
И в ней запустите требуемый файл:
Скриншоты Hashcat
Инструкции по Hashcat
Близкие программы:
факультете информационной безопасности от GeekBrains? Комплексная годовая программа практического обучения с охватом всех основных тем, а также с дополнительными курсами в подарок. По итогам обучения выдаётся свидетельство установленного образца и сертификат. По этой ссылке специальная скидка на любые факультеты и курсы!
Читайте также: