新聞中心

        EEPW首頁 > 嵌入式系統 > 設計應用 > 木馬/后門程序在WINNT中進程隱藏及查找的方法

        木馬/后門程序在WINNT中進程隱藏及查找的方法

        作者: 時間:2012-07-02 來源:網絡 收藏

         // 計算目前有多少, aProcesses[]用來存放有效的PIDs

        本文引用地址:http://www.104case.com/article/148821.htm

          if ( !EnumProcesses( aProcesses, sizeof(aProcesses), cbNeeded ) ) return 0;

          cProcesses = cbNeeded / sizeof(DWORD);

          // 按有效的PID遍歷所有的

          for ( i = 0; i cProcesses; i++ )

          {

          // 打開特定PID的進程

          hProcess = OpenProcess( PROCESS_QUERY_INFORMATION |

          PROCESS_VM_READ,

          FALSE, aProcesses[i]);

          // 取得特定PID的進程名

          if ( hProcess )

          {

          if ( EnumProcessModules( hProcess, hMod, sizeof(hMod), cbNeeded) )

          {

          GetModuleBaseName( hProcess, hMod,

          szProcessName, sizeof(szProcessName) );

          //將取得的進程名與輸入的進程名比較,如相同則返回進程PID

          if(!_stricmp(szProcessName, InputProcessName)){

          CloseHandle( hProcess );

          return aProcesses[i];

          }

          }

          }//end of if ( hProcess )

          }//end of for

          //沒有找到相應的進程名,返回0

          CloseHandle( hProcess );

          return 0;

          }//end of ProcessToPID

          //錯誤處理函數CheckError()

          //如果iReturnCode等于iErrorCode,則輸出pErrorMsg并退出

          void CheckError(int iReturnCode, int iErrorCode, char *pErrorMsg)

          {

          if(iReturnCode==iErrorCode) {

          printf(%s Error:%dnn, pErrorMsg, GetLastError());

          //清場處理

          if (pszLibFileRemote != NULL)

          VirtualFreeEx(hRemoteProcess, pszLibFileRemote, 0, MEM_RELEASE);

          if (hRemoteThread != NULL) CloseHandle(hRemoteThread );

          if (hRemoteProcess!= NULL) CloseHandle(hRemoteProcess);

          exit(0);

          }

          }//end of CheckError()

          //使用說明函數usage()

          void usage(char * pErrorMsg)

          {

          printf(%snn,pErrorMsg);

          printf(ttRemote Process DLL by Shotgunn);

          printf(tThis program can inject a DLL into remote processn);

          printf(Email:n);

          printf(tShotgun@Xici.Netn);

          printf(HomePage:n);

          printf(thttp://It.Xici.Netn);

          printf(thttp://www.Patching.Netn);

          printf(USAGE:n);

          printf(tRmtDLL.exe PID[|ProcessName] DLLFullPathNamen);

          printf(Example:n);

          printf(tRmtDLL.exe 1024 C:System32MyDLL.dlln);

          printf(tRmtDLL.exe Explorer.exe C:MyDLL.dlln);

          exit(0);

          }//end of usage()


        上一頁 1 2 3 下一頁

        評論


        相關推薦

        技術專區

        關閉
        主站蜘蛛池模板: 沙湾县| 汕尾市| 四川省| 锡林浩特市| 偃师市| 盐津县| 淳化县| 达日县| 罗江县| 潢川县| 阿城市| 高碑店市| 深水埗区| 盐边县| 顺昌县| 巴楚县| 娄底市| 七台河市| 昌都县| 铜陵市| 永平县| 松原市| 丰都县| 罗源县| 鹤峰县| 甘德县| 永济市| 翁牛特旗| 株洲县| 应城市| 泸州市| 瑞丽市| 玛曲县| 威信县| 南溪县| 蕲春县| 阿尔山市| 鹿泉市| 彭山县| 勃利县| 延川县|