{"id":13841093,"url":"https://github.com/DebugST/STPortScanner","last_synced_at":"2025-07-11T10:31:32.287Z","repository":{"id":140683355,"uuid":"349338781","full_name":"DebugST/STPortScanner","owner":"DebugST","description":"[端口扫描器] 采用.NET开发的端口扫描器 支持端口协议探测 内置多种类型扫描器 TCP/UDP/SYN/SMB/ICMP 等 采用IOCP模型开发 性能表现不错 可视为轻量级NMAP","archived":false,"fork":false,"pushed_at":"2021-03-19T10:23:26.000Z","size":1631,"stargazers_count":33,"open_issues_count":1,"forks_count":9,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-08-05T17:26:42.464Z","etag":null,"topics":["csharp","dotnet","portscanner","scanner-ports"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DebugST.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":"2021-03-19T07:35:54.000Z","updated_at":"2024-07-26T05:58:21.000Z","dependencies_parsed_at":"2024-02-03T04:15:11.558Z","dependency_job_id":null,"html_url":"https://github.com/DebugST/STPortScanner","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DebugST%2FSTPortScanner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DebugST%2FSTPortScanner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DebugST%2FSTPortScanner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DebugST%2FSTPortScanner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DebugST","download_url":"https://codeload.github.com/DebugST/STPortScanner/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225713220,"owners_count":17512573,"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":["csharp","dotnet","portscanner","scanner-ports"],"created_at":"2024-08-04T17:01:02.549Z","updated_at":"2024-11-21T10:31:42.766Z","avatar_url":"https://github.com/DebugST.png","language":"C#","funding_links":[],"categories":["C# #"],"sub_categories":[],"readme":"## STPortScanner\n\nGITHUB: [https://github.com/DebugST/STPortScanner](https://github.com/DebugST/STPortScanner)\n\n![STPortScanner](https://github.com/DebugST/STPortScanner/blob/main/Images/Screen%20Shot%202021-03-18%20at%2016.27.01.png)\n\n![STPortScanner](https://github.com/DebugST/STPortScanner/blob/main/Images/Screen%20Shot%202021-03-18%20at%2017.30.50.png)\n\n## 关于作者\n* Blog: [Crystal_lz](http://st233.com)\n* Mail: (2212233137@qq.com)\n\n## 可执行程序参数\n\n```cs\n --------------------------------[STPScan  4.0]--------------------------------\n-h     Host ......................................... [默认:未指定]\n       -h target.com,192.168.0.1,192.168.0.2-192.168.1.254,192.168.0.0/24\n-hf    Host from file 从文件加载'\\n'分割 ............ [默认:未指定]\n       -hf ./iplist.txt\n-p     Port ......................................... [默认:Top 300]\n       -p 21,22,80,443,8000-8080\n-pf    Port from file 从文件加载'\\n'分割 ............ [默认:未指定]\n       -pf ./portlist.txt       \n-np    Null Probe 空探测包 .......................... [默认:未指定]\n-pr    The count of probes 进行多少次协议探测........ [默认:2]\n       -pr 3\n-i     ICMP only 仅扫描存活主机 ..................... [默认:未指定]\n       该操作需要管理员权限和server系统\n-is    ICMP + Scan 先扫描存活主机再扫描 ............. [默认:未指定]\n-t     Timeout 超时时间 ............................. [默认:5]\n       -t 3\n-tt    TotalTimeout 一个任务总超时时间 .............. [默认:60]\n       -tt 50\n-r     Retry 重试次数 ............................... [默认:2]\n       -r 5\n-st    Tcp Scan 使用TCP方式扫描 ..................... [默认:已指定]\n-su    Udp Scan 使用UDP方式扫描 ..................... [默认:未指定]\n-ss    Syn Scan 使用SYN方式扫描 ..................... [默认:未指定]\n       该操作需要管理员权限和server系统\n-smb   Only scan 445 通过smb探测系统版本(仅扫描445) . [默认:未指定]\n-con   Concurrent of Scanner 并发数 ................. [默认:6000]\n       -con 20000\n-stop  Stop 当扫描到指定协议时 停止该主机扫描 ....... [默认:未指定]\n       -stop http,https\n-order The priority of scanning 优先扫描顺序 ........ [默认:rnd]\n       -order (host or port or rnd)\n-delay The delay 控制台进度刷新时间 ................. [默认:2]\n       -delay 5\n-cd    Console Display 控制台显示方式 ............... [默认:2]\n       -cd (0 or 1 or 2)\n           0  Not display\n           1  xxx.xxx.xxx.xxx:xxx [Protocol]\n           2  xxx.xxx.xxx.xxx:xxx [Protocol][RegexLine][Banner]\n-o     Out to file 输出结果到文件 ................... [默认:未指定]\n       -o ./result.txt\n-f     Format for output 输出文件格式................ [默认:json:h,pr,b]\n       -f (json or csv):(fields)\n           h  Host                    [127.0.0.1:8080]\n           a  Address                 [127.0.0.1]\n           p  Port                    [8080]\n           pt Protocol Type           [TCP]\n           pf Protocol Flag           [http]\n           pr Protocol                [(TCP)http]\n           l  Line for regexpression  [123]\n           b  Banner                  [SSH-2.0-Ubuntu-Server]\n           d  Hex data for recv       [485454502F312E312032...]\n-cn    Convert Nmap config file  转换nmap配置文件为当前扫描器适配文件\n       parameters [Nmap config file] [Save file for STPscan]\n       -cn [./nmap-service-probes] [./config_nmap.st]\n\n -2021-03-19----------------Powered by -\u003e Crystal_lz-----------------ST233.COM-\n注:\n    icmp 与 syn 不能同时使用 并不推荐使用这两个选项 测试阶段\n    Null Probe -\u003e 是否使用空探测包 \n    若使用\n        连通后先等待对方返回banner(如:mysql,ftp主动返回banner协议等) 直到超时才进行下一次探测\n    否则\n        连通后立即发送探测包\n    区别\n        不使用 将影响收到banner是进行规制匹配的顺序 将优先使用发送的探测包的规则匹配\n        再进行空探测包的规则进行匹配(mysql,ftp等协议无需探测包的规则)\n        不使用速度快精度低 使用速度慢进度高\n    \neg:\n    STPScan -h 192.168.1.1/24\n    STPScan -h 192.168.1.1/24 -pr 3\n    STPScan -h 192.168.1.1/24 -smb\n    STPScan -h 192.168.1.1/24 -p 80,443,8000-8080 -pr 3\n    STPScan -h 192.168.1.1/24 -o result.json\n    STPScan -h 192.168.1.1/24 -o result.csv -f csv:h,pr,d\n```\n## 调用库接口\n```cs\n[Interface]\n    IPortScanner : IDispose\n    \n[Configer Class]\n    ProbeConfiger\n    \n[Scanner Class]\n    PortScanner : IPortScanner\n    TCPScanner  : PortScanner\n    UDPScanner  : PortScanner\n    SYNScanner  : PortScanner\n    SmbScanner  : PortScanner\n    IcmpScanner : IDispose\n    \n[Other Class]\n    IcmpEventArgs : EventArgs\n    ScanEventArgs : EventArgs\n    RawSocket\n    \n[RawSocket]\n    static RawSocket.Dispose();\n    static RawSocket.InitRawSocket(EndPoint bindEndPoint);\n    static RawSocket.SendData(byte[] byBuffer);\n    static RawSocket.RecvCompleted -\u003e EventHandler\u003cSocketAsyncEventArgs\u003e;\n    \n[IPortScanner]\n    event ScanEventHandler Completed;\n    uint Scan(uint uIP, int nPort);\n    uint Scan(uint uIP, int nPort, int nProbes);\n    uint Scan(uint uIP, int nPort, int nProbes, int nTimeout);\n    uint Scan(uint uIP, int nPort, int nProbes, int nTimeout, int nRetry);\n    uint Scan(uint uIP, int nPort, int nProbes, int nTimeout, int nRegry, int nTotalTimeout);\n    uint Scan(uint uIP, int nPort, int nProbes, int nTimeout, int nRetry, int nTotalTimeout, bool bUseNullProbes);\n    uint Scan(string strIP, int nPort);\n    uint Scan(string strIP, int nPort, int nProbes);\n    uint Scan(string strIP, int nPort, int nProbes, int nTimeout);\n    uint Scan(string strIP, int nPort, int nProbes, int nTimeout, int nRetry);\n    uint Scan(string strIP, int nPort, int nProbes, int nTimeout, int nRetry, int nTotalTimeout);\n    uint Scan(string strIP, int nPort, int nProbes, int nTimeout, int nRetry, int nTotalTimeout, bool bUseNullProbes);\n    uint Scan(int nPort, EndPoint endPoint, int nProbes, int nTimeout, int nRetry, int nTotalTimeout, bool bUseNullProbes);\n        return         -\u003e TaskID\n        nProbes        -\u003e 最多进行多少次探测\n        nRetry         -\u003e 重试次数\n        bUseNullProbes -\u003e 是否使用空探测包 \n                \n[EventArgs]\n    IcmpEventArgs : EventArgs\n        .Address\n        .TTL\n        .CanAccess\n        .Times\n        \n    ScanEventArgs : EventArgs\n        .TaskID \n        .CanConnect\n        .EndPoint\n        .Protocol\n        .RegexLine\n        .Banner\n        .Data\n        .Length\n        .ErrorMessage\n        \n[EG]\n    ProbeConfiger pc = new ProbeConfiger(\n                File.ReadAllText(\"./config_probes.st\"),\n                File.ReadAllText(\"./config_defports.st\")\n                );\n    IPortScanner ps = new TCPScanner(3000, pc);\n    or\n    PortScanner ps = new UDPScanner(3000, pc);\n    //PortScanner ps = new SYNScanner(3000, pc);\n    //PortScanner ps = new SmbScanner(3000);\n    ps.Completed += m_scanner_Completed;\n    \n    void m_scanner_Completed(object sender, ScanEventArgs e) {\n        if(e.CanConnect) Console.Write(e.EndPoint + \"\\t\" + e.Protocol);\n    }\n    \n    ps.Scan(\"127.0.0.1\",80);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDebugST%2FSTPortScanner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDebugST%2FSTPortScanner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDebugST%2FSTPortScanner/lists"}