Skip to content

Commit 5ae0b0c

Browse files
committed
Fix golint issue
1 parent 55e12c5 commit 5ae0b0c

23 files changed

+45
-19
lines changed

src/adfs/struct.go

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77

88
var log *logger.Logger
99

10+
// Options for owa module
1011
type Options struct {
1112
Domain string
1213
utils.BaseOptions

src/adfs/utils.go

+3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ import (
1212
"strings"
1313
)
1414

15+
// FIND_ADFS_URL is the URL used to find the URL of an ADFS instance based on company hostname
1516
var FIND_ADFS_URL = "https://login.microsoftonline.com/getuserrealm.srf?login=%s"
17+
18+
// ADFS_URL is the endpoint to authenticate on
1619
var ADFS_URL = "https://%s/adfs/ls/idpinitiatedsignon.aspx?client-request-id=%s&pullStatus=0"
1720

1821
func (options *Options) brute(username, password string) bool {

src/azure/struct.go

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"GoMapEnum/src/utils"
55
)
66

7+
// Options for Azure module
78
type Options struct {
89
utils.BaseOptions
910
}

src/azure/userEnum.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
"time"
1414
)
1515

16-
// Data of the request which will be sent to authenticate
16+
// BASE_XML is the data of the request which will be sent to authenticate
1717
var BASE_XML = `<?xml version="1.0" encoding="UTF-8"?>
1818
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
1919
<s:Header>
@@ -47,6 +47,8 @@ var BASE_XML = `<?xml version="1.0" encoding="UTF-8"?>
4747
</s:Body>
4848
</s:Envelope>
4949
`
50+
51+
// AZURE_URL is the url to authenticate on
5052
var AZURE_URL = "https://autologon.microsoftazuread-sso.com/%s/winauth/trust/2005/usernamemixed?client-request-id=%s"
5153

5254
var log *logger.Logger

src/cmd/brute/bruteSpray.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ var proxy func(*http.Request) (*url.URL, error)
3434

3535
var proxyString string
3636

37-
// bruteSprayCmd represents the bruteSpray command
37+
// BruteSprayCmd represents the bruteSpray command
3838
var BruteSprayCmd = &cobra.Command{
3939
Use: "bruteSpray",
4040
Short: "Spray a password or bruteforce a user's password",

src/cmd/enum/userenum.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ var proxy func(*http.Request) (*url.URL, error)
2121

2222
var proxyString string
2323

24-
// userenumCmd represents the userenum command
24+
// UserenumCmd represents the userenum command
2525
var UserenumCmd = &cobra.Command{
2626
Use: "userenum",
2727
Short: "User enumeration",

src/cmd/gather/gather.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ var users []string
3535
var output string
3636
var proxyString string
3737

38-
// gatherCmd represents the gather command
38+
// GatherCmd represents the gather command
3939
var GatherCmd = &cobra.Command{
4040
Use: "gather",
4141
Short: "Retrieve a list of email address based on the company name",

src/cmd/gather/searchEngine.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ package gather
1717

1818
import (
1919
"GoMapEnum/src/logger"
20-
"GoMapEnum/src/searchEngine"
20+
searchengine "GoMapEnum/src/searchEngine"
2121

2222
"github.com/spf13/cobra"
2323
)
2424

25-
var searchEngineOptions searchEngine.Options
25+
var searchEngineOptions searchengine.Options
2626

2727
// o365Cmd represents the o365 command
2828
var searchEngineCmd = &cobra.Command{

src/linkedin/gather.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import (
55
"strings"
66
)
77

8-
// URL to search for companies
8+
// LINKEDIN_LIST_COMPANY is the URL to search for companies
99
var LINKEDIN_LIST_COMPANY = "https://www.linkedin.com/voyager/api/voyagerSearchDashTypeahead?decorationId=com.linkedin.voyager.dash.deco.search.typeahead.GlobalTypeaheadCollection-27&q=globalTypeahead&query=%s"
1010

11-
// URL to search for people
11+
// LINKEDIN_LIST_PEOPLE is the URL to search for people
1212
var LINKEDIN_LIST_PEOPLE = "https://www.linkedin.com/voyager/api/search/dash/clusters?decorationId=com.linkedin.voyager.dash.deco.search.SearchClusterCollection-126&origin=COMPANY_PAGE_CANNED_SEARCH&q=all&query=(flagshipSearchIntent:SEARCH_SRP,queryParameters:(currentCompany:List(%d),resultType:List(PEOPLE)),includeFiltersInResponse:false)&start=%d"
1313

1414
// Gather return a list of all users belongins to the specified company (or multiple companies if the search return more than one)

src/linkedin/struct.go

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77

88
var log *logger.Logger
99

10+
// Options for o365 module
1011
type Options struct {
1112
Format string
1213
ExactMatch bool

src/logger/logger.go

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"github.com/fatih/color"
77
)
88

9+
// Level is a type representing the logging level
910
type Level int
1011

1112
const (
@@ -17,13 +18,15 @@ const (
1718
DebugLevel
1819
)
1920

21+
// Logger is the options for the logging module
2022
type Logger struct {
2123
Level Level
2224
Module string
2325
Target string
2426
Type string
2527
}
2628

29+
// New create a Logger object for the specified arguments
2730
func New(kind, module, target string) *Logger {
2831
log := &Logger{}
2932
// If not set during the init of logger

src/o365/struct.go

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"encoding/xml"
66
)
77

8+
// Options for o365 module
89
type Options struct {
910
Mode string
1011
LockoutThreshold int

src/o365/userEnum.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"sync"
77
)
88

9-
// UserEnum: Return a valid list of users according the provided options
9+
// UserEnum return a valid list of users according the provided options
1010
func (options *Options) UserEnum() []string {
1111
mux := &sync.Mutex{}
1212
options.Users = utils.GetStringOrFile(options.Users)
@@ -25,9 +25,9 @@ func (options *Options) UserEnum() []string {
2525
if !options.validTenant(domain) {
2626
options.Log.Error("Tenant " + domain + " is not valid")
2727
return
28-
} else {
29-
options.Log.Verbose("Tenant " + domain + " is valid")
3028
}
29+
options.Log.Verbose("Tenant " + domain + " is valid")
30+
3131
switch options.Mode {
3232
case "office":
3333
if options.enumOffice(email) {

src/o365/utils.go

+7
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,16 @@ import (
1313
"strings"
1414
)
1515

16+
// OFFICE_URL is used to get parameter for office user enumeration
1617
var OFFICE_URL = "https://www.office.com"
18+
19+
// MICROSOFT_ONLINE_URL is the URL to performed user enumeration
1720
var MICROSOFT_ONLINE_URL = "https://login.microsoftonline.com/common/GetCredentialType?mkt=en-US"
21+
22+
// VALIDATE_TENANT_URL is the url to validate if a tenant exist or not
1823
var VALIDATE_TENANT_URL = "https://login.microsoftonline.com/getuserrealm.srf?login=user@%s&xml=1"
24+
25+
// OAUTH2_URL is the URL to authenticate with oauth2 method
1926
var OAUTH2_URL = "https://login.microsoft.com/common/oauth2/token"
2027

2128
// enumOffice return a bool if the user exist or not

src/owa/brute.go

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"time"
1111
)
1212

13+
// Brute will bruteforce or spray passwords on the specified users.
1314
func (options *Options) Brute() {
1415
log = options.Log
1516
var emailList []string

src/owa/struct.go

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88

99
var log *logger.Logger
1010

11+
// Options for owa module
1112
type Options struct {
1213
tr *http.Transport
1314
utils.BaseOptions

src/owa/userEnum.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"time"
1111
)
1212

13-
// UserEnum: Return a valid list of users according the provided options
13+
// UserEnum return a valid list of users according the provided options
1414
func (options *Options) UserEnum() []string {
1515
log = options.Log
1616

src/searchEngine/gather.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package searchEngine
1+
package searchengine
22

33
import (
44
"GoMapEnum/src/utils"
@@ -7,15 +7,17 @@ import (
77
"strings"
88
)
99

10+
// SEARCH_ENGINE contains url for search on Google and Bing
1011
var SEARCH_ENGINE = map[string]string{"google": `https://www.google.com/search?q=site:linkedin.com/in+"%s"&num=100&start=%d`,
1112
"bing": `http://www.bing.com/search?q=site:linkedin.com/in+"%s"&first=%d`}
1213

