Skip to content

Instantly share code, notes, and snippets.

@SegoCode
Last active January 10, 2022 01:47
Show Gist options
  • Select an option

  • Save SegoCode/399d301913a64c9f9f8ff2c6026e91b7 to your computer and use it in GitHub Desktop.

Select an option

Save SegoCode/399d301913a64c9f9f8ff2c6026e91b7 to your computer and use it in GitHub Desktop.
Admin panel finder in golang
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 [*]")
}
@SegoCode
Copy link
Author

Usage

goFinder.exe http://www.example.com

Features

  • Multi-threading
  • More than 1000+ path list
  • Supports php, asp and html extensions

Other implementations

Java : https://gist.github.com/SegoCode/b3327aaac84e8fb17ce9d384f1e80591
Powershell: https://gist.github.com/SegoCode/d3b2a5d83bc02b0f1531d45bae683613

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment