-
-
Save vysecurity/20311c29d879e0aba9dcffbe72a88b10 to your computer and use it in GitHub Desktop.
GitLab Scanner
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 ( | |
| "fmt" | |
| "github.com/anaskhan96/soup" | |
| "os" | |
| "strings" | |
| ) | |
| func main() { | |
| resp, err := soup.Get("https://" + os.Args[1] + "/explore") | |
| if err != nil { | |
| os.Exit(1) | |
| } | |
| //fmt.Println(resp) | |
| doc := soup.HTMLParse(resp) | |
| links := doc.FindAll("span", "class", "project-name") | |
| if (len(links) > 0){ | |
| fmt.Println("") | |
| fmt.Println(os.Args[1]) | |
| for _, link := range links { | |
| fmt.Println("✔ " + link.Text()) | |
| } | |
| } | |
| resp, err = soup.Get("https://" + os.Args[1] + "/explore/snippets") | |
| if err != nil { | |
| os.Exit(1) | |
| } | |
| doc = soup.HTMLParse(resp) | |
| links = doc.FindAll("div", "class", "title") | |
| if (len(links) > 0){ | |
| for _, link := range links { | |
| fmt.Println("📜 " + strings.TrimSpace(link.Find("a").Text()))} | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment