@@ -405,7 +405,7 @@ def run(self, args):
405405 except Exception as e :
406406 print ("\n \033 [1;31m[!]\033 [0;0m Incorrect choice" )
407407
408- template_body = template_body .decode (encoding = 'utf-8 ' )
408+ template_body = template_body .decode (encoding = 'latin-1 ' )
409409 template_code = template_body .replace ("%SANDBOX_ESCAPES%" , sandbox_techniques )
410410
411411 delivery_method = "1"
@@ -449,7 +449,7 @@ def run(self, args):
449449 # sc_split = [encoded_sc[i:i+100] for i in range(0, len(encoded_sc), 100)]
450450 # for i in sc_split:
451451 #else:
452- template_code = template_code .replace ("%SHELLCODE64%" , encoded_sc .decode (encoding = 'utf-8 ' ))
452+ template_code = template_code .replace ("%SHELLCODE64%" , encoded_sc .decode (encoding = 'latin-1 ' ))
453453
454454 else :
455455 refs = args .refs
@@ -521,36 +521,36 @@ def run(self, args):
521521
522522 key = self .rand_key (10 )
523523 payload_encrypted = self .rc4 (key , template_code )
524- payload_encoded = base64 .b64encode (payload_encrypted .encode (encoding = 'utf-8 ' ))
524+ payload_encoded = base64 .b64encode (payload_encrypted .encode (encoding = 'latin-1 ' ))
525525
526526 awl_payload_simple = ""
527527
528528 if ("js" in file_type or args .comtechnique ):
529- harness = self .read_file (source_path + "templates/harness.js" ).decode (encoding = 'UTF-8 ' )
530- payload = harness .replace ("%B64PAYLOAD%" , payload_encoded .decode (encoding = 'utf-8 ' ))
529+ harness = self .read_file (source_path + "templates/harness.js" ).decode (encoding = 'latin-1 ' )
530+ payload = harness .replace ("%B64PAYLOAD%" , payload_encoded .decode (encoding = 'latin-1 ' ))
531531 payload = payload .replace ("%KEY%" , "'%s'" % (key ))
532532 payload_minified = jsmin (payload )
533533 awl_payload_simple = template_code
534534 elif ("wsf" in file_type ):
535- harness = self .read_file (source_path + "templates/harness.wsf" ).decode (encoding = 'utf-8 ' )
536- payload = harness .replace ("%B64PAYLOAD%" , payload_encoded .decode (encoding = 'utf-8 ' ))
535+ harness = self .read_file (source_path + "templates/harness.wsf" ).decode (encoding = 'latin-1 ' )
536+ payload = harness .replace ("%B64PAYLOAD%" , payload_encoded .decode (encoding = 'latin-1 ' ))
537537 payload = payload .replace ("%KEY%" , "'%s'" % (key ))
538538 payload_minified = jsmin (payload )
539539 elif ("hta" in file_type ):
540- harness = self .read_file (source_path + "templates/harness.hta" ).decode (encoding = 'utf-8 ' )
541- payload = harness .replace ("%B64PAYLOAD%" , payload_encoded .decode (encoding = 'utf-8 ' ))
540+ harness = self .read_file (source_path + "templates/harness.hta" ).decode (encoding = 'latin-1 ' )
541+ payload = harness .replace ("%B64PAYLOAD%" , payload_encoded .decode (encoding = 'latin-1 ' ))
542542 payload = payload .replace ("%KEY%" , "'%s'" % (key ))
543543 payload_minified = jsmin (payload )
544544 elif ("vba" in file_type ):
545- harness = self .read_file (source_path + "templates/harness.vba" ).decode (encoding = 'utf-8 ' )
546- payload = harness .replace ("%B64PAYLOAD%" , payload_encoded .decode (encoding = 'utf-8 ' ))
545+ harness = self .read_file (source_path + "templates/harness.vba" ).decode (encoding = 'latin-1 ' )
546+ payload = harness .replace ("%B64PAYLOAD%" , payload_encoded .decode (encoding = 'latin-1 ' ))
547547 payload = payload .replace ("%KEY%" , "\" %s\" " % (key ))
548548 payload_minified = jsmin (payload )
549549 elif ("slk" in file_type ):
550550 pass
551551 else :
552- harness = self .read_file (source_path + "templates/harness.vbs" ).decode (encoding = 'utf-8 ' )
553- payload = harness .replace ("%B64PAYLOAD%" , payload_encoded .decode (encoding = 'utf-8 ' ))
552+ harness = self .read_file (source_path + "templates/harness.vbs" ).decode (encoding = 'latin-1 ' )
553+ payload = harness .replace ("%B64PAYLOAD%" , payload_encoded .decode (encoding = 'latin-1 ' ))
554554 payload = payload .replace ("%KEY%" , "\" %s\" " % (key ))
555555
556556 if (payload_type == 3 ):
@@ -588,7 +588,7 @@ def run(self, args):
588588 outputfile_shellcode = outputfile + ".payload"
589589 with open (outputfile_shellcode , 'w' ) as f :
590590 gzip_encoded = base64 .b64encode (shellcode_gzip .getvalue ())
591- f .write (gzip_encoded .decode (encoding = 'utf-8 ' ))
591+ f .write (gzip_encoded .decode (encoding = 'latin-1 ' ))
592592 f .close ()
593593 print ("\033 [1;34m[*]\033 [0;0m Written shellcode payload to %s" % outputfile_shellcode )
594594
0 commit comments