Skip to content

Commit

Permalink
don't print empty summary info
Browse files Browse the repository at this point in the history
  • Loading branch information
jreisinger committed Apr 19, 2022
1 parent cbb9a4d commit 7467c30
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ $ checkip 218.92.0.158
abuseipdb.com --> domain: chinatelecom.com.cn, usage type: Data Center/Web Hosting/Transit
db-ip.com --> country: China (CN), city: Nanjing (Jiangning Qu), EU member: false
dns mx --> chinatelecom.com.cn: testmail.chinatelecom.com.cn
dns name --> n/a
iptoasn.com --> AS description: CHINANET-BACKBONE No.31,Jin-rong Street
maxmind.com --> country: China (CN), city: Caolin, EU member: false
phishstats.info --> n/a
shodan.io --> OS: n/a, 2 open ports: tcp/22 (OpenSSH, 7.4), tcp/53
urlscan.io --> 0 related URLs
virustotal.com --> network: 218.92.0.0/16, SAN: n/a
Expand Down Expand Up @@ -40,14 +38,13 @@ Active checks (`-a`) directly interact with the IP address. And scan checks (`-s
$ checkip -a -s 45.33.32.156 # scanme.nmap.org
checkip: Tls: dial tcp 45.33.32.156:443: connect: connection refused
Open TCP ports --> 22 (ssh), 80 (http), 9929 (nping-echo), 31337 (Elite)
Ping --> 0% packet loss, sent 5, recv 5, avg round-trip 169 ms
Ping --> 0% packet loss, sent 5, recv 5, avg round-trip 168 ms
abuseipdb.com --> domain: linode.com, usage type: Data Center/Web Hosting/Transit
db-ip.com --> country: United States (US), city: Fremont, EU member: false
dns mx --> linode.com: inbound-mail1.linode.com, inbound-mail3.linode.com
dns name --> scanme.nmap.org
iptoasn.com --> AS description: LINODE-AP Linode, LLC
maxmind.com --> country: United States (US), city: Fremont, EU member: false
phishstats.info --> n/a
shodan.io --> OS: n/a, 3 open ports: tcp/22 (OpenSSH, 6.6.1p1 Ubuntu-2ubuntu2.13), tcp/80 (Apache httpd, 2.4.7), udp/123
urlscan.io --> 0 related URLs
virustotal.com --> network: 45.33.0.0/17, SAN: n/a
Expand Down
2 changes: 1 addition & 1 deletion check/dnsname.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
type Names []string

func (n Names) Summary() string {
return na(strings.Join(n, ", "))
return strings.Join(n, ", ")
}

func (n Names) Json() ([]byte, error) {
Expand Down
2 changes: 1 addition & 1 deletion check/phishstats.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type phishstats struct {
}

func (ps phishstats) Summary() string {
return na(ps.url)
return ps.url
}

func (ps phishstats) Json() ([]byte, error) {
Expand Down
4 changes: 2 additions & 2 deletions cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ func (rs Results) SortByName() {
func (rs Results) PrintSummary() {
for _, r := range rs {
// To avoid "invalid memory address or nil pointer dereference"
// runtime error.
if r.Info == nil {
// runtime error and printing empty summary info.
if r.Info == nil || r.Info.Summary() == "" {
continue
}

Expand Down

0 comments on commit 7467c30

Please sign in to comment.