cdncheck icon indicating copy to clipboard operation
cdncheck copied to clipboard

cdncheck cli support + update

Open ehsandeep opened this issue 3 years ago • 1 comments

Continuation of https://github.com/projectdiscovery/cdncheck/pull/37

  • [x] CLI flag add / update
  • [x] JSON output

CLI option:

cdncheck is a tool for identifying the technology associated with ip network addresses.

Usage:
  ./cdncheck [flags]

Flags:
INPUT:
   -i, -inputs string[]  input ip / cidr to process
   -l, -list string      file input with list of ip / cidr to process

DETECTION:
   -cdn              display cdn ip
   -cloud            display cloud ip
   -waf              display waf ip

MATCHERS:
   -mcdn, -match-cdn string[]         match host with specified cdn provider (fastly, incapsula)
   -mcloud, -match-cloud string[]     match host with specified cloud provider (fastly, incapsula)
   -mwaf, -match-waf string[]         match host with specified waf provider (fastly, incapsula)

FILTER:
   -fcdn, -filter-cdn string[]        filter host with specified cdn provider (fastly, incapsula)
   -mcloud, -filter-cdn string[]      filter host with specified cloud provider (fastly, incapsula)
   -mwaf, -filter-cdn string[]        filter host with specified waf provider (fastly, incapsula)
   -e, -exclude      		      exclude detected ip from output

OUTPUT:
   -resp             display technology name in cli output
   -j, -json         write output in json format
   -o, -output       write output in plain format
   -version          display version of the project

JSON output:

{
  "timestamp": "2022-08-02T03:00:17.698783+05:30",
  "ip": "104.16.51.111",
  "cdn": true,
  "cdn_name": "cloudflare"
}

CLI examples:

$ cat ips

52.60.165.183
3.98.63.202
52.60.160.16
185.199.109.153
104.16.51.111
54.192.171.16
54.192.171.2
54.192.171.22
$ cat ips | cdncheck

104.16.51.111 
54.192.171.16
54.192.171.2
54.192.171.22
$ cat ips | cdncheck -resp

104.16.51.111 [waf] [cloudflare] 
54.192.171.16 [waf] [cloudflare] 
54.192.171.2 [cdn] [cloudfront] 
54.192.171.22 [cdn] [cloudfront] 
$ cat ips | cdncheck -resp -waf

104.16.51.111 [waf] [cloudflare] 
54.192.171.16 [waf] [cloudflare]
$ cat ips | cdncheck -e

52.60.165.183
3.98.63.202
52.60.160.16
185.199.109.153
$ cat ips | cdncheck -e -waf

52.60.165.183
3.98.63.202
52.60.160.16
185.199.109.153
54.192.171.2
54.192.171.22

Question: -e should already exclude -waf?

ehsandeep avatar Aug 01 '22 23:08 ehsandeep

here would be nice to accept as input

Domains
URLs
ASN
IP
IP:port
IP/CIDR
  • exclude-ips /match-ips would be great if was ips/cidr https://github.com/projectdiscovery/mapcidr/issues/48

  • also filter/match for cdn/cloud/waf https://github.com/projectdiscovery/httpx/issues/570

-fcdn <filter cdn>
-mcdn <match cdn>

-fcloud <filter cloud>
-mcloud <match cloud>

-fwaf <filter waf>
-mwaf <match waf>

brenocss avatar Aug 01 '22 23:08 brenocss