Merge remote-tracking branch 'au/main' into refactoring

This commit is contained in:
ph
2023-07-26 12:10:27 +03:00
11 changed files with 71 additions and 23 deletions
+2 -2
View File
@@ -19,7 +19,7 @@ func NetBIOS(info common.HostInfo, flags common.Flags) error {
netbios, _ := NetBIOS1(info, flags)
output := netbios.String()
if len(output) > 0 {
result := fmt.Sprintf("[*] NetBios: %-15s %s ", info.Host, output)
result := fmt.Sprintf("[*] NetBios: %-15s %s", info.Host, output)
common.LogSuccess(result)
return nil
}
@@ -238,7 +238,7 @@ func (info NetBiosInfo) String() (output string) {
}
if text == "" {
} else if info.DomainControllers != "" {
output = fmt.Sprintf("[+]DC %-24s", text)
output = fmt.Sprintf("[+] DC:%-24s", text)
} else {
output = fmt.Sprintf("%-30s", text)
}
+3 -2
View File
@@ -10,6 +10,7 @@ import (
"sync"
"time"
"github.com/fatih/color"
"github.com/shadow1ng/fscan/common"
"golang.org/x/net/icmp"
)
@@ -29,9 +30,9 @@ func CheckLive(hostslist []string, ping bool, liveTop int) []string {
ExistHosts[ip] = struct{}{}
if !common.Silent {
if !ping {
fmt.Printf("(icmp) Target %-15s is alive\n", ip)
color.Green("(icmp) Target %-15s is alive\n", ip)
} else {
fmt.Printf("(ping) Target %-15s is alive\n", ip)
color.Green("(ping) Target %-15s is alive\n", ip)
}
}
AliveHosts = append(AliveHosts, ip)
+5 -4
View File
@@ -7,6 +7,7 @@ import (
"strings"
"sync"
"github.com/fatih/color"
"github.com/shadow1ng/fscan/WebScan/lib"
"github.com/shadow1ng/fscan/common"
)
@@ -24,9 +25,9 @@ func Scan(info common.HostInfo, flags common.Flags) {
web := strconv.Itoa(common.PORTList["web"])
ms17010 := strconv.Itoa(common.PORTList["ms17010"])
if len(Hosts) > 0 || len(info.HostPort) > 0 {
if !flags.NoPing && len(Hosts) > 0 {
if flags.NoPing == false && len(Hosts) > 0 {
Hosts = CheckLive(Hosts, flags.Ping, flags.LiveTop)
fmt.Println("[*] Icmp alive hosts len is:", len(Hosts))
color.Cyan("[*] Icmp alive hosts len is: %d", len(Hosts))
}
if flags.Scantype == "icmp" {
common.LogWG.Wait()
@@ -41,7 +42,7 @@ func Scan(info common.HostInfo, flags common.Flags) {
AlivePorts = NoPortScan(Hosts, info.Ports, flags)
} else if len(Hosts) > 0 {
AlivePorts = PortScan(Hosts, info.Ports, flags)
fmt.Println("[*] alive ports len is:", len(AlivePorts))
color.Cyan("[*] alive ports len is: %d", len(AlivePorts))
if flags.Scantype == "portscan" {
common.LogWG.Wait()
return
@@ -51,7 +52,7 @@ func Scan(info common.HostInfo, flags common.Flags) {
AlivePorts = append(AlivePorts, info.HostPort...)
AlivePorts = common.RemoveDuplicate(AlivePorts)
info.HostPort = nil
fmt.Println("[*] AlivePorts len is:", len(AlivePorts))
color.Cyan("[*] AlivePorts len is:", len(AlivePorts))
}
var severports []string //severports := []string{"21","22","135"."445","1433","3306","5432","6379","9200","11211","27017"...}