| 63 | return FinalOutput, HtmlResults, JsonResults |
| 64 | |
| 65 | def process(self): |
| 66 | dl = Download.Download(verbose=self.verbose) |
| 67 | # Get all the USER code Repos |
| 68 | # https://github.com/search?p=2&q=enron.com+&ref=searchresults&type=Code&utf8=✓ |
| 69 | UrlList = [] |
| 70 | while self.Counter <= self.Depth: |
| 71 | if self.verbose: |
| 72 | p = ' [*] GitHub Code Search on page: ' + str(self.Counter) |
| 73 | print helpers.color(p, firewall=True) |
| 74 | try: |
| 75 | url = "https://github.com/search?p=" + str(self.Counter) + "&q=" + \ |
| 76 | str(self.domain) + "+&ref=searchresults&type=Code&utf8=✓" |
| 77 | r = dl.requesturl(url, useragent=self.UserAgent, raw=True, timeout=10) |
| 78 | if r.status_code != 200: |
| 79 | break |
| 80 | except Exception as e: |
| 81 | error = " [!] Major isself.Counter += 1sue with GitHub Search:" + \ |
| 82 | str(e) |
| 83 | print helpers.color(error, warning=True) |
| 84 | RawHtml = r.content |
| 85 | # Parse the results for our URLS) |
| 86 | soup = BeautifulSoup(RawHtml) |
| 87 | for a in soup.findAll('a', href=True): |
| 88 | a = a['href'] |
| 89 | if a.startswith('/'): |
| 90 | UrlList.append(a) |
| 91 | self.Counter += 1 |
| 92 | # Now take all gathered URL's and gather the HTML content needed |
| 93 | for url in UrlList: |
| 94 | try: |
| 95 | url = "https://github.com" + url |
| 96 | html = dl.requesturl(url, useragent=self.UserAgent, timeout=10) |
| 97 | self.Html += html |
| 98 | except Exception as e: |
| 99 | error = " [!] Connection Timed out on Github Search:" + str(e) |
| 100 | print helpers.color(error, warning=True) |
| 101 | |
| 102 | def get_emails(self): |
| 103 | Parse = Parser.Parser(self.Html) |