Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
PS2 — 一个完全用 PowerShell 编写的端口扫描器。 | Kitploit
工具/GitHubGitHub/nccgroup/ps2
侦察网络映射端口扫描信息收集网络安全渗透测试
GitHubnccgroup/ps2

PS2

一个完全用 PowerShell 编写的端口扫描器。

查看仓库
82112年前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

PS2

一款完全使用 PowerShell 编写的端口扫描器。

免责声明

本工具仅用于合法目的;用户有责任确保其使用本工具的行为符合所有适用法律。使用本工具即表示您对自己执行的所有操作承担全部责任。NCC Group 与作者均不对因使用本工具而造成的任何损害承担责任。

用法

root@kitploit:~
SYNTAX
    ps2.ps1 [-banners] [-delay <Int32>] [-inFiles <FileInfo[]>] [-hostnames <String[]>] [-ips <String[]>]      
    [-serviceMap <FileInfo>] [-noColour] [-noPing] [-overwrite] [-outAll <FileInfo>] [-outJson <FileInfo>]
    [-outTxt <FileInfo>] [-ports <Int32[]>] [-quick] [-randomise] [-timeout <Int32>] [-topPorts <Int32>]
    [-traceroute] -udp [-v]

    ps2.ps1 [-banners] [-delay <Int32>] [-inFiles <FileInfo[]>] [-hostnames <String[]>] [-ips <String[]>]      
    [-serviceMap <FileInfo>] [-noColour] [-noPing] [-overwrite] [-outAll <FileInfo>] [-outJson <FileInfo>]
    [-outTxt <FileInfo>] [-ports <Int32[]>] [-quick] [-randomise] [-timeout <Int32>] [-topPorts <Int32>]
    [-traceroute] -tcp [-v]

    ps2.ps1 [-delay <Int32>] [-inFiles <FileInfo[]>] [-hostnames <String[]>] [-ips <String[]>] [-noColour]     
    [-overwrite] [-outAll <FileInfo>] [-outJson <FileInfo>] [-outTxt <FileInfo>] [-randomise]
    [-timeout <Int32>] [-traceroute] -ping [-v]

    ps2.ps1 -help

PARAMETERS
    -banners [<SwitchParameter>]
        (-b) Attempt to grab banners from open ports

    -delay <Int32>
        (-d) Delay to use between each connection in milliseconds

    -inFiles <FileInfo[]>
        (-f) File(s) containing targets to scan (1 per line)

    -help [<SwitchParameter>]
        (-h) Displays help information

    -hostnames <String[]>
        (-n) Hostname(s) of target(s) to scan

    -ips <String[]>
        (-i) IP address(es) of target(s) to scan (supports individual IPv4 addresses, IPv4 address ranges,
        IPv4 CIDR notation, and individual IPv6 addresses)   

    -serviceMap <FileInfo>
        (-m) Service map to use (overrides default of <PS2_dir>/servicemap.csv)

    -noColour [<SwitchParameter>]
        (-nC) Do not use colour in terminal output

    -noPing [<SwitchParameter>]
        (-nP) Assume all hosts are up and do not ping them prior to scanning

    -overwrite [<SwitchParameter>]
        (-o) Force output files to be overwritten if they exist and do not prompt for confirmation

    -outAll <FileInfo>
        (-oA) Save output in txt and JSON formats to files with a specified name (supersedes -oJ and -oT
        options)

    -outJson <FileInfo>
        (-oJ) Save output in JSON format to a specified file

    -outTxt <FileInfo>
        (-oT) Save output in txt format to a specified file

    -ports <Int32[]>
        (-p) Port(s) to scan [supports PowerShell ranges e.g. use "-p (1..65535)" to scan all ports] (overrides default of top 1000 commonly used ports)

    -quick [<SwitchParameter>]
        (-q) Scan only the top 100 most commonly used ports

    -randomise [<SwitchParameter>]
        (-r) Randomise the order in which hosts and ports are scanned

    -timeout <Int32>
        (-t) Timeout to use for connections in milliseconds (overrides default of 1000ms)

    -topPorts <Int32>
        Scan the top n most commonly used ports (maximum 1000)

    -traceroute [<SwitchParameter>]
        Trace hop path to each host

    -ping [<SwitchParameter>]
        (-sP) Perform a ping scan

    -tcp [<SwitchParameter>]
        (-sT) Perform a TCP connect scan

    -udp [<SwitchParameter>]
        (-sU) Perform a UDP scan

    -v [<SwitchParameter>]
        (-Verbose, -vb) Show verbose output

    -------------------------- EXAMPLE 1 --------------------------

    PS C:\>ps2.ps1 -sT -i 192.168.1.1
    
    Perform a TCP connect scan against the top 1000 most commonly used ports

    -------------------------- EXAMPLE 2 --------------------------

    PS C:\>ps2.ps1 -sT -p (1..65535) -i 192.168.1.1

    Perform a TCP connect scan against all ports

    -------------------------- EXAMPLE 3 --------------------------

    PS C:\>ps2.ps1 -sU -i 192.168.1.1

    Perform a UDP scan against the top 1000 most commonly used ports

    -------------------------- EXAMPLE 4 --------------------------

    PS C:\>ps2.ps1 -sP -i 192.168.1.1

    Perform a ping scan

服务映射

服务映射用于定义哪些服务已知在哪些端口上运行。

PS2 在没有服务映射的情况下也能正常工作,但如果没有服务映射,它将无法提供服务信息。

默认情况下,PS2 会在 ps2.ps1 所在目录中查找 servicemap.csv,但可以使用 -serviceMap 或 -m 参数覆盖该默认路径。

本仓库中包含的服务映射文件是在 Kali Linux 机器上使用以下命令生成的:

root@kitploit:~
sed '/^#/d' /usr/share/nmap/nmap-services | sed '/^unknown\s/d' | cut -f 1,2 --output-delimiter "," | cut -d '/' -f 1,2 --output-delimiter "," | grep -P ',tcp$|,udp$' | unix2dos > servicemap.csv

兼容性

PS2 应兼容 PowerShell 5.1 及以上版本。

致谢

UDP 负载取自 udp-proto-scanner。

下载工具