me.parseArguments(sys.argv); target = me.getValue(); portsFound = ""; fn = target + "-ports-" + str(random.randint(1000,9999)) + ".dat"; defaultScanPorts = "22,21,25,80,443,3306"; scanPorts = EasyDialogs.AskString("Which TCP ports do you want to scan on " + target +"?",defaultScanPorts); if (scanPorts is None): me.returnOutput(); exit(); myentity = me.addEntity("IPAddress",target); nmapCMD = "nmap -n -oG " + fn + " -p" + scanPorts + " -sS -PN " + target + ">"+fn+".stdout"; os.system(nmapCMD); try: if (os.path.exists(fn) == False): me.debug("File not found, please make sure another scan is not currently running. (windows limitation)"); me.returnOutput(); exit(); f = open(fn) for line in f: if (line[:1] <> "#"): fields = line.split("\t"); for field in fields: theField = field.split(": "); if(theField[0] == "Ports"): allports = theField[1].split(","); for port in allports: port = port.replace("//","/"); values = port.split("/"); if (values[1] == "open"): portNumber = values[0].strip();
#!/usr/bin/python # Twitter ID to weighted influencers # Minor tweak import sys from MaltegoTransform import * from pyklout import Klout api = Klout("YOUR API KEY") me = MaltegoTransform(); me.debug("Starting Transform"); #Debug Info name = str(sys.argv[1]) data = api.identity(name,'twitter') user_id = data['id'] # fails hard if you feed it a name that doesn't have a Klout account # really must find Python equivalent of Try::Tiny for this problem. list = api.influences(user_id) for inf in list['myInfluencers']: name = str(inf['entity']['payload']['nick']); score = str(int(inf['entity']['payload']['score']['score'])); NewEnt = me.addEntity("AffiliationTwitter",name); NewEnt.setWeight(score); NewEnt.addAdditionalFields("affiliation.uid","UID","",name); nurl = "http://twitter.com/" + name; NewEnt.addAdditionalFields("affiliation.profile-url","Profile URL","",nurl); NewEnt.addAdditionalFields("twitter.screen-name","Screen Name","",name); me.returnOutput();
me.parseArguments(sys.argv) target = me.getValue() targetRange = target.split("-") ipr = IPRange(targetRange[0], targetRange[1]) rangeTarget = "" for i in ipr.cidrs(): rangeTarget = rangeTarget + str(i) + " " fn = target + "-ports-" + str(random.randint(1000, 9999)) + ".dat" defaultScanPorts = "22,21,25,80,443,3306" scanPorts = EasyDialogs.AskString( "Which ports do you want to scan on " + target + "?", defaultScanPorts) if (scanPorts is None): me.returnOutput() exit() nmapCMD = "nmap -n -oG " + fn + " -p" + scanPorts + " -sS -PN " + rangeTarget + ">" + fn + ".stdout" me.debug("running " + nmapCMD + "\n") os.system(nmapCMD) try: if (os.path.exists(fn) == False): me.debug( "File not found, please make sure another scan is not currently running and/or a resource is not using the file" ) me.returnOutput() exit() f = open(fn) for line in f: lasthost = "" portsFound = "" if (line[:1] <> "#"): fields = line.split("\t") for field in fields:
#!/usr/bin/python # Twitter ID to weighted influencers # Minor tweak import sys from MaltegoTransform import * from pyklout import Klout api = Klout("YOUR API KEY") me = MaltegoTransform() me.debug("Starting Transform") #Debug Info name = str(sys.argv[1]) data = api.identity(name, 'twitter') user_id = data['id'] # fails hard if you feed it a name that doesn't have a Klout account # really must find Python equivalent of Try::Tiny for this problem. list = api.influences(user_id) for inf in list['myInfluencers']: name = str(inf['entity']['payload']['nick']) score = str(int(inf['entity']['payload']['score']['score'])) NewEnt = me.addEntity("AffiliationTwitter", name) NewEnt.setWeight(score) NewEnt.addAdditionalFields("affiliation.uid", "UID", "", name) nurl = "http://twitter.com/" + name NewEnt.addAdditionalFields("affiliation.profile-url", "Profile URL", "", nurl) NewEnt.addAdditionalFields("twitter.screen-name", "Screen Name", "", name) me.returnOutput()
#!/usr/bin/python # Twitter ID to weighted influencers # minor tweak import sys from MaltegoTransform import * from pyklout import Klout api = Klout("YOUR API KEY HERE") me = MaltegoTransform(); me.debug("Starting Transform"); #Debug Info name = str(sys.argv[1]) data = api.identity(name,'twitter') user_id = data['id'] # fails hard if you feed it a name that doesn't have a Klout account # really must find Python equivalent of Try::Tiny for this problem. list = api.influences(user_id) for inf in list['myInfluencees']: name = str(inf['entity']['payload']['nick']); score = str(int(inf['entity']['payload']['score']['score'])); NewEnt = me.addEntity("AffiliationTwitter",name); NewEnt.setWeight(score); NewEnt.addAdditionalFields("affiliation.uid","UID","",name); nurl = "http://twitter.com/" + name; NewEnt.addAdditionalFields("affiliation.profile-url","Profile URL","",nurl); NewEnt.addAdditionalFields("twitter.screen-name","Screen Name","",name); me.returnOutput();
####################################################### import os,sys,time from MaltegoTransform import * me = MaltegoTransform(); me.parseArguments(sys.argv); ports = me.getVar("ports"); target = me.getValue(); fn = target + "-version"; if (ports == None): me.addUIMessage("No ports found, please do a portscan first!"); me.returnOutput(); exit(); nmapCMD = "nmap --version-light -oG " + fn + " -sV -PN -p" + ports + " " + target + ">"+fn+".stdout" me.debug("running " + nmapCMD); os.system(nmapCMD); try: if (os.path.exists(fn) == False): me.debug("File not found, please make sure another scan is not currently running. (windows limitation)"); me.returnOutput(); exit(); f = open(fn) for line in f: if (line[:1] <> "#"): fields = line.split("\t"); for field in fields: theField = field.split(": "); if(theField[0] == "Ports"): #we can haz ports.