본문 바로가기

2024/046

[ WIN ] 코드사인 (WinTrust API)검증 WinTrust API는 Windows 운영 체제에서 디지털 서명을 검증하고 파일 및 기타 객체의 신뢰성을 확인하는 데 사용됩니다. 이를 이해하기 쉽게 다이어그램으로 나타내 보겠습니다.다음은 WinTrust API의 주요 구성 요소와 흐름을 설명하는 다이어그램입니다.요청자(Requestor): 신뢰성을 확인하고자 하는 애플리케이션 또는 서비스.WinTrust API: 요청을 받아 디지털 서명을 검증하고 신뢰성을 평가하는 API.정책(Policy): 신뢰성 확인에 사용되는 기준 및 규칙 집합.신뢰 공급자(Trust Provider): 인증서와 서명을 검증하는 역할을 하는 엔티티.결과(Result): 파일 또는 객체의 신뢰성에 대한 검증 결과.[ 요청자 ] --> [ WinTrust API ] --> [ 정.. 2024. 4. 22.
[ WIN ] APP Init DLL class cAppInitDllHelper { public: cAppInitDllHelper(); virtual ~cAppInitDllHelper(); bool AddDllPathA( const std::string& _ssDllPath ); bool RemoveDllPathA( const std::string& _ssDllPath ); bool AddDllPathW( const std::wstring& _ssDllPath ); bool RemoveDllPathW( const std::wstring& _ssDllPath ); private: bool IsDllPathPresentA( const std::string& _ssCcurrentValue, const std::string& _ssDllPath ).. 2024. 4. 22.
[ WIN ] OS Version Util #include #include typedef LONG NTSTATUS, * PNTSTATUS; #define STATUS_SUCCESS (0x00000000) extern "C" NTSTATUS NTAPI RtlGetVersion( PRTL_OSVERSIONINFOW lpVersionInformation ); #ifndef NT_SUCCESS #define NT_SUCCESS(Status) (((NTSTATUS)(Status)) >= 0) #endif class cWinVersion { DECLARE_NO_SELF_CLASS( nxcWinVersion ); static bool IsSystem64Bit() { SYSTEM_INFO si; GetNativeSystemInfo( &si ); // PROCE.. 2024. 4. 22.
[ C++] StringUtil Class #pragma once #include class cStringUtil { public: static std::wstring MBSToWCS( const std::string& _ssMbsStr, UINT _nCodePage = CP_UTF8 ); // 유니코드 문자열을 멀티바이트 문자열로 변환 static std::string WCSToMBS( const std::wstring& _ssWcs, UINT _nCodePage = CP_UTF8 ); // Format 함수는 가변 인수를 받아 들여 std::wstring을 포맷합니다. template static std::wstring Format( const std::wstring& format, Args&&... args ) { return std::vf.. 2024. 4. 22.
[ WIN ] RunAsUserOrAdmin class cRunProc { DECLARE_NO_SELF_CLASS( cRunProc ); public: enum class eRunOption { eAsUser, eAsAdmin }; static bool RunAsAdmin( const std::wstring& _ssPath, const std::wstring& _ssParameters, DWORD _nWaitMilliseconds ) { SHELLEXECUTEINFO sei = { sizeof( sei ) }; sei.lpVerb = L"runas"; sei.lpFile = _ssPath.c_str(); sei.lpParameters = _ssParameters.c_str(); sei.hwnd = NULL; sei.nShow = SW_NORMAL;.. 2024. 4. 22.
[ WIN ] DLL INJECTION DLL 인젝션(DLL Injection)은 다른 프로세스의 주소 공간에 동적으로 라이브러리(DLL 파일)를 삽입하는 기술입니다. 이 방법은 주로 소프트웨어 개발과 디버깅, 리버스 엔지니어링, 또는 때때로 보안 테스트에 사용됩니다. 하지만, 악의적 목적으로 사용될 수도 있기 때문에 책임감 있는 사용이 중요합니다. DLL 인젝션의 기본 원리 DLL 인젝션을 수행하는 과정은 일반적으로 다음 단계를 포함합니다: 대상 프로세스 식별: 인젝션을 수행할 프로세스의 식별자(Process ID, PID)를 얻습니다. 메모리 할당: 대상 프로세스의 주소 공간에 새로운 메모리를 할당합니다. 이 메모리는 DLL 경로를 저장하는 데 사용됩니다. DLL 경로 작성: 할당된 메모리에 DLL의 경로를 씁니다. 리모트 스레드 생성: .. 2024. 4. 22.
반응형