Last active
November 5, 2022 15:22
-
-
Save dginhoux/49c906357c0eed8532d2058a48cb0cc6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## tcp one port | |
ip=192.168.175.140 ; port=80 ; timeout 1 bash -c "</dev/tcp/$ip/$port && echo $ip port tcp/$port open || echo $ip port tcp/$port closed" 2>/dev/null || echo $ip port tcp/$port connection timeout 2>/dev/null | |
## udp range port | |
ip=192.168.175.140 ; for port in $(seq 1 65535); do timeout 1 bash -c "</dev/tcp/$ip/$port && echo $ip port tcp/$port open || echo $ip port tcp/$port closed" 2>/dev/null || echo $ip port tcp/$port connection timeout 2>/dev/null; done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment