Skip to content
This repository has been archived by the owner on Mar 29, 2023. It is now read-only.

Commit

Permalink
refactor: add TemplatePass
Browse files Browse the repository at this point in the history
  • Loading branch information
niudaii committed Sep 6, 2022
1 parent b6ad794 commit a25edd3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
6 changes: 6 additions & 0 deletions internal/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ func NewRunner(options *Options) (*Runner, error) {
func (r *Runner) Run() {
addrs := crack.ParseTargets(r.options.Targets)
addrs = crack.FilterModule(addrs, r.options.Module)
if len(addrs) == 0 {
gologger.Info().Msgf("目标为空")
return
}
gologger.Info().Msgf("存活探测")
addrs = r.crackRunner.CheckAlive(addrs)
gologger.Info().Msgf("存活数量: %v", len(addrs))
results := r.crackRunner.Run(addrs, r.options.UserDict, r.options.PassDict)
if len(results) > 0 {
gologger.Info().Msgf("爆破成功: %v", len(results))
Expand Down
13 changes: 2 additions & 11 deletions pkg/crack/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,13 @@ package crack
import (
"fmt"
"github.com/cheggaaa/pb/v3"
"github.com/projectdiscovery/gologger"
"net"
"sync"
"time"
)

// CheckAlive 存活检测
func (e *Runner) CheckAlive(addrs []*IpAddr) (results []*IpAddr) {
if len(addrs) == 0 {
gologger.Info().Msgf("目标为空")
return
}
gologger.Info().Msgf("存活探测")
// RunTask
mutex := &sync.Mutex{}
wg := &sync.WaitGroup{}
Expand All @@ -38,8 +32,6 @@ func (e *Runner) CheckAlive(addrs []*IpAddr) (results []*IpAddr) {
wg.Add(1)
taskChan <- task
}
close(taskChan)
wg.Wait()
} else {
bar := pb.StartNew(len(addrs))
for _, task := range addrs {
Expand All @@ -48,11 +40,10 @@ func (e *Runner) CheckAlive(addrs []*IpAddr) (results []*IpAddr) {
taskChan <- task
}
close(taskChan)
wg.Wait()
bar.Finish()
}
close(taskChan)
wg.Wait()

gologger.Info().Msgf("存活数量: %v", len(results))
return
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/crack/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ var (
"mongodb": {"admin", "root"},
}

TemplatePass = []string{"{user}", "{user}!@#123", "{user}!@#456", "{user}#123", "{user}*PWD", "{user}1", "{user}11", "{user}12#$", "{user}123", "{user}123456", "{user}@111", "{user}@123", "{user}@123#4", "{user}@2017", "{user}@2017", "{user}@2018", "{user}@2018", "{user}@2019", "{user}@2020", "{user}@2021", "{user}_123"}
TemplatePass = []string{"{user}", "{user}!@#123", "{user}!@#456", "{user}#123", "{user}*PWD", "{user}1", "{user}11", "{user}12#$", "{user}123", "{user}123456", "{user}@111", "{user}@123", "{user}@123#4", "{user}@2016", "{user}@2017", "{user}@2018", "{user}@2019", "{user}@2020", "{user}@2021", "{user}_123"}

CommonPass = []string{"", "!QAZ2wsx", "000000", "1", "111111", "123", "123123", "12313", "123321", "1234", "12345!@#$%abc", "123456", "12345678", "123456789", "1234567890", "12345678;abc", "123456Aa", "123qwe!@#", "123qweASD", "1q2w3e", "1qaz2wsx", "1QAZ2wsx", "1qaz@WSX", "1QAZ@WSX", "1qazxsw2", "654321", "666666", "8888888", "a11111", "a123123", "a12345", "a123456", "a123456", "a123456.", "Aa123123", "Aa1234", "Aa1234.", "Aa12345", "Aa12345.", "Aa123456", "Aa123456!", "Aa123456789", "abc+123", "abc123", "abc123456", "abc@123", "admin", "admin123", "Admin123", "admin123!@#", "admin888", "admin@123", "Admin@123", "Admin@1234", "admin@888", "adminadmin", "adminPwd", "Asdfg@123", "Charge123", "P@ssw0rd", "P@ssw0rd!", "P@ssword", "p@ssword", "pass123", "pass@123", "Passw0rd", "password", "qwe123", "qwe123!@#", "root", "sysadmin", "system", "test", "test123", "xcv@123", "zxc1qaz", "Zxcvb123"}
)

0 comments on commit a25edd3

Please sign in to comment.