mirror of
https://github.com/shadow1ng/fscan.git
synced 2025-07-13 21:02:44 +08:00
修改多个用户认证成功的问题。然后由于smb误报率较高,将会默认不开启了,待加入smb指纹后再开启,但可以-m smb用于口令碰撞
This commit is contained in:
parent
600904b41a
commit
d468986428
@ -33,15 +33,14 @@ func Scan(info common.HostInfo) {
|
|||||||
for _, targetIP := range AlivePorts {
|
for _, targetIP := range AlivePorts {
|
||||||
info.Host, info.Ports = strings.Split(targetIP, ":")[0], strings.Split(targetIP, ":")[1]
|
info.Host, info.Ports = strings.Split(targetIP, ":")[0], strings.Split(targetIP, ":")[1]
|
||||||
if info.Scantype == "all" {
|
if info.Scantype == "all" {
|
||||||
if IsContain(severports, info.Ports) {
|
if info.Ports == "445" { //scan more vul
|
||||||
AddScan(info.Ports, info, ch, &wg)
|
|
||||||
} else if info.Ports == "445" { //scan more vul
|
|
||||||
AddScan("1000001", info, ch, &wg)
|
AddScan("1000001", info, ch, &wg)
|
||||||
AddScan("1000002", info, ch, &wg)
|
AddScan("1000002", info, ch, &wg)
|
||||||
|
} else if IsContain(severports, info.Ports) {
|
||||||
|
AddScan(info.Ports, info, ch, &wg)
|
||||||
} else {
|
} else {
|
||||||
AddScan("1000003", info, ch, &wg) //webtitle
|
AddScan("1000003", info, ch, &wg) //webtitle
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
port, _ := common.PortlistBack[info.Scantype]
|
port, _ := common.PortlistBack[info.Scantype]
|
||||||
scantype := strconv.Itoa(port)
|
scantype := strconv.Itoa(port)
|
||||||
|
@ -14,6 +14,13 @@ func SmbScan(info *common.HostInfo) (tmperr error) {
|
|||||||
pass = strings.Replace(pass, "{user}", user, -1)
|
pass = strings.Replace(pass, "{user}", user, -1)
|
||||||
flag, err := doWithTimeOut(info, user, pass)
|
flag, err := doWithTimeOut(info, user, pass)
|
||||||
if flag == true && err == nil {
|
if flag == true && err == nil {
|
||||||
|
var result string
|
||||||
|
if info.Domain != "" {
|
||||||
|
result = fmt.Sprintf("SMB:%v:%v:%v\\%v %v", info.Host, info.Ports, info.Domain, user, pass)
|
||||||
|
} else {
|
||||||
|
result = fmt.Sprintf("SMB:%v:%v:%v %v", info.Host, info.Ports, user, pass)
|
||||||
|
}
|
||||||
|
common.LogSuccess(result)
|
||||||
return err
|
return err
|
||||||
} else {
|
} else {
|
||||||
tmperr = err
|
tmperr = err
|
||||||
@ -25,7 +32,7 @@ func SmbScan(info *common.HostInfo) (tmperr error) {
|
|||||||
|
|
||||||
func SmblConn(info *common.HostInfo, user string, pass string, Domain string, signal chan struct{}) (flag bool, err error) {
|
func SmblConn(info *common.HostInfo, user string, pass string, Domain string, signal chan struct{}) (flag bool, err error) {
|
||||||
flag = false
|
flag = false
|
||||||
Host, Port, Username, Password := info.Host, common.PORTList["smb"], user, pass
|
Host, Username, Password := info.Host, user, pass
|
||||||
options := smb.Options{
|
options := smb.Options{
|
||||||
Host: Host,
|
Host: Host,
|
||||||
Port: 445,
|
Port: 445,
|
||||||
@ -39,13 +46,6 @@ func SmblConn(info *common.HostInfo, user string, pass string, Domain string, si
|
|||||||
if err == nil {
|
if err == nil {
|
||||||
session.Close()
|
session.Close()
|
||||||
if session.IsAuthenticated {
|
if session.IsAuthenticated {
|
||||||
var result string
|
|
||||||
if Domain != "" {
|
|
||||||
result = fmt.Sprintf("SMB:%v:%v:%v\\%v %v", Host, Port, Domain, Username, Password)
|
|
||||||
} else {
|
|
||||||
result = fmt.Sprintf("SMB:%v:%v:%v %v", Host, Port, Username, Password)
|
|
||||||
}
|
|
||||||
common.LogSuccess(result)
|
|
||||||
flag = true
|
flag = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -64,5 +64,4 @@ func doWithTimeOut(info *common.HostInfo, user string, pass string) (flag bool,
|
|||||||
case <-time.After(time.Duration(info.Timeout) * time.Second):
|
case <-time.After(time.Duration(info.Timeout) * time.Second):
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user