Skip to content

Commit

Permalink
minor fixes (#6)
Browse files Browse the repository at this point in the history
* small changes

[^] README.md | fixed typo, added error to examples
[^] gomap_test.go | changed to panic()
[^] gomap_syn_scan.go | removed redundant struct names
[^] gomap_ports.go | changed vnc from 5550 to 5900, added tor, dnp, skype, RDP and mongoDB
[^] gomap_funcs.go | removed punctuation because errors should not end with punctuation or a newline

* added a few common ports
  • Loading branch information
schmenn authored Mar 23, 2021
1 parent 1b30be6 commit a2a8eb0
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 30 deletions.
52 changes: 29 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Gomap is a fully self-contained nmap like module for Golang. Unlike other projec
## Features
- Parallel port scanning using go routines
- Automated CIDR range scanning
- Service perdiction by port number
- Service prediction by port number
- SYN (Silent) Scanning Mode
- UDP Scanning (Non-Stealth)
- Fast and detailed scanning for common ports
Expand All @@ -31,20 +31,23 @@ Performs a fastscan for the most common ports on every IP on a local range
package main

import (
"fmt"
"fmt"

"github.com/JustinTimperio/gomap"
"github.com/JustinTimperio/gomap"
)

func main() {
var (
proto = "tcp"
fastscan = true
syn = false
)

scan := gomap.ScanRange(proto, fastscan, syn)
fmt.Printf(scan.String())
var (
proto = "tcp"
fastscan = true
syn = false
)

scan, err := gomap.ScanRange(proto, fastscan, syn)
if err != nil {
// handle error
}
fmt.Printf(scan.String())
}
```
2. `go mod init quickscan`
Expand Down Expand Up @@ -84,22 +87,25 @@ Performs a detailed stealth scan on a single IP
package main

import (
"fmt"
"fmt"

"github.com/JustinTimperio/gomap"
"github.com/JustinTimperio/gomap"
)

func main() {
// Stealth scans MUST be run as root/admin
var (
fastscan = false
syn = true
proto = "tcp"
ip = "192.168.1.120"
)

scan := gomap.ScanIP(ip, proto, fastscan, syn)
fmt.Printf(scan.String())
// Stealth scans MUST be run as root/admin
var (
fastscan = false
syn = true
proto = "tcp"
ip = "192.168.1.120"
)

scan, err := gomap.ScanIP(ip, proto, fastscan, syn)
if err != nil {
// handle error
}
fmt.Printf(scan.String())
}
```
2. `go mod init stealthmap`
Expand Down
2 changes: 1 addition & 1 deletion gomap_funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,5 @@ func getLocalIP() (string, error) {
}
}
}
return "", fmt.Errorf("No IP Found!")
return "", fmt.Errorf("No IP Found")
}
25 changes: 24 additions & 1 deletion gomap_ports.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,27 @@ var commonlist = map[int]string{
23: "telnet",
25: "smtp",
43: "whois",
50: "IPSec",
51: "IPSec",
53: "dns",
67: "dhcp",
68: "dhcp",
69: "TFTP",
80: "http",
88: "kerberos",
110: "pop3",
111: "rpc",
115: "sftp",
119: "nntp",
123: "ntp",
137: "netbios",
138: "netbios",
139: "netbios",
143: "imap4",
156: "sql server",
161: "SNMP",
162: "SNMP",
389: "LDAP",
443: "https",
513: "rlogin",
540: "uucp",
Expand All @@ -41,15 +48,31 @@ var commonlist = map[int]string{
2082: "cpanel",
2083: "cpanel",
3306: "mysql",
3389: "RDP",
5000: "unpn",
5432: "psql",
5550: "vnc server",
5500: "vnc server",
5900: "vnc server",
5938: "teamviewer",
8000: "http-alt",
8080: "https-proxy",
8333: "VMware Web Access",
8443: "https-alt",
8998: "I2P",
9030: "Tor",
9050: "Tor",
9051: "Tor",
9150: "Tor Browser",
9200: "elasticsearch",
9418: "git",
9987: "Teamspeak 3 voice",
19999: "DNP",
23399: "Skype",
25565: "minecraft",
27017: "MongoDB",
28015: "Rust (Video Game)",
43594: "runescape",
43595: "runescape",
}

var detailedlist = map[int]string{
Expand Down
4 changes: 2 additions & 2 deletions gomap_syn_scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ import (
func sendSyn(laddr string, raddr string, sport uint16, dport uint16) error {
// Create TCP packet struct and header
op := []tcpOption{
tcpOption{
{
Kind: 2,
Length: 4,
Data: []byte{0x05, 0xb4},
},
tcpOption{
{
Kind: 0,
},
}
Expand Down
5 changes: 2 additions & 3 deletions gomap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ func TestMain(m *testing.M) {
results, err := gomap.ScanRange(proto, fastscan, stealth)

if err != nil {
fmt.Println(err)
} else {
fmt.Println(results)
panic(err)
}
fmt.Println(results.String())
}

0 comments on commit a2a8eb0

Please sign in to comment.