Kontaktieren Sie uns in Messenger oder per Telefon.

whatsapp telegram viber phone email
+79214188555

A set for hacking programs. Choosing reverse tools

Демитрий

Private Zugriffsebene
Mitglied seit
12.12.2017
Beiträge
422
Punkte für Reaktionen
450
Punkte
193
Ort
г.Ейск, ул.Коммунистическая, 12/1, офис 308
A set for hacking programs. Choosing reverse tools


Each reverse engineer, viral analyst, and simply researcher eventually has an established set of utilities that he constantly uses for analysis, unpacking, or cracking. In this review, I will share my version. This will be useful to everyone who has not yet acquired their kit and is just starting to study this topic. However, an experienced reverser should be curious what colleagues in the shop use.

WARNING
All information is provided for informational purposes only. Neither the editors nor the author are liable for any possible harm caused by the materials in this article.

Debuggers
Debugging an application is an integral part of the research process, a tool that is always at your fingertips. In the modern world, the debugger must support both Intel architectures - x64 and x86, from which we will proceed.

We should also be able to debug code that runs in kernel mode. Such a need arises periodically, especially if you intend to look for zeroday vulnerabilities in the OS kernel or reverse virus drivers. There are two main applicants: x64dbg and WinDbg. The first debugger works in user mode, the second can debug code in kernel mode.

x64dbg
x64dbg.com

This modern debugger with a very nice interface is a worthy successor to OllyDbg. It supports both architectures - x64 and x86, has a lot of useful plugins.

cfbec24d9f3d5e01123ac.jpg

4b84d78ebb5586bdf0965.jpg


Yes, of course, it is not without flaws - it still has some unpleasant bugs. However, it is actively supported and developed. Of course, because the debugger works in user mode, it remains vulnerable to many debugging detection techniques. But this minus is partially offset by a variety of plugins to hide the debugger.

X64dbg has a built-in decompiler, it supports the display of code in the form of a graph, you can make breakpoints for reading, writing, executing and accessing, there is a built-in utility for import reconstruction (both x64 and x86). In general, what to say - this debugger was used in narrow circles in order to defeat the notorious Denuvo game defense, and successfully copes with this task!

Why not OllyDbg
OllyDbg debugger didn’t get into the selection - for the reason that it is already seriously outdated. It does not support modern OSes or x64 architecture. The official website of the application announced a 64-bit version and even reported progress in its development, but the site itself was updated for the last time in 2014. Of course, a whole era is associated with OllyDbg, but, apparently, it has passed. And kernel mode debuggers were also reduced - the developers abandoned Syser Kernel Debugger, and he was once the successor to SoftICE.

Windbg
Official page

If you need to debug the kernel or driver, then WinDbg is second to none. This debugger is supported by Microsoft itself, and it is part of the Windows Driver Kit (WDK). At the moment, this is the most relevant and powerful tool for debugging kernel code. There is no such pleasant interface as in x64dbg, but we also have a little choice - other debuggers do not work in kernel mode.

08a333a744a544109c2c9.jpg


WinDbg supports remote debugging and can download debugging symbols directly from Microsoft servers. To quickly configure it to debug the OS kernel inside virtual machines, there is a VirtualKD add-in. Of course, starting a reverse path with WinDbg is strictly contraindicated, but when you gain experience and start trying various interesting things, it becomes a necessity.

It is in WinDbg that you can easily see how one or another system structure looks, and it is easy to disassemble NTAPI functions. Of course, they can debug "normal" applications, but personally, I prefer to unpack such a powerful tool only when absolutely necessary!

Disassemblers
It is difficult to imagine a reverse without static code analysis tools. To date, things are a little better with disassemblers than with debuggers, but you can still pick out the favorites in this area. The recognized standard for antivirus labs is the IDA Pro disassembler. The second place in demand is taken by the Radare2 reverse engineering framework (although many believe that Radare2 is not inferior to IDA).

IDA Disassembler
hex-rays.com/products/ida

