Example #1
0
 def submit_file(self, file: File):
     self.api_subf.file = {"file[]": file.fd()}
     self.api_subf.data = {**self.get_apikey(), "QUICKSAND_RERUN": 1}
     # {"QUICKSAND_BRUTE": 1, "QUICKSAND_LOOKAHEAD": 1}
     data, _ = request(self.api_subf)
     data = frmt.jsontree(data)
     return out.pformat(data)
Example #2
0
 def submit_file(self, file: File):
     self.api_subf.fulluri = self.api_subf.fullurl % (self.get_apikey(key=True))
     self.api_subf.file = {
         "upload": file.fd()
     } 
     data, _ = request(self.api_subf)
     return data
Example #3
0
 def submit_file(self, file: File):
     # HTTP 405 Method Not Allowed
     self.api_subf.data = {**self.get_apikey(), "shared": "yes"}
     self.api_subf.file = {"file": (file.name, file.fd())}
     data, _ = request(self.api_subf)
     data = frmt.jsontree(data)
     return out.pformat(data)
Example #4
0
 def submit_file(self, file: File):
     self.api_subf.data = {
         "accept-tac": "1" if self._accept_tac else "0",
         **self.get_apikey()
     }
     self.api_subf.file = {"sample": file.fd()}
     data, _ = request(self.api_subf, json=True)
     return data["data"]
Example #5
0
 def submit_file(self, file: File):
     self.api_subf.file = {"sample[]": file.fd()}
     self.api_subf.data = {"type": "json", "message": "", "email": ""}
     data, _ = request(self.api_subf)
     if " is not a PDF file. Not processed." in data:
         return f"{file} is not a PDF file"
     data = frmt.jsontree(data)
     return out.pformat(data)
Example #6
0
 def submit_file(self, file: File):
     self.api_subf.auth = self.get_apikey(key=True, user=True)
     self.api_subf.data = {
         "environmentId": 100
         # "nosharevt": "true"
     }
     self.api_subf.file = {"file": file.fd()}
     data, _ = request(self.api_subf)
     return data
Example #7
0
 def submit_file(self, file: File):
     self.api_subf.data = self.get_apikey()
     self.api_subf.file = {"file": (file.name, file.fd())}
     data, _ = request(self.api_subf)
     data = frmt.jsontree(data)
     # web.openurl(data["permalink"])
     data = frmt.jsonvert(data)
     # return out.pformat(data)
     return data
Example #8
0
    def submit_file(self, file: File):
        self.api_subf.data = self.get_apikey()
        self.api_subf.file = {"file": (file.name, file.fd())}
        if file.len > 32 * 1024 * 1024:
            api_subfl = APISpec("GET", "https://www.virustotal.com",
                                "/vtapi/v2/file/scan/upload_url")
            api_subfl.param = {**self.get_apikey()}

            data, _ = request(api_subfl)
            data = frmt.jsontree(data)
            self.api_subf.fulluri = data["upload_url"]
            self.api_subf.data = None
        else:
            self.api_subf.default()

        data, _ = request(self.api_subf)
        data = frmt.jsontree(data)
        # web.openurl(data["permalink"])
        data = frmt.jsonvert(data)
        # return out.pformat(data)
        return data
Example #9
0
 def submit_file(self, file: File):
     self.api_subf.header = self.get_apikey()
     self.api_subf.file = {"file": file.fd()}
     data, _ = request(self.api_subf)
     data = frmt.jsontree(data)
     return out.pformat(data)
Example #10
0
 def submit_file(self, file: File):
     self.api_subf.data = {"file": file.fd(), **self.get_apikey()}
     data, _ = request(self.api_subf)
     return data