Bad-PDF - attack via infected PDF file

Father

Professional
Messages
2,601
Reaction score
836
Points
113
To carry out an attack, it is enough to generate and send a PDF file of the target.

Today we will deal with the relative new Bad-PDF utility from Deepzec and its ability to steal NTLM data and hashes of windowed applications. It is not yet detected by most antiviruses. The code was posted on GitHub about 10 days ago.

According to Check Point researchers, instead of exploiting a vulnerability in Microsoft Word files or processing Outlook RTF files, attackers use a feature that allows them to embed deleted documents and files in a PDF file. An attacker can then use this to insert malicious content into the PDF, so when that PDF is opened, the object will automatically flow credentials in the form of NTLM hashes.

How to carry out an attack?
We run standard commands. I have been testing on Kali Linux:
Code:
# git clone https://github.com/deepzec/Bad-Pdf.git # cd Bad-Pdf # chmod + x badpdf.py # python badpdf.py

This will open a window with a dialog menu. To work, we need to know the IP of our target, the interface and the name of the file. After launching, we need to enter the path of the responder, if it is not automatically detected:
Code:
/ usr / sbin / responder // 1

Next, we specify the IP address (2), the file name (3), and select the interface (4). After that, the process starts. If you have errors, it is possible that the interface is incorrect or it is better to enter it with pens.

df2996e4-d4e7-41df-b7c8-08411d679498.png


If everything worked out, go to the next step. We need to deliver the file to our target. It is located in the root of the Bad-Pdf folder. This can be done through mail, social networks, or in another way. I used the mail and sent it to a potential target.

bbcf6b9e-89fb-4612-ab5e-776689225015.png


Next, we are waiting for the launch. After a successful attack, we immediately get NTML data. Let's take it can be seen in the screenshot:

10324886-370c-48fc-ae55-78e93770277d.png


Thus, after successful completion, we get the data in NTLMv2.

How can this vulnerability be exploited?
pth-winexe
The point is that this attack is more relevant in corporate networks. There is a major vulnerability in two versions of the NTLM protocol. For authentication, it is enough to know only the user's hash. Thus, having received a hash as shown above, you can enjoy all the advantages of a compromised user's network. This methodology is called Pass The Hash and was first used in 1997. The most popular set of utilities for this implementation is the Pass-the-Hash Toolkit. Let's take a closer look at pth-winexe, which is available from the box in Kali Linux.

4a9da02d-2f35-4b29-89b2-77ac1203cde3.png


FreeRDP
Another utility from the set is FreeRDP. It is a Remote Desktop Protocol console client. One of the features of the client is the ability to use a password hash instead of the password itself.

Example command:
Code:
xfreerdp / d: win2012 / u: offcec / pth: 8846F7EAEE8FB117AD06BDD830B7586C /v:192.168.0.1
where after / d: is the domain name,
after / u: - username,
after / pth: - hash,
after / v: - server IP.

141933ac-31e2-4d53-98f0-31e51f78ccba.png


Windows vs Microsoft

feadfe33-d8eb-4e1a-8625-e99866c98029.png


Also, modern versions of the Windows operating system offer you to create a Microsoft account. Do you understand the chain? With the ability to log into your local account using the Bad-Pdf utility, you can go further and get access to mail, Skype and other Microsoft services that will be used. Therefore, this vulnerability is very interesting and has a wide range of uses.

Conclusion
It is better to check the links and files that you open several times. This is very important, as one such discovery can provide all the data for a hacker. Use virtual machines as well as data encryption in all cases. In this case, it is enough to disable the NTLM connection in Group Policy.
 
Top