Skip to content

Instantly share code, notes, and snippets.

@bandrel
Created August 1, 2017 21:05
Show Gist options
  • Save bandrel/e432f55b79a001a8a10e7c87433d0858 to your computer and use it in GitHub Desktop.
Save bandrel/e432f55b79a001a8a10e7c87433d0858 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import ipaddress
import sys
subnets = str(sys.argv[1]).split(',')
for network in subnets:
for host in ipaddress.IPv4Network(network).hosts():
print(host)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment