블로그 이미지
vicjung

프로그래밍이나 컴퓨터 관련 위주 블로그

Rss feed Tistory
Programming 2011. 11. 5. 14:15

윈도우에서 자동 실행되는 경로들

은근 가끔씩 필요한 정보

DiamondCS
에서 제공하는 Autostart Guard, Autostart Viewer 프로그램이 모니터링하는 Windows 자동 실행 위치의 리스트 입니다.


웜, 바이러스 등에 감염되었을 때 한번쯤 살펴봐야 할 곳들이죠.


Autostart Locations are listed in no particular order.

Registry Autostart Locations

  1. HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionRun
    All values in this key are executed. 
  2. HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionRunOnce
    All values in this key are executed, and then their autostart reference is deleted. 
  3. HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionRunServices
    All values in this key are executed as services. 
  4. HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionRunServicesOnce
    All values in this key are executed as services, and then their autostart reference is deleted. 
  5. HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionRun
    All values in this key are executed. 
  6. HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionRunOnce
    All values in this key are executed, and then their autostart reference is deleted. 
  7. HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionRunOnceSetup
    Used only by Setup. Displays a progress dialog box as the keys are run one at a time. 
  8. HKEY_USERS.DefaultSoftwareMicrosoftWindowsCurrentVersionRun
    Similar to the Run key from HKEY_CURRENT_USER. 
  9. HKEY_USERS.DefaultSoftwareMicrosoftWindowsCurrentVersionRunOnce
    Similar to the RunOnce key from HKEY_CURRENT_USER. 
  10. HKEY_LOCAL_MACHINESoftwareMicrosoftWindows NTCurrentVersionWinlogon
    The "Shell" value is monitored. This value is executed after you log in. 
  11. HKEY_LOCAL_MACHINESoftwareMicrosoftActive SetupInstalled Components
    All subkeys are monitored, with special attention paid to the "StubPath" value in each subkey. 
  12. HKEY_LOCAL_MACHINESystemCurrentControlSetServicesVxD
    All subkeys are monitored, with special attention paid to the "StaticVXD" value in each subkey. 
  13. HKEY_CURRENT_USERControl PanelDesktop
    The "SCRNSAVE.EXE" value is monitored. This value is launched when your screen saver activates. 
  14. HKEY_LOCAL_MACHINESystemCurrentControlSetControlSession Manager
    The "BootExecute" value is monitored. Files listed here are Native Applications that are executed before Windows starts. 
  15. HKEY_CLASSES_ROOTvbsfileshellopencommand
    Executed whenever a .VBS file (Visual Basic Script)  is run. 
  16. HKEY_CLASSES_ROOTvbefileshellopencommand
    Executed whenever a .VBE file (Encoded Visual Basic Script) is run. 
  17. HKEY_CLASSES_ROOTjsfileshellopencommand
    Executed whenever a .JS file (Javascript) is run. 
  18. HKEY_CLASSES_ROOTjsefileshellopencommand
    Executed whenever a .JSE file (Encoded Javascript) is run. 
  19. HKEY_CLASSES_ROOTwshfileshellopencommand
    Executed whenever a .WSH file (Windows Scripting Host) is run. 
  20. HKEY_CLASSES_ROOTwsffileshellopencommand
    Executed whenever a .WSF file (Windows Scripting File) is run. 
  21. HKEY_CLASSES_ROOTexefileshellopencommand
    Executed whenever a .EXE file (Executable) is run. 
  22. HKEY_CLASSES_ROOTcomfileshellopencommand
    Executed whenever a .COM file (Command) is run. 
  23. HKEY_CLASSES_ROOTatfileshellopencommand
    Executed whenever a .BAT file (Batch Command) is run. 
  24. HKEY_CLASSES_ROOTscrfileshellopencommand
    Executed whenever a .SCR file (Screen Saver) is run. 
  25. HKEY_CLASSES_ROOTpiffileshellopencommand
    Executed whenever a .PIF file (Portable Interchange Format) is run. 
  26. HKEY_LOCAL_MACHINESystemCurrentControlSetServices
    Services marked to startup automatically are executed before user login. 
  27. HKEY_LOCAL_MACHINESystemCurrentControlSetServicesWinsock2ParametersProtocol_CatalogCatalog_Entries
    Layered Service Providers, executed before user login. 
  28. HKEY_LOCAL_MACHINESystemControlWOWcmdline
    Executed when a 16-bit Windows executable is executed. 
  29. HKEY_LOCAL_MACHINESystemControlWOWwowcmdline
    Executed when a 16-bit DOS application is executed. 
  30. HKEY_LOCAL_MACHINESoftwareMicrosoftWindows NTCurrentVersionWinlogonUserinit
    Executed when a user logs in. 
  31. HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionShellServiceObjectDelayLoad
    Executed by explorer.exe as soon as it has loaded. 
  32. HKEY_CURRENT_USERSoftwareMicrosoftWindows NTCurrentVersionWindows un
    Executed when the user logs in. 
  33. HKEY_CURRENT_USERSoftwareMicrosoftWindows NTCurrentVersionWindowsload
    Executed when the user logs in. 
  34. HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer un
    Subvalues are executed when Explorer initialises. 
  35. HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer un
    Subvalues are executed when Explorer initialises. 