There are two versions of IDA - paid (Pro) and free (Starter). The free version is truncated by the number of supported architectures - it understands only x86, in addition, it does not support plugins. The paid version has no such restrictions: it supports an impressive number of processor architectures and allows you to connect extensions.

66d404187bf8911caeef4.jpg


The IDA has a built-in debugger, very simple in terms of its set of functions, but you will have to adapt to its original interface. Also, the IDA can be equipped with the Hex-Rays add-on - a decompiler of the application source code into C code. This is a very useful add-on that significantly speeds up the analysis of the program.

In general, the IDA is a powerful and beautifully polished tool that has been developing for many years. It is only a pity that the professional version costs around 500-1000 dollars, depending on the type of license and is not sold to anyone. Anyone who gets as a result gets out as best he can.

Radare2
rada.re

Radare2 was originally conceived as a regular hex editor, but today it is a whole framework that will help debug and disassemble a wide variety of code, including device firmware, viruses and crack.

bbc4303a23b8564f46847.jpg


Radare2 is a set of console utilities that include a debugger, a disassembler, a decompiler, a hex editor, a custom compiler, a binary comparison tool, and much more. To work in the GUI, there is a separate add-in called Cutter. It greatly improves the look and feel of the Radare framework and usability.

The framework supports a large number of processors and platforms, so it can compete even with products such as IDA Pro. A huge plus is that the source code is open, the product is completely free and supported by the community.

Utility Utilities
We examined the basic tools, but it is difficult to imagine a reverse without packer analyzers, network monitors, hex editors, and even a host of auxiliary utilities. Let's look at the main ones in more detail.

Detect it Easy (DiE)
ntinfo.biz

This is an excellent program for identifying packers, which has a very wide range of useful functions. For example, it allows you to view the entropy of file sections, which helps to visually determine the presence of encryption.

be81319469b0a123d9b4d.jpg


It also has a resource viewer with the ability to dump to disk. You can easily view the import table; there is support for extensions and scripts. There are also settings for signature scanning methods, a file header viewer, and full support for the PE and PE + formats.

There is only one minus - the program is rarely updated, but it cannot be said that it was abandoned - a new version has just been released!

Exeinfope
exeinfo-pe.en.uptodown.com

This is another detector for packers and protectors. It has a rather peculiar interface that not everyone will like. But the program is often updated, it is full of interesting functions and there are friendly tips for unpacking.

bc2d2442caddd852b0907.jpg


All in all, I would recommend ExeInfoPE to newbies. It has a database of automatic unpackers, and the program itself will tell you which tool to remove the hinged protection.

And of course, there is a whole standard set of features: a file header viewer, section viewer, a hex viewer, and even a number of small built-in utilities such as TerminateProcess and more. Plus there is support for plugins.

Hxd
Often there is a need to access a hard drive, memory or application in binary mode. Hexadecimal editors come to the rescue, the bright representative of which is the HxD program. It is free, constantly updated, supports popular formats, is well-searched and has a nice interface. There are other successful features, for example, the ability to reliably delete files (i.e., overwriting with zeros). HxD also has a portable version to make it convenient to keep on a flash drive.

d0878e620b4e0d7033db7.jpg

Hew
hiew.ru

Hex editor with a long history, but still supported by developers. He has a paid and free version ($ 20 without the possibility of updates, $ 200 with lifelong updates). The interface in the style of Norton Commander can scare young people a little, but you quickly get used to it. Separately pleased with the ability to work only with the keyboard, calling all the functions of the hot keys.

405700bc0c203b1126017.jpg

Pestudio
winitor.com

This is a useful program tailored for the analysis of malvari. It automatically scans the downloaded sample file for VirusTotal, interestingly displays the functions of the import table used in the experimental application, shows the virus signs of the application, the libraries used, and the header information of the PE file. Here you can work with resources. In other words, it is a multifunctional antivirus processor for initial sample analysis.

967c07a0ff9c9934865b5.jpg

Pe bear
PE-bear developer blog page

Another interesting viewer and editor for PE and PE + files. It contains an analyzer for packers and protectors, displays information about file headers, resources and sections. If desired, you can look at the hex representation of these sections and disassemble them into regular assembler mnemonics.

aae1569aba148370f646c.jpg

PE-bear has a nice interface and a nice utility for comparing files. The only drawback is that the program is rarely updated, although it is open source. So, if you find a bug in it, you can always fix it yourself.

Fakenet-ng
GitHub repository

This program is necessary in order to emulate working with a network. When studying malvari samples, you often need to look at all network accesses: monitor DNS and HTTP requests, sniff traffic and determine the IP addresses of control servers (if it is, for example, a ransomware bot). For obvious reasons, the virtual machine should be disconnected from the network, and if the virus notices this, it will not do everything that it usually does.

Fakenet-NG is constantly updated and maintained, so this utility can be used on the most modern OS.

25b2895009e2b12b7bceb.jpg

Processexplorer
Official page

Sysinternals programs that monitor file system and process access would be difficult to do without. ProcessExplorer will show all processes in the system in the form of a hierarchical tree so that you can easily see in which order they are generated. In addition, you can find out which dynamic libraries are loaded into processes, priorities, digital signatures, processor usage, and much more.

b657feb96ec113ec80e1e.jpg

Regshot
SourceForge Repository

A convenient program for monitoring changes in the registry. RegShot takes pictures before and after the application you are interested in, and then shows where the changes were.

TCPView
Official page

A small program for monitoring network activity of applications. You can see which ports the application opens (local and remote), as well as protocols, process identifiers, and packet forwarding counters. In general, one of the most useful tools in any hacker kit!

bcc01d8b4c0358c448115.jpg

Resource hacker
angusj.com/resourcehacker

A popular resource editing program. Allows you to edit the manifest, icons, text dialog lines, cursor information, and more. Editing application resources is not necessary so often, but if you nevertheless have such a need, it is nice to have the right tool on hand.

d6e9eb6cec3a4db210294.jpg

Total
We examined the basic set of utilities that are used to solve most problems associated with reverse. I think that at the beginning these applications will be enough for a novice reverser. And with your experience, your own list will grow.

Many reversers gradually come to the point that they create the necessary highly specialized programs, plugins and scripts themselves. Not all tasks have ready-made tools that make life easier. If you know about such developments or want to share links to other useful programs - write in the comments!

Source: hackep.ru
 
Original message
Набор для взлома программ. Выбираем инструменты для реверса


У каждого реверс-инженера, вирусного аналитика и просто исследователя со временем появляется устоявшийся набор утилит, которыми он постоянно пользуется для анализа, распаковки или кряка. В этом обзоре я поделюсь своей версией. Это будет полезно всем, кто еще не обзавелся своим набором и только приступает к изучению этой темы. Впрочем, и опытному реверсеру должно быть любопытно, что используют коллеги по цеху.

WARNING
Вся информация предоставлена исключительно в ознакомительных целях. Ни редакция, ни автор не несут ответственности за любой возможный вред, причиненный материалами данной статьи.

Отладчики
Отладка приложения — это неотъемлемая часть процесса исследования, инструмент, который всегда под рукой у реверсера. В современном мире отладчик должен поддерживать обе интеловские архитектуры — x64 и x86, из этого мы и будем исходить.

Также у нас должна быть возможность отлаживать код, который работает в режиме ядра. Такая нужда периодически возникает, особенно если ты намерен искать zeroday-уязвимости в ядре ОС или реверсить драйверы вирусов. Основных претендентов два: x64dbg и WinDbg. Первый отладчик работает в режиме user mode, второй может отлаживать код в режиме kernel mode.

x64dbg
x64dbg.com

Этот современный отладчик с весьма приятным интерфейсом — достойный преемник OllyDbg. Поддерживает обе архитектуры — x64 и x86, обладает массой полезнейших плагинов.

