aboutsummaryrefslogtreecommitdiff
path: root/2026/asn215540-report/censys-cli-queries.md
blob: 63fa51d0b3688cb1b1da562951b4923fb0fb0acc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Censys CLI Queries Used

## Prerequisites

The Censys API tools (`search_hosts`, `aggregate`) were non-functional for this dataset. All host search queries were run via the Censys CLI with `--streaming` NDJSON output.

## Queries

### Find all hosts in ASN 215540
```bash
censys search --quiet --streaming --max-pages 10 --page-size 100 \
  "host.autonomous_system.asn=215540"
```

### Find hosts by HASSH fingerprint within ASN
```bash
censys search --quiet --streaming --max-pages 5 --page-size 100 \
  "host.autonomous_system.asn=215540 AND host.services.ssh.hassh_fingerprint=e42184b06d45385a906f0803d04c83da"
```

### Find hosts by exact SSH banner within ASN
```bash
censys search --quiet --streaming --max-pages 5 --page-size 100 \
  'host.autonomous_system.asn=215540 AND host.services.ssh.endpoint_id.raw="SSH-2.0-OpenSSH_9.6p1 Ubuntu-3ubuntu13.16"'
```

### Find hosts in specific /24 block
```bash
censys search --quiet --streaming --max-pages 3 --page-size 100 \
  'host.ip: "92.118.112.0/24"'
```

### Find hosts by PTR pattern
```bash
censys search --quiet --streaming --max-pages 5 --page-size 100 \
  'host.dns.reverse_dns.names: "157279.ip-ptr.tech"'
```

## Field Extraction (jq)

### Extract IP, location, PTR (TSV)
```bash
jq -r '.host | [.ip, .location.city // "?", .location.country_code // "?", .dns.reverse_dns.names[0] // "no-ptr"] | @tsv'
```

### Extract SSH build info
```bash
jq -r '.host.services[]? | select(.protocol=="SSH") | .ssh.endpoint_id.raw // empty'
```

### Summary counts by IP block
```bash
jq -r '.host.autonomous_system.bgp_prefix' | sort | uniq -c | sort -rn
```