加入netbios探测、域控识别

This commit is contained in:
shadow1ng
2021-04-21 00:13:04 +08:00
parent 323d786c66
commit 27324dc4a5
21 changed files with 80 additions and 66 deletions
+6 -2
View File
@@ -117,6 +117,9 @@ func ParseInput(Info *HostInfo) {
if TmpSave == true {
IsSave = false
}
if Info.Ports == DefaultPorts {
Info.Ports += Webport
}
}
func ParseScantype(Info *HostInfo) {
@@ -127,13 +130,14 @@ func ParseScantype(Info *HostInfo) {
if Info.Scantype != "all" {
if Info.Ports == DefaultPorts {
switch Info.Scantype {
case "webtitle":
case "web":
Info.Ports = Webport
case "ms17010":
Info.Ports = "445"
case "cve20200796":
Info.Ports = "445"
case "portscan":
case "main":
Info.Ports = DefaultPorts
default:
port, _ := PORTList[Info.Scantype]
Info.Ports = strconv.Itoa(port)
+2 -22
View File
@@ -24,34 +24,14 @@ var PORTList = map[string]int{
"smb": 445,
"ms17010": 1000001,
"cve20200796": 1000002,
"webtitle": 1000003,
"web": 1000003,
"elastic": 9200,
"findnet": 135,
"netbios": 139,
"all": 0,
"portscan": 0,
"icmp": 0,
}
var PortlistBack = map[string]int{
"ftp": 21,
"ssh": 22,
"mem": 11211,
"mgo": 27017,
"mssql": 1433,
"psql": 5432,
"redis": 6379,
"mysql": 3306,
"smb": 445,
"ms17010": 1000001,
"cve20200796": 1000002,
"webtitle": 1000003,
"elastic": 9200,
"findnet": 135,
"NetBIOS": 139,
"all": 0,
"portscan": 0,
"icmp": 0,
"main": 0,
}
var Outputfile = getpath() + "result.txt"
-1
View File
@@ -18,7 +18,6 @@ func Banner() {
func Flag(Info *HostInfo) {
Banner()
DefaultPorts += Webport
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(&Info.Ports, "p", DefaultPorts, "Select a port,for example: 22 | 1-65535 | 22,80,3306")
flag.StringVar(&Info.Command, "c", "", "exec command (ssh)")
+9 -1
View File
@@ -60,7 +60,15 @@ func CheckErrs(err error) bool {
if err == nil {
return false
}
errs := []string{"closed by the remote host", "too many connections", "i/o timeout", "EOF", "A connection attempt failed", "established connection failed", "connection attempt failed", "Unable to read", "is not allowed to connect to this", "no pg_hba.conf entry", "no supported methods remain"}
errs := []string{
"closed by the remote host", "too many connections",
"i/o timeout", "EOF", "A connection attempt failed",
"established connection failed", "connection attempt failed",
"Unable to read", "is not allowed to connect to this",
"no pg_hba.conf entry",
"no supported methods remain",
"No connection could be made",
}
for _, key := range errs {
if strings.Contains(strings.ToLower(err.Error()), strings.ToLower(key)) {
return true