mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-25 12:41:53 +08:00
Update
This commit is contained in:
+20
-20
@@ -101,7 +101,7 @@ func ParsePass(Info *HostInfo) {
|
||||
newport += port + ","
|
||||
}
|
||||
}
|
||||
Info.Ports = newport
|
||||
Ports = newport
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -140,15 +140,15 @@ func ParseInput(Info *HostInfo) {
|
||||
IsSave = false
|
||||
}
|
||||
|
||||
if Info.Ports == DefaultPorts {
|
||||
Info.Ports += "," + Webport
|
||||
if Ports == DefaultPorts {
|
||||
Ports += "," + Webport
|
||||
}
|
||||
|
||||
if PortAdd != "" {
|
||||
if strings.HasSuffix(Info.Ports, ",") {
|
||||
Info.Ports += PortAdd
|
||||
if strings.HasSuffix(Ports, ",") {
|
||||
Ports += PortAdd
|
||||
} else {
|
||||
Info.Ports += "," + PortAdd
|
||||
Ports += "," + PortAdd
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,35 +219,35 @@ func ParseScantype(Info *HostInfo) {
|
||||
if !ok {
|
||||
showmode()
|
||||
}
|
||||
if Scantype != "all" && Info.Ports == DefaultPorts+","+Webport {
|
||||
if Scantype != "all" && Ports == DefaultPorts+","+Webport {
|
||||
switch Scantype {
|
||||
case "wmiexec":
|
||||
Info.Ports = "135"
|
||||
Ports = "135"
|
||||
case "wmiinfo":
|
||||
Info.Ports = "135"
|
||||
Ports = "135"
|
||||
case "smbinfo":
|
||||
Info.Ports = "445"
|
||||
Ports = "445"
|
||||
case "hostname":
|
||||
Info.Ports = "135,137,139,445"
|
||||
Ports = "135,137,139,445"
|
||||
case "smb2":
|
||||
Info.Ports = "445"
|
||||
Ports = "445"
|
||||
case "web":
|
||||
Info.Ports = Webport
|
||||
Ports = Webport
|
||||
case "webonly":
|
||||
Info.Ports = Webport
|
||||
Ports = Webport
|
||||
case "ms17010":
|
||||
Info.Ports = "445"
|
||||
Ports = "445"
|
||||
case "cve20200796":
|
||||
Info.Ports = "445"
|
||||
Ports = "445"
|
||||
case "portscan":
|
||||
Info.Ports = DefaultPorts + "," + Webport
|
||||
Ports = DefaultPorts + "," + Webport
|
||||
case "main":
|
||||
Info.Ports = DefaultPorts
|
||||
Ports = DefaultPorts
|
||||
default:
|
||||
port, _ := PORTList[Scantype]
|
||||
Info.Ports = strconv.Itoa(port)
|
||||
Ports = strconv.Itoa(port)
|
||||
}
|
||||
fmt.Println("-m ", Scantype, " start scan the port:", Info.Ports)
|
||||
fmt.Println("-m ", Scantype, " start scan the port:", Ports)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,9 @@ func ParsePort(ports string) (scanPorts []int) {
|
||||
if port == "" {
|
||||
continue
|
||||
}
|
||||
if PortGroup[port] != "" {
|
||||
port = PortGroup[port]
|
||||
}
|
||||
upper := port
|
||||
if strings.Contains(port, "-") {
|
||||
ranges := strings.Split(port, "-")
|
||||
|
||||
@@ -82,6 +82,7 @@ type PocInfo struct {
|
||||
}
|
||||
|
||||
var (
|
||||
Ports string
|
||||
Path string
|
||||
Scantype string
|
||||
Command string
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ func Flag(Info *HostInfo) {
|
||||
Banner()
|
||||
flag.StringVar(&Info.Host, "h", "", "IP address of the host you want to scan,for example: 192.168.11.11 | 192.168.11.11-255 | 192.168.11.11,192.168.11.12")
|
||||
flag.StringVar(&NoHosts, "hn", "", "the hosts no scan,as: -hn 192.168.1.1/24")
|
||||
flag.StringVar(&Info.Ports, "p", DefaultPorts, "Select a port,for example: 22 | 1-65535 | 22,80,3306")
|
||||
flag.StringVar(&Ports, "p", DefaultPorts, "Select a port,for example: 22 | 1-65535 | 22,80,3306")
|
||||
flag.StringVar(&PortAdd, "pa", "", "add port base DefaultPorts,-pa 3389")
|
||||
flag.StringVar(&UserAdd, "usera", "", "add a user base DefaultUsers,-usera user")
|
||||
flag.StringVar(&PassAdd, "pwda", "", "add a password base DefaultPasses,-pwda password")
|
||||
|
||||
Reference in New Issue
Block a user