Skip to content

Commit 2333c70

Browse files
0.2.2; 2025-01-04
1 parent 4c66547 commit 2333c70

File tree

5 files changed

+63
-39
lines changed

5 files changed

+63
-39
lines changed

CHANGELOG.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
### version 0.2.1-2024-09-30
1+
### version 0.2.2; 2025-01-04
2+
```
3+
Added geo printout
4+
Updated Reverse Proxy / WAF list
5+
```
6+
### version 0.2.1; 2024-09-30
27
```
38
Refactored code
49
Refined flags
@@ -7,7 +12,7 @@ Added proxy / WAF checks
712
Added CloudFlare IP lookup
813
Added built-in subdomain lists
914
```
10-
### version 0.1.0-2023-12-15
15+
### version 0.1.0; 2023-12-15
1116
```
1217
Initial version
1318
```

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
[![Go Report Card](https://goreportcard.com/badge/github.com/cyclone-github/ipscope)](https://goreportcard.com/report/github.com/cyclone-github/ipscope)
44
[![GitHub issues](https://img.shields.io/github/issues/cyclone-github/ipscope.svg)](https://github.com/cyclone-github/ipscope/issues)
55
[![License](https://img.shields.io/github/license/cyclone-github/ipscope.svg)](LICENSE)
6-
<!-- [![GitHub release](https://img.shields.io/github/release/cyclone-github/ipscope.svg)](https://github.com/cyclone-github/ipscope/releases) -->
6+
[![GitHub release](https://img.shields.io/github/release/cyclone-github/ipscope.svg)](https://github.com/cyclone-github/ipscope/releases)
77
<!-- [![Go Reference](https://pkg.go.dev/badge/github.com/cyclone-github/ipscope.svg)](https://pkg.go.dev/github.com/cyclone-github/ipscope) -->
88

99
# IPScope
1010

1111
A CLI tool written in pure Go for IP lookup and subdomain discovery. Designed for security researchers and network administrators to resolve IP addresses for TLDs and subdomains. Includes support for some reverse proxy and WAF detection.
1212

13-
IPScope was written as a capable, no-fuss alternative to more complex CLI tools commonly used for subdomain discovery and active DNS resolution. IPScope features a simple CLI that only requires one command-line argument, the target URL, while maintaining a powerful backend and optional command-line arguments for further customization. Since it's written in Go, there's no need to hunt down outdated or obscure Python dependencies, and since it's written with ease of use in mind, there's no need to figure out complex command-line arguments -- **IPScope just works**.
13+
IPScope was written as a capable, no-fuss alternative to more complex CLI tools commonly used for subdomain discovery and active DNS resolution. IPScope features a simple CLI that only requires one command-line argument, the target URL, while maintaining a powerful backend and optional command-line arguments for further customization. Since it's written in Go, there's no need to hunt down outdated or obscure Python / Ruby dependencies, and since it's written with ease of use in mind, there's no need to figure out complex command-line arguments -- **IPScope just works**.
1414

1515
### Usage Instructions:
1616
Of course, don't run IPScope on domains you don't have permission to probe.
@@ -27,8 +27,8 @@ Of course, don't run IPScope on domains you don't have permission to probe.
2727
2828
Processing URL: example.org using DNS: 1.1.1.1
2929
30-
TLD example.org 93.184.215.14 AS15133 Edgecast Inc. (Reverse Proxy or WAF Detected)
31-
TLD www.example.org 93.184.215.14 AS15133 Edgecast Inc. (Reverse Proxy or WAF Detected)
30+
TLD example.org 93.184.215.14 AS15133 Edgecast Inc. Dźwirzyno, West Pomerania, PL (Reverse Proxy or WAF Detected)
31+
TLD www.example.org 93.184.215.14 AS15133 Edgecast Inc. Dźwirzyno, West Pomerania, PL (Reverse Proxy or WAF Detected)
3232
```
3333
- `./ipscope.bin -url example.org -sub subdomains.txt -dns 8.8.8.8`
3434

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module ipscope
22

3-
go 1.22.4
3+
go 1.23.4

main.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,27 @@ https://github.com/cyclone-github/ipscope/blob/main/LICENSE
2424
2525
Version History:
2626
27-
0.1.0-2023-12-15
27+
0.1.0; 2023-12-15
2828
Initial version
29-
0.2.1-2024-09-30
29+
0.2.1; 2024-09-30
3030
Refactored code
3131
Refined flags
3232
Added domain lookup from crt.sh
3333
Added proxy / WAF checks
3434
Added CloudFlare IP lookup
3535
Added built-in subdomain lists
36+
0.2.2; 2025-01-04
37+
Added geo printout
38+
Updated Reverse Proxy / WAF list
3639
*/
3740

3841
const cloudflareIPv4URL = "https://www.cloudflare.com/ips-v4/"
3942

4043
type IPInfo struct {
41-
Org string `json:"org"`
44+
Org string `json:"org"`
45+
Region string `json:"region"`
46+
Country string `json:"country"`
47+
City string `json:"city"`
4248
}
4349

4450
func main() {

utils.go

Lines changed: 42 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,15 @@ func printOutput(writer *tabwriter.Writer, label, domain string, ips []net.IP) {
5555
continue
5656
}
5757

58-
org, err := getIPInfo(ipv4.String())
58+
ipInfo, err := getIPInfo(ipv4.String())
5959
if err != nil {
60-
fmt.Fprintf(writer, "Error fetching organization info: %v\n", err)
60+
fmt.Fprintf(writer, "Error fetching IP info: %v\n", err)
6161
} else {
62-
isReverseProxy := checkCloudFlare(ipv4.String()) || checkKnownWAF(org)
62+
isReverseProxy := checkCloudFlare(ipv4.String()) || checkKnownWAF(ipInfo.Org)
6363
if isReverseProxy {
64-
fmt.Fprintf(writer, "%-3s\t%-24s\t%-20s\t%-24s (Reverse Proxy or WAF Detected)\n", label, domain, ipv4, org)
64+
fmt.Fprintf(writer, "%-3s\t%-25s\t%-16s\t%-32s\t %s, %s, %s (Reverse Proxy or WAF Detected)\n", label, domain, ipv4, ipInfo.Org, ipInfo.City, ipInfo.Region, ipInfo.Country)
6565
} else {
66-
fmt.Fprintf(writer, "%-3s\t%-24s\t%-20s\t%-24s\n", label, domain, ipv4, org)
66+
fmt.Fprintf(writer, "%-3s\t%-25s\t%-16s\t%-32s\t %s, %s, %s\n", label, domain, ipv4, ipInfo.Org, ipInfo.City, ipInfo.Region, ipInfo.Country)
6767
}
6868
}
6969
}
@@ -74,45 +74,58 @@ func printOutput(writer *tabwriter.Writer, label, domain string, ips []net.IP) {
7474
func checkKnownWAF(org string) bool {
7575
org = strings.ToLower(org)
7676
return strings.Contains(org, "cloudflare") || // Cloudflare
77+
strings.Contains(org, "360.cn") || // Qihoo 360
7778
strings.Contains(org, "akamai") || // Akamai
79+
strings.Contains(org, "aliyun") || // Alibaba Cloud
7880
strings.Contains(org, "amazon") || // Amazon AWS
79-
strings.Contains(org, "fastly") || // Fastly
80-
strings.Contains(org, "imperva") || // Imperva
81-
strings.Contains(org, "incapsula") || // Incapsula
82-
strings.Contains(org, "sucuri") || // Sucuri
83-
strings.Contains(org, "stackpath") || // StackPath
84-
strings.Contains(org, "f5") || // F5 Networks
85-
strings.Contains(org, "google") || // Google
86-
strings.Contains(org, "microsoft") || // Microsoft
81+
strings.Contains(org, "arvancloud") || // ArvanCloud
82+
strings.Contains(org, "aws waf") || // AWS WAF
83+
strings.Contains(org, "azure") || // Azure
84+
strings.Contains(org, "baidu") || // Baidu Cloud
8785
strings.Contains(org, "barracuda") || // Barracuda
86+
strings.Contains(org, "bitninja") || // BitNinja
87+
strings.Contains(org, "blazingfast") || // BlazingFast
88+
strings.Contains(org, "cdnsun") || // CDNSun
8889
strings.Contains(org, "citrix") || // Citrix
8990
strings.Contains(org, "cloudfront") || // CloudFront
90-
strings.Contains(org, "verizon") || // Verizon
91-
strings.Contains(org, "fortinet") || // Fortinet
92-
strings.Contains(org, "edgecast") || // Edgecast
91+
strings.Contains(org, "digitalocean") || // DigitalOcean
9392
strings.Contains(org, "dyn") || // Dyn
94-
strings.Contains(org, "radware") || // Radware
95-
strings.Contains(org, "azure") || // Azure
96-
strings.Contains(org, "arvancloud") || // ArvanCloud
93+
strings.Contains(org, "edgecast") || // Edgecast
94+
strings.Contains(org, "f5") || // F5 Networks
95+
strings.Contains(org, "fastly") || // Fastly
96+
strings.Contains(org, "fortinet") || // Fortinet
97+
strings.Contains(org, "gcore") || // Gcore
98+
strings.Contains(org, "google") || // Google
99+
strings.Contains(org, "imperva") || // Imperva
100+
strings.Contains(org, "incapsula") || // Imperva Incapsula
101+
strings.Contains(org, "incapsula") || // Incapsula
102+
strings.Contains(org, "kingsoft") || // Kingsoft Cloud
103+
strings.Contains(org, "limelight") || // Limelight Networks
104+
strings.Contains(org, "microsoft") || // Microsoft
105+
strings.Contains(org, "neustar") || // Neustar
97106
strings.Contains(org, "onapp") || // OnApp
98-
strings.Contains(org, "bitninja") || // BitNinja
107+
strings.Contains(org, "quantil") || // QUANTIL
108+
strings.Contains(org, "radware") || // Radware
99109
strings.Contains(org, "reblaze") || // Reblaze
100110
strings.Contains(org, "section.io") || // Section.io
101-
strings.Contains(org, "neustar") || // Neustar
102-
strings.Contains(org, "blazingfast") || // BlazingFast
103-
strings.Contains(org, "quantil") || // QUANTIL
104-
strings.Contains(org, "cdnsun") // CDNSun
111+
strings.Contains(org, "shield") || // Cloudflare Spectrum/Shield
112+
strings.Contains(org, "stackpath") || // StackPath
113+
strings.Contains(org, "stackrox") || // StackRox
114+
strings.Contains(org, "sucuri") || // Sucuri
115+
strings.Contains(org, "tencent") || // Tencent Cloud
116+
strings.Contains(org, "verizon") || // Verizon
117+
strings.Contains(org, "vultr") // Vultr
105118
}
106119

107120
// get org info from IP
108-
func getIPInfo(ip string) (string, error) {
121+
func getIPInfo(ip string) (*IPInfo, error) {
109122
url := fmt.Sprintf("https://ipinfo.io/%s/json", ip)
110123
backoffTime := initialBackoff
111124

112125
for {
113126
resp, err := http.Get(url)
114127
if err != nil {
115-
return "", err
128+
return nil, err
116129
}
117130
defer resp.Body.Close()
118131

@@ -137,10 +150,10 @@ func getIPInfo(ip string) (string, error) {
137150

138151
var ipInfo IPInfo
139152
if err := json.NewDecoder(resp.Body).Decode(&ipInfo); err != nil {
140-
return "", err
153+
return nil, err
141154
}
142155

143-
return ipInfo.Org, nil
156+
return &ipInfo, nil
144157
}
145158
}
146159

@@ -210,7 +223,7 @@ func isValidPublicIPv4(ip net.IP) bool {
210223

211224
// version info
212225
func versionFunc() {
213-
fmt.Fprintln(os.Stderr, "Cyclone's IPScope v0.2.1-2024-09-30\nhttps://github.com/cyclone-github/ipscope\n")
226+
fmt.Fprintln(os.Stderr, "Cyclone's IPScope v0.2.2; 2025-01-04\nhttps://github.com/cyclone-github/ipscope\n")
214227
}
215228

216229
// cyclone

0 commit comments

Comments
 (0)