def get_sqlmap(self, url, headers, raw_request): request_user_agent = headers['User-Agent'] #userhash=headers['userhash'] post_data = {"url": url, 'user-agent': request_user_agent} if 'Cookie' in headers.keys(): post_data = { "url": url, "cookie": headers['Cookie'], 'user-agent': request_user_agent } post_data.update(self.sqlmap_config) post_data = json.dumps(post_data) md5string = "%s" % (url) md5string = md5(md5string).hexdigest() isrun = self.test_hash(md5string) if isrun == True: taskid = self.new_task() send_data = { 'key': taskid, 'request': base64_encode(raw_request), 'url': base64_encode(url), 'userhash': headers['userhash'], 'apiserver': self.sqlmapapi } self.send_info(self.webserver + "/api.php?type=sqlmap", send_data) self.send_inject(taskid, post_data) self.upload_hash(md5string, taskid) return taskid return False
def post_sqlmap(self,url,headers,body,raw_request): request_user_agent=headers['User-Agent'] #userhash=headers['userhash'] post_data={"url":url,"data":body,'user-agent':request_user_agent} if 'Cookie' in headers.keys(): post_data={"url":url,"cookie":headers['Cookie'],"data":body,'user-agent':request_user_agent} post_data.update(self.sqlmap_config) post_data=json.dumps(post_data) md5string="%s:%s"%(url,body) md5string=md5(md5string).hexdigest() isrun=self.test_hash(md5string) if isrun==True: taskid=self.new_task() send_data={'key':taskid,'request':base64_encode(raw_request),'url':base64_encode(url),'userhash':headers['userhash'],'apiserver':self.sqlmapapi} self.send_info(self.webserver+"/api.php?type=sqlmap",send_data) self.send_inject(taskid,post_data) self.upload_hash(md5string,taskid)