Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- "net/http"
- "os"
- "bufio"
- )
- func main() {
- fmt.Println("DIRECTORY:")
- if os.Args[1] == "help" {
- fmt.Println("Format:\ngo run main.go https://example.com")
- }
- file, err0:=os.Open("common.txt")
- if err0 != nil {
- fmt.Println("Error!!, godir-enum don't found common.txt")
- os.Exit(1)
- }
- defer file.Close()
- scanner:=bufio.NewScanner(file)
- for scanner.Scan() {
- req,err1:=http.Get(fmt.Sprint("%s/%s",os.Args[1],scanner.Text()))
- if req.StatusCode >= 200 && req.StatusCode <= 299 {
- fmt.Printf("%s/%s\n",os.Args[1],scanner.Text())
- }
- fmt.Sprint(req,err1)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement