Secure Dose

Wednesday, 3 May 2017

Hands on Eternalblue, Doublepulsar and Patch

I know, I am writing after a quite long time but I had to!
Eternalblue and Doublepulsar are the exploits by NSA which were leaked by Shadow Brokers. These leaks are known to be a big Cyber Chaos after Stuxnet.
I though to dive into it.

Setting up the environment:
Here is a piece of the orignal exploit by two researchers, Pablo Gonzalez and Sheila Berta from ElevenPaths for the msf implementation.
You can clone it from here

https://github.com/ElevenPaths/Eternalblue-Doublepulsar-Metasploit/

I assume that you are aware about the how's and do's of msf.
Download and place the exploit file into it.

/usr/share/metaplsoit-framework/modules/exploit/windows/smb/

Search for eternalblue and use it on msfconsole.

In the options, give the path to the dependencies for both eternalblue, doublepulsar and also fulfill rest of the options.Make sure you are giving correct TARGETARCHITECTURE value and PROCESSINJECT value.

This may give you an error for wine. Simply run wine foo.exe and it will create a .wine folder to your root directory.

Run again and it should successfully run.

It is not really necessary to set value for LHOST unless you have networks constrains.

I have got access to the win7 machine.

What it does?

It actually uses the original binary present in the leak using wine.

You can find this on Ln 105 and 114

Not so deep but just an overview that the orignal binary, exploits the SMB protocol and have Windows Kernel exploit and then:

DLL Injection

Process Injection

You need to have a persistence access so that on every startup it then just require a multi handler and no exploiting again, and again each time you want to access.

Exploitation Scope:

Windows XP(all service pack)(x86)(x64)

Windows Server 2003 SP0/1/2(x86)

Windows Vista(x86)(x64)

Windows Server 2008(x86)

Windows Server 2008 R2(x86)(x64)

Windows 7(all service pack)(x86)(x64)

Reliable?

These exploits aren't reliable for win7as well as win server 2k8 R2 as it doesn't always exploit it but does affect the server in some or the other way.

Following are the behaviors:

Unexpected Shutdown

BSOD

Reboot

Hangs up

Errors poping up

So if these are the issues you are facing since 3-4 days, you probably being attacked using these "public" 0days.

What did I see?
Lots of errors and critical issues the system was facing.
Let me share:

There were lots of Criticals, Errors and Warnings.
Ok, on analysing these errors you may get a good idea on how these exploits work! :)

If you are interested to dive into few of them following are the links where you can understand it more deeply

The Blog is completly related to websec and sometimes other branches of Information Security. It focus on theory and practical both with some resource section provided where I share my presentation pdf where I recently give my talk. Have a good read and suggestions are always welcome.