mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-22 03:10:42 +08:00
新增rdp扫描,新增添加端口参数-pa 3389(会在原有端口列表基础上,新增该端口)
This commit is contained in:
@@ -120,6 +120,14 @@ func ParseInput(Info *HostInfo) {
|
||||
if Info.Ports == DefaultPorts {
|
||||
Info.Ports += "," + Webport
|
||||
}
|
||||
|
||||
if PortAdd != "" {
|
||||
if strings.HasSuffix(Info.Ports, ",") {
|
||||
Info.Ports += PortAdd
|
||||
} else {
|
||||
Info.Ports += "," + PortAdd
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func ParseScantype(Info *HostInfo) {
|
||||
@@ -130,6 +138,8 @@ func ParseScantype(Info *HostInfo) {
|
||||
if Info.Scantype != "all" {
|
||||
if Info.Ports == DefaultPorts {
|
||||
switch Info.Scantype {
|
||||
case "rdp":
|
||||
Info.Ports = "3389"
|
||||
case "wmi":
|
||||
Info.Ports = "135"
|
||||
case "web":
|
||||
|
||||
@@ -5,6 +5,7 @@ var Userdict = map[string][]string{
|
||||
"mysql": {"root", "mysql"},
|
||||
"mssql": {"sa", "sql"},
|
||||
"smb": {"administrator", "admin", "guest"},
|
||||
"rdp": {"administrator", "admin", "guest"},
|
||||
"postgresql": {"postgres", "admin"},
|
||||
"ssh": {"root", "admin"},
|
||||
"mongodb": {"root", "admin"},
|
||||
@@ -19,6 +20,7 @@ var PORTList = map[string]int{
|
||||
"smb": 445,
|
||||
"mssql": 1433,
|
||||
"mysql": 3306,
|
||||
"rdp": 3389,
|
||||
"psql": 5432,
|
||||
"redis": 6379,
|
||||
"fcgi": 9000,
|
||||
@@ -93,4 +95,5 @@ var (
|
||||
NoPorts string
|
||||
NoHosts string
|
||||
SC string
|
||||
PortAdd string
|
||||
)
|
||||
|
||||
@@ -21,6 +21,7 @@ func Flag(Info *HostInfo) {
|
||||
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(&PortAdd, "pa", "", "add port base DefaultPorts,-pa 3389")
|
||||
flag.StringVar(&NoPorts, "pn", "", "the ports no scan,as: -pn 445")
|
||||
flag.StringVar(&Info.Command, "c", "", "exec command (ssh)")
|
||||
flag.StringVar(&Info.SshKey, "sshkey", "", "sshkey file (id_rsa)")
|
||||
|
||||
Reference in New Issue
Block a user