| 64 | return strings.Contains(ret, s.UserName) |
| 65 | } |
| 66 | func (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 | } |
| 90 | func (s *SecurityTrails) GetBuildId() { |
| 91 | ret, err := s.httpReq("https://securitytrails.com/list/apex_domain/baidu.com") |
| 92 | s.http.IgnoreSSL() |