ASNmap أداة مسح أرقام النظام المستقل (ASN) - ورقة الحيل
نظرة عامة
ASNmap هي أداة سريعة ومتعددة الاستخدامات طورها مشروع Discovery لرسم خرائط أرقام النظام المستقل (ASNs) إلى نطاقات IP المقابلة ومعلومات المنظمة. وهي توفر طريقة بسيطة وفعالة لاسترداد بيانات ASN، والتي تعتبر أساسية للاستطلاع الشبكي ورسم سطح الهجوم.
ما يميز ASNmap عن أدوات البحث عن ASN الأخرى هو سرعته وبساطته وتعدد استخداماته. فهو يدعم تنسيقات إدخال متعددة، بما في ذلك أرقام ASN، وعناوين IP، وأسماء النطاقات، وأسماء المنظمات، مما يجعله أداة مرنة لسيناريوهات الاستطلاع المختلفة. يمكن لـ ASNmap استرداد نطاقات IP المرتبطة بمنظمات أو أنظمة مستقلة محددة، مما يساعد المتخصصين في الأمن على فهم البصمة الشبكية لأهدافهم.
يتم استخدام ASNmap بشكل شائع في المراحل الأولى من التقييمات الأمنية والبحث عن الثغرات للتعرف على مساحة IP التابعة للمنظمات المستهدفة. هذه المعلومات ضرورية للأنشطة اللاحقة من المسح والحصر. يمكن دمج الأداة بسهولة في سير عمل الأمن ودمجها مع أدوات الاستطلاع الأخرى لأتمتة عملية رسم سطح الهجوم.
Would you like me to continue with the remaining sections?```bash
Install using Go (requires Go 1.20 or later)
go install -v github.com/projectdiscovery/asnmap/cmd/asnmap@latest
Verify installation
asnmap -version
### Using Docker
```bash
# Pull the latest Docker image
docker pull projectdiscovery/asnmap:latest
# Run ASNmap using Docker
docker run -it projectdiscovery/asnmap:latest -h
Using Homebrew (macOS)
# Install using Homebrew
brew install asnmap
# Verify installation
asnmap -version
Using PDTM (Project Discovery Tools Manager)
# Install PDTM first if not already installed
go install -v github.com/projectdiscovery/pdtm/cmd/pdtm@latest
# Install ASNmap using PDTM
pdtm -i asnmap
# Verify installation
asnmap -version
On Kali Linux
# Install using apt
sudo apt install asnmap
# Verify installation
asnmap -version
Basic Usage
Querying ASN Information
# Query by ASN number
asnmap -asn AS15169
# Query by IP address
asnmap -ip 8.8.8.8
# Query by domain name
asnmap -d google.com
# Query by organization name
asnmap -org "Google LLC"
Multiple Queries
# Query multiple ASNs
asnmap -asn AS15169,AS13414
# Query multiple IPs
asnmap -ip 8.8.8.8,1.1.1.1
# Query multiple domains
asnmap -d google.com,cloudflare.com
# Query multiple organizations
asnmap -org "Google LLC,Cloudflare, Inc."
Input from Files
# Query from a file containing ASNs
asnmap -asn-file asns.txt
# Query from a file containing IPs
asnmap -ip-file ips.txt
# Query from a file containing domains
asnmap -d-file domains.txt
# Query from a file containing organizations
asnmap -org-file orgs.txt
Input from STDIN
# Query from STDIN
echo "AS15169"|asnmap
# Query from STDIN with specific input type
echo "8.8.8.8"|asnmap -i ip
# Query from STDIN with multiple input types
cat input.txt|asnmap -i ip,asn,domain
Output Options
# Save results to a file
asnmap -asn AS15169 -o results.txt
# Output in JSON format
asnmap -asn AS15169 -json -o results.json
# Output in CSV format
asnmap -asn AS15169 -csv -o results.csv
# Silent mode (only results)
asnmap -asn AS15169 -silent
Advanced Usage
Output Filtering
# Output only IP ranges
asnmap -asn AS15169 -r
# Output only ASN information
asnmap -asn AS15169 -a
# Output only organization information
asnmap -asn AS15169 -org-info
CIDR Expansion
# Expand CIDR ranges to individual IPs
asnmap -asn AS15169 -cidr-expand
# Limit CIDR expansion
asnmap -asn AS15169 -cidr-expand -limit 100
Filtering by Country
# Filter results by country
asnmap -asn AS15169 -c US
# Filter results by multiple countries
asnmap -asn AS15169 -c US,CA,UK
Filtering by Registry
# Filter results by registry
asnmap -asn AS15169 -registry ARIN
# Filter results by multiple registries
asnmap -asn AS15169 -registry ARIN,RIPE
Integration with Other Tools
Pipeline with Naabu
# Map ASN to IP ranges and scan for open ports
asnmap -asn AS15169 -silent|naabu -silent
# Map ASN to IP ranges, filter, and scan for open ports
asnmap -asn AS15169 -silent|grep -v ":"|naabu -silent
Pipeline with HTTPX
# Map ASN to IP ranges and probe for HTTP services
asnmap -asn AS15169 -silent|httpx -silent
# Map ASN to IP ranges, expand CIDRs, and probe for HTTP services
asnmap -asn AS15169 -cidr-expand -silent|httpx -silent
Pipeline with Nuclei
# Map ASN to IP ranges, probe for HTTP services, and scan for vulnerabilities
asnmap -asn AS15169 -silent|httpx -silent|nuclei -t cves/
# Map organization to IP ranges and scan for vulnerabilities
asnmap -org "Example Inc" -silent|httpx -silent|nuclei -t exposures/
Pipeline with MapCIDR
# Map ASN to IP ranges and split into smaller subnets
asnmap -asn AS15169 -silent|mapcidr -silent -split 256
# Map ASN to IP ranges, filter, and split into smaller subnets
asnmap -asn AS15169 -silent|grep -v ":"|mapcidr -silent -split 256
Output Customization
Custom Output Format
# Output only IP ranges
asnmap -asn AS15169 -silent -r
# Output ASN and IP ranges
asnmap -asn AS15169 -silent|awk '\\\\{print $1,$2\\\\}'
# Count total IP ranges
asnmap -asn AS15169 -silent|wc -l
# Sort output by IP range
asnmap -asn AS15169 -silent|sort
Filtering Output
# Filter by IP version (IPv4)
asnmap -asn AS15169 -silent|grep -v ":"
# Filter by IP version (IPv6)
asnmap -asn AS15169 -silent|grep ":"
# Filter by CIDR size
asnmap -asn AS15169 -silent|grep "/24"
# Filter by specific pattern
asnmap -asn AS15169 -silent|grep "192.168"
```## الفلترة المتقدمة
```bash
# Filter by CIDR prefix length
asnmap -asn AS15169 -silent|grep "/24"
# Filter by CIDR prefix length range
asnmap -asn AS15169 -silent|grep -E "/2[0-4]"
# Count IPs by CIDR prefix length
asnmap -asn AS15169 -silent|grep -E "/[0-9]+"|sort|uniq -c
```### الفلترة حسب إصدار IP
```bash
# Filter IPv4 addresses
asnmap -asn AS15169 -silent|grep -v ":"
# Filter IPv6 addresses
asnmap -asn AS15169 -silent|grep ":"
# Count IPv4 vs IPv6 addresses
asnmap -asn AS15169 -silent|grep -v ":"|wc -l # IPv4 count
asnmap -asn AS15169 -silent|grep ":"|wc -l # IPv6 count
```## استكشاف المشكلات
```bash
# Check if ASN exists
asnmap -asn AS15169 -v
# Try a different input type
asnmap -ip 8.8.8.8
# Try a different data source
asnmap -asn AS15169 -source cymru
```1. **لا توجد نتائج**
```bash
# Check internet connection
ping 8.8.8.8
# Increase timeout
asnmap -asn AS15169 -timeout 30
# Reduce concurrency
asnmap -asn AS15169 -c 5
# Add delay between requests
asnmap -asn AS15169 -delay 2
```2. **مشاكل الاتصال**
```bash
# Process ASNs one by one
for asn in $(cat asns.txt); do asnmap -asn $asn -o "$asn-ranges.txt"; done
# Enable verbose mode
asnmap -asn AS15169 -v
# Show debug information
asnmap -asn AS15169 -debug
# Check data sources
asnmap -list-sources
```3. **تقييد المعدل**
`$HOME/.config/asnmap/config.yaml`
```yaml
# Example configuration file
concurrency: 10
timeout: 30
sources:
- asnmap
- cymru
- ripe
```4. **مشاكل الذاكرة**
```bash
# Set ASNmap configuration via environment variables
export ASNMAP_CONCURRENCY=10
export ASNMAP_TIMEOUT=30
export ASNMAP_SOURCES=asnmap,cymru,ripe
| علم | وصف |
|---|---|
-asn | رقم(أرقام) ASN للاستعلام |
-asn-file | ملف يحتوي على أرقام ASN |
-ip | عناوين IP للاستعلام |
-ip-file | ملف يحتوي على عناوين IP |
-d, -domain | أسماء النطاق للاستعلام |
-d-file | ملف يحتوي على أسماء النطاقات |
-org | أسماء المنظمة (المنظمات) للاستعلام |
-org-file | ملف يحتوي على أسماء المنظمات |
-i, -input | أنواع الإدخال لـ STDIN (asn، ip، domain، org) |
-o, -output | ملف للكتابة إليه |
-json | اكتب المخرجات بتنسيق JSON |
-csv | اكتب المخرجات بتنسيق CSV |
-silent | قواعد: |
- أظهر فقط النتائج في المخرجات |
|
-v, -verbose| إظهار المخرجات التفصيلية | |-debug| إظهار معلومات التصحيح | |-r, -range-only| قم بإخراج نطاقات IP فقط | |-a, -asn-only| قم بإخراج معلومات ASN فقط | |-org-info| إخراج معلومات المنظمة فقط | |-cidr-expand| قم بتوسيع نطاقات CIDR إلى عناوين IP فردية | |-limit| الحد الأقصى لعدد عناوين IP للتوسيع | |-c, -country| تصفية النتائج حسب رمز/رموز الدولة | |-registry| تصفية النتائج حسب السجل/السجلات | |-source| مصدر/مصادر البيانات للاستخدام | |-list-sources| قائمة مصادر البيانات المتاحة | |-timeout| مهلة الطلبات بالثواني | |-delay| التأخير بين الطلبات بالثواني | |-version| إظهار إصدار ASNmap |### تصحيح الأخطاء
| نوع | وصف | مثال |
|---|---|---|
asn | رقم النظام المستقل | AS15169 |
ip | عنوان IP | ٨.٨.٨.٨ |
domain | اسم النطاق | google.com |
org | اسم المنظمة | جوجل ش.ذ.م.م |
| مصدر | وصف |
|---|---|
asnmap | قاعدة بيانات ASNmap الخاصة |
cymru | خدمة البحث عن ASN الخاصة بـ Team Cymru |
ripe | قاعدة بيانات RIPE NCC |
| حقل | وصف |
|---|---|
asn | رقم النظام المستقل |
range | نطاق IP بتنسيق CIDR |
org | اسم المنظمة |
country | رمز الدولة |
registry | سجل الإنترنت الإقليمي |
description | وصف ASN |
| https://docs.projectdiscovery.io/tools/asnmapيستخدم ASNmap ملف تكوين موجود في https://github.com/projectdiscovery/asnmap. يمكنك تخصيص الإعدادات المختلفة في هذا الملف: | |
| https://discord.gg/projectdiscovery |