Skip to content

Instantly share code, notes, and snippets.

@tjt263
Created January 11, 2018 00:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tjt263/7ae9f24ae90d0d5f533a0d24eab07a7a to your computer and use it in GitHub Desktop.
Save tjt263/7ae9f24ae90d0d5f533a0d24eab07a7a to your computer and use it in GitHub Desktop.
Quick script to generate a list of random IP addresses via nmap.
#!/usr/bin/env bash
dir="/tmp/$0"
mkdir -p "$dir"
nmap -n -sL -iR "$1" |
sed '1,2d;$d' |
awk '{print$5}' |
sort -t. -k1,1n -k2,2n -k3,3n -k4,4n |
tee "$dir/$(date +%s)"
########################################
#!/usr/bin/env bash
dir="/tmp/$0"
mkdir -p "$dir"
nmap -n -sL -iR "$1" \
|sed '1,2d;$d' \
|awk '{print$5}' \
|sort -t. -k1,1n -k2,2n -k3,3n -k4,4n \
|tee "$dir/$(date +%s)"
########################################
#!/usr/bin/env bash
dir="/tmp/$0"
mkdir -p "$dir"
nmap -n -sL -iR "$1" | sed '1,2d;$d' | awk '{print$5}' | sort -t. -k1,1n -k2,2n -k3,3n -k4,4n | tee "$dir/$(date +%s)"
@tjt263
Copy link
Author

tjt263 commented Jan 11, 2018

Couldn't decide which was the appropriate style. So here's all three.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment