-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GPT-commit: Update argparse.sh, add port-scan.sh, mod arg_scripts.csv
Modified `argparse.sh` to update command line argument parsing functionality, added `port-scan.sh` in the `src/commands` directory to implement the port scanning feature, and modified `arg_scripts.csv` in the `src/data` directory to include additional argument scripts for the new functionality.
- Loading branch information
Showing
3 changed files
with
44 additions
and
6 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
host="$1" | ||
port_range="$2" | ||
|
||
sys.log.h1 "Port Scanner" | ||
sys.log.hr | ||
sys.log.h2 "This script scans all the open ports on a given host." | ||
sys.log.h2 "Usage: ./port-scan.sh <host> <port-range>" | ||
sys.log.hr | ||
echo "" | ||
if ! wyxd.arggt "1"; then | ||
sys.util.inlineread "Enter the host to scan (defaults to 'localhost'): " host | ||
fi | ||
if ! wyxd.arggt "2"; then | ||
sys.util.inlineread "Enter the port range to scan (defaults to 1-10000): " port_range | ||
fi | ||
host=$(echo "$host" | sed 's/https\?:\/\///') | ||
host=${host:-"localhost"} | ||
port_range=${port_range:-"1-10000"} | ||
|
||
sys.log.info "Scanning $host for open ports in the range $port_range with nmap..." | ||
nmap -p "$port_range" "$host" |
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