当前位置: 首页>>代码示例>>Python>>正文


Python MaltegoTransform.returnOutput方法代码示例

本文整理汇总了Python中MaltegoTransform.returnOutput方法的典型用法代码示例。如果您正苦于以下问题:Python MaltegoTransform.returnOutput方法的具体用法?Python MaltegoTransform.returnOutput怎么用?Python MaltegoTransform.returnOutput使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MaltegoTransform的用法示例。


在下文中一共展示了MaltegoTransform.returnOutput方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: main

# 需要导入模块: import MaltegoTransform [as 别名]
# 或者: from MaltegoTransform import returnOutput [as 别名]
def main():
#    print "Content-type: xml\n\n";
#    MaltegoXML_in = sys.stdin.read()
#    logging.debug(MaltegoXML_in)
#    if MaltegoXML_in <> '':
#     m = MaltegoMsg(MaltegoXML_in)

    #Custom query per transform, but apply filter with and_(*filters) from transformCommon.
    filters = []
    filters.extend((cookies.c.client_mac==mac, cookies.c.baseDomain==domain))
    s = select([cookies.c.name, cookies.c.value], and_(*filters))
    logging.debug(s) 
    #s = select([ssids.c.ssid]).where(ssids.c.mac==mac).distinct()
    r = db.execute(s)
    results = r.fetchall()
    logging.debug(results)
    #results = [t[0] for t in results]
    TRX = MaltegoTransform()

    illegal_xml_re = re.compile(u'[\x00-\x08\x0b-\x1f\x7f-\x84\x86-\x9f\ud800-\udfff\ufdd0-\ufddf\ufffe-\uffff]')


    for cookie in results:
        logging.debug(cookie)
        name, value = cookie
        NewEnt=TRX.addEntity("snoopy.Cookie", name)
        NewEnt.addAdditionalFields("value","Value", "strict",value)
        NewEnt.addAdditionalFields("fqdn","Domain", "strict",domain)
        NewEnt.addAdditionalFields("mac","Client Mac", "strict",mac)

    TRX.returnOutput()
开发者ID:SonRiab,项目名称:snoopy-ng,代码行数:33,代码来源:fetchCookies.py

示例2: main

# 需要导入模块: import MaltegoTransform [as 别名]
# 或者: from MaltegoTransform import returnOutput [as 别名]
def main():
#    print "Content-type: xml\n\n";
#    MaltegoXML_in = sys.stdin.read()
#    logging.debug(MaltegoXML_in)
#    if MaltegoXML_in <> '':
#     m = MaltegoMsg(MaltegoXML_in)

    #Custom query per transform, but apply filter with and_(*filters) from transformCommon.
    filters = []
    filters.append(weblogs.c.client_ip==ip)
    s = select([weblogs.c.useragent], and_(*filters))
    logging.debug(s) 
    #s = select([ssids.c.ssid]).where(ssids.c.mac==mac).distinct()
    r = db.execute(s)
    results = r.fetchall()
    logging.debug(results)
    #results = [t[0] for t in results]
    TRX = MaltegoTransform()

    illegal_xml_re = re.compile(u'[\x00-\x08\x0b-\x1f\x7f-\x84\x86-\x9f\ud800-\udfff\ufdd0-\ufddf\ufffe-\uffff]')

    for ua in results:
        logging.debug(ua)
        if str(ua).find('None') < 1:
            NewEnt=TRX.addEntity("snoopy.useragent", str(ua))
            NewEnt.addAdditionalFields("ip","Client IP", "strict",ip)

    TRX.returnOutput()
开发者ID:4sp1r3,项目名称:snoopy-ng,代码行数:30,代码来源:fetchUserAgent.py

示例3: main

