Skip to content

Instantly share code, notes, and snippets.

@rwat
Created July 21, 2010 16:49
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 rwat/484747 to your computer and use it in GitHub Desktop.
Save rwat/484747 to your computer and use it in GitHub Desktop.
; Generate a list of random IPs to be fed into nmap so that nmap may scan
; aggressively but not swamp any given subnet within the 172.16.0.0/12 range.
;
; Licensed under the EPL. (fwiw ;)
(use '[clojure.contrib.seq-utils :only (shuffle)]
'[clojure.contrib.duck-streams :only (write-lines)])
(write-lines
"./ips.txt"
(shuffle
(for [octet1 [172]
octet2 (range 16 33)
octet3 (range 256)
octet4 (range 256)]
(str octet1 \. octet2 \. octet3 \. octet4))))
@cemerick
Copy link

(defn ordered-ips [](time %28count %28vec %28for [octet1 [172]
octet2 %28range 16 33%29
octet3 %28range 256%29
octet4 %28range 256%29]
%28str octet1 . octet2 . octet3 . octet4%29%29%29%29))

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