nitefood / asn

ASN / RPKI validity / BGP stats / IPv4v6 / Prefix / URL / ASPath / Organization / IP reputation / IP geolocation / IP fingerprinting / Network recon / lookup API server / Web traceroute server
MIT License
1.31k stars 159 forks source link

Installed ipcalc not detected #35

Closed paulmenzel closed 1 year ago

paulmenzel commented 1 year ago
$ git log --oneline --no-decorate -1
741a5d5 reduced default shodan scanning threads - threads reduced from 20 to 10, Shodan introduced stricter rate limits (and longer cooldown timers)
$ dpkg -l ipcalc
Gewünscht=Unbekannt/Installieren/R=Entfernen/P=Vollständig Löschen/Halten
| Status=Nicht/Installiert/Config/U=Entpackt/halb konFiguriert/
         Halb installiert/Trigger erWartet/Trigger anhängig
|/ Fehler?=(kein)/R=Neuinstallation notwendig (Status, Fehler: GROSS=schlecht)
||/ Name           Version      Architektur  Beschreibung
+++-==============-============-============-=======================================
ii  ipcalc         0.42-2       all          parameter calculator for IPv4 addresses

$ ipcalc --version
0.5
$ ./asn github.com

╭─────────────╮
│ ! WARNING ! │
╰─────────────╯

The following tools were not found on this system:  
 - ipcalc

The following features will be disabled: 
 - CIDR deaggregation (due to incompatible ipcalc version - v0.41+ for Debian-based or v1.0.0+ for RHEL-based required, but you have v0.5)

Please install the necessary prerequisite packages
for your system by following these instructions: 

>> https://github.com/nitefood/asn#prerequisite-packages <<

Press ENTER to continue...
Interrupted
nitefood commented 1 year ago

Hi @paulmenzel! The ipcalc saga continues. Can you please confirm if you have the -d or -r option on ipcalc v0.5? What distro and version? Thanks.

paulmenzel commented 1 year ago

See the output of dpkg above, but it’s Debian sid/unstable, and it only has the switch -r, and not -d apparently. (It worked up until fetch the latest changes today.)

$ ipcalc --help
[…]
 -n --nocolor  Don't display ANSI color codes.
 -c --color    Display ANSI color codes (default).
 -b --nobinary Suppress the bitwise output.
 -c --class    Just print bit-count-mask of given address.
 -h --html     Display results as HTML (not finished in this version).
 -v --version  Print Version.
 -s --split n1 n2 n3
               Split into networks of size n1, n2, n3.
 -r --range    Deaggregate address range.
    --help     Longer help text.
[…]
nitefood commented 1 year ago

Ok. Apparently what should be ipcalc v0.42 actually reports itself as v0.5 for some reason which slips me (as also noted here). I had checks in place to make sure version was >=0.41 (as per issue #34) which was indeed correct, but didn't account for ipcalc's mission to drive people crazy with versions, forks and different implementations under the same name.

The initial trouble started with @odoucet's system running v0.2.x (which didn't have range deaggregation), so I'll fix it by checking if >= 0.5 instead of 0.41 - that should settle the matter for Debian-based systems, account for Redhat-based version overlapping, and hopefully mark the end of the saga :-)

Thanks for reporting!