Skip to content

Commit b440a81

Browse files
committed
fix jaeles db not init 2022-10-30
1 parent f1a442d commit b440a81

File tree

11 files changed

+50
-17
lines changed

11 files changed

+50
-17
lines changed

burp.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"JWT":"","endpoint":"http://http://127.0.0.1:5000/api/parse","password":"f0542023f9","username":"jaeles"}

config/config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
bind: http://127.0.0.1:5000
2+
cors: '*'
3+
defaultsign: '*'
4+
password: f0542023f9
5+
secret: f0542023f9e46accd1e195c7830ec556718e037f
6+
username: jaeles

config/scan4all_db.db

36 KB
Binary file not shown.

db/sqlite3.db

88 KB
Binary file not shown.

main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"log"
99
"net/http"
1010
_ "net/http/pprof"
11+
"os"
1112

1213
"runtime"
1314
"runtime/debug"
@@ -22,7 +23,7 @@ var config embed.FS
2223
var Version string
2324

2425
func main() {
25-
//os.Args = []string{"", "-host", "http://192.168.0.109", "-v"}
26+
os.Args = []string{"", "-host", "http://192.168.0.109", "-v"}
2627
//os.Args = []string{"", "-host", "http://127.0.0.1", "-v"}
2728
//os.Args = []string{"", "-host", "https://www.sina.com.cn/", "-v", "-o", "xxx.csv"}
2829
//os.Args = []string{"", "-list", "list.txt", "-v"}

pkg/hydra/hydra.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package hydra
22

33
import (
4+
"fmt"
45
"github.com/hktalent/ProScan4all/pkg/hydra/oracle"
56
"github.com/hktalent/ProScan4all/pkg/kscan/lib/gotelnet"
67
"github.com/hktalent/ProScan4all/pkg/kscan/lib/misc"
@@ -134,6 +135,21 @@ func (c *Cracker) Run() {
134135
return
135136
}
136137
c.authInfo.Auth = a
138+
//开始工作,输出工作结果
139+
//if enableDevDebug {
140+
v := c.authInfo
141+
//if v, ok := param.(hydra.AuthInfo); ok {
142+
u001 := v.Auth.Username
143+
if 15 > len(u001) {
144+
u001 += strings.Repeat(" ", 15-len(u001))
145+
}
146+
u002 := v.Auth.Password
147+
if 18 > len(u002) {
148+
u002 += strings.Repeat(" ", 18-len(u002))
149+
}
150+
fmt.Printf(" hydra: %s %s %s \r", v.Protocol, u001, u002)
151+
//}
152+
//}
137153
c.Pool.In <- *c.authInfo
138154
}
139155
//关闭信道

pkg/kscan/lib/pool/pool.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,6 @@ func (p *Pool) work() {
105105
p.JobsList.Set(Tick, param)
106106
//设置工作内容
107107
f := NewWorker(p.Function)
108-
//开始工作,输出工作结果
109-
//if enableDevDebug {
110-
fmt.Printf(" hydra: %v\r", param)
111-
//}
112108
out, err := f.Run(param)
113109
//输出工作结果
114110
p.Out <- out

vendor/github.com/hktalent/jaeles/core/config.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/hktalent/jaeles/core/update.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/hktalent/jaeles/database/sign.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webScan/jaeles/jaelesImp.go

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,30 @@ import (
2828
// RootCmd.AddCommand(scanCmd)
2929
//}
3030

31+
func init() {
32+
util.RegInitFunc(func() {
33+
Options.ChunkLimit = math.MaxInt
34+
Options.RootFolder = util.SzPwd + "/"
35+
Options.Output = util.SzPwd + "/logs/"
36+
Options.SignFolder = util.SzPwd + "/config/jaeles-signatures"
37+
Options.ChunkRun = false // 每个目标单独一个进程运行
38+
Options.NoBackGround = false // 不转到后台,显示运行
39+
utils.InitLog(&Options)
40+
core.InitConfig(&Options)
41+
InitDB()
42+
Options.SelectedSigns = core.SelectSign("**")
43+
})
44+
}
45+
3146
// [email protected]:jaeles-project/jaeles-signatures.git
3247
// 这玩意没有 他自定义的yarm 等于0
3348
// urlFile 也将作为临时文件,输入
3449
func RunScan(urls []string, urlFile string) error {
35-
util.Wg.Done()
36-
Options.ChunkLimit = math.MaxInt
37-
Options.RootFolder = util.SzPwd
38-
Options.SignFolder = util.SzPwd + "/config/jaeles-signatures"
39-
Options.ChunkRun = false // 每个目标单独一个进程运行
40-
Options.NoBackGround = false // 不转到后台,显示运行
41-
Options.SelectedSigns = core.SelectSign("**")
50+
defer util.Wg.Done()
51+
if 0 == len(urls) {
52+
return nil
53+
}
54+
4255
// fmt.Println(os.Args)
4356
//SelectSign()
4457
// input as a file

0 commit comments

Comments
 (0)