mirror of
				https://github.com/mgeeky/Penetration-Testing-Tools.git
				synced 2025-11-04 13:05:26 +01:00 
			
		
		
		
	updated tamperUpx.py
This commit is contained in:
		@@ -6,7 +6,12 @@ import os, sys
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def tamperUpx(outfile):
 | 
					def tamperUpx(outfile):
 | 
				
			||||||
 | 
					    pe = None
 | 
				
			||||||
 | 
					    try:
 | 
				
			||||||
        pe = pefile.PE(outfile)
 | 
					        pe = pefile.PE(outfile)
 | 
				
			||||||
 | 
					    except:
 | 
				
			||||||
 | 
					        print('[!] Input PE file corrupted. Unable to proceed.')
 | 
				
			||||||
 | 
					        return False
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    newSectionNames = (
 | 
					    newSectionNames = (
 | 
				
			||||||
        '.text',
 | 
					        '.text',
 | 
				
			||||||
@@ -144,6 +149,8 @@ def main(argv):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    if tamperUpx(outfile):
 | 
					    if tamperUpx(outfile):
 | 
				
			||||||
        print('[+] Success. UPX should have some issues decompressing output artifact now.')
 | 
					        print('[+] Success. UPX should have some issues decompressing output artifact now.')
 | 
				
			||||||
 | 
					    else:
 | 
				
			||||||
 | 
					        print('[-] FAILED: Could not tamper input file.')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if __name__ == '__main__':
 | 
					if __name__ == '__main__':
 | 
				
			||||||
    main(sys.argv)
 | 
					    main(sys.argv)
 | 
				
			||||||
		Reference in New Issue
	
	Block a user