cfbec24d9f3d5e01123ac.jpg

4b84d78ebb5586bdf0965.jpg


Да, безусловно, он не лишен недостатков — в нем до сих пор есть несколько неприятных багов. Однако он активно поддерживается и развивается. Разумеется, из-за того что отладчик работает в пользовательском режиме, он остается уязвимым для многих техник обнаружения отладки. Но этот минус отчасти компенсируется разнообразием плагинов для сокрытия отладчика.

У x64dbg есть встроенный декомпилятор, поддерживается отображение кода в виде графа, можно делать точки останова на чтение, запись, выполнение и доступ, имеется встроенная утилита реконструкции импортов (как x64, так и x86). В общем, что говорить — этот отладчик использовался в узких кругах для того, чтобы победить небезызвестную игровую защиту Denuvo, и успешно справляется с этой задачей!

Почему не OllyDbg
В подборку не попал отладчик OllyDbg — по той причине, что он уже серьезно устарел. Он не поддерживает ни современные ОС, ни архитектуру x64. На официальном сайте приложения был анонс 64-битной версии и даже сообщалось о прогрессе в ее разработке, но сам сайт обновлялся в последний раз в 2014 году. Безусловно, с OllyDbg связана целая эпоха, но, по всей видимости, она прошла. Да и отладчиков kernel mode тоже поубавилось — разработчики забросили Syser Kernel Debugger, а он в свое время был преемником SoftICE.

WinDbg
Официальная страница

Если нужно отлаживать ядро или драйвер, то WinDbg нет равных. Этот отладчик поддерживает сама Microsoft, и он входит в состав Windows Driver Kit (WDK). На данный момент это самое актуальное и мощное средство отладки кода ядра. Здесь нет такого приятного интерфейса, как в x64dbg, но и выбора у нас немного — другие отладчики не работают в kernel mode.

08a333a744a544109c2c9.jpg


WinDbg поддерживает удаленную отладку и умеет скачивать отладочные символы напрямую с серверов Microsoft. Чтобы быстрее настроить его для отладки ядра ОС внутри виртуальных машин, существует надстройка VirtualKD. Безусловно, начинать путь реверсера с WinDbg строго противопоказано, но, когда наберешься опыта и начнешь пробовать разные интересные вещи, он становится необходимостью.

Именно в WinDbg можно запросто посмотреть, как выглядят те или иные системные структуры, и легко дизассемблировать функции NTAPI. Конечно, им можно отлаживать и «обычные» приложения, но лично я предпочитаю распаковывать столь могучий инструмент только при крайней необходимости!

Дизассемблеры
Сложно представить себе реверс без инструментов статического анализа кода. На сегодняшний день дела с дизассемблерами обстоят немногим лучше, чем с отладчиками, но все-таки можно выделить фаворитов в этой области. Признанный стандарт антивирусных лабораторий — это дизассемблер IDA Pro. Второе место по востребованности занимает фреймворк для реверс-инжиниринга Radare2 (хотя многие считают, что Radare2 не уступает IDA).

IDA Disassembler
hex-rays.com/products/ida

Существует две версии IDA — платная (Pro) и бесплатная (Starter). Бесплатная версия урезана по количеству поддерживаемых архитектур — она понимает только x86, кроме того, она не поддерживает плагины. Платная версия лишена подобных ограничений: она поддерживает внушительное количество архитектур процессоров и позволяет подключать расширения.

66d404187bf8911caeef4.jpg


В IDA есть встроенный отладчик, весьма простенький по набору функций, но к его самобытному интерфейсу придется приноровиться. Также IDA может быть укомплектован дополнением Hex-Rays — декомпилятором исходного кода приложения в код на C. Это полезнейшее дополнение, которое значительно ускоряет анализ программы.

В целом IDA — мощнейший и прекрасно отполированный инструмент, который развивался много лет. Жаль только, что профессиональная версия стоит в районе 500–1000 долларов в зависимости от вида лицензии и кому попало не продается. Кто попало в результате выкручивается как может.

