mirror of
https://github.com/shadow1ng/fscan.git
synced 2025-07-13 21:02:44 +08:00
Update CVE-2020-0796.go
This commit is contained in:
parent
a2a4afc41d
commit
fddfd08d01
@ -94,18 +94,18 @@ const (
|
||||
"\x00\x00\x00\x00"
|
||||
)
|
||||
|
||||
func SmbGhost(info common.HostInfo, flags common.Flags) error {
|
||||
if flags.IsBrute {
|
||||
func SmbGhost(info *common.HostInfo) error {
|
||||
if common.IsBrute {
|
||||
return nil
|
||||
}
|
||||
err := SmbGhostScan(info, flags)
|
||||
err := SmbGhostScan(info)
|
||||
return err
|
||||
}
|
||||
|
||||
func SmbGhostScan(info common.HostInfo, flags common.Flags) error {
|
||||
ip, port, timeout := info.Host, 445, time.Duration(flags.Timeout)*time.Second
|
||||
func SmbGhostScan(info *common.HostInfo) error {
|
||||
ip, port, timeout := info.Host, 445, time.Duration(common.Timeout)*time.Second
|
||||
addr := fmt.Sprintf("%s:%v", info.Host, port)
|
||||
conn, err := common.WrapperTcpWithTimeout("tcp", addr, common.Socks5{Address: flags.Socks5Proxy}, timeout)
|
||||
conn, err := common.WrapperTcpWithTimeout("tcp", addr, timeout)
|
||||
defer func() {
|
||||
if conn != nil {
|
||||
conn.Close()
|
||||
@ -119,15 +119,12 @@ func SmbGhostScan(info common.HostInfo, flags common.Flags) error {
|
||||
return err
|
||||
}
|
||||
buff := make([]byte, 1024)
|
||||
|
||||
_ = conn.SetReadDeadline(time.Now().Add(timeout))
|
||||
|
||||
err = conn.SetReadDeadline(time.Now().Add(timeout))
|
||||
n, err := conn.Read(buff)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if bytes.Contains(buff[:n], []byte("Public")) {
|
||||
if bytes.Contains(buff[:n], []byte("Public")) == true {
|
||||
result := fmt.Sprintf("[+] %v CVE-2020-0796 SmbGhost Vulnerable", ip)
|
||||
common.LogSuccess(result)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user