def getwig(url): print("Scanning: " + url) w = wig(url=url) w.run() result = w.get_results() # print(result) return(str(result), url)
def info_002(self): w = wig(url=self.stripped_target, run_all=True, proxy="localhost:" + self.zap.port) # see github.com/jkyc/wig/blob/master/wig/wig.py#L284 for options # since the normal output format is slightly arcane, it may make more sense # to dump to a json file and re-import # alternatively, sort through results for OS and Platform w.run() res = w.get_results() ret = [] for nt in res: #entry = nt._asdict() # asdict omits the name of the tuple. wig has some overlap and ambiguity # so we'll add the name of the named tuple #entry["class"] = type( nt ).__name__ note = "Information Discovery" url = "" if ("note" in nt._fields): note = nt.note else: note = type(nt).__name__ if ("url" in nt._fields): path = nt.url else: path = None ret.append( create_report("info_002", note, severity="low", misc=[nt.__str__()], path=path)) return ret
def run(self): content = Query() args = {'url': self.src} _log.info("wig thread start: %s", self.uuid) w = wig(**args) w.run() data = {'wig': w.get_results()} _log.info("wig thread return: %s", data) self.db.update(data, content.uuid == self.uuid)
def run_fingerprint(place_id): client = MongoClient(dbhost, dbport) db = client.prospectinator places = db.places query_url = place_url % (place_id, gmaps_apikey) # retrieve a record by the place id. If it is not present, create a new one. place_doc = places.find_one({'result.place_id': place_id}) or json.loads( requests.get(query_url).text) if 'website' in place_doc['result']: if 'fingerprint' not in place_doc and site_is_up( place_doc['result']['website']): print("scanning url %-40s for place ID %s" % (place_doc['result']['website'], place_id)) w = wig(url=place_doc['result']['website']) w.run() results = OutputJSON(w.options, w.data) results.add_results() place_doc['fingerprint'] = results.json_data[0] places.save(place_doc) return
def process(bot, update): if update.message.text == '/wig@AegisRobot' or update.message.text == '/wig': update.message.reply_text('*Syntax*: `/wig domain`', 'Markdown') else: parameter = update.message.text.replace("/wig ", "") domain_valid = re.match( "(?=^.{4,253}$)(^((?!-)[a-zA-Z0-9-]{1,63}(?<!-)\.)+[a-zA-Z]{2,63}$)", parameter) if domain_valid: update.message.reply_text( "Please be patient! The result will be sent when the scan is complete" ) w = wig(url=parameter) w.run() results = w.get_results() if not results: update.message.reply_text( "An error has been occurred. I can't scan this domain") else: str1 = "\n".join(str(x) for x in results) update.message.reply_text(str1) else: update.message.reply_text( "You may have the incorrect input, check your parameter")
def home(request): w = wig(url='github.com') w.run() results = w.get_results() return HttpResponse(json.dumps(results))