#port-scan #nushell-plugin #open-ports #nushell #networking #ip-address #plugin

app nu_plugin_port_scan

A nushell plugin for scanning ports on a target

9 stable releases

1.2.6 Nov 15, 2024
1.2.5 Oct 17, 2024
1.2.4 Sep 19, 2024
1.2.3 Aug 26, 2024
1.0.3 Nov 15, 2023

#243 in Network programming

Download history 142/week @ 2024-08-24 16/week @ 2024-08-31 112/week @ 2024-09-14 49/week @ 2024-09-21 14/week @ 2024-09-28 6/week @ 2024-10-05 153/week @ 2024-10-12 34/week @ 2024-10-19 3/week @ 2024-10-26 7/week @ 2024-11-02 68/week @ 2024-11-09 63/week @ 2024-11-16 11/week @ 2024-11-23 11/week @ 2024-11-30

155 downloads per month

MIT and maybe CC-PDDC

20KB
292 lines

nu_plugin_port_scan

A nushell plugin for scanning ports on a target

Similar to nc -vz {ip} {port} -w {timeout} the parameters are mapped to port scan {ip} {port} -t {timeout}

Examples

~> port scan 8.8.8.8 53
╭─────────┬───────────────────╮
 address │ 8.8.8.8           │
 port    │ 53                │
 result  │ Open              │
 is_open │ true              │
 elapsed │ 140ms 965µs 400ns │
╰─────────┴───────────────────╯
~> 50..60 | par-each { |it| port scan 8.8.8.8 $it -t 100ms } |  where is_open | collect { $in }
╭───┬─────────┬──────┬────────┬─────────┬──────────────────╮
# │ address │ port │ result │ is_open │     elapsed      │
├───┼─────────┼──────┼────────┼─────────┼──────────────────┤
│ 0 │ 8.8.8.8 │   53 │ Open   │ true    │ 39ms 704µs 200ns │
╰───┴─────────┴──────┴────────┴─────────┴──────────────────╯
~> [8.8.8.8, 1.1.1.1, 1.0.0.1, 4.2.2.4] | par-each { |it| port scan $it 53 -t 1sec } |  where is_open | collect { $in } | sort-by elapsed
╭───┬─────────┬──────┬────────┬─────────┬──────────────────╮
# │ address │ port │ result │ is_open │     elapsed      │
├───┼─────────┼──────┼────────┼─────────┼──────────────────┤
│ 0 │ 8.8.8.8 │   53 │ Open   │ true    │ 40ms 519µs 900ns │
│ 1 │ 1.0.0.1 │   53 │ Open   │ true    │ 93ms 471µs 500ns │
│ 2 │ 4.2.2.4 │   53 │ Open   │ true    │       97ms 130µs │
│ 3 │ 1.1.1.1 │   53 │ Open   │ true    │ 99ms 867µs 500ns │
╰───┴─────────┴──────┴────────┴─────────┴──────────────────╯

Installing

git clone https://github.com/FMotalleb/nu_plugin_port_scan.git
nupm install --path nu_plugin_port_scan -f
  • or compile manually
git clone https://github.com/FMotalleb/nu_plugin_port_scan.git
cd nu_plugin_port_scan
cargo build
plugin add target/debug/nu_plugin_port_scan
  • or using cargo
cargo install nu_plugin_port_scan
plugin add ~/.cargo/bin/nu_plugin_port_scan

Dependencies

~23–53MB
~1M SLoC