Skip to content

Instantly share code, notes, and snippets.

@vysecurity
Created August 8, 2020 11:45
Show Gist options
  • Select an option

  • Save vysecurity/20311c29d879e0aba9dcffbe72a88b10 to your computer and use it in GitHub Desktop.

Select an option

Save vysecurity/20311c29d879e0aba9dcffbe72a88b10 to your computer and use it in GitHub Desktop.
GitLab Scanner
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