초심으로 살자.~!!!
음..오늘 이런 영감이 떠올랐다.
내가 왜 이렇게 포스팅이 줄었을까? 생각해 봤다.
그런데, 근본적인 이유는 마음에 불이 꺼져버렸기 때문이라는것을 알았다.
음..내가 프로그래머로서 성공(?)하기 위해서는 초심을 잊어서는 안된다는 것이라고 생각이 들었다.
(음..정말 글 못쓰죠... 읽어주시는 분들에게 어떻게 돈이라도 드리고 싶네요--;;;;;;; 부끄러워서요...)
음..다시 초심으로 돌아가 더 열정적으로 포스팅을 하기로 마음먹었다.
사고뭉치 제닉스님 같은 경우도 처음에는 하루에 하나씩 포스팅을 했었다고 한다.
나도 최선을 다해 하루에 하나 이상의 포스팅을 해, 블로그에 방문해주시는 분들에게 어제 본거네 라는 실망이 들지 않게 해야겠다.
음..그런의미에서 어제 본...
lucid7 님(lucid7.egloos.com)의 FindProcess.pdf을 읽으면서 알게된것 한가지만 적고자 한다.
루트킷중에 phide2 라는 녀석이 있는데
이 녀석은 별도의 스레드 스케줄러를 만들어 프로세스를 감추는 기술을 사용하는 아주 아주 기발한 녀식이다.
뭔저 이 녀석이 나올 수 있었던 배경은 이렇다.
Joanna Rutkowska
(조안나 루트코우스카[?이렇게 읽는것 아닐것 같은데--;;;암튼.])님이 만든 Klister v0.4란 anti-rootkit이라고 해야하나?? 숨겨있는 프로세스를 찾아주는 툴이다.
이 Klister 는 CPU를 할당 받기 위해 대기하고 있는 스레드리스트를 확인하여 프로세스를 찾아내는 기법이다.
(여기서 잠깐 문제~~!!??. 문제를 함 출제 해보겠습니다.)
<문제1>이렇게 대기하고 있는 스레드 리스트를 기억하고 있는 커널 전역변수가 무었인가?
1)
KiWaitInListHead
2)
KiReadyQueueIndex3)
KiDispatcherReadyListHead4)
KiReadySummy
답은 맨밑에 있어요 ^^
암튼 phide2란 놈과 klist라는 툴이 라는 것이 있구요...
자 그럼 어제 phide2.zip이라는 소스를 보면서 새로 알게된것 한개만 써보겠다...
오늘은 OS의 버전을 알오는 함수 PsGetVersion()함수에 대해서 알아 보겠다.
다음은 phide2에 있는 소스
PrepareOsSpecificStuff()함수이고 이 함수의 역할은
지원가능한 OS인지 아닌지를 확인하는 함수 있다.
PsGetVersion() 의 프로토타입을 보자.
이놈의 역할은
PsGetVersion
This function is obsolete in Windows XP and later versions of the operating system. Use RtlGetVersion instead.
PsGetVersion returns caller-selected information about the current version of the NT-based operating system.
음.. XP 이후부터는 지원하지 않는 함수다. --;; 이론 이런것을 포스팅 하다니..지송...암튼. 대신 RtlGetVersion이라는 놈을 지원한다는군요.
PsGetVersion이란 놈은 호출한놈이 선택한 정보를 리턴한담니다. (선택한 정보라는 말의 의미는 파마리터를 모두 채울필요가 없고 알고 싶은것만 채워서 알수 있다는 말이다. 알겠는가???)
BOOLEAN
PsGetVersion(
PULONG MajorVersion OPTIONAL, <-- 이것보라 OPTIONAL 이라고 써있지 않는가~~~ ^^
PULONG MinorVersion OPTIONAL,
PULONG BuildNumber OPTIONAL,
PUNICODE_STRING CSDVersion OPTIONAL
);
Parameters
- MajorVersion
- Points to a caller-supplied variable that this routine sets to the major version of the operating system. This optional parameter can be NULL.
- MinorVersion
- Points to a caller-supplied variable that this routine sets to the minor version of the operating system. This optional parameter can be NULL.
- BuildNumber
- Points to a caller-supplied variable that this routine sets to the current build number of the operating system. This optional parameter can be NULL.
- CSDVersion
- Points to a caller-allocated buffer in which this routine returns the current service-pack version as a Unicode string only during system driver initialization. This optional parameter can be NULL.
서비스팩 버젼을 유니코드로 리턴해준단다...그런데 시스템 드라이버가 초기화 할때만 리턴해준단다--;;; 이론 그럼 시스템 드라이버는 뭐야?? 시스템 드라이버가 아니면 모른다 이건데....음....
Return Value
PsGetVersion returns whether the system is a checked or free build, as follows:
tbody> | Value | Meaning |
|---|
| TRUE (1) | Checked build of the oprating system. |
| FALSE (0) | Free build of the operating system. |
오~~ 리턴 되는 값이 그냥 성공여부를 나타내는것이 아니다. 오~~ TRUE면, Checked 버젼 FALSE이면 Free 버젼 음...그렇다면
우리가 쓰는 OS는 다 FALSE겠네... Checked버젼을 쓰시는 분도 계시는가??? 음.. Checked 버젼도 MS에서 배포 한다고 했는데...
음.. 궁금해진다. 구글에서 찾아보자... ^^ㅋㅋ 음...못찾겠다...--;;;;;;;;;;;;;;;;;;;;;;;;;;;; 죄송해요...더 열심히 찾아야되는디...암튼..
음..COMMENT를 보니까... 레지스트리에서 읽으면 된다고 되어 있다....
Comments
PsGetVersion returns the requested information, depending on which optional parameter(s) the caller supplies.
To retrieve the current service-pack number, it is easier and more efficient to make an application-level call within the Win32 environment than to call PsGetVersion during system driver initialization, which then must parse the string it returns at CSDVersion. When the registry is initialized, a driver cannot obtain this string from PsGetVersion, but must read the CmCSDVersionString value from the registry.
Requirements
IRQL: PASSIVE_LEVEL <-- 아... 그리고 패시브 모드에서만 호출되어야 한다.....
Headers: Declared in ntddk.h. Include ntddk.h. <-- ntddk.h에 정의되어 있단다.
APIScan Requirements
Header: Ntddk.h
Function: PsGetVersion
긁어온곳 :
http://msdn.microsoft.com/en-us/library/ms802950.aspx음...

음...또 내일 뵈요~~~ㅋㅋ
답)
문제1 - 3)
KiDispatcherReadyListHead