Skip to content

Commit

Permalink
redo scanner
Browse files Browse the repository at this point in the history
  • Loading branch information
NubeDev committed Jun 23, 2022
1 parent 37c8013 commit e0fc57d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion scanner/portlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ var portShortList = map[string]string{
"1615": "nube-rubix-bios",
"1616": "nube-rubix-service",
"1660": "nube-flow-framework",
"1770": "nube-rubix-apps",
"1661": "nube-edge",
"1662": "nube-assist",
"1663": "nube-automater",
"1880": "node-red",
"1883": "mqtt-broker",
}
4 changes: 2 additions & 2 deletions scanner/portscanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ func (inst *Scanner) ResoleAddress(ip string, count int, interfaceName string) (
if count > 254 {
count = 254
}
if count < 0 {
count = 1
if count <= 0 {
count = 254
}
if ip != "" {
err := ipUtil.IsIPAddrErr(ip)
Expand Down
4 changes: 2 additions & 2 deletions scanner/protscanner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (

func TestPortScanner(t *testing.T) {

ports := []string{"22", "1414", "1883", "1660", "502", "80", "7"}
ports := []string{"22", "1414", "1883", "1662", "502", "80", "7"}

address, err := New().ResoleAddress("", 50, "wlp3s0")
address, err := New().ResoleAddress("", 254, "wlp3s0")
if err != nil {
fmt.Println("err msg", err)
return
Expand Down

0 comments on commit e0fc57d

Please sign in to comment.