Last active
January 10, 2022 01:47
-
-
Save SegoCode/399d301913a64c9f9f8ff2c6026e91b7 to your computer and use it in GitHub Desktop.
Admin panel finder in golang
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "bufio" | |
| "fmt" | |
| "net/http" | |
| "net/url" | |
| "os" | |
| "sync" | |
| ) | |
| func testUrl(wg *sync.WaitGroup, url string) { | |
| resp, _ := http.Get(url) | |
| if resp != nil && resp.StatusCode < 400 { | |
| fmt.Println("[+] FOUND: " + url + " (Code: " + resp.Status + ")") | |
| } | |
| wg.Done() | |
| } | |
| func main() { | |
| var wg sync.WaitGroup | |
| var inputUrl string | |
| //Usage validation | |
| if len(os.Args) <= 1 { | |
| fmt.Println("[!] USAGE: GoFinder.exe http://example.com") | |
| os.Exit(1) | |
| } | |
| //path file validation | |
| file, errOs := os.Open("paths.txt") | |
| if errOs != nil { | |
| dir, _ := os.Getwd() | |
| fmt.Println("[!] FILE LIST PATH NOT FOUND (" + dir + string(os.PathSeparator) + "paths.txt)") | |
| os.Exit(1) | |
| } | |
| //input url validation | |
| inputUrl = os.Args[1] | |
| _, errParse := url.ParseRequestURI(inputUrl) | |
| if errParse != nil { | |
| fmt.Println("[!] URL NOT VALID (Example: http://example.com)") | |
| os.Exit(1) | |
| } | |
| fmt.Println(` | |
| _____ _____ _ _ | |
| | __|___ | __|_|___ _| |___ ___ | |
| | | | . | | __| | | . | -_| _| | |
| |_____|___| |__| |_|_|_|___|___|_| | |
| [ github.com/SegoCode ]` + "\n") | |
| fmt.Println("[*] SCAN STARTED (" + inputUrl + ")\n") | |
| scanner := bufio.NewScanner(file) | |
| for scanner.Scan() { | |
| wg.Add(1) | |
| go testUrl(&wg, inputUrl+scanner.Text()) | |
| } | |
| wg.Wait() | |
| fmt.Println("\n" + "[*] SCAN COMPLETE [*]") | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage
Features
Other implementations
Java : https://gist.github.com/SegoCode/b3327aaac84e8fb17ce9d384f1e80591
Powershell: https://gist.github.com/SegoCode/d3b2a5d83bc02b0f1531d45bae683613