程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> C語言 >> VC >> vc教程 >> 查看進程令牌信息

查看進程令牌信息

編輯:vc教程

    用過whoami吧,這個tokenInfor和它的功能相仿,不過是查看指定進程的用戶信息和訪問令牌信息。

    本版管理員不能查看普通用戶進程的信息,功能完整的版本可以從www.red8black.com上下載。

    用法如下:
D:>E:projects inforlcc infor.exe /?
TokenInfor tell Token Infor and Owner Infor of Specify Process, -- bingle

Usage : E:projects inforlcc infor.exe [pid]
pid -- ID of target process, if not provide, use current process
-?|/? -- show this.

如果沒有指定進程ID就查詢當前進程,也就是tinfor自己了,就和whoami一樣了。

D:>tinfor 160
TokenInfor tell Token Infor and Owner Infor of Specify Process, -- bingle

Token Information of Process ID = 160.
Execute File Path = ??D:WINNTsystem32csrss.exe.

User Name : NT AUTHORITYSYSTEM S-1-5-18

Belong to 3 groups
[group 0] "BUILTINAdministrators" S-1-5-32-544
[group 1] "Everyone" S-1-1-0
[group 2] "NT AUTHORITYAuthenticated Users" S-1-5-11

Have 21 Privileges
[Privilege 0] SeTcbPrivilege - 以操作系統方式操作
[Privilege 1] SeCreateTokenPrivilege - 創建記號對象
[Privilege 2] SeTakeOwnershipPrivilege - 取得文件或其它對象的所有權
[Privilege 3] SeCreatePagefilePrivilege - 創建頁面文件
[Privilege 4] SeLockMemoryPrivilege - 內存中鎖定頁
[Privilege 5] SeAssignPrimaryTokenPrivilege - 替換進程級記號
[Privilege 6] SeIncreaseQuotaPrivilege - 添加配額
[Privilege 7] SeIncreaseBasePriorityPrivilege - 增加進度優先級
[Privilege 8] SeCreatePermanentPrivilege - 創建永久共享對象
[Privilege 9] SeDebugPrivilege - 調試程序
[Privilege 10] SeAuditPrivilege - 產生安全審核
[Privilege 11] SeSecurityPrivilege - 管理審核和安全日志
[Privilege 12] SeSystemEnvironmentPrivilege - 修改固件環境值
[Privilege 13] SeChangeNotifyPrivilege - 跳過遍歷檢查
[Privilege 14] SeBackupPrivilege - 備份文件和目錄
[Privilege 15] SeRestorePrivilege - 還原文件和目錄
[Privilege 16] SeShutdownPrivilege - 關閉系統
[Privilege 17] SeLoadDriverPrivilege - 裝載和卸載設備驅動程序
[Privilege 18] SeProfileSingleProcessPrivilege - 配置單一進程
[Privilege 19] SeSystemtimePrivilege - 更改系統時間
[Privilege 20] SeUndockPrivilege - 從插接工作站中取出計算機

Token Type : Primary Token
OpenProcessToken QUERY_SOURCE error : 5

whoami.exe是一個有錯誤的debug版tokenInfor程序,什麼錯誤,你調試看看把,這個錯誤不影響

程序的主要功能,程序代碼的實現也沒有問題。不要用vc重新編譯whoami.c,否則錯誤就沒有了。

vc和lcc有點不同。

源程序
/**
TokenInfor tell Token Infor and Owner Infor of Specify Process
--bingle, [email protected]
*/

#include
#include
#include
#include

#define UULEN 256
#define true 1
#define false 0

typedef DWord GetModuleFileNameExType(
HANDLE hProcess, // handle to the process
HMODULE hModule, // handle to the module
LPTSTR lpFilename, // buffer that receives the path
DWord nSize // size of the buffe

[1] [2] [3] [4] [5] 下一頁

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved