Example #1
0
 def get_data(self, module_path):
     try:
         results = []
         for module_url in self.get_raw_urls(module_path):
             res = requests.get(module_url, verify=False)
             results.append(res.text)
         return results
     except Exception:
         return ()
Example #2
0
 def check(self, url, **kwargs):
     res = requests.get(url)
     result = {
         "url":
         url,
         "status":
         0 if res.status_code == 200 else 1,
         "msg":
         "demo2 poc " + ("success" if res.status_code == 200 else "failed"),
         "hit_urls": [url],
         "extra": {}
     }
     return result
Example #3
0
 def get_raw_urls(self, module_path):
     module_path = self.remove_protocol(module_path)
     if module_path.endswith("/"):
         res = requests.get(
             "https://gitee.com/guuest/glimmer_pocs/raw/master/dir_struct.txt"
         )
         return [
             parse.urljoin(
                 "https://gitee.com/guuest/glimmer_pocs/raw/master/", path)
             for path in res.text.split() if path.startswith(module_path)
         ]
     else:
         module_path = module_path if module_path.endswith(
             ".py") else module_path + ".py"
         return (parse.urljoin(
             "https://gitee.com/guuest/glimmer_pocs/raw/master/",
             module_path), )
Example #4
0
 def get_data(self, module_path):
     try:
         res = requests.get(module_path)
         return (res.text, )
     except Exception:
         return ()