Radare2
rada.re

Radare2 изначально задумывался как обычный hex-редактор, но на сегодняшний день это целый фреймворк, который поможет отлаживать и дизассемблировать самый разный код, включая прошивки устройств, вирусы и крякми.

bbc4303a23b8564f46847.jpg


Radare2 — это набор консольных утилит, в которые входят отладчик, дизассемблер, декомпилятор, hex-редактор, собственный компилятор, утилита сравнения бинарных файлов и многое другое. Для работы в GUI есть отдельная надстройка под названием Cutter. Она значительно улучшает внешний вид фреймворка и юзабилити Radare.

Фреймворк поддерживает большое число процессоров и платформ, благодаря этому может составлять конкуренцию даже таким продуктам, как IDA Pro. Огромный плюс — в том, что исходный код открыт, продукт совершенно бесплатен и поддерживается силами сообщества.

Вспомогательные утилиты
Мы рассмотрели основные инструменты, но реверс сложно представить себе без анализаторов упаковщиков, сетевых мониторов, hex-редакторов и еще массы вспомогательных утилит. Давай глянем на основные из них более подробно.

Detect it Easy (DiE)
ntinfo.biz

Это отличная программа для определения упаковщиков, которая имеет весьма широкий набор полезных функций. Например, она позволяет просматривать энтропию секций файлов, что помогает визуально определять наличие шифрования.

be81319469b0a123d9b4d.jpg


Также в ней есть просмотрщик ресурсов с возможностью дампа на диск. Можно легко просматривать таблицу импорта, есть поддержка расширений и скриптов. Имеются и настройки методов сканирования сигнатур, просмотрщик заголовков файлов и полная поддержка форматов PE и PE+.

Минус только один — программа редко обновляется, но нельзя сказать, что ее забросили, — совсем недавно вышла новая версия!

ExeInfoPE
exeinfo-pe.en.uptodown.com

Это еще один детектор пакеров и протекторов. У него довольно своеобразный интерфейс, который придется по вкусу не всем. Зато программа часто обновляется, в ней полно интересных функций и есть дружелюбные подсказки по распаковке.

bc2d2442caddd852b0907.jpg


В общем, я бы порекомендовал ExeInfoPE новичкам. В нем есть база автоматических распаковщиков, и программа сама подскажет, каким инструментом снимать навесную защиту.

Ну и конечно, здесь присутствует весь стандартный набор возможностей: просмотрщик заголовков файлов, просмотр секций, hex-просмотрщик и даже некоторое количество маленьких встроенных утилит, типа TerminateProcess и прочего. Плюс есть поддержка плагинов.

HxD
Зачастую возникает необходимость обратиться к жесткому диску, памяти или приложению в бинарном режиме. Здесь на помощь приходят шестнадцатеричные редакторы, ярким представителем которых и является программа HxD. Она бесплатна, постоянно обновляется, поддерживает популярные форматы, хорошо ищет и обладает приятным интерфейсом. Есть и другие удачные фичи — например, возможность надежного удаления файлов (то есть затирания нулями). А еще у HxD есть портативная версия, чтобы было удобно держать на флешке.

d0878e620b4e0d7033db7.jpg

HIEW
hiew.ru

Hex-редактор с давней историей, но до сих пор поддерживаемый разработчиками. У него есть платная и бесплатная версия (20 долларов без возможности обновлений, 200 долларов с пожизненными апдейтами). Интерфейс в стиле Norton Commander может немного испугать молодежь, но с ним быстро свыкаешься. Отдельно радует возможность работать только с клавиатуры, вызывая все функции по горячим клавишам.

405700bc0c203b1126017.jpg

Pestudio
winitor.com

