mirror of
https://github.com/shadow1ng/fscan.git
synced 2025-07-13 21:02:44 +08:00
增加爆破关闭参数 -nobr
This commit is contained in:
parent
dd00ec7bac
commit
e49e6dd433
@ -9,6 +9,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func FtpScan(info *common.HostInfo) (tmperr error) {
|
func FtpScan(info *common.HostInfo) (tmperr error) {
|
||||||
|
if common.IsBrute {
|
||||||
|
return
|
||||||
|
}
|
||||||
starttime := time.Now().Unix()
|
starttime := time.Now().Unix()
|
||||||
flag, err := FtpConn(info, "anonymous", "")
|
flag, err := FtpConn(info, "anonymous", "")
|
||||||
if flag == true && err == nil {
|
if flag == true && err == nil {
|
||||||
|
@ -10,6 +10,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func MssqlScan(info *common.HostInfo) (tmperr error) {
|
func MssqlScan(info *common.HostInfo) (tmperr error) {
|
||||||
|
if common.IsBrute {
|
||||||
|
return
|
||||||
|
}
|
||||||
starttime := time.Now().Unix()
|
starttime := time.Now().Unix()
|
||||||
for _, user := range common.Userdict["mssql"] {
|
for _, user := range common.Userdict["mssql"] {
|
||||||
for _, pass := range common.Passwords {
|
for _, pass := range common.Passwords {
|
||||||
|
@ -10,6 +10,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func MysqlScan(info *common.HostInfo) (tmperr error) {
|
func MysqlScan(info *common.HostInfo) (tmperr error) {
|
||||||
|
if common.IsBrute {
|
||||||
|
return
|
||||||
|
}
|
||||||
starttime := time.Now().Unix()
|
starttime := time.Now().Unix()
|
||||||
for _, user := range common.Userdict["mysql"] {
|
for _, user := range common.Userdict["mysql"] {
|
||||||
for _, pass := range common.Passwords {
|
for _, pass := range common.Passwords {
|
||||||
|
@ -10,6 +10,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func PostgresScan(info *common.HostInfo) (tmperr error) {
|
func PostgresScan(info *common.HostInfo) (tmperr error) {
|
||||||
|
if common.IsBrute {
|
||||||
|
return
|
||||||
|
}
|
||||||
starttime := time.Now().Unix()
|
starttime := time.Now().Unix()
|
||||||
for _, user := range common.Userdict["postgresql"] {
|
for _, user := range common.Userdict["postgresql"] {
|
||||||
for _, pass := range common.Passwords {
|
for _, pass := range common.Passwords {
|
||||||
|
@ -21,6 +21,9 @@ func RedisScan(info *common.HostInfo) (tmperr error) {
|
|||||||
if flag == true && err == nil {
|
if flag == true && err == nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if common.IsBrute {
|
||||||
|
return
|
||||||
|
}
|
||||||
for _, pass := range common.Passwords {
|
for _, pass := range common.Passwords {
|
||||||
pass = strings.Replace(pass, "{user}", "redis", -1)
|
pass = strings.Replace(pass, "{user}", "redis", -1)
|
||||||
flag, err := RedisConn(info, pass)
|
flag, err := RedisConn(info, pass)
|
||||||
@ -46,14 +49,14 @@ func RedisConn(info *common.HostInfo, pass string) (flag bool, err error) {
|
|||||||
realhost := fmt.Sprintf("%s:%v", info.Host, info.Ports)
|
realhost := fmt.Sprintf("%s:%v", info.Host, info.Ports)
|
||||||
conn, err := net.DialTimeout("tcp", realhost, time.Duration(info.Timeout)*time.Second)
|
conn, err := net.DialTimeout("tcp", realhost, time.Duration(info.Timeout)*time.Second)
|
||||||
defer func() {
|
defer func() {
|
||||||
if conn != nil{
|
if conn != nil {
|
||||||
conn.Close()
|
conn.Close()
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return flag, err
|
return flag, err
|
||||||
}
|
}
|
||||||
err = conn.SetReadDeadline(time.Now().Add(time.Duration(info.Timeout)*time.Second))
|
err = conn.SetReadDeadline(time.Now().Add(time.Duration(info.Timeout) * time.Second))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return flag, err
|
return flag, err
|
||||||
}
|
}
|
||||||
@ -71,8 +74,8 @@ func RedisConn(info *common.HostInfo, pass string) (flag bool, err error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
result := fmt.Sprintf("[+] Redis:%s %s", realhost, pass)
|
result := fmt.Sprintf("[+] Redis:%s %s", realhost, pass)
|
||||||
common.LogSuccess(result)
|
common.LogSuccess(result)
|
||||||
return flag,err
|
return flag, err
|
||||||
}else {
|
} else {
|
||||||
result := fmt.Sprintf("[+] Redis:%s %s file:%s/%s", realhost, pass, dir, dbfilename)
|
result := fmt.Sprintf("[+] Redis:%s %s file:%s/%s", realhost, pass, dir, dbfilename)
|
||||||
common.LogSuccess(result)
|
common.LogSuccess(result)
|
||||||
}
|
}
|
||||||
@ -86,14 +89,14 @@ func RedisUnauth(info *common.HostInfo) (flag bool, err error) {
|
|||||||
realhost := fmt.Sprintf("%s:%v", info.Host, info.Ports)
|
realhost := fmt.Sprintf("%s:%v", info.Host, info.Ports)
|
||||||
conn, err := net.DialTimeout("tcp", realhost, time.Duration(info.Timeout)*time.Second)
|
conn, err := net.DialTimeout("tcp", realhost, time.Duration(info.Timeout)*time.Second)
|
||||||
defer func() {
|
defer func() {
|
||||||
if conn != nil{
|
if conn != nil {
|
||||||
conn.Close()
|
conn.Close()
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return flag, err
|
return flag, err
|
||||||
}
|
}
|
||||||
err = conn.SetReadDeadline(time.Now().Add(time.Duration(info.Timeout)*time.Second))
|
err = conn.SetReadDeadline(time.Now().Add(time.Duration(info.Timeout) * time.Second))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return flag, err
|
return flag, err
|
||||||
}
|
}
|
||||||
@ -111,9 +114,9 @@ func RedisUnauth(info *common.HostInfo) (flag bool, err error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
result := fmt.Sprintf("[+] Redis:%s unauthorized", realhost)
|
result := fmt.Sprintf("[+] Redis:%s unauthorized", realhost)
|
||||||
common.LogSuccess(result)
|
common.LogSuccess(result)
|
||||||
return flag,err
|
return flag, err
|
||||||
}else {
|
} else {
|
||||||
result := fmt.Sprintf("[+] Redis:%s unauthorized file:%s/%s", realhost,dir,dbfilename)
|
result := fmt.Sprintf("[+] Redis:%s unauthorized file:%s/%s", realhost, dir, dbfilename)
|
||||||
common.LogSuccess(result)
|
common.LogSuccess(result)
|
||||||
}
|
}
|
||||||
err = Expoilt(realhost, conn)
|
err = Expoilt(realhost, conn)
|
||||||
|
@ -12,6 +12,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func SshScan(info *common.HostInfo) (tmperr error) {
|
func SshScan(info *common.HostInfo) (tmperr error) {
|
||||||
|
if common.IsBrute {
|
||||||
|
return
|
||||||
|
}
|
||||||
starttime := time.Now().Unix()
|
starttime := time.Now().Unix()
|
||||||
for _, user := range common.Userdict["ssh"] {
|
for _, user := range common.Userdict["ssh"] {
|
||||||
for _, pass := range common.Passwords {
|
for _, pass := range common.Passwords {
|
||||||
|
@ -80,6 +80,7 @@ var (
|
|||||||
Ping bool
|
Ping bool
|
||||||
Pocinfo PocInfo
|
Pocinfo PocInfo
|
||||||
IsWebCan bool
|
IsWebCan bool
|
||||||
|
IsBrute bool
|
||||||
RedisFile string
|
RedisFile string
|
||||||
RedisShell string
|
RedisShell string
|
||||||
Userfile string
|
Userfile string
|
||||||
|
@ -37,6 +37,7 @@ func Flag(Info *HostInfo) {
|
|||||||
flag.StringVar(&RedisFile, "rf", "", "redis file to write sshkey file (as: -rf id_rsa.pub) ")
|
flag.StringVar(&RedisFile, "rf", "", "redis file to write sshkey file (as: -rf id_rsa.pub) ")
|
||||||
flag.StringVar(&RedisShell, "rs", "", "redis shell to write cron file (as: -rs 192.168.1.1:6666) ")
|
flag.StringVar(&RedisShell, "rs", "", "redis shell to write cron file (as: -rs 192.168.1.1:6666) ")
|
||||||
flag.BoolVar(&IsWebCan, "nopoc", false, "not to scan web vul")
|
flag.BoolVar(&IsWebCan, "nopoc", false, "not to scan web vul")
|
||||||
|
flag.BoolVar(&IsBrute, "nobr", false, "not to Brute password")
|
||||||
flag.BoolVar(&IsPing, "np", false, "not to ping")
|
flag.BoolVar(&IsPing, "np", false, "not to ping")
|
||||||
flag.BoolVar(&Ping, "ping", false, "using ping replace icmp")
|
flag.BoolVar(&Ping, "ping", false, "using ping replace icmp")
|
||||||
flag.StringVar(&TmpOutputfile, "o", "result.txt", "Outputfile")
|
flag.StringVar(&TmpOutputfile, "o", "result.txt", "Outputfile")
|
||||||
|
Loading…
Reference in New Issue
Block a user