Skip to content

Commit

Permalink
v1.5.2-修复递归扫描已知bug
Browse files Browse the repository at this point in the history
  • Loading branch information
corunb committed Aug 13, 2023
1 parent 50cfce4 commit 8d5439e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 13 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Dirscan 是一款由 go 编写的高并发的目录扫描器,现在已经支
* 已实现功能:

```
Version--> V1.5.1 :
Version--> V1.5.2 :
1. 支持并发快速扫描,可设置线程,延迟时间;
2. 过滤状态码;
3. 设置字典;
Expand Down Expand Up @@ -251,6 +251,7 @@ socks5代理:
* [!] 2023.3.21 修复已知bug
* [+] 2023.6.26 新增反向递归扫描
* [!] 2023.6.26 新增探存活开关
* [!] 2023.8.13 修复递归扫描已知bug



Expand Down
10 changes: 7 additions & 3 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"net/url"
"os"
"path"
"regexp"
"sort"
"strconv"
"strings"
Expand Down Expand Up @@ -255,13 +256,16 @@ func RemoveRepByLoop(slc []string) []string {

// Recursionchoose 递归扫描的数据存储
func Recursionchoose(respCode int ,url string,path string) {
if (respCode == 200 || respCode == 403) && IsPath(url+path) == true {
if strings.Contains(path,"/etc/passwd") != true {
if (respCode == 200 ||respCode == 301 || respCode == 302 || respCode == 403) && IsPath(Urll(path)) == true {
// 正则表达式模式,匹配以 /etc/ 开头的路径
pattern := "^/etc/.*$"
match, _ := regexp.MatchString(pattern, path)
if match != true {
Urlpath := Urll(url+path)
//color.Green.Printf("\rAdd: %v \n", Urlpath )
BiaoJi = append(BiaoJi, Urlpath)
}


}
}

Expand Down
2 changes: 1 addition & 1 deletion config/flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func init() {
██████████ █████ █████ █████░░█████████ ░░█████████ █████ █████ █████ ░░█████
░░░░░░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░░░░░ ░░░░░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░
[+] code by Corun V1.5.1
[+] code by Corun V1.5.2
[+] https://github.com/corunb/Dirscan
`
color.HiGreen.Println(logo)
Expand Down
18 changes: 10 additions & 8 deletions config/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func Scans(Turl string) {
//删除数据得第一个元素
BiaoJi = BiaoJi[1:]
fmt.Println(" ")
color.Green.Printf("target: %v \n", newurl)
color.Green.Printf("Target: %v \n", newurl)
time.Sleep(200 * time.Millisecond)
Scans(newurl)
} else {
Expand Down Expand Up @@ -140,12 +140,13 @@ func HeadScan(Turl string, pathChan <-chan string, w *sync.WaitGroup, bar *Bar)
for _, code := range newcodes {
if respCode == code {
HeadPrint(respCode, Turl, path, Rurl)
if Recursion == true {
Recursionchoose(respCode, Turl, path)
}
}
}

if Recursion == true {
Recursionchoose(respCode, Turl, path)
}

}
//进度条计数
bar.Add(1)
Expand Down Expand Up @@ -179,11 +180,12 @@ func GetScan(Turl string, pathChan <-chan string, w *sync.WaitGroup, bar *Bar) {
if respCode == code {
//fmt.Println(Targeturl)
GetPrint(respCode, Bodylen,body, Turl, path, Rurl)
}
}

if Recursion == true {
Recursionchoose(respCode, Turl, path)
//记录递归扫描的目录
if Recursion == true {
Recursionchoose(respCode, Turl, path)
}
}
}

}
Expand Down

0 comments on commit 8d5439e

Please sign in to comment.