Это полезная программа, заточенная под анализ малвари. Она автоматически сканирует загруженный образец файла на VirusTotal, интересно отображает используемые в подопытном приложении функции таблицы импорта, показывает вирусные признаки приложения, используемые библиотеки и информацию заголовка PE-файла. Здесь же можно работать с ресурсами. Другими словами, это многофункциональный антивирусный комбайн начального анализа семплов.

967c07a0ff9c9934865b5.jpg

PE-bear
Страница PE-bear в блоге разработчика

Еще один интересный просмотрщик и редактор файлов формата PE и PE+. Содержит анализатор пакеров и протекторов, отображает информацию о файловых заголовках, ресурсах и секциях. При желании можно посмотреть hex-представление данных секций и дизассемблировать их в обычные мнемоники ассемблера.

aae1569aba148370f646c.jpg

У PE-bear приятный интерфейс и приятная утилита для сравнения файлов. Единственный недостаток — программа редко обновляется, хотя и имеет открытый исходный код. Так что, если найдешь в ней баг, всегда можешь поправить сам.

Fakenet-NG
Репозиторий на GitHub

Эта программа необходима для того, чтобы эмулировать работу с сетью. При изучении семплов малвари часто нужно просматривать все сетевые обращения: следить за запросами к DNS и HTTP, снифать трафик и определять IP-адреса управляющих серверов (если это, например, бот-вымогатель). Виртуальная машина по понятным причинам должна быть отключена от сети, и, если вирус это заметит, он не будет делать все то, что обычно делает.

Fakenet-NG постоянно обновляется и поддерживается, так что эту утилиту можно использовать на самых современных ОС.

25b2895009e2b12b7bceb.jpg

ProcessExplorer
Официальная страница

Обойтись без программ Sysinternals, которые мониторят обращения к файловой системе и процессам, было бы непросто. ProcessExplorer покажет все процессы в системе в форме иерархического дерева, чтобы легко можно было видеть, в каком порядке они порождаются. Кроме этого, можно узнать, какие динамические библиотеки подгружены в процессы, приоритеты, цифровые подписи, использование процессора и многое другое.

b657feb96ec113ec80e1e.jpg

RegShot
Репозиторий на SourceForge

Удобная программа для мониторинга изменений в реестре. RegShot делает снимки до и после работы интересующего тебя приложения, а потом показывает, где были изменения.

TCPView
Официальная страница

Маленькая программа для мониторинга сетевой активности приложений. Можно смотреть, какие порты открывает приложение (локальные и удаленные), а также протоколы, идентификаторы процессов и счетчики пересылаемых пакетов. В общем, один из полезнейших инструментов в любом хакерском наборе!

bcc01d8b4c0358c448115.jpg

Resource Hacker
angusj.com/resourcehacker

Популярная программа для редактирования ресурсов. Позволяет редактировать манифест, иконки, текстовые диалоговые строки, информацию о курсоре и многое другое. Редактировать ресурсы приложения приходится не так часто, но, если все же возникнет такая нужда, приятно иметь под рукой подходящий инструмент.

d6e9eb6cec3a4db210294.jpg

Итого
Мы рассмотрели основной набор утилит, которые используются для решения большинства задач, связанных с реверсом. Я думаю, что на первых порах для начинающего реверсера этих приложений будет достаточно. А вместе с опытом будет расти и твой собственный список.

Многие реверсеры постепенно приходят к тому, что создают нужные узкоспециализированные программы, плагины и скрипты сами. Далеко не для всех задач есть готовые средства, облегчающие жизнь. Если знаешь о подобных наработках или хочешь поделиться ссылками на другие полезные программы — пиши в комментариях!

Источник: хаkep.ru

Матушкин Андрей Николаевич

Президент IAPD
Teammitglied
Private Zugriffsebene
Full members of NP "MOD"
Mitglied seit
01.01.1970
Beiträge
21.442
Punkte für Reaktionen
3.531
Punkte
113
Alter
52
Ort
Россия,
Website
o-d-b.ru
Набор для взлома программ..jpg
 
Original message
Набор для взлома программ..jpg