Folder Autostart Locations

  1. windirStart MenuProgramsStartup
  2. UserStartup
  3. All UsersStartup
  4. windirsystemiosubsys
  5. windirsystemvmm32
  6. windirTasks


File Autostart Locations

  1. c:explorer.exe 
  2. c:autoexec.bat
  3. c:config.sys
  4. windirwininit.ini
  5. windirwinstart.bat
  6. windirwin.ini - [windows] "load"
  7. windirwin.ini - [windows] "run"
  8. windirsystem.ini - [boot] "shell"
  9. windirsystem.ini - [boot] "scrnsave.exe"
  10. windirdosstart.bat
  11. windirsystemautoexec.nt
  12. windirsystemconfig.nt출처:Windows 자동 실행 위치 


조금더 디테일한 설명

보통 Auto Start시키는 설정은 다음과 같습니다. 여기에서 예제 스파이웨어 파일명을 malware.exe로 가정해 보겠습니다.


1) win.ini 파일에서 다음과 같이 설치됩니다


[winodws]

load = malware.exe

run = malware.exe


2) system.ini 파일에서 다음과 같이 추가됩니다.


[boot]

Shell = explorer.exe malware.exe


3) Autoexec.bat 파일에서

%windir%system32% 디렉터리 밑에 malware.exe


4) Registry Shell Open


[HKEY_CLASS_ROOT/exefile/shell/open/command]

[HKEY_LOCAL_MACHINE/Software/Classes/exefile/shell/open/command]

"malware.exe %1 %*" 요런식으로 값이 들어가 있습니다.


5) Alternative Registry Keys


[HKEY_CLASSES_ROOT.exe] @="myexefile"]

[HKEY_LOCAL_MACHINE/Software/Classes/myexefile/shell/open/command@="malware.exe %1 %*"]

winstart.bat


6) Main 레지스트리에 등록되는 경우

[HKEY_LOCAL_MACHINE/SoftwareMicrosoft/Windows/CurrentVersion/RunServices]

[HKEY_LOCAL_MACHINE/SoftwareMicrosoft/Windows/CurrentVersion/RunServicesOnce]

[HKEY_LOCAL_MACHINE/SoftwareMicrosoft/Windows/CurrenVersion/Run]


6) wininit.ini 에 혹시 등록되어 있는 프로그램이 없는지 확인

'Programming' 카테고리의 다른 글

닷넷에서 xml 처리  (0) 2011.11.14
원격 인스톨 방법  (0) 2011.11.05
터미널 세션 강제 종료  (0) 2011.11.05
인코딩 타입 알아내기  (0) 2011.10.04
64비트 포팅에 주의 사항  (0) 2011.10.04
,
Programming 2011. 11. 5. 14:06

터미널 세션 강제 종료

cmd 모드에서 tcdiscon을 실행
 
사용방법은
tsdiscon 세션ID /server:서버명

ex) tsdiscon 1 /server:www01

인터넷에 찾아보면 자료 많음 
,
Programming 2011. 10. 4. 16:27

인코딩 타입 알아내기

[그림출처:http://wiki.secondlife.com/wiki/Unicode_In_5_Minutes]

인코딩 타입이란 특정 캐릭터셋으로 만들어진 파일을 보여주는 방식입니다. 전세계 주요 언어문자를 하나의 바이너리 코드로 처리하기 위해서 유니코드(unicode)를 만들었지만 이 코드를 보여주는 인코딩 방식은 다양합니다.
많이 사용하는 인코딩 타입으로는 UTF-8, UTF-16, EUC-KR, ISO8859-1, MS949등이 있는데요, 텍스트 파일이 어떤 인코딩 타입으로 설정되어 있느냐에 따라 똑같은 유니코드 데이터도 제대로 보이기도 안보이기도 합니다. 그럼 이 파일이 어떤 인코딩타입으로 되어 있는지 알아내려면 어떻게 해야 할까요?
BOM이라는게 있습니다. BOM(Byte Order Mask)은 파일이 어떤 인코딩 타입임을 나타냅니다만 어떤 에디터는 이 BOM을 생략하기도 하기때문에 절대적이라고 볼 수는 없습니다.
그럼 자바로 쉽게 인코딩 타입을 확인할 수는 없을까? ICU를 이용하면 가능합니다.
ICU(International Component for Unicode)는 이와 관련된 라이브러리를 제공합니다. C와 Java를 지원하며 제가 확인한 것은 자바용인 ICU4J입니다.
1.Maven의 POM에 관련 설정을 추가합니다.

      <dependency>
          <groupId>com.ibm.icu</groupId>
          <artifactId>icu4j</artifactId>
          <version>4.0.1</version>
          <type>jar</type>
          <scope>compile</scope>
      </dependency>
2.유틸리티 함수를 하나 추가합니다. 저의 경우에는 FileUtil이라는 유틸클래스에 추가했습니다.
    public static String readFileToString(File file) throws Exception {
        try {
CharsetDetector detector = new CharsetDetector();           
            detector.setText(FileUtils.readFileToByteArray(file));
            return FileUtils.readFileToString(file, detector.detect().getName());  
        } catch (IOException e) {
            throw new Exception(e);
        }
    }
테스트해 보니 EUC-KR, UTF8인 경우에는 잘 동작합니다. 많이들 필요할것 같은데 의외로 자료가 없어서 찾는데 애를 좀 먹어서 정리해놓습니다.

 

출처: http://pragmaticstory.com/1548

,
TOTAL TODAY