악성 코드 분석 중인데요. 궁금한 점이 있습니다.

익명 사용자의 이미지

분석하는 악성 코드는 리소스 형태로 있다가 DLL 파일로 만들어서 인터넷 익스플로러 웹브라우저(iexplore.exe)에 인젝션시킵니다.
구체적으로 말씀드리면 해당 웹브라우저에서 키 입력 이벤트가 발생했을 때, DLL 파일이 인젝션됩니다.
DLL 파일에는 키로깅 기능이 구현되어 있습니다.
제가 질문하고 싶은 점은 키로깅되는 순간에 OllyDBG로 DLL 파일을 분석하고 싶은데요
Attach 기능으로 실행중인 iexplore.exe에 DLL 파일이 인젝션됐을 때 BP를 걸었어요.
그런데 해당 DLL 파일이 패킹되어있어요. ㅠ.ㅜ
언패킹 시킨 다음 키로깅이 실행되는 것을 볼 수 없습니다. 왜냐하면 악성 코드가 실행되면서 패킹된 DLL 파일을 만들거든요.
현재 정적 분석으로는 키로깅 기능이 구현된걸 찾았는데요.
동적 분석으로 그 기능의 동작을 확인하고 싶네요. 그런데 방법을 모르겠어요. ㅠ.ㅜ

익명 사용자의 이미지

언패킹된 dll 을 인젝션 시켜서 확인하시면 되지 않나요??

익명 사용자의 이미지

그럼 실행중에 로드된 dll을 언패킹해서 올리디버그로 열면 되나요 ?^^

Stand Alone Complex의 이미지

분석 절차

1. 악성 프로그램 실행
2. 패킹된 형태의 악성 DLL 수집
3. DLL 언팩
4. iexplore.exe 프로세스에 언패킹된 DLL 인젝션
5. 동적 분석

RET ;My life :P

익명 사용자의 이미지

제가 iexplore.exe에 언패킹된 DLL을 인젝션할 생각은 못했네요.

익명 사용자의 이미지

제가 iexplore.exe에 언패킹된 DLL을 인젝션할 생각은 못했네요.

익명 사용자의 이미지

해당 DLL에서 키보드 후킹하는 부분이 StartHook() 함수인데요.
그래서 다음과 같은 방법으로 인젝션하였어요

kernel32.dll의 LoadLibrary() API 함수로 해당 DLL(msdtis.dll)을
맵핑시킨 다음.....

typedef void (*PFNFUNC)();

hMod = GetModuleHandle("mstdis.dll");
fnTest = (PFNFUNC)GetProcAddress(hMod, "StartHook");
fnTest();

StartHook()을 호출하니깐 iexplore.exe에서 에러가 납니다.

StartHook()에서 하는 일은 SetWindowsHookExA() API 함수를 호출하여 키로깅하는 함수(fn)를 실행시켜요

왜 에러가 나는 걸까요? 키로깅하는 부분은 ollydbg로 실행해가며 볼 수는 없을까요?

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.