SHELLCODE

  1. 코드 분석
  2. 악성 shell cde 발견
  3. python을 이용한 shell 코드 실행

실습

#!/usr/bin/venv python3
with open("", "r") as f:
	hex_string = f.read().replace("0x","").replace("byte[] rsrc = new byte[464] {","").replace("}","").replace(",","")
	hex_encode = hex_string.encode()
	
#print(hex_code)
 
#print(hex_encode)
 
with open("out_put.bin", "wb") as out:
	out.write(hex_encode)
 

다음 코드를 실행할 경우 코드상에서 얻은 shell코드에서 불필요한 문자열을 자동으로 제고된 out_put.bin이라는 파일을 받을수 있습니다.

scdbg /f out_put.bin -s -1

이후 scdbg를 이용해서 해당 쉘 코드를 분석하면 해당 쉘 코드에서 호출하고 있는 window API를 알아낼수 있습니다.

SCDBG

https://github.com/ldh0227/VS_LIBEMU

scdbg /f out.bin -s -1