MCPcopy Create free account
hub / github.com/code-scan/Goal / Login

Method Login

Gsensor/SecurityTrailsSensor.go:66–89  ·  view source on GitHub ↗
(ReLogin bool)

Source from the content-addressed store, hash-verified

64 return strings.Contains(ret, s.UserName)
65}
66func (s *SecurityTrails) Login(ReLogin bool) bool {
67 s.MaxPage = 100
68 s.http = Ghttp.Http{}
69 if ReLogin == false {
70 s.http.SetCookie(s.Cookie)
71 return true
72 }
73 if s.CheckLogin() {
74 return true
75 }
76 postData := make(map[string]interface{})
77 postData["email"] = s.UserName
78 postData["password"] = s.PassWord
79
80 s.http.New("POST", "https://151.139.240.16/api/auth/login")
81 s.http.IgnoreSSL()
82 s.http.HttpRequest.Host = "securitytrails.com"
83 s.http.SetPostJson(postData)
84 s.http.Execute()
85 defer s.http.Close()
86 s.Cookie = s.http.RespCookie()
87 s.GetBuildId()
88 return true
89}
90func (s *SecurityTrails) GetBuildId() {
91 ret, err := s.httpReq("https://securitytrails.com/list/apex_domain/baidu.com")
92 s.http.IgnoreSSL()

Callers 1

TestSecTrailFunction · 0.95

Calls 9

CheckLoginMethod · 0.95
GetBuildIdMethod · 0.95
SetCookieMethod · 0.80
NewMethod · 0.80
IgnoreSSLMethod · 0.80
SetPostJsonMethod · 0.80
ExecuteMethod · 0.80
RespCookieMethod · 0.80
CloseMethod · 0.45

Tested by 1

TestSecTrailFunction · 0.76