projectdiscovery / asnmap Goto Github PK
View Code? Open in Web Editor NEWGo CLI and Library for quickly mapping organization network ranges using ASN information.
License: MIT License
Go CLI and Library for quickly mapping organization network ranges using ASN information.
License: MIT License
asnmap -a AS15169
___ _____ __
/ _ | / __/ |/ /_ _ ___ ____
/ __ |_\ \/ / ' \/ _ / _ \
/_/ |_/___/_/|_/_/_/_/\_,_/ .__/
/_/
projectdiscovery.io
[INF] Current asnmap version v1.0.5 (latest)
panic: runtime error: index out of range [15] with length 0
goroutine 1 [running]:
github.com/projectdiscovery/mapcidr.ipNetToRange({{0x0, 0x0, 0x0}, {0xc0004c5110, 0x10, 0x10}})
/home/runner/go/pkg/mod/github.com/projectdiscovery/[email protected]/ip.go:289 +0x474
github.com/projectdiscovery/mapcidr.partitionCIDR({{0xc0004c50a0, 0x10, 0x10}, {0xc0004c50b0, 0x10, 0x10}}, {{0x0, 0x0, 0x0}, {0xc0004c5110, ...}})
/home/runner/go/pkg/mod/github.com/projectdiscovery/[email protected]/ip.go:622 +0x199
github.com/projectdiscovery/mapcidr.rangeToCIDRs({0x0, 0x0, 0x0}, {0x0, 0x0, 0x0})
/home/runner/go/pkg/mod/github.com/projectdiscovery/[email protected]/ip.go:599 +0x694
github.com/projectdiscovery/mapcidr.GetCIDRFromIPRange({0x0, 0x0, 0x0}, {0x0, 0x0, 0x0})
/home/runner/go/pkg/mod/github.com/projectdiscovery/[email protected]/ip.go:1058 +0x146
github.com/projectdiscovery/asnmap/libs.GetCIDR({0xc0002ba700, 0xb9, 0xc0004c412a?})
/home/runner/work/asnmap/asnmap/libs/cidr.go:12 +0x129
github.com/projectdiscovery/asnmap/runner.(*Runner).writeOutput(0xc0004cc318, {0xc0002ba700?, 0xc0004c4128?, 0x7?})
/home/runner/work/asnmap/asnmap/runner/output.go:78 +0xe5
github.com/projectdiscovery/asnmap/runner.(*Runner).process.func1({0xc0004c40f8?, 0x2?, 0x8?}, {0xc000949c2f?, 0x1?, 0x1?})
/home/runner/work/asnmap/asnmap/runner/runner.go:127 +0x292
github.com/projectdiscovery/hmap/store/disk.(*LevelDB).Scan(0x0?, {{0x0, 0x0}, 0x0, {0x0, 0x0}, 0x0, 0xc0004cc000})
/home/runner/go/pkg/mod/github.com/projectdiscovery/[email protected]/store/disk/leveldb.go:224 +0x27f
github.com/projectdiscovery/hmap/store/hybrid.(*HybridMap).Scan(0x1071dc6?, 0x0?)
/home/runner/go/pkg/mod/github.com/projectdiscovery/[email protected]/store/hybrid/hybrid.go:258 +0x11e
github.com/projectdiscovery/asnmap/runner.(*Runner).process(0xc0004cc318)
/home/runner/work/asnmap/asnmap/runner/runner.go:80 +0x94
github.com/projectdiscovery/asnmap/runner.(*Runner).Run(0xc0004cc318)
/home/runner/work/asnmap/asnmap/runner/runner.go:74 +0x32f
main.main()
/home/runner/work/asnmap/asnmap/cmd/asnmap/asnmap.go:36 +0x185
$ docker build .
...
[+] Building 45.6s (8/12)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 748B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 121B 0.0s
=> [internal] load metadata for docker.io/library/alpine:3.17.2 2.0s
=> [internal] load metadata for docker.io/library/golang:1.20.1 1.8s
=> [internal] load build context 0.1s
=> => transferring context: 98.84kB 0.0s
=> [stage-1 1/3] FROM docker.io/library/alpine:3.17.2@sha256:69665d02cb32192e52e07644d76bc6f25abeb5410edc1c7a81a10ba3f0efb90a 26.7s
=> => resolve docker.io/library/alpine:3.17.2@sha256:69665d02cb32192e52e07644d76bc6f25abeb5410edc1c7a81a10ba3f0efb90a 0.0s
=> => sha256:69665d02cb32192e52e07644d76bc6f25abeb5410edc1c7a81a10ba3f0efb90a 1.64kB / 1.64kB 0.0s
=> => sha256:e2e16842c9b54d985bf1ef9242a313f36b856181f188de21313820e177002501 528B / 528B 0.0s
=> => sha256:b2aa39c304c27b96c1fef0c06bee651ac9241d49c4fe34381cab8453f9a89c7d 1.47kB / 1.47kB 0.0s
=> => sha256:63b65145d645c1250c391b2d16ebe53b3747c295ca8ba2fcb6b0cf064a4dc21c 3.37MB / 3.37MB 26.5s
=> => extracting sha256:63b65145d645c1250c391b2d16ebe53b3747c295ca8ba2fcb6b0cf064a4dc21c 0.1s
=> CANCELED [builder 1/4] FROM docker.io/library/golang:1.20.1@sha256:2edf6aab2d57644f3fe7407132a0d1770846867465a39c2083770cf62734b05d 43.5s
=> => resolve docker.io/library/golang:1.20.1@sha256:2edf6aab2d57644f3fe7407132a0d1770846867465a39c2083770cf62734b05d 0.0s
=> => sha256:1e4aec178e0864db93a6f97a20bde3445871a4562c1801185eca1238d3a0e80d 55.05MB / 55.05MB 9.2s
=> => sha256:56d1b895b796596bb0fc29ea4c9c1dc157ea86de3baffbb8d365da252e6f3587 7.32kB / 7.32kB 0.0s
=> => sha256:6c1024729feeb2893dad43684fe7679c4d866c3640dfc3912bbd93c5a51f32d2 5.17MB / 5.17MB 1.3s
=> => sha256:c3aa11fbc85a2a9660c98cfb4d0a2db8cde983ce3c87565c356cfdf1ddf2654c 10.88MB / 10.88MB 7.2s
=> => sha256:2edf6aab2d57644f3fe7407132a0d1770846867465a39c2083770cf62734b05d 2.36kB / 2.36kB 0.0s
=> => sha256:745aa72cefb6f9527c1588590982c0bdf85a1be5d611dda849e54b5dbf551506 1.79kB / 1.79kB 0.0s
=> => sha256:aa54add66b3a47555c8b761f60b15f818236cc928109a30032111efc98c6fcd4 54.59MB / 54.59MB 24.9s
=> => sha256:bb80f942c8f48f157732f2928b6d37b63b9a9989bbcd6cd0f21a18ce292fc100 85.99MB / 85.99MB 32.4s
=> => sha256:52d5f431180ae645e799e6b42d60883e0e420aa5064e5673643f58f26c73330f 99.89MB / 99.89MB 36.9s
=> => extracting sha256:1e4aec178e0864db93a6f97a20bde3445871a4562c1801185eca1238d3a0e80d 1.0s
=> => extracting sha256:6c1024729feeb2893dad43684fe7679c4d866c3640dfc3912bbd93c5a51f32d2 0.1s
=> => extracting sha256:c3aa11fbc85a2a9660c98cfb4d0a2db8cde983ce3c87565c356cfdf1ddf2654c 0.1s
=> => extracting sha256:aa54add66b3a47555c8b761f60b15f818236cc928109a30032111efc98c6fcd4 1.1s
=> => sha256:36946d8e120bb47e8f0ac93cb0323604d651ca78578653d47e83f4df837b68fb 156B / 156B 25.3s
=> => extracting sha256:bb80f942c8f48f157732f2928b6d37b63b9a9989bbcd6cd0f21a18ce292fc100 1.4s
=> ERROR [stage-1 2/3] RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2 && apk update && apk add ca-certificates wget && apk add ca-certificates && rm -rf /var/cache/apk/* && wget -q -O /etc/apk/keys/sgerrand.rsa.pub http 16.8s
------
> [stage-1 2/3] RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2 && apk update && apk add ca-certificates wget && apk add ca-certificates && rm -rf /var/cache/apk/* && wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.30-r0/glibc-2.30-r0.apk && apk --no-cache add glibc-2.30-r0.apk:
#6 0.424 fetch https://dl-cdn.alpinelinux.org/alpine/v3.17/main/x86_64/APKINDEX.tar.gz
#6 0.864 fetch https://dl-cdn.alpinelinux.org/alpine/v3.17/community/x86_64/APKINDEX.tar.gz
#6 1.455 v3.17.2-102-gdf04f02cc86 [https://dl-cdn.alpinelinux.org/alpine/v3.17/main]
#6 1.455 v3.17.2-108-g44ea995f846 [https://dl-cdn.alpinelinux.org/alpine/v3.17/community]
#6 1.455 OK: 17812 distinct packages available
#6 1.706 (1/5) Installing ca-certificates (20220614-r4)
#6 1.900 (2/5) Installing libunistring (1.1-r0)
#6 2.112 (3/5) Installing libidn2 (2.3.4-r0)
#6 2.161 (4/5) Installing pcre2 (10.42-r0)
#6 2.245 (5/5) Installing wget (1.21.3-r2)
#6 2.297 Executing busybox-1.35.0-r29.trigger
#6 2.301 Executing ca-certificates-20220614-r4.trigger
#6 2.350 OK: 11 MiB in 20 packages
#6 2.611 OK: 11 MiB in 20 packages
#6 3.431 --2023-02-28 11:39:25-- https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.30-r0/glibc-2.30-r0.apk
#6 3.466 Resolving github.com (github.com)... 140.82.121.3, ::ffff:140.82.121.3
#6 3.495 Connecting to github.com (github.com)|140.82.121.3|:443... connected.
#6 3.560 HTTP request sent, awaiting response... 302 Found
#6 3.791 Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/33333969/946dab00-c1b4-11e9-987e-da37e3103482?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230228%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230228T113925Z&X-Amz-Expires=300&X-Amz-Signature=001cbd698171970ef1043a603583d396b80456b59b19408ef734ca23f1dc9a7d&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=33333969&response-content-disposition=attachment%3B%20filename%3Dglibc-2.30-r0.apk&response-content-type=application%2Fvnd.android.package-archive [following]
#6 3.791 --2023-02-28 11:39:25-- https://objects.githubusercontent.com/github-production-release-asset-2e65be/33333969/946dab00-c1b4-11e9-987e-da37e3103482?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230228%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230228T113925Z&X-Amz-Expires=300&X-Amz-Signature=001cbd698171970ef1043a603583d396b80456b59b19408ef734ca23f1dc9a7d&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=33333969&response-content-disposition=attachment%3B%20filename%3Dglibc-2.30-r0.apk&response-content-type=application%2Fvnd.android.package-archive
#6 3.791 Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.111.133, 185.199.108.133, 185.199.110.133, ...
#6 3.847 Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.111.133|:443... connected.
#6 3.896 HTTP request sent, awaiting response... 200 OK
#6 4.515 Length: 4408199 (4.2M) [application/vnd.android.package-archive]
#6 4.515 Saving to: 'glibc-2.30-r0.apk'
#6 4.515
#6 4.515 0K .......... .......... .......... .......... .......... 1% 248K 17s
#6 4.717 50K .......... .......... .......... .......... .......... 2% 514K 13s
#6 4.814 100K .......... .......... .......... .......... .......... 3% 2.15M 9s
#6 4.836 150K .......... .......... .......... .......... .......... 4% 676K 8s
#6 4.910 200K .......... .......... .......... .......... .......... 5% 83.0K 16s
#6 5.515 250K .......... .......... .......... .......... .......... 6% 217M 13s
#6 5.515 300K .......... .......... .......... .......... .......... 8% 450M 11s
#6 5.515 350K .......... .......... .......... .......... .......... 9% 393M 10s
#6 5.515 400K .......... .......... .......... .......... .......... 10% 567M 9s
#6 5.515 450K .......... .......... .......... .......... .......... 11% 552M 8s
#6 5.515 500K .......... .......... .......... .......... .......... 12% 457M 7s
#6 5.515 550K .......... .......... .......... .......... .......... 13% 532M 6s
#6 5.515 600K .......... .......... .......... .......... .......... 15% 624M 6s
#6 5.515 650K .......... .......... .......... .......... .......... 16% 572M 5s
#6 5.515 700K .......... .......... .......... .......... .......... 17% 635M 5s
#6 5.515 750K .......... .......... .......... .......... .......... 18% 561M 4s
#6 5.515 800K .......... .......... .......... .......... .......... 19% 658M 4s
#6 5.515 850K .......... .......... .......... .......... .......... 20% 642M 4s
#6 5.515 900K .......... .......... .......... .......... .......... 22% 421M 4s
#6 5.515 950K .......... .......... .......... .......... .......... 23% 577M 3s
#6 5.515 1000K .......... .......... .......... .......... .......... 24% 630M 3s
#6 5.515 1050K .......... .......... .......... .......... .......... 25% 647M 3s
#6 5.515 1100K .......... .......... .......... .......... .......... 26% 666M 3s
#6 5.515 1150K .......... .......... .......... .......... .......... 27% 519M 3s
#6 5.515 1200K .......... .......... .......... .......... .......... 29% 463M 2s
#6 5.515 1250K .......... .......... .......... .......... .......... 30% 564M 2s
#6 5.515 1300K .......... .......... .......... .......... .......... 31% 648M 2s
#6 5.515 1350K .......... .......... .......... .......... .......... 32% 323M 2s
#6 5.515 1400K .......... .......... .......... .......... .......... 33% 146M 2s
#6 5.519 1450K .......... .......... .......... .......... .......... 34% 228M 2s
#6 5.519 1500K .......... .......... .......... .......... .......... 36% 236M 2s
#6 5.519 1550K .......... .......... .......... .......... .......... 37% 256M 2s
#6 5.519 1600K .......... .......... .......... .......... .......... 38% 594M 2s
#6 5.519 1650K .......... .......... .......... .......... .......... 39% 12.3M 2s
#6 5.520 1700K .......... .......... .......... .......... .......... 40% 18.5M 1s
#6 5.523 1750K .......... .......... .......... .......... .......... 41% 6.89M 1s
#6 5.530 1800K .......... .......... .......... .......... .......... 42% 6.81M 1s
#6 5.537 1850K .......... .......... .......... .......... .......... 44% 6.48M 1s
#6 5.544 1900K .......... .......... .......... .......... .......... 45% 5.90M 1s
#6 5.553 1950K .......... .......... .......... .......... .......... 46% 3.59M 1s
#6 5.566 2000K .......... .......... .......... .......... .......... 47% 4.76M 1s
#6 5.577 2050K .......... .......... .......... .......... .......... 48% 4.10M 1s
#6 5.588 2100K .......... .......... .......... .......... .......... 49% 2.83M 1s
#6 5.606 2150K .......... .......... .......... .......... .......... 51% 4.86M 1s
#6 5.616 2200K .......... .......... .......... .......... .......... 52% 4.59M 1s
#6 5.626 2250K .......... .......... .......... .......... .......... 53% 4.74M 1s
#6 5.637 2300K .......... .......... .......... .......... .......... 54% 4.81M 1s
#6 5.647 2350K .......... .......... .......... .......... .......... 55% 3.56M 1s
#6 5.661 2400K .......... .......... .......... .......... .......... 56% 4.78M 1s
#6 5.671 2450K .......... .......... .......... .......... .......... 58% 5.07M 1s
#6 5.680 2500K .......... .......... .......... .......... .......... 59% 4.48M 1s
#6 5.691 2550K .......... .......... .......... .......... .......... 60% 5.64M 1s
#6 5.700 2600K .......... .......... .......... .......... .......... 61% 4.87M 1s
#6 5.710 2650K .......... .......... .......... .......... .......... 62% 4.46M 1s
#6 5.721 2700K .......... .......... .......... .......... .......... 63% 5.82M 1s
#6 5.729 2750K .......... .......... .......... .......... .......... 65% 3.77M 1s
#6 5.742 2800K .......... .......... .......... .......... .......... 66% 4.43M 1s
#6 5.753 2850K .......... .......... .......... .......... .......... 67% 6.24M 1s
#6 5.761 2900K .......... .......... .......... .......... .......... 68% 4.62M 1s
#6 5.773 2950K .......... .......... .......... .......... .......... 69% 4.73M 1s
#6 5.782 3000K .......... .......... .......... .......... .......... 70% 5.80M 1s
#6 5.790 3050K .......... .......... .......... .......... .......... 72% 6.04M 0s
#6 5.799 3100K .......... .......... .......... .......... .......... 73% 5.47M 0s
#6 5.808 3150K .......... .......... .......... .......... .......... 74% 3.59M 0s
#6 5.821 3200K .......... .......... .......... .......... .......... 75% 6.57M 0s
#6 5.828 3250K .......... .......... .......... .......... .......... 76% 6.26M 0s
#6 5.836 3300K .......... .......... .......... .......... .......... 77% 5.99M 0s
#6 5.844 3350K .......... .......... .......... .......... .......... 78% 6.22M 0s
#6 5.852 3400K .......... .......... .......... .......... .......... 80% 5.03M 0s
#6 5.862 3450K .......... .......... .......... .......... .......... 81% 8.00M 0s
#6 5.868 3500K .......... .......... .......... .......... .......... 82% 7.15M 0s
#6 5.875 3550K .......... .......... .......... .......... .......... 83% 6.07M 0s
#6 5.883 3600K .......... .......... .......... .......... .......... 84% 5.95M 0s
#6 5.891 3650K .......... .......... .......... .......... .......... 85% 6.14M 0s
#6 5.899 3700K .......... .......... .......... .......... .......... 87% 5.27M 0s
#6 5.908 3750K .......... .......... .......... .......... .......... 88% 7.28M 0s
#6 5.915 3800K .......... .......... .......... .......... .......... 89% 5.48M 0s
#6 5.924 3850K .......... .......... .......... .......... .......... 90% 5.11M 0s
#6 5.933 3900K .......... .......... .......... .......... .......... 91% 10.4M 0s
#6 5.938 3950K .......... .......... .......... .......... .......... 92% 6.51M 0s
#6 5.946 4000K .......... .......... .......... .......... .......... 94% 7.11M 0s
#6 5.953 4050K .......... .......... .......... .......... .......... 95% 5.17M 0s
#6 5.962 4100K .......... .......... .......... .......... .......... 96% 5.79M 0s
#6 5.970 4150K .......... .......... .......... .......... .......... 97% 7.67M 0s
#6 5.977 4200K .......... .......... .......... .......... .......... 98% 7.88M 0s
#6 5.983 4250K .......... .......... .......... .......... .......... 99% 5.95M 0s
#6 5.991 4300K .... 100% 15.2M=1.5s
#6 5.993
#6 5.993 2023-02-28 11:39:27 (2.85 MB/s) - 'glibc-2.30-r0.apk' saved [4408199/4408199]
#6 5.993
#6 5.996 fetch https://dl-cdn.alpinelinux.org/alpine/v3.17/main/x86_64/APKINDEX.tar.gz
#6 6.271 fetch https://dl-cdn.alpinelinux.org/alpine/v3.17/community/x86_64/APKINDEX.tar.gz
#6 6.822 (1/1) Installing glibc (2.30-r0)
#6 6.832 ERROR: glibc-2.30-r0: trying to overwrite etc/nsswitch.conf owned by alpine-baselayout-data-3.4.0-r0.
#6 6.876 1 error; 20 MiB in 21 packages
------
executor failed running [/bin/sh -c mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2 && apk update && apk add ca-certificates wget && apk add ca-certificates && rm -rf /var/cache/apk/* && wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.30-r0/glibc-2.30-r0.apk && apk --no-cache add glibc-2.30-r0.apk]: exit code: 1
When a domain is provided to asnmap
, the input
value stored is the IP, not the domain:
$ echo "hackerone.com" | asnmap -silent -json
{"timestamp":"2023-04-21 10:44:57.438696847 -0600 MDT","input":"104.16.99.52","as_number":"AS9498","as_name":"BBIL-AP BHARTI Airtel Ltd.","as_country":"IN","as_range":["102.129.206.0/23","102.129.208.0/20","102.129.224.0/19","102.130.0.0/15","102.132.0.0/14","102.136.0.0/13","102.144.0.0/12","102.160.0.0/11","102.192.0.0/10","103.0.0.0/8","104.0.0.0/5","112.0.0.0/4"]}
{"timestamp":"2023-04-21 10:44:57.45290937 -0600 MDT","input":"104.16.100.52","as_number":"AS9498","as_name":"BBIL-AP BHARTI Airtel Ltd.","as_country":"IN","as_range":["102.129.206.0/23","102.129.208.0/20","102.129.224.0/19","102.130.0.0/15","102.132.0.0/14","102.136.0.0/13","102.144.0.0/12","102.160.0.0/11","102.192.0.0/10","103.0.0.0/8","104.0.0.0/5","112.0.0.0/4"]}
{"timestamp":"2023-04-21 10:44:57.471475348 -0600 MDT","input":"2606:4700::6810:6334","as_number":"AS13335","as_name":"CLOUDFLARENET","as_country":"US","as_range":["2606:4700::/47"]}
{"timestamp":"2023-04-21 10:44:57.485204484 -0600 MDT","input":"2606:4700::6810:6434","as_number":"AS13335","as_name":"CLOUDFLARENET","as_country":"US","as_range":["2606:4700::/47"]}
Based on the project's README and the user's choice in submitting a domain rather than an IP, this seems like a bug.
When running asnmap
, more often than not the tool will also include entire cloud ranges like Akamai, Cloudflare, Google Cloud, etc. Would it be possible to either filter out these ranges, or add a flag which filters them out (e.g.: -no-cloud
, or -no-shared
)?
I always notice that whenever I use asnmap I always end up accidentally scanning humongous ranges which aren't even relevant to the target, resulting in lots of lost time. An example of this is when I scan my own website which is hosted at Netlify. ASNmap returns a range owned by Google, which would result in me scanning about 262142 hosts, far exceeding the expected scope.
$ echo paradoxis.nl | asnmap -json -silent | jq
{
"timestamp": "2022-12-23 13:02:07.036926759 +0000 UTC",
"input": "paradoxis.nl",
"as_number": "AS396982",
"as_name": "GOOGLE-CLOUD-PLATFORM",
"as_country": "US",
"as_range": [
"104.196.0.0/14"
]
}
The underlying API that asnmap uses is unstable, api.asnmap.sh/api/v1/asnmap?ip=X.X.X.X
the endpoint hangs and doesn't return results.
The tool itself is awesome when it works properly however it seems that the API is having issues.
I debugged through the code base and the code looks really good, however the API seems to be having issues and is unresponsive.
I also tried changing my IP address but am still getting the same errors.
[FTL] unexpected end of JSON input
essentially, the API doesn't respond resulting in an http request timeout in the call to c.makeRequest() in client.go on line 116
https://github.com/projectdiscovery/asnmap/blob/main/libs/client.go#L116
Do you experience the same results?
@ehsandeep
command used: asnmap -d att.com
/ _ | / / |/ / _ ___ ____
/ __ |\ / / ' / _ / _
// |///|////_,/ .__/
//
projectdiscovery.io
[INF] Current asnmap version v1.0.6 (latest)
[FTL] invalid character '<' looking for beginning of value`
System: Linux wsl
Multiple internal functions within libs triggers fatal errors with gologger.Fatal()
. These errors are all likely recoverable and should be propagated upstream:
Eg.
Line 206 in 5c98487
Hey,
When using the script and parsing the -org flag using a example such as google, results are not returned if you use "google" however "GOOGLE" does parse ranges.
I suggest the script uppercases org flag input if api.asnmap.sh uses this format.
:)
For example:
asnmap -a AS20001 -c -silent
asnmap -a AS20001 -c
vs
asnmap -a AS20001 -c -silent -o myoutput.txt
The former produces no output and the latter works as intended. Previously, both worked as expected. The first would output CSV data to stdout and the second would write CSV data to a file.
I think this might be due to a recent change in runner.go (line 61) but haven't done enough testing to confirm.
Release 1.0.1 couldn't correctly generate assets due to a git commit hash mismatch. A new release, 1.0.2, should be generated after the dev
=> main
merge. Todo:
dev
to main
v1.0.2
Ref: https://github.com/projectdiscovery/asnmap/actions/runs/4323004122
For those who are connected to corporate networks with required proxy to access the Internet.
-p, -proxy list of proxy to use (comma separated or file input)
Should support:
UPDATE:
-up, -update update asnmap to the latest version
-duc, -disable-update-check disable automatic update check
Take for example:
asnmap -a AS20940 -j
vs
asnmap -a AS20940 -j -o test.json
The latter of the two does not work, it's not a big deal as can just redirect stdout to a file but ideally -o
should write the results to a file.
Description:
When using the ASNmap tool with the command asnmap -a AS5650
, an error occurs with the following details:
$ asnmap -a AS5650
___ _____ __
/ _ | / __/ |/ /_ _ ___ ____
/ __ |_\ \/ / ' \/ _ / _ \
/_/ |_/___/_/|_/_/_/_/\_,_/ .__/
/_/
projectdiscovery.io
[INF] Current asnmap version v1.0.6 (latest)
[FTL] invalid character 'e' looking for beginning of value
Steps to Reproduce:
asnmap -a AS5650
in the terminal.Expected Behavior:
The ASNmap tool should execute the command without any errors and provide the expected output for the specified Autonomous System Number (AS5650).
Additional Information:
This issue is affecting the proper functionality of ASNmap, and it would be great if it could be addressed in the next release.
It seems like when given hostnames with an underscore character (_
), asnmap
fails with an unmarshalling error.
/ # asnmap -d test_.google.com
___ _____ __
/ _ | / __/ |/ /_ _ ___ ____
/ __ |_\ \/ / ' \/ _ / _ \
/_/ |_/___/_/|_/_/_/_/\_,_/ .__/
/_/
projectdiscovery.io
[INF] Current asnmap version v1.1.0 (latest)
[FTL] json: cannot unmarshal string into Go value of type []*asnmap.Response
It seems like asnmap is is facing some bugs due to the asnmap version check api being down. I am currently using the latest version of asnmap, but it seems that we the https://api.pdtm.sh/api/v1/tools/asnmap?arch=amd64&go_version=go1.20.4&os=linux&v=v1.0.4 cannot be reached
I queried asnmap for an IP / ASN known to me through work. See attached screenshot.
For comparison purposes, here's a screenshot of the same query against Team Cymru's IP to ASN lookup.
The Cymru mapping to NYLI-AS is correct. The asnmap data is not, or at least does not include the distinct mapping to NYLI-AS.
Even the Cymru data is not complete. The network allocation is larger than /24, it's /19. https://whois.domaintools.com/206.210.19.0
Multiple calls to Client.GetData
for close network IPs/CIDRs causes valid results to be removed from the response due to some internal embedded deduplication logic. As a client instance, it would be expected that the function returns stable results or an error.
asnmap -org GOOGLE -silent
[FTL] invalid character '<' looking for beginning of value
root@vmi1343274:~/ALL/ford#
$ go/bin/asnmap -v -org GOOGLE
___ _____ __
/ _ | / __/ |/ /_ _ ___ ____
/ __ |_\ \/ / ' \/ _ / _ \
/_/ |_/___/_/|_/_/_/_/\_,_/ .__/
/_/ v1.0.2
projectdiscovery.io
[FTL] unexpected end of JSON input
┌──(kali㉿kali)-[~]
└─$ go install github.com/projectdiscovery/asnmap/cmd/asnmap@latest
┌──(kali㉿kali)-[~]
└─$ asnmap -h
Trying to figure out why the data returned from asnmap is different from the data provided by bgpview.
With asnmap I receive 7 prefixes:
> asnmap -a AS6431 -silent
12.106.32.0/22
204.178.0.0/20
207.76.218.0/24
207.140.168.0/24
192.20.225.0/24
135.197.0.0/16
135.205.0.0/16
135.207.0.0/16
and with bgpview I receive 17 prefixes:
https://bgpview.io/asn/6431#prefixes-v4
Any idea what's happening in the background here?
Hello,
Hope all is well?
When i am running the following command:
asnmap -d google.com, i am recieving the following error:
[FTL] read udp 10.115.199.171:50612->8.8.8.8:53: i/o timeout
Not sure why i am recieving this error, is this fault on my side or on the application. Appreicate any help and answers.
Warm Regards,
-auth configure projectdiscovery cloud (pdcp) api key
Note:
- need to make sure other projects depended on asnmap as library like httpx and dnsx with
-asn
is able to read token from env- unauth api will be deprecated soon after release of new client.
- Host: https://asn.projectdiscovery.io
AFAICT it is not currently possible to use the v1.0.0 tag of this repo, as there is an inconsistency with the git repo tagging and the version of the package cached in proxy.golang.org
under v1.0.0, potentially due to re-tagging a later commit with the v1.0.0 tag.
Specifically the version cached in the proxy looks to be based off this commit (hash h1:h9aUEHT3gEWgeTxDCd0UMxBw1yPthDwL1ogqUWnkBXo=
) whereas the git repo tag is based on a later commit (hash: h1:SrUb+bDqpFecmbHSKhwFppPtNk4trWJs3MhNhwpY/p8=
)
As a result we get a warning when trying to use the package.
verifying github.com/projectdiscovery/[email protected]: checksum mismatch
downloaded: h1:SrUb+bDqpFecmbHSKhwFppPtNk4trWJs3MhNhwpY/p8=
go.sum: h1:h9aUEHT3gEWgeTxDCd0UMxBw1yPthDwL1ogqUWnkBXo=
SECURITY ERROR
Could you please mint a new release, so that the versions are in sync?
Use utils.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.