Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update of asinfo.txt #4

Open
aalmenar opened this issue Aug 22, 2018 · 7 comments
Open

update of asinfo.txt #4

aalmenar opened this issue Aug 22, 2018 · 7 comments

Comments

@aalmenar
Copy link

Is there a way to update asinfo.txt located here?

@JackSlateur
Copy link
Owner

Sure, the asinfo.txt is based on this: https://github.com/manuelkasper/AS-Stats/blob/master/contrib/generate-asinfo.py

However, please note that the fetch_ip_asn.py script does not actually care much about that file
You can proceed this way, to fetch ASN from AS1 to AS2000

for i in {1..2000}; do echo $i; done | ./fetch_ip_asn.py /dev/stdin

@empi89
Copy link

empi89 commented May 13, 2019

I have used the database of https://dev.maxmind.com/geoip/geoip2/geolite2/ in combination with the following:

tail -q -n +2  GeoLite2-ASN-CSV_20190514/GeoLite2-ASN-Blocks-IPv4.csv GeoLite2-ASN-CSV_20190514/GeoLite2-ASN-Blocks-IPv6.csv | jq -n -R '

  inputs |
  split(",") |
  { (.[0]):  .[1] } '  | jq -s add

To get an up to date database.

@ya-zero
Copy link

ya-zero commented Jun 14, 2019

I have used the database of https://dev.maxmind.com/geoip/geoip2/geolite2/ in combination with the following:

tail -q -n +2  GeoLite2-ASN-CSV_20190514/GeoLite2-ASN-Blocks-IPv4.csv GeoLite2-ASN-CSV_20190514/GeoLite2-ASN-Blocks-IPv6.csv | jq -n -R '

  inputs |
  split(",") |
  { (.[0]):  .[1] } '  | jq -s add

To get an up to date database.
jq: --null-input cannot be used with --raw-input or --slurp
Use jq --help for help with command-line options,
or see the jq documentation at http://stedolan.github.com/jq
null

Could not start your command string, and the script for i in {1..2000}; do echo $ i; done | ./fetch_ip_asn.py / dev / stdin is frozen.

@empi89
Copy link

empi89 commented Jun 15, 2019

@ya-zero this has worked for me with
jq-1.5-1-a5b5cbe

@ya-zero
Copy link

ya-zero commented Jun 21, 2019

@ya-zero this has worked for me with
jq-1.5-1-a5b5cbe

good !

@ya-zero
Copy link

ya-zero commented Sep 10, 2019

when I installed the as-stats system, I found that not all traffic on graphs is displayed.
suggested that a very old asinfo.txt
the next step I updated asinfo. according to your example. everything went well.
but the graphics stubbornly draw less volume

@ArlindoFNeto
Copy link

I have used the database of https://dev.maxmind.com/geoip/geoip2/geolite2/ in combination with the following:

tail -q -n +2  GeoLite2-ASN-CSV_20190514/GeoLite2-ASN-Blocks-IPv4.csv GeoLite2-ASN-CSV_20190514/GeoLite2-ASN-Blocks-IPv6.csv | jq -n -R '

  inputs |
  split(",") |
  { (.[0]):  .[1] } '  | jq -s add

To get an up to date database.

@empi89, your idea is wonderful. MaxMind provides a good database with a compact set of prefixes, reducing the number of items in the JSON file. In addition, it includes only the ASNs that actually exist, not an interval from 1 to N.

To complement your idea, using the newly created ip2as.json, the command below will generate an asinfo.txt.

(echo begin; echo verbose; jq -r 'to_entries | .[].value' ip2as.json | sort -n -u | sed 's/^/AS/'; echo end) | netcat whois.cymru.com 43 | ./generate-asinfo.py > asinfo.txt

Note that this command is just a slight modification of the usage of the original script generate-asinfo.py.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants