更新指纹、优化内存占用

This commit is contained in:
影舞者
2021-09-10 20:32:51 +08:00
parent 2e452a9695
commit d5665f03d6
20 changed files with 265 additions and 48 deletions
+5 -1
View File
@@ -104,6 +104,11 @@ func SmbGhostScan(info *common.HostInfo) error {
ip, port, timeout := info.Host, 445, time.Duration(info.Timeout)*time.Second
addr := fmt.Sprintf("%s:%v", info.Host, port)
conn, err := net.DialTimeout("tcp", addr, timeout)
defer func() {
if conn != nil{
conn.Close()
}
}()
if err != nil {
return err
}
@@ -117,7 +122,6 @@ func SmbGhostScan(info *common.HostInfo) error {
if err != nil {
return err
}
defer conn.Close()
if bytes.Contains(buff[:n], []byte("Public")) == true {
result := fmt.Sprintf("[+] %v CVE-2020-0796 SmbGhost Vulnerable", ip)
common.LogSuccess(result)