> For the complete documentation index, see [llms.txt](https://try-hard3r.gitbook.io/try-hard3r-blog/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://try-hard3r.gitbook.io/try-hard3r-blog/useful-tools-and-links/simple-bash-port-and-host-scanners.md).

# Simple bash port and host scanners

Recently I wrote (for my lab purpose) two bash scripts that can scan entire network to discover alive hosts or scan target IP searching for open ports.

Both scanners have % progress information status just to know how far in process they are.&#x20;

**You can download both script from my Giuthub repository:**

<https://github.com/przemokam/bash_scanners>

### 1. bash port scanner with % progress view instruction:

1. Copy `portscan.sh` file from my [Github](https://github.com/przemokam/bash_scanners/blob/main/portscan.sh) and make it executable: `chmod +x portscan.sh`
2. Run file: `./portscan.sh`
3. First insert your target IP
4. Then choose TCP or UDP scan type you want perform

<figure><img src="https://1736120781-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlvAAyThlvtKMDypgmoOh%2Fuploads%2Fhk06kn3ZPCVLWhJHy6ui%2Fimage.png?alt=media&amp;token=bc0791ab-b8bd-481f-b3e6-756b5b7053e5" alt=""><figcaption></figcaption></figure>

Script scans all 65535 ports so it may take some time (about 10 minutes).

Feel free to use it in case you don't have access to nmap :)

### 2. bash host discovery scanner with % progress view instruction:

1. copy `hostscan.sh` file from my [Github](https://github.com/przemokam/bash_scanners/blob/main/hostscan.sh) and make it executable: `chmod +x hostscan.sh`
2. Run file: `./hostscan.sh`
3. Insert your target network IP range eg. `192.168.1.0/24`

<figure><img src="https://1736120781-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlvAAyThlvtKMDypgmoOh%2Fuploads%2FS1d0b8Wc0uNW9EzTjrJ9%2Fimage.png?alt=media&amp;token=83bed698-a16a-4a18-91de-e9b23075d13f" alt=""><figcaption></figcaption></figure>

Script will scan all network and will look for alive hosts.

Feel free to use it in case you don't have access to nmap :)
