本文整理汇总了Python中MaltegoTransform.addEntity方法的典型用法代码示例。如果您正苦于以下问题:Python MaltegoTransform.addEntity方法的具体用法?Python MaltegoTransform.addEntity怎么用?Python MaltegoTransform.addEntity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MaltegoTransform
的用法示例。
在下文中一共展示了MaltegoTransform.addEntity方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: import MaltegoTransform [as 别名]
# 或者: from MaltegoTransform import addEntity [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()
示例2: parsereport
# 需要导入模块: import MaltegoTransform [as 别名]
# 或者: from MaltegoTransform import addEntity [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()
示例3: main
# 需要导入模块: import MaltegoTransform [as 别名]
# 或者: from MaltegoTransform import addEntity [as 别名]
def main(argv):
myURLs = LinkedIn(sys.argv[1])
mt = MaltegoTransform();
for urls in myURLs:
mt.addEntity("maltego.Alias", urls)
mt.returnOutput()
示例4: main
# 需要导入模块: import MaltegoTransform [as 别名]
# 或者: from MaltegoTransform import addEntity [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.
#db.echo=True
#Need to implement outer join at some point:
# s=select([cookies.c.client_mac]).outerjoin(vends, cookies.c.client_mac == vends.c.mac) #Outer join
sl = select([leases.c.mac, leases.c.hostname]).distinct()
lease_list = dict ( db.execute(sl).fetchall() )
#filters.append(cookies.c.client_mac == vends.c.mac) # Replaced with JOIN
j = cookies.outerjoin(vends, cookies.c.client_mac == vends.c.mac)
s = select([cookies.c.client_mac,vends.c.vendor, vends.c.vendorLong], and_(*filters)).select_from(j).distinct()
logging.debug(s)
#s = select([cookies.c.client_mac,vends.c.vendor, vends.c.vendorLong], and_(*filters))
if ssid:
nfilters=[]
nfilters.append(ssids.c.ssid == ssid)
nfilters.append(ssids.c.mac == vends.c.mac)
s = select([ssids.c.mac,vends.c.vendor, vends.c.vendorLong], and_(*nfilters))
#logging.debug(s)
#s = select([cookies.c.client_mac,vends.c.vendor, vends.c.vendorLong], and_(cookies.c.client_mac == vends.c.mac, cookies.c.num_probes>1 ) ).distinct()
cwdF = [cookies.c.run_id == sess.c.run_id]
cw = select([cookies.c.client_mac], and_(*cwdF))
logging.debug(cw)
r = db.execute(s)
results = r.fetchall()
TRX = MaltegoTransform()
for mac,vendor,vendorLong in results:
hostname = lease_list.get(mac)
if hostname:
NewEnt=TRX.addEntity("snoopy.Client", "%s\n(%s)" %(vendor,hostname))
else:
NewEnt=TRX.addEntity("snoopy.Client", "%s\n(%s)" %(vendor,mac[6:]))
NewEnt.addAdditionalFields("mac","mac address", "strict",mac)
NewEnt.addAdditionalFields("vendor","vendor", "nostrict", vendor)
NewEnt.addAdditionalFields("vendorLong","vendorLong", "nostrict", vendorLong)
TRX.returnOutput()
示例5: main
# 需要导入模块: import MaltegoTransform [as 别名]
# 或者: from MaltegoTransform import addEntity [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()
示例6: main
# 需要导入模块: import MaltegoTransform [as 别名]
# 或者: from MaltegoTransform import addEntity [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()
示例7: main
# 需要导入模块: import MaltegoTransform [as 别名]
# 或者: from MaltegoTransform import addEntity [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()
示例8: main
# 需要导入模块: import MaltegoTransform [as 别名]
# 或者: from MaltegoTransform import addEntity [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()
示例9: main
# 需要导入模块: import MaltegoTransform [as 别名]
# 或者: from MaltegoTransform import addEntity [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()
示例10: main
# 需要导入模块: import MaltegoTransform [as 别名]
# 或者: from MaltegoTransform import addEntity [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()
示例11: main
# 需要导入模块: import MaltegoTransform [as 别名]
# 或者: from MaltegoTransform import addEntity [as 别名]
def main(argv):
url = sys.argv[1];
html = urllib.urlopen(url).read()
emails = collectAllEmail(html)
#print emails
#myfile = open('emails.csv', 'wb')
#wr = csv.writer(myfile, quoting=csv.QUOTE_ALL)
#wr.writerow(emails)
mt = MaltegoTransform();
for email in emails:
mt.addEntity("maltego.EmailAddress", email)
mt.returnOutput()
示例12: main
# 需要导入模块: import MaltegoTransform [as 别名]
# 或者: from MaltegoTransform import addEntity [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&sensor=false&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()
示例13: parsereport
# 需要导入模块: import MaltegoTransform [as 别名]
# 或者: from MaltegoTransform import addEntity [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()
示例14: parsereport
# 需要导入模块: import MaltegoTransform [as 别名]
# 或者: from MaltegoTransform import addEntity [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()
示例15: main
# 需要导入模块: import MaltegoTransform [as 别名]
# 或者: from MaltegoTransform import addEntity [as 别名]
def main(argv):
url = sys.argv[1];
html = urllib.urlopen(url).read()
emails = collectAllEmail(html)
#print emails
#myfile = open('emails.csv', 'wb')
#wr = csv.writer(myfile, quoting=csv.QUOTE_ALL)
#wr.writerow(emails)
mt = MaltegoTransform();
for email in emails:
index = email.find('@');
alias = email[:index]
mt.addEntity("maltego.Alias", alias)
mt.returnOutput()