mirror of
https://github.com/shadow1ng/fscan.git
synced 2025-07-14 05:12:36 +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"
|
"\x00\x00\x00\x00"
|
||||||
)
|
)
|
||||||
|
|
||||||
func SmbGhost(info common.HostInfo, flags common.Flags) error {
|
func SmbGhost(info *common.HostInfo) error {
|
||||||
if flags.IsBrute {
|
if common.IsBrute {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
err := SmbGhostScan(info, flags)
|
err := SmbGhostScan(info)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func SmbGhostScan(info common.HostInfo, flags common.Flags) error {
|
func SmbGhostScan(info *common.HostInfo) error {
|
||||||
ip, port, timeout := info.Host, 445, time.Duration(flags.Timeout)*time.Second
|
ip, port, timeout := info.Host, 445, time.Duration(common.Timeout)*time.Second
|
||||||
addr := fmt.Sprintf("%s:%v", info.Host, port)
|
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() {
|
defer func() {
|
||||||
if conn != nil {
|
if conn != nil {
|
||||||
conn.Close()
|
conn.Close()
|
||||||
@ -119,15 +119,12 @@ func SmbGhostScan(info common.HostInfo, flags common.Flags) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
buff := make([]byte, 1024)
|
buff := make([]byte, 1024)
|
||||||
|
err = conn.SetReadDeadline(time.Now().Add(timeout))
|
||||||
_ = conn.SetReadDeadline(time.Now().Add(timeout))
|
|
||||||
|
|
||||||
n, err := conn.Read(buff)
|
n, err := conn.Read(buff)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if bytes.Contains(buff[:n], []byte("Public")) == true {
|
||||||
if bytes.Contains(buff[:n], []byte("Public")) {
|
|
||||||
result := fmt.Sprintf("[+] %v CVE-2020-0796 SmbGhost Vulnerable", ip)
|
result := fmt.Sprintf("[+] %v CVE-2020-0796 SmbGhost Vulnerable", ip)
|
||||||
common.LogSuccess(result)
|
common.LogSuccess(result)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user