Packetforge and arpreplay for chopchop/fragment attacks

Confirmed chopchop forges packet and replays as expected.
This commit is contained in:
derv82
2015-06-06 10:47:20 -07:00
parent 64e2c44e17
commit 096dfeaa50
4 changed files with 132 additions and 36 deletions

View File

@@ -12,17 +12,17 @@ class Process(object):
return open('/dev/null', 'w')
@staticmethod
def call(command):
def call(command, cwd=None,shell=False):
'''
Calls a command (either string or list of args).
Returns tuple:
(stdout, stderr)
'''
if type(command) != str or ' ' in command:
if type(command) != str or ' ' in command or shell:
shell = True
else:
shell = False
pid = Popen(command, stdout=PIPE, stderr=PIPE, shell=shell)
pid = Popen(command, cwd=cwd, stdout=PIPE, stderr=PIPE, shell=shell)
pid.wait()
return pid.communicate()
@@ -35,7 +35,7 @@ class Process(object):
return True
def __init__(self, command, devnull=False, stdout=PIPE, stderr=PIPE):
def __init__(self, command, devnull=False, stdout=PIPE, stderr=PIPE, cwd=None):
''' Starts executing command '''
if type(command) == str:
@@ -55,7 +55,7 @@ class Process(object):
self.start_time = time.time()
self.pid = Popen(command, stdout=sout, stderr=serr)
self.pid = Popen(command, stdout=sout, stderr=serr, cwd=cwd)
def __del__(self):
'''