{"id":19890173,"url":"https://github.com/adminisme/sharprdplog","last_synced_at":"2026-01-27T02:07:59.129Z","repository":{"id":40604633,"uuid":"328150527","full_name":"Adminisme/SharpRDPLog","owner":"Adminisme","description":"Windows rdp相关的登录记录导出工具，可用于后渗透中Windows服务器的信息收集阶段。输出内容包括：本地rdp端口、mstsc缓存、cmdkey缓存、登录成功、失败日志事件。","archived":false,"fork":false,"pushed_at":"2024-06-23T09:44:37.000Z","size":202,"stargazers_count":279,"open_issues_count":2,"forks_count":28,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-07-11T23:38:10.689Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Adminisme.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2021-01-09T12:30:36.000Z","updated_at":"2025-03-26T16:29:46.000Z","dependencies_parsed_at":"2024-11-21T17:42:25.694Z","dependency_job_id":null,"html_url":"https://github.com/Adminisme/SharpRDPLog","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Adminisme/SharpRDPLog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adminisme%2FSharpRDPLog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adminisme%2FSharpRDPLog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adminisme%2FSharpRDPLog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adminisme%2FSharpRDPLog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Adminisme","download_url":"https://codeload.github.com/Adminisme/SharpRDPLog/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adminisme%2FSharpRDPLog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28796962,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T01:07:07.743Z","status":"online","status_checked_at":"2026-01-27T02:00:07.755Z","response_time":168,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-12T18:13:11.424Z","updated_at":"2026-01-27T02:07:59.103Z","avatar_url":"https://github.com/Adminisme.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# SharpRDPLog\n\n![Author](https://img.shields.io/badge/Author-Trim-blueviolet)  ![Bin](https://img.shields.io/badge/SharpRDPLog-Bin-ff69b4)  ![build](https://img.shields.io/badge/build-passing-green.svg)  ![language](https://img.shields.io/badge/language-C%20%23-blue.svg)\n\n### 简介\n\n- **Windows rdp相关的登录记录导出工具，用于后渗透中Windows服务器的RDP相关的信息收集。输出内容包括：本地rdp端口、mstsc缓存、cmdkey缓存、登录成功、失败日志事件。**\n\n- **运行前需要bypassUAC后的管理员权限权限**\n\n### 说明\n**由于代码比较简单，已经编译了.Net 3.5版本的可执行文件，需要的可以直接到[releases](https://github.com/Adminisme/SharpRDPLog/releases)下载，下面主要分享和提供思路供大家参考。**\n\n#### 1、查看本地rdp TCP端口\n\n原理：通过读取系统注册表信息获取rdp TCP端口。\n\n注册表Path：\n\n```\n计算机\\HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server\\WinStations\\RDP-Tcp\n```\n\n\n\n#### 2、导出当前用户mstsc远程登录服务器记录\n输出：ip地址：端口\n\n原理：通过读取系统注册表信息获取mstsc缓存记录。\n\n注册表Path：\n\n```\n计算机\\HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Terminal Server Client\\Default\n```\n\n\n\n#### 3、导出本地所有用户rdp登录服务器记录\n\n输出包括：ip地址、登录用户名\n\n原理：通过调用WMI API接口获取所有当前系统所有用户的Name、SID，通过系统注册表依次读取获取该用户登录记录，类似cmdkey /list功能，区别于可以导出系统内所有用户记录登录信息。\n\n注册表Path：\n\n```\n系统当前用户：\n计算机\\HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Terminal Server Client\\Servers\n\n系统全局用户：\n计算机\\HKEY_USERS\\{SID}\\SOFTWARE\\Microsoft\\Terminal Server Client\\Servers\\\n```\n\n\n\n#### 4、导出服务器被登录事件，获取当前服务器被登录记录\n\n参考：https://github.com/uknowsec/SharpEventLog \n\n输出包括：时间、源IP地址、域名、用户名\n\n原理：通过Win API 获取windows事件安全日志中ID为4624、4625的事件，提取事件中的关键信息。\n\n\n\n### Usage:\n\n```\nC:\\Users\\Trim\u003eSharpRDPLog.exe\nUsage: SharpRDPLog.exe -rdpport        #本地RDP端口\n       SharpRDPLog.exe -rdp_History    #当前用户的mstsc缓存和当前用户的cmdkey缓存\n       SharpRDPLog.exe -cmdkey         #所有用户的cmdkey缓存\n       SharpRDPLog.exe -4624           #登录成功事件\n       SharpRDPLog.exe -4625           #登录失败事件\n       SharpRDPLog.exe  -all           #全部输出\n```\n\n![image-20210109193312513](imgs/image-20210109193312513.png)\n\n\n\n### 运行样例：\n\n\u003cimg src=\"imgs/image-20210109193907873.png\" alt=\"image-20210109193907873\" style=\"zoom:67%;\" /\u003e\n\n\n\n### 输出样例：\n\n\u003cimg src=\"imgs/image-20210109192049688.png\" alt=\"image-20210109192049688\" style=\"zoom: 67%;\" /\u003e\n\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadminisme%2Fsharprdplog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadminisme%2Fsharprdplog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadminisme%2Fsharprdplog/lists"}