欢迎来到Chaosmos!

我们提供免费辅助,破解辅助,成人资源,包括黑客技术交流等版块;相信您一定能在这里找到您想要的。

立即注册!
  • 为了确保论坛积极互助的氛围,本论坛需要下载的资源一律必须在回复帖子之后才能进行下载。对于非附件内容也鼓励开启隐藏回复/反应可见模式!

    VIP用户可以免回复帖子下载资源,升级为VIP可通过发表超过15条贴子或消息后自动升级为VIP用户。

  • Chaosmos官方电报频道:https://t.me/metastemsu Chaosmos官方电报群聊: https://t.me/chinahvh

开源 网站目录扫描器源码

Sky

候补委员
gemgemgemgemgem
管理成员
政治局委员
优秀干部
注册
2024/07/29
消息
122
代码:
package main

import (
"bufio"
"fmt"
"net/http"
"os"
"strings"
)

func checkDirectory(url string, direcotry string, showNotFound bool) {
fullURL := fmt.Sprintf("%s/%s", url, direcotry)
response, err := http.get(fullURL)
if err != nil {
fmt.Printf("Error: %v\n", err)
return
}

defer response.Body.Close()

if response.StatusCode == http.StatusOK {
fmt.Printf("(200) Found: %s\n", fullURL)
} else if response.StatusCode == http.StatusNotFound && showNotFound {
fmt.Printf("(404) Not Found: %s\n", fullURL)
}
}

func scanWithWordlist(url string, wordlist string, showNotFound bool) {
file, err := os.Open(wordlist)
if err != nil {
fmt.Printf("Failed to Open Wordlists: %v\n", err)
return
}
defer file.Close()

scanner := bufio.NewScanner(file)
fmt.Println("\nScanning with Wordlists: ")
for scanner.Scan() {
directory := scanner.Text()
checkDirectory(url, direcotry, showNotFound)
}

if err := scanner.Err(); err != nil {
fmt.Printf("Failed to read Wordlists: %v\n", err)
}
}

func main() {
var url, wordlist string
fmt.Printf("Enter the URL: ")
fmt.Scanln(&url)

if !strings.HasPrefix(url, "https") {
url = "https://" + url
}

fmt.Print("Enter the Wordlist Path: ")
fmt.Scanln(&wordlist)

var disableNotFound string
fmt.print("Do you want to remove (404) Not found Errors? (y/n): ")
fmt.Scanln(&disableNotFound)
showNotFound := strings.ToLower(disableNotFound) != "y"

scanWithWordlist(url, wordlist, showNotFound)
}
 

magicdog20

同志
gemgemgem
普通党员
优秀干部
注册
2024/08/22
消息
25
有趣
 
顶部