# 需要导入模块: import MaltegoTransform [as 别名]
# 或者: from MaltegoTransform import returnOutput [as 别名]
def main():
#    print "Content-type: xml\n\n";
#    MaltegoXML_in = sys.stdin.read()
#    logging.debug(MaltegoXML_in)
#    if MaltegoXML_in <> '':
#     m = MaltegoMsg(MaltegoXML_in)

    #Custom query per transform, but apply filter with and_(*filters) from transformCommon.
    filters.append(ssids.c.mac==mac)
    s = select([ssids.c.ssid], and_(*filters))
 

    #s = select([ssids.c.ssid]).where(ssids.c.mac==mac).distinct()
    r = db.execute(s)
    results = r.fetchall()
    results = [t[0] for t in results]
    TRX = MaltegoTransform()

    illegal_xml_re = re.compile(u'[\x00-\x08\x0b-\x1f\x7f-\x84\x86-\x9f\ud800-\udfff\ufdd0-\ufddf\ufffe-\uffff]')


    for ssid in results:
        #ssid = b64decode(ssid)
        ssid=escape(ssid)
        ssid = illegal_xml_re.sub('', ssid)

        if not ssid.isspace() and ssid:
            NewEnt=TRX.addEntity("snoopy.SSID", ssid)
            NewEnt.addAdditionalFields("properties.ssid","ssid", "strict",ssid)

    TRX.returnOutput()
开发者ID:4sp1r3,项目名称:snoopy-ng,代码行数:33,代码来源:fetchSSIDs.py

示例4: parsereport

# 需要导入模块: import MaltegoTransform [as 别名]
# 或者: from MaltegoTransform import returnOutput [as 别名]
def parsereport(page):
	xform = MaltegoTransform()
	
	try:
		try:
			single = page.find(text='To mark the presence in the system, the following Mutex object was created:').findNext('ul').li.text
		except:
			single = None	
		try:
			multiple = page.find(text='To mark the presence in the system, the following Mutex objects were created:').findNext('ul')
		except:
			multiple = None	
				
		if single is not None:
			entity = xform.addEntity("maltego.IPv4Address", single)
			if multiple is not None:
				for mutex in multiple.findAll('li'):
					entity = xform.addEntity("maltego.Phrase", mutex.text)
		elif multiple is not None:
			for mutex in multiple.findAll('li'):
					entity = xform.addEntity("maltego.Phrase", mutex.text)
		else:
			sys.exit("No Mutexes Reported")
	
	except:
		sys.exit("Error finding Mutexes.")
			
	xform.returnOutput()
开发者ID:cmlh,项目名称:MaltegoWork,代码行数:30,代码来源:threatexpert_hash2mutex.py

示例5: main

# 需要导入模块: import MaltegoTransform [as 别名]
# 或者: from MaltegoTransform import returnOutput [as 别名]
def main():
#    print "Content-type: xml\n\n";
#    MaltegoXML_in = sys.stdin.read()
#    logging.debug(MaltegoXML_in)
#    if MaltegoXML_in <> '':
#     m = MaltegoMsg(MaltegoXML_in)

    #Custom query per transform, but apply filter with and_(*filters) from transformCommon.
    filters = []
    filters.append(cookies.c.client_mac==mac)
    #s = select([cookies.c.baseDomain], and_(*filters)) #Bug: baseDomain being returned as full URL.
    s = select([cookies.c.host], and_(*filters))
    logging.debug(s) 
    logging.debug(mac)
    #s = select([ssids.c.ssid]).where(ssids.c.mac==mac).distinct()
    r = db.execute(s)
    results = r.fetchall()
    results = [t[0] for t in results]
    TRX = MaltegoTransform()

    illegal_xml_re = re.compile(u'[\x00-\x08\x0b-\x1f\x7f-\x84\x86-\x9f\ud800-\udfff\ufdd0-\ufddf\ufffe-\uffff]')


    for domain in results:
        domain = illegal_xml_re.sub('', domain)
        NewEnt=TRX.addEntity("maltego.Domain", domain)
        NewEnt.addAdditionalFields("fqdn","Domain", "strict",domain)
        NewEnt.addAdditionalFields("mac","Client Mac", "strict",mac)

    TRX.returnOutput()
开发者ID:4sp1r3,项目名称:snoopy-ng,代码行数:32,代码来源:fetchDomains.py

示例6: main

# 需要导入模块: import MaltegoTransform [as 别名]
# 或者: from MaltegoTransform import returnOutput [as 别名]
def main():
#    print "Content-type: xml\n\n";
#    MaltegoXML_in = sys.stdin.read()
#    logging.debug(MaltegoXML_in)
#    if MaltegoXML_in <> '':
#     m = MaltegoMsg(MaltegoXML_in)

    #Custom query per transform, but apply filter with and_(*filters) from transformCommon.
#    s = select([proxs.c.drone], and_(*filters)).distinct()
    s = select([sess.c.drone], and_(*filters)).distinct()
    logging.debug(filters)
    logging.debug(s)
    r = db.execute(s)
    results = r.fetchall()
    results = [t[0] for t in results]
    TRX = MaltegoTransform()

    for drone in results:
        logging.debug(drone)
        NewEnt=TRX.addEntity("snoopy.Drone", drone)
        NewEnt.addAdditionalFields("properties.drone","drone", "strict",drone)
        NewEnt.addAdditionalFields("start_time", "start_time", "strict", start_time)
        NewEnt.addAdditionalFields("end_time", "end_time", "strict", end_time)
        #NewEnt.addAdditionalFields("drone", "drone", "strict", drone)
        #NewEnt.addAdditionalFields("location", "location", "strict", location)
    TRX.returnOutput()
开发者ID:4sp1r3,项目名称:snoopy-ng,代码行数:28,代码来源:fetchDrones.py

示例7: main

# 需要导入模块: import MaltegoTransform [as 别名]
# 或者: from MaltegoTransform import returnOutput [as 别名]
def main(argv):
    if argv[1] == "caseyso":
        namesList = ["bobbyo", "jjc", "alf", "courtp"]
    elif argv[1] == "jjc":
        namesList = ["caseyso", "jjc", "alf", "courtp", "mrclean"]
    elif argv[1] == "alf":
        namesList = ["mrclean", "jjc", "alf", "courtp", "joe"]
    elif argv[1] == "bobbyo":
        namesList = ["jjc", "caseyso", "brat322"]
    else:
        users = twitterSearch.getFollowers(argv[1])
        if DEBUG:
            print users
        searchString = ""
        for i in range(len(users["users"])):
            searchString += str(users["users"][i]["id"]) + ","

        if DEBUG:
            print searchString[:-1]

        names = twitterSearch.idToUsername(searchString[:-1])
        namesList = []
        for name in names:
            namesList.append(name["screen_name"])

    if DEBUG:
        print namesList

    mt = MaltegoTransform()
    for user_name in namesList:
        if DEBUG:
            print user_name
        mt.addEntity("maltego.Twit", user_name)

    mt.returnOutput()
开发者ID:cookies08,项目名称:maltego-project,代码行数:37,代码来源:getTwitterUsers.py

示例8: main

# 需要导入模块: import MaltegoTransform [as 别名]
# 或者: from MaltegoTransform import returnOutput [as 别名]
def main():
#    print "Content-type: xml\n\n";
#    MaltegoXML_in = sys.stdin.read()
#    logging.debug(MaltegoXML_in)
#    if MaltegoXML_in <> '':
#     m = MaltegoMsg(MaltegoXML_in)

    #Custom query per transform, but apply filter with and_(*filters) from transformCommon.
    filters = []
    filters.append(weblogs.c.client_ip==ip)
    s = select([weblogs.c.full_url, weblogs.c.cookies], and_(*filters))
    logging.debug(s) 
    #s = select([ssids.c.ssid]).where(ssids.c.mac==mac).distinct()
    r = db.execute(s)
    results = r.fetchall()
    #logging.debug(results)
    #results = [t[0] for t in results]
    TRX = MaltegoTransform()

    illegal_xml_re = re.compile(u'[\x00-\x08\x0b-\x1f\x7f-\x84\x86-\x9f\ud800-\udfff\ufdd0-\ufddf\ufffe-\uffff]')


    for res in results:
        logging.debug(res)
        url, cookies = res
        #logging.debug(cookies)
        NewEnt=TRX.addEntity("maltego.URL", url)
        NewEnt.addAdditionalFields("url","URL", "strict",url)

    TRX.returnOutput()
开发者ID:4sp1r3,项目名称:snoopy-ng,代码行数:32,代码来源:fetchURL.py

示例9: main

# 需要导入模块: import MaltegoTransform [as 别名]
# 或者: from MaltegoTransform import returnOutput [as 别名]
def main():

    #   init Maltego
    me = MaltegoTransform()

    #  open database and create a cursor object
    if not os.path.isfile(DBNAME):
        #print "Collecting intelligence from the Internet ..."
        me.addEntity("maltego.Phrase", "Database file not found " + DBNAME)
    conn = sqlite3.connect(DBNAME)
    conn.text_factory = str
    c = conn.cursor()

    #   reading samples table ...
    c.execute("SELECT * FROM samples")
    found = c.fetchall()
    if found is not None:
        for i in range(0, len(found)):
            #   adding Sample entity
            name = found[i][2]
            me.addEntity("ran2.Sample", name)
    else:
        #print "Collecting intelligence from the Internet ..."
        me.addEntity("maltego.Phrase", name + " is not found")


    me.returnOutput()
    conn.commit()
    c.close()
开发者ID:Beercow,项目名称:malicious-domain-profiling,代码行数:31,代码来源:mGetAllSamples.py

示例10: selectEvent

# 需要导入模块: import MaltegoTransform [as 别名]
# 或者: from MaltegoTransform import returnOutput [as 别名]
def selectEvent(eventID):
    s = shelve.open(eventDB)
    s['id'] = eventID
    s['age'] = datetime.today()
    s.close()
    mt = MaltegoTransform()
    mt.addUIMessage("[Info] Event with ID %s selected for insert" % eventID)
    mt.returnOutput()
开发者ID:MISP,项目名称:MISPego,代码行数:10,代码来源:mispego.py

示例11: returnSuccess

# 需要导入模块: import MaltegoTransform [as 别名]
# 或者: from MaltegoTransform import returnOutput [as 别名]
def returnSuccess(etype,value,event=None, mt=None):
    if not mt:
        mt = MaltegoTransform()
    if event:
        mt.addUIMessage("[Info] Successful entry of %s with value %s into event %s" % (etype, value, event))
    else:
        mt.addUIMessage("[Info] Successful entry of %s with ID %s" % (etype, value))
    mt.returnOutput()
开发者ID:MISP,项目名称:MISPego,代码行数:10,代码来源:mispego.py

示例12: main

# 需要导入模块: import MaltegoTransform [as 别名]
# 或者: from MaltegoTransform import returnOutput [as 别名]
def main(argv):
	myURLs = LinkedIn(sys.argv[1])

	mt = MaltegoTransform();
	for urls in myURLs:
		mt.addEntity("maltego.Alias", urls)

	mt.returnOutput()
开发者ID:Erik-k,项目名称:maltego_project,代码行数:10,代码来源:linkedin_xform.py

示例13: main

# 需要导入模块: import MaltegoTransform [as 别名]
# 或者: from MaltegoTransform import returnOutput [as 别名]
def main():
    filters.append(wigle.c.ssid == ssid)
    filters.append(wigle.c.overflow == 0)
    s = select([wigle], and_(*filters)).distinct().limit(limit)

    #s = select([ssids.c.ssid]).where(ssids.c.mac==mac).distinct()
    r = db.execute(s)
    results = r.fetchall()
    logging.debug(results)

    TRX = MaltegoTransform()

    illegal_xml_re = re.compile(u'[\x00-\x08\x0b-\x1f\x7f-\x84\x86-\x9f\ud800-\udfff\ufdd0-\ufddf\ufffe-\uffff]')


    for address in results:
        if len(results) > 20:
            break
        #ssid = b64decode(ssid)
        #ssid=escape(ssid)
        #ssid = illegal_xml_re.sub('', ssid)
        logging.debug(type(address))

        street_view_url1 = "http://maps.googleapis.com/maps/api/streetview?size=800x800&amp;sensor=false&amp;location=%s,%s" % (str(address['lat']),str(address['long']))
        street_view_url2 = "https://maps.google.com/maps?q=&layer=c&cbp=11,0,0,0,0&cbll=%s,%s " % (str(address['lat']),str(address['long']))
        map_url = "http://maps.google.com/maps?t=h&q=%s,%s"%(str(address['lat']),str(address['long']))
        flag_img = "http://www.geognos.com/api/en/countries/flag/%s.png" % str(address['code']).upper()

        #NewEnt=TRX.addEntity("maltego.Location", address['shortaddress'].encode('utf-8'))
        NewEnt=TRX.addEntity("snoopy.ssidLocation", address['shortaddress'].encode('utf-8'))
        NewEnt.addAdditionalFields("city","city", "strict", address['city'].encode('utf-8'))
        NewEnt.addAdditionalFields("countrycode","countrycode", "strict", address['code'].encode('utf-8'))
        NewEnt.addAdditionalFields("country","country", "strict", address['country'].encode('utf-8'))
        NewEnt.addAdditionalFields("lat","lat", "strict", str(address['lat']))
        NewEnt.addAdditionalFields("long","long", "strict", str(address['long']))
        NewEnt.addAdditionalFields("longaddress","longaddress", "strict", address['longaddress'].encode('utf-8'))
        NewEnt.addAdditionalFields("location.areacode","Area Code", "strict", address['postcode'])
        NewEnt.addAdditionalFields("road","Road", "strict", address['road'].encode('utf-8'))
        NewEnt.addAdditionalFields("streetaddress","streetaddress", "strict", address['shortaddress'].encode('utf-8'))
        NewEnt.addAdditionalFields("ssid","SSID", "strict", address['ssid'])
        NewEnt.addAdditionalFields("state","State", "strict", address['state'].encode('utf-8'))
        NewEnt.addAdditionalFields("area","Area", "strict", address['suburb'].encode('utf-8'))

        NewEnt.addAdditionalFields("googleMap", "Google map", "nostrict", map_url)
        NewEnt.addAdditionalFields("streetView", "Street View", "nostrict", street_view_url2)

        #NewEnt.setIconURL(flag_img)
        logging.debug(street_view_url1)
        NewEnt.setIconURL(street_view_url1)


        NewEnt.addDisplayInformation("<a href='%s'>Click for map </a>" % street_view_url2, "Street view")
        NewEnt.addDisplayInformation("one","two")

    #try:
    TRX.returnOutput()
开发者ID:4sp1r3,项目名称:snoopy-ng,代码行数:58,代码来源:fetchSSIDLocations.py

示例14: parsereport

# 需要导入模块: import MaltegoTransform [as 别名]
# 或者: from MaltegoTransform import returnOutput [as 别名]
def parsereport(page):
	xform = MaltegoTransform()
	
	table = page.find("div", {"id" : "network_hosts"}).findNext('table')
	elements = table.findAll('td', {"class" : "row"})
	for element in elements:
		text = element.find(text=True)
		entity = xform.addEntity("maltego.IPv4Address", text)
		
	xform.returnOutput()
开发者ID:cmlh,项目名称:MaltegoWork,代码行数:12,代码来源:malwr_hash2ip.py

示例15: parsereport

# 需要导入模块: import MaltegoTransform [as 别名]
# 或者: from MaltegoTransform import returnOutput [as 别名]
def parsereport(page):
	xform = MaltegoTransform()
	
	try:
		for element in page.findAll(text=re.compile("^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$")):
			entity = xform.addEntity("maltego.IPv4Address", element)
	except:
		sys.exit("Report contains no IPs.")
			
	xform.returnOutput()
开发者ID:cmlh,项目名称:MaltegoWork,代码行数:12,代码来源:threatexpert_hash2ip.py


注:本文中的MaltegoTransform.returnOutput方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。