1
0
mirror of https://github.com/sairson/Yasso.git synced 2026-06-17 07:38:13 +08:00

修复当用户指定字典换行出现的问题,并且增强用户爆破时输入字典路径,增加--ud "administrator" --pd "123456,11123" 的格式

This commit is contained in:
sairson
2022-01-26 18:14:38 +08:00
parent c5cb8e898f
commit 8e055b4a81
4 changed files with 21 additions and 2 deletions

View File

@@ -85,6 +85,7 @@ func BurpCall(EncryptMap map[string]interface{}, name string, params ...interfac
args[k] = reflect.ValueOf(param)
}
//Println()(args)
//fmt.Println(args)
return f.Call(args) // 调用函数并返回结果
}
@@ -209,6 +210,11 @@ func Readiness(file *os.File) []string {
return readiness
}
str := strings.TrimSpace(string(data))
// 修复读取时出现空的导致抛出panic
if str == "" {
continue
}
readiness = append(readiness, str) /*将去除换行符的字符串写入切片*/
}
return readiness
@@ -219,7 +225,15 @@ func ReadTextToDic(service, user, pass string) ([]string, []string) {
userdic = config.Userdict[service]
passdic = config.Passwords
)
if user != "" {
// 入过不包含.txt的话按照用户名和密码来算。其中
if !strings.Contains(user, ".txt") {
userdic = strings.Split(user, ",")
}
if !strings.Contains(pass, ".txt") {
passdic = strings.Split(pass, ",")
}
if user != "" && strings.Contains(user, ".txt") {
userive, err := os.Open(user)
if err != nil {
Println(fmt.Sprintf(Clearln+"[ERROR] Open %s is failed,please check your user dic path", UserDic))
@@ -227,7 +241,7 @@ func ReadTextToDic(service, user, pass string) ([]string, []string) {
}
userdic = Readiness(userive)
}
if pass != "" {
if pass != "" && strings.Contains(pass, ".txt") {
passive, err := os.Open(pass)
if err != nil {
Println(fmt.Sprintf(Clearln+"[ERROR] Open %s is failed,please check your pass dic path", PassDic))

View File

@@ -48,6 +48,7 @@ func BruteSshByUser() {
}
if BruteFlag == true {
users, pass := ReadTextToDic("ssh", UserDic, PassDic)
fmt.Println(users, pass)
Println(Clearln + "[*] Brute Module [ssh]")
Println(fmt.Sprintf(Clearln+"[*] Have [user:%v] [pass:%v] [request:%v]", len(users), len(pass), len(users)*len(pass)*len(ips)))
SwitchBurp("ssh", users, pass, ips, BrutePort, Runtime, TimeDuration, "")

View File

@@ -1,3 +1,4 @@
123456
P@ssw0rd
930517
kali

View File

@@ -1,2 +1,5 @@
administrator
Oadmin
kali
root