13-
// Regex to extract title from search engine's results
14+
// REGEX_TITLE is the regex to extract title from search engine's results
1415
var REGEX_TITLE = `<h[23](.*?")?>(.*?)<\/h[23]>`
1516

16-
// Regex to extract field from the title
17+
// REGEX_LINKEDIN is the regex to extract field from the title
1718
var REGEX_LINKEDIN = `<h[23](.*?")?>(?P<FirstName>.*?) (?P<LastName>.*?) [-–] (?P<Title>.*?) [-–] (?P<Company>.*?)(\| LinkedIn)(.*?)<\/h[23]>`
1819

20+
// Gather will search a company name and returned the list of people in specified format
1921
func (options *Options) Gather() []string {
2022
var output []string
2123
log = options.Log

src/searchEngine/struct.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package searchEngine
1+
package searchengine
22

33
import (
44
"GoMapEnum/src/logger"
@@ -7,6 +7,7 @@ import (
77

88
var log *logger.Logger
99

10+
// Options for searchengine module
1011
type Options struct {
1112
Format string
1213
ExactMatch bool

src/teams/struct.go

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77

88
var log *logger.Logger
99

10+
// Options for teams module
1011
type Options struct {
1112
Email string
1213
Token string

src/teams/utils.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import (
1313
// getPresence request the Teams API to get additional details about the user with its mri
1414
func (options *Options) getPresence(mri, bearer string, log *logger.Logger) (string, string, string) {
1515

16-
var json_data = []byte(`[{"mri":"` + mri + `"}]`)
17-
req, _ := http.NewRequest("POST", URL_PRESENCE_TEAMS, bytes.NewBuffer(json_data))
16+
var jsonData = []byte(`[{"mri":"` + mri + `"}]`)
17+
req, _ := http.NewRequest("POST", URL_PRESENCE_TEAMS, bytes.NewBuffer(jsonData))
1818
req.Header.Add("Authorization", bearer)
1919
req.Header.Add("x-ms-client-version", CLIENT_VERSION)
2020
req.Header.Set("Content-Type", "application/json")

src/utils/struct.go

+1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ type BaseOptions struct {
2222
Proxy func(*http.Request) (*url.URL, error)
2323
}
2424

25+
// ErrLockout is the error to returned when an account is locked
2526
var ErrLockout = errors.New("account is locked")

src/utils/utils.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ func GetUserAgent() string {
8484
return userAgents[rand.Intn(len(userAgents))]
8585
}
8686

87-
// Credits: https://stackoverflow.com/a/46202939/7245054
8887
// ReSubMatchMap will applied a regex with named capture and return a map
88+
// Credits: https://stackoverflow.com/a/46202939/7245054
8989
func ReSubMatchMap(r *regexp.Regexp, str string) map[string]string {
9090
matches := r.FindAllStringSubmatch(str, -1)
9191

0 commit comments

Comments
 (0)