Skip to content

Instantly share code, notes, and snippets.

@pry0cc
Created August 13, 2020 22:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pry0cc/28decdc3feefadf7cfc6a457f57b4552 to your computer and use it in GitHub Desktop.
Save pry0cc/28decdc3feefadf7cfc6a457f57b4552 to your computer and use it in GitHub Desktop.
A quick script to generate an on-the-fly CSV of resolved assets. Useful for generating asset discovery lists.
#!/bin/bash
(echo "Subdomain,IP,Region,Country,Organization,Netblock,Link Type" && while read line; do ip=$(echo $line| cut -d " " -f 2); name=$(echo $line | cut -d " " -f 1); echo -n "$name,"; echo $ip | ipi '[.ip,.city,.region,.country,.company.name,.asn.name,.asn.route,.asn.type] | @csv'; done) | tee -a assets.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment