Skip to content

Commit

Permalink
2023/9/9更新
Browse files Browse the repository at this point in the history
  • Loading branch information
pingc0y committed Sep 9, 2023
1 parent 70a79f6 commit e1c0334
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 9 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ go build -ldflags "-s -w" -o ./URLFinder-macos-arm64


## 更新说明
2023/9/9
修复 -ff 重复验证问题
修复 自动识别协议bug

2023/9/2
修复 子目录定位bug

Expand Down
2 changes: 1 addition & 1 deletion cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"os"
)

var Update = "2023.9.2"
var Update = "2023.9.9"
var XUpdate string

var (
Expand Down
46 changes: 44 additions & 2 deletions crawler/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,15 @@ func Run() {
if cmd.U == "" {
cmd.U = line
}
start(line)
startFF(line)
fmt.Println("----------------------------------------")
}

if err == io.EOF {
break
}
}
ValidateFF()
Res()
return
}
Expand All @@ -155,6 +156,48 @@ func Run() {
start(cmd.U)
Res()
}
func startFF(u string) {
fmt.Println("Target URL: " + u)
config.Wg.Add(1)
config.Ch <- 1
go Spider(u, 1)
config.Wg.Wait()
config.Progress = 1
fmt.Printf("\r\nSpider OK \n")
}

func ValidateFF() {
result.ResultUrl = util.RemoveRepeatElement(result.ResultUrl)
result.ResultJs = util.RemoveRepeatElement(result.ResultJs)
if cmd.S != "" {
fmt.Printf("Start %d Validate...\n", len(result.ResultUrl)+len(result.ResultJs))
fmt.Printf("\r ")
JsFuzz()
//验证JS状态
for i, s := range result.ResultJs {
config.Wg.Add(1)
config.Jsch <- 1
go JsState(s.Url, i, result.ResultJs[i].Source)
}
//验证URL状态
for i, s := range result.ResultUrl {
config.Wg.Add(1)
config.Urlch <- 1
go UrlState(s.Url, i)
}
config.Wg.Wait()

time.Sleep(1 * time.Second)
fmt.Printf("\r ")
fmt.Printf("\rValidate OK \n\n")

if cmd.Z != 0 {
UrlFuzz()
time.Sleep(1 * time.Second)
}
}
AddSource()
}

func start(u string) {
fmt.Println("Target URL: " + u)
Expand Down Expand Up @@ -194,7 +237,6 @@ func start(u string) {
}
}
AddSource()

}

func Res() {
Expand Down
13 changes: 7 additions & 6 deletions util/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,19 @@ func GetProtocol(domain string) string {
if strings.HasPrefix(domain, "http") {
return domain
}
response, err := http.Get("http://" + domain)
if err != nil {

response, err := http.Get("https://" + domain)
if err == nil {
return "https://" + domain
}
response, err = http.Get("http://" + domain)
if err == nil {
return "http://" + domain
}
defer response.Body.Close()
if response.TLS == nil {
return "http://" + domain
}
response, err = http.Get("https://" + domain)
if err != nil {
return "https://" + domain
}
return ""
}

Expand Down

0 comments on commit e1c0334

Please sign in to comment.