ftp默认列出前5个目录

This commit is contained in:
shadow1ng
2020-12-30 21:30:36 +08:00
parent df45b07ce8
commit fbf480b3a8
5 changed files with 54 additions and 10 deletions
+24 -1
View File
@@ -94,7 +94,11 @@ func ParseInput(Info *HostInfo) {
os.Exit(0)
}
if Info.Outputfile != "" {
Outputfile = Info.Outputfile
if !strings.Contains(Outputfile, "/") && !strings.Contains(Outputfile, `\`) {
Outputfile = getpath() + Info.Outputfile
} else {
Outputfile = Info.Outputfile
}
}
if Info.IsSave == true {
IsSave = false
@@ -116,6 +120,10 @@ func ParseScantype(Info *HostInfo) {
switch Info.Scantype {
case "webtitle":
Info.Ports = "80,81,443,7001,8000,8080,8089,9200"
case "ms17010":
Info.Ports = "445"
case "cve20200796":
Info.Ports = "445"
case "portscan":
default:
port, _ := PORTList[Info.Scantype]
@@ -132,3 +140,18 @@ func CheckErr(text string, err error) {
os.Exit(0)
}
}
func getpath() string {
filename := os.Args[0]
var path string
if strings.Contains(filename, "/") {
tmp := strings.Split(filename, `/`)
tmp[len(tmp)-1] = ``
path = strings.Join(tmp, `/`)
} else if strings.Contains(filename, `\`) {
tmp := strings.Split(filename, `\`)
tmp[len(tmp)-1] = ``
path = strings.Join(tmp, `\`)
}
return path
}