Skip to content

Commit 570bce6

Browse files
committed
update docs
1 parent b9f4124 commit 570bce6

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,30 @@
44

55
# checkip
66

7-
Sometimes I come across an IP address, for example when reviewing logs. And I'd like to find out more about this numerical label. Checkip is CLI tool and Go [library](https://pkg.go.dev/github.com/jreisinger/checkip/check) that provides information on and security posture of IP addresses. Most checks are passive. Active checks (like ping and tls) are not aggressive.
7+
Sometimes I come across an IP address, reviewing logs for example, and I want to know more about this numerical label. Checkip is CLI tool and Go [library](https://pkg.go.dev/github.com/jreisinger/checkip/check) that provides (security) information on IP addresses. It runs various checks to get the information. Most checks are passive, i.e. not interacting directly with the IP address. Active checks, like ping and tls, are not aggressive.
88

99
## Quick start
1010

1111
```
1212
$ go install github.com/jreisinger/checkip@latest
13-
$ checkip 91.228.166.47
13+
$ checkip 1.1.1.1 91.228.166.47
14+
--- 1.1.1.1 ---
15+
db-ip.com Sydney, Australia
16+
dns name one.one.one.one
17+
iptoasn.com CLOUDFLARENET
18+
is on AWS false
19+
isc.sans.edu attacks: 0, abuse contact: [email protected]
20+
ping 0% packet loss (5/5), avg round-trip 4 ms
21+
tls TLS 1.3, exp. 2026/01/21, cloudflare-dns.com, *.cloudflare-dns.com, one.one.one.one
22+
virustotal.com network: 1.1.1.0/24, SAN: cloudflare-dns.com, *.cloudflare-dns.com, one.one.one.one, 1.0.0.1, 1.1.1.1, 162.159.36.1, 162.159.46.1, 2606:4700:4700::1001, 2606:4700:4700::1111, 2606:4700:4700::64, 2606:4700:4700::6400
23+
malicious prob. 0% (0/12) ✅
1424
--- 91.228.166.47 ---
1525
db-ip.com Petržalka, Slovakia
1626
dns name skh1-webredir01-v.eset.com
1727
iptoasn.com ESET-AS
1828
is on AWS false
1929
isc.sans.edu attacks: 0, abuse contact: [email protected]
20-
ping 0% packet loss (5/5), avg round-trip 4 ms
30+
ping 0% packet loss (5/5), avg round-trip 5 ms
2131
tls TLS 1.3, exp. 2024/01/02!!, www.eset.com, eset.com
2232
virustotal.com network: 91.228.164.0/22, SAN: www.eset.com, eset.com
2333
malicious prob. 17% (2/12) 🤏
@@ -73,7 +83,7 @@ or download a [release](https://github.com/jreisinger/checkip/releases) binary (
7383

7484
## Configuration and cache
7585

76-
For some checks to start working you need to register on the related web site (like https://www.abuseipdb.com/) and get an API (or LICENSE) key. An absent key is not reported as an error, the check is simply not executed and `missingCredentials` JSON field is set to the name of the API key (like `ABUSEIPDB_API_KEY`).
86+
For some checks to start working you need to sign up on a web site (like https://www.abuseipdb.com) and get an API (or LICENSE) key. Checkip doesn't report an absent API key as an error; the check is simply not executed and `missingCredentials` JSON field is set to the name of the API key (like `ABUSEIPDB_API_KEY`).
7787

7888
Store the keys in `$HOME/.checkip.yaml` file:
7989

@@ -87,7 +97,7 @@ VIRUSTOTAL_API_KEY: aaaaaaaabbbbbbbbccccccccddddddddeeeeeeeeffffffff111111112222
8797

8898
You can also use environment variables with the same names.
8999

90-
Data used by some checks are downloaded (cached) to `$HOME/.checkip/` folder. They are periodically re-downloaded so they are fresh.
100+
Data used by some checks is downloaded (cached) to `$HOME/.checkip/` folder. Is gets periodically re-downloaded so it is fresh.
91101

92102
## Development
93103

cli/cli.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,10 @@ func (checks Checks) maliciousStats() (total, malicious int, prob float64) {
129129
return total, malicious, prob
130130
}
131131

132-
// GetIpAddrs parses IP addresses supplied as command line arguments or as
133-
// STDIN. It sends the received IP addresses down the ipaddrs channel.
134-
func GetIpAddrs(args []string, ipaddrs chan net.IP) {
132+
// GetIpAddrs parses IP addresses supplied as command line arguments or on
133+
// STDIN. It keeps sending the received IP addresses down the ipaddrs channel.
134+
// When there's no more input it closes the channel and returns.
135+
func GetIpAddrs(args []string, ipaddrs chan<- net.IP) {
135136
defer close(ipaddrs)
136137

137138
if len(args) == 0 { // get IP addresses from stdin.

0 commit comments

Comments
 (0)