{"id":13929922,"url":"https://github.com/parseword/darkstat-with-asn","last_synced_at":"2025-09-21T03:31:27.120Z","repository":{"id":82258236,"uuid":"106303163","full_name":"parseword/darkstat-with-asn","owner":"parseword","description":"darkstat-3.0.719 patched to query and display Autonomous System numbers","archived":false,"fork":false,"pushed_at":"2017-10-13T18:23:18.000Z","size":182,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-13T19:40:52.570Z","etag":null,"topics":["asn","darkstat","network-analysis","network-monitoring","network-visualization"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/parseword.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-10-09T15:43:47.000Z","updated_at":"2024-09-27T14:54:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"3d9450a4-5a20-4f30-b38e-c1b49d7f0294","html_url":"https://github.com/parseword/darkstat-with-asn","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parseword%2Fdarkstat-with-asn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parseword%2Fdarkstat-with-asn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parseword%2Fdarkstat-with-asn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parseword%2Fdarkstat-with-asn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parseword","download_url":"https://codeload.github.com/parseword/darkstat-with-asn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233706285,"owners_count":18717256,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asn","darkstat","network-analysis","network-monitoring","network-visualization"],"created_at":"2024-08-07T18:02:37.343Z","updated_at":"2025-09-21T03:31:21.808Z","avatar_url":"https://github.com/parseword.png","language":"C","funding_links":[],"categories":["others"],"sub_categories":[],"readme":"# darkstat-with-asn\nThis is a copy of the [darkstat](http://unix4lyfe.org/darkstat/) network \ntraffic analyzer which has been patched to \nsupport [Autonomous System Numbers](https://en.wikipedia.org/wiki/Autonomous_system_\\(Internet\\)). \n\nAfter cloning this repo, build as usual: `./configure`, `make`, `make install`. \n(Got [compiler errors](#libresolv)?)\n\nOr, you can apply the [patch](https://raw.githubusercontent.com/parseword/darkstat-with-asn/master/patch.txt) to \nan existing source tree and compile. \n\nTo enable ASN support, use the new `--with-asn` command line option. darkstat \nwill query the [Team Cymru IP to ASN DNS service](http://www.team-cymru.org/IP-ASN-mapping.html#dns) to \ndetermine the AS Number of each IPv4 host. The AS Numbers are displayed in \ndarkstat's web interface, both as a new column in the \"hosts\" list and also on \nthe host detail pages.\n\n![Host summary page with AS numbers displayed](https://i.imgur.com/m21Nk2O.png)\n\nIn order to reduce DNS query load, an effort is made to skip AS Number lookups \nfor IP addresses in certain reserved ranges (RFC1918, multicast, etc.). IPv6 \nhosts are also skipped for the time being. The ASN column will display \"(none)\" \nor \"(unsupported)\" for these hosts.\n\nASN support adds a second child thread to darkstat, mirroring the behavior of \nthe main DNS resolution thread. In testing, there was no noticeable additional \noverhead from the extra process; it only does anything when you load the \nweb interface.\n\nThis build has been tested on several Linux 2.6 kernels and on FreeBSD 11.1. \nFeedback from users of other operating systems is welcome.\n\n### Changes\n\nThe following files are new (italic) or modified from the original source:\n\n* Makefile.in\n* *asn.c*\n* *asn.h*\n* configure\n* configure.ac\n* darkstat.8.in\n* darkstat.c\n* dns.c\n* hosts_db.c\n* hosts_db.h\n* opt.h\n\nYou can review the [patch](https://raw.githubusercontent.com/parseword/darkstat-with-asn/master/patch.txt) to \nsee what's changed.\n\n### Caveats\n\n#### IPv4 only\n\nAt present, AS Numbers will only be looked up for IPv4 hosts.\n\n#### libresolv\n\nQuerying for DNS TXT resource records uses several functions from the resolver \nlibrary. Modern unix-based operating systems support these functions either \nnatively or through libresolv.\n\nLinux users will need to link against libresolv. I've tried to make the configure \nscript detect this automatically. If you receive errors like this when compiling,\n\n    asn.o: In function `ip4_lookup_asn':\n    asn.c:420: undefined reference to `__res_nquery'\n    asn.c:451: undefined reference to `ns_initparse'\n    asn.c:461: undefined reference to `ns_parserr'\n    asn.c:462: undefined reference to `ns_sprintrr'\n    collect2: ld returned 1 exit status\n    make: *** [darkstat] Error 1\n\n...open the Makefile and append `-lresolv` to the `LIBS = ` line, then \nrecompile.\n\n#### Google's name servers (8.8.8.8, 8.8.4.4)\n\nEnabling ASN lookups will nearly double the number of DNS queries generated \nby darkstat. Google's public name servers are rate limited, and may refuse \nyour queries for awhile when you send a rapid burst of traffic. If you use \nGoogle DNS, and darkstat shows a lot of \"(none)\" where you know there should be \nvalid data, this is likely due to a Google rate limit. Consider using your \nISP's DNS servers or running one of your own.\n\n### TODO\n\n* Support IPv6 addresses.\n\n* Maybe refactor the ASN into an integer (I *know*!) and support sorting by it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparseword%2Fdarkstat-with-asn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparseword%2Fdarkstat-with-asn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparseword%2Fdarkstat-with-asn/lists"}