If you have a subdirectory where you run it named after your email hostname (such as "example/" for "example.com"), then it will prompt you to "overwrite the contents of the directory" and then, if you accept, it will not only overwrite the contents, it will remove the entire contents with:
cd $outdir
rm * 2>/dev/null
There's a slight violation of user expectations here. Removing and replacing the contents isn't quite the same as overwriting the contents. It may be a fine line, but it's better to err on the side of protecting the user's files, not deleting them, when deciding where to come down on that fine line.And if $outdir is empty or not there, it tries to detect that by first doing a check for -d $outdir, but this won't save the user if $outdir gets moved aside by another process while they are reading the prompt and before the cd happens, leaving them in another directory. Hopefully the user has rm aliased to rm -i but that still won't help since the rm is being run in its own shell in the script.
I know we're not supposed to focus on the negative here on HN. I'm sure the script is awesome for whatever it does. Just be careful out there!
- enter a user and mount namespace
- mount a tmpfs, e.g. over /tmp
- remount everything else as readonly
alternatively firejail --overlay-tmpfs <command>I'm a network engineer at an ISP and it's pretty common to use something like this for analyzing traffic network when considering peering sessions, for example. Even if you don't run BGP, you could use it for answering questions like "how much traffic do we send to/receive from Facebook?" and such.
RIPE's RIS dumps are performed every five minutes from more than a dozen different "vantage points" across the Internet.
ARIN used to provide an "originAS" file [1] but it looks like they quit doing that a few years ago. You may be able to find some interesting stuff browsing around /pub on their FTP server, though [2].
[0]: https://www.ripe.net/analyse/internet-measurements/routing-i...
[1]: ftp://ftp.arin.net/pub/originAS/
[2]: ftp://ftp.arin.net/pub/
https://iptoasn.com/ https://pypi.python.org/pypi/pyasn
I've been working on tweaking pyasn a bit and building a service around that.
$ curl ipinfo.io/8.8.8.8
{
"ip": "8.8.8.8",
"hostname": "google-public-dns-a.google.com",
"city": "Mountain View",
"region": "California",
"country": "US",
"loc": "37.3860,-122.0840",
"org": "AS15169 Google Inc.",
"postal": "94035",
"phone": "650"
}
$ curl ipinfo.io/8.8.8.8/org
AS15169 Google Inc.
And ASN details are available on the web, eg https://ipinfo.io/AS15169I'm generally pretty not okay with scripts that curl | tar things (or apt-get install things, which this does if it's run on a linux) from the interwebs without my explicit consent.
By running it as root, I'd argue that you did give explicit consent for the script to do anything it wants.
> A tool to enumerate CIDRs by querying RIRs & BGP ASN prefix lookups
> Currently queries: ARIN, RIPE NCC, APNIC, AfriNIC, LACNIC
>
> Queries are made for the Org name, network handles, org handles, customer handles,
> BGP prefixes, PoCs with target email domain, and 'notify' email address - used by
> some RIRs.
>
> Note that severl RIRs currently limit query results to 256 or less, so large
> target orgs may not return all results.
>
> LACNIC only allows query of ASN or IP address bloks & cannot search for Org names
> directly. The entire DB as been downloaded to a separate file for queries to this RIR.
> The file will be periodically updated to maintain accurate information.
>
> Output saved to two csv files - one for org & one for PoCs
> A txt file is also output with a full list of enumerated CIDRs
>
> Author: Jason Ashton (@ninewires)
> Created: 09/19/2016
Edit: the header from the script is good, toss it into the README for great success.
> HardCidr is written by Jason Ashton, Senior Security Consultant at TrustedSec
I'm guessing it was written with pen-testing in mind.
To what end?