コード例 #1
0
ファイル: whois.py プロジェクト: HMSH00D/KatanaFramework
def main(run):
	try:
		# HEAD MODULE
		if run:	actions=raw_input(Message.prompt(initialize.CodeName))
		else  : actions="run"
		if   getFunction.KatanaCheckActionShowOptions(actions):getFunction.ShowOptions(initialize.DEFAULT_VARIABLE)
		elif getFunction.KatanaCheckActionSetValue(actions)   :initialize.DEFAULT_VARIABLE=getFunction.UpdateValue(actions,initialize.DEFAULT_VARIABLE)
		elif getFunction.KatanaCheckActionisBack(actions)     :return
		# END HEAD MODULE
		elif getFunction.runModule(actions):
			Message.run()
			# CODE MODULE    ############################################################################################
			try:
				getFunction.live(initialize.DEFAULT_VARIABLE[0][0],initialize.DEFAULT_VARIABLE[1][0])
				if True:
					w = whois.whois(initialize.DEFAULT_VARIABLE[0][0])
					if w:
						wd = w.__dict__
						print colors[10]
						for k, v in wd.items():
							print('%20s\t"%s"' % (k, v))
						print colors[0]
			except:
				Errors.Errors(event=sys.exc_info(), info=initialize.DEFAULT_VARIABLE[0][0]+":"+initialize.DEFAULT_VARIABLE[1][0])
			# END CODE MODULE ############################################################################################
		else:
			getFunction.KatanaCheckActionGlobalCommands(actions)
	# ERROR GENERAL
	except:
		Errors.Errors(event=sys.exc_info(), info=sys.exc_traceback.tb_lineno)
	# END ERROR GENERAL
	main(True)
コード例 #2
0
ファイル: whois.py プロジェクト: TxBlackWolf/KatanaFramework
def main(run):
    NET.CheckConnectionHost(init.var['target'], init.var['port'], 5)

    w = whois.whois(init.var['target'])
    wd = w.__dict__
    for k, v in wd.items():
        print(colors[10] + '%20s\t"%s"' % (k, v))
        print colors[0]
コード例 #3
0
ファイル: whois.py プロジェクト: 0xicl33n/KatanaFramework
def main(run):
	isLive(init.var['target'],HTTP_PORT)

	w = whois.whois(init.var['target'])
	wd = w.__dict__
	for k, v in wd.items():
		print(colors[10]+'%20s\t"%s"' % (k, v))
		print colors[0]

# END CODE MODULE ############################################################################################
コード例 #4
0
def main(run):
    isLive(init.var['target'], HTTP_PORT)

    w = whois.whois(init.var['target'])
    wd = w.__dict__
    for k, v in wd.items():
        print(colors[10] + '%20s\t"%s"' % (k, v))
        print colors[0]


# END CODE MODULE ############################################################################################
コード例 #5
0
def wuis(run):
    try:
        global defaulthost, defaultport
        if run != 1:
            actions = raw_input(d.prompt("web/whois"))
        else:
            actions = "run"
        if actions == "show options" or actions == "sop":
            d.option()
            d.descrip("target", "yes", "IP or DNS", defaulthost)
            d.descrip("port", "no", "Port of target", defaultport)
            d.space()
        elif actions[0:10] == "set target":
            defaulthost = defaulthost.replace("http://", "")
            defaulthost = ping.update(defaulthost, actions, "target")
            d.change("target", defaulthost)
        elif actions[0:8] == "set port":
            defaultport = ping.update(defaultport, actions, "port")
            d.change("port", defaultport)
        elif actions == "exit" or actions == "x":
            d.goodbye()
            exit()
        elif actions == "help" or actions == "h":
            help.help()
        elif actions == "back" or actions == "b":
            return
            return
        elif actions == "run" or actions == "r":
            d.run()
            try:
                ping.live(defaulthost, defaultport)
                if True:
                    try:
                        w = whois.whois(defaulthost)
                        if w:
                            wd = w.__dict__
                            for k, v in wd.items():
                                print('%20s\t"%s"' % (k, v))
                            print ""
                    except:
                        Errors.Errors(event=sys.exc_info(), info=False)
            except:
                Errors.Errors(event=sys.exc_info()[0],
                              info=defaulthost + ":" + defaultport)
        else:
            d.No_actions()
    except:
        Errors.Errors(event=sys.exc_info()[0], info=False)
    wuis(0)
コード例 #6
0
ファイル: Whois.py プロジェクト: hanshaze/Katana
def wuis(run):
	try:
		global defaulthost,defaultport
		if run!=1:
			actions=raw_input(d.prompt("web/whois"))
		else:
			actions="run"
		if actions == "show options" or actions == "sop":
			d.option()
			d.descrip("target","yes","IP or DNS",defaulthost)
			d.descrip("port","no","Port of target",defaultport)
			d.space()
		elif actions[0:10] == "set target":
			defaulthost=defaulthost.replace("http://", "")
			defaulthost=ping.update(defaulthost,actions,"target")
			d.change("target",defaulthost)
		elif actions[0:8] == "set port":
			defaultport=ping.update(defaultport,actions,"port")
			d.change("port",defaultport)
		elif actions=="exit" or actions=="x":
			d.goodbye()
			exit()
		elif actions=="help" or actions=="h":
			help.help()
		elif actions=="back" or actions=="b":
			return
			return
		elif actions=="run"  or actions=="r":
			d.run()
			try:
				ping.live(defaulthost,defaultport)
				if True:
					try:
						w = whois.whois(defaulthost)
						if w:
							wd = w.__dict__
							for k, v in wd.items():
								print('%20s\t"%s"' % (k, v))
							print ""
					except:
						Errors.Errors(event=sys.exc_info(), info=False)
			except:
				Errors.Errors(event=sys.exc_info()[0], info=defaulthost+":"+defaultport)
		else:
			d.No_actions()
	except:
		Errors.Errors(event=sys.exc_info()[0], info=False)
	wuis(0)
コード例 #7
0
ファイル: Whois.py プロジェクト: GrizzlySystems/Katana
def wuis(run):
	try:
		global defaulthost,defaultport
		if run!=1:
			actions=raw_input(d.prompt("web/whois"))
		else:
			actions="run"
		if actions == "show options" or actions == "sop":
			d.option()
			d.descrip("target","yes","IP or DNS",defaulthost)
			d.descrip("port","no","Port of target",defaultport)
			print ""
		elif actions[0:10] == "set target":
			defaulthost = actions[11:]
			d.change("target",defaulthost)
			wuis(0)
		elif actions=="exit" or actions=="x":
			d.goodbye()
			exit()
		elif actions=="help" or actions=="h":
			help.help()
		elif actions=="back" or actions=="b":
			return
			return
		elif actions=="run"  or actions=="r":
			d.run()
			try:
				ping.live(defaulthost,defaultport)
				if True:
					try:
						w = whois.whois(defaulthost)
						if w:
							wd = w.__dict__
							for k, v in wd.items():
								print('%20s\t"%s"' % (k, v))
							print ""
					except(KeyboardInterrupt):
						d.kbi()
						exit()
			except:
				d.off()
		else:
			d.nocommand()
	except:
		d.kbi()
		exit()
	wuis(0)
コード例 #8
0
def wuis(run):
    try:
        global defaulthost, defaultport
        if run != 1:
            actions = raw_input(d.prompt("web/whois"))
        else:
            actions = "run"
        if actions == "show options" or actions == "sop":
            d.option()
            d.descrip("target", "yes", "IP or DNS", defaulthost)
            d.descrip("port", "no", "Port of target", defaultport)
            print ""
        elif actions[0:10] == "set target":
            defaulthost = actions[11:]
            d.change("target", defaulthost)
            wuis(0)
        elif actions == "exit" or actions == "x":
            d.goodbye()
            exit()
        elif actions == "help" or actions == "h":
            help.help()
        elif actions == "back" or actions == "b":
            return
            return
        elif actions == "run" or actions == "r":
            d.run()
            try:
                ping.live(defaulthost, defaultport)
                if True:
                    try:
                        w = whois.whois(defaulthost)
                        if w:
                            wd = w.__dict__
                            for k, v in wd.items():
                                print('%20s\t"%s"' % (k, v))
                            print ""
                    except (KeyboardInterrupt):
                        d.kbi()
                        exit()
            except:
                d.off()
        else:
            d.nocommand()
    except:
        d.kbi()
        exit()
    wuis(0)
コード例 #9
0
ファイル: whois.py プロジェクト: Postgre/HackingTools
def main(run):
	
	result = whois.whois(init.var['target'])
	result_parse = json.loads(str(result))
	print "     |"
	print "     | Date: "+str(result_parse["updated_date"])
	print "     | Status: "
	#print result_parse["status"]
	for u in result_parse["status"]:
		if len(u) == 1:
			print "     |        "+str(result_parse["status"])
			break
		print "     |        "+str(u)
	print "     | Name: "+str(result_parse["name"])
	print "     | Dnssec: "+str(result_parse["dnssec"])
	print "     | City:   "+str(result_parse["city"])
	print "     | Expiration date: "+str(result_parse["expiration_date"])
	print "     | Zipcode: "+str(result_parse["zipcode"])
	print "     | Domain names:"
	for n in result_parse["domain_name"]:
		if len(n) == 1:
			print "     |        "+str(result_parse["domain_name"])
			break
		print "     |        "+str(n)	
	print "     | Whois servers: "+str(result_parse["whois_server"])
	print "     | State: "+str(result_parse["state"])
	print "     | Registrar: "+str(result_parse["registrar"])
	print "     | Referral url: "+str(result_parse["referral_url"]) 
	print "     | Country: "+str(result_parse["country"])
	print "     | Name servers:"
	for s in result_parse["name_servers"]:
                if len(s) == 1:
                        print "     |        "+str(result_parse["name_servers"])
                        break
		print "     |        "+str(s)
	print "     | Org: "+str(result_parse["org"])
	print "     | Creation date: "+str(result_parse["creation_date"])
	print "     | Emails:"
	for e in result_parse["emails"]:
                if len(e) == 1:
                        print "     |        "+str(result_parse["emails"])
                        break
		print "     |        "+str(e)
	print "     |"
コード例 #10
0
def main(run):

    result = whois.whois(init.var['target'])
    result_parse = json.loads(str(result))
    print "     |"
    print "     | Date: " + str(result_parse["updated_date"])
    print "     | Status: "
    #print result_parse["status"]
    for u in result_parse["status"]:
        if len(u) == 1:
            print "     |        " + str(result_parse["status"])
            break
        print "     |        " + str(u)
    print "     | Name: " + str(result_parse["name"])
    print "     | Dnssec: " + str(result_parse["dnssec"])
    print "     | City:   " + str(result_parse["city"])
    print "     | Expiration date: " + str(result_parse["expiration_date"])
    print "     | Zipcode: " + str(result_parse["zipcode"])
    print "     | Domain names:"
    for n in result_parse["domain_name"]:
        if len(n) == 1:
            print "     |        " + str(result_parse["domain_name"])
            break
        print "     |        " + str(n)
    print "     | Whois servers: " + str(result_parse["whois_server"])
    print "     | State: " + str(result_parse["state"])
    print "     | Registrar: " + str(result_parse["registrar"])
    print "     | Referral url: " + str(result_parse["referral_url"])
    print "     | Country: " + str(result_parse["country"])
    print "     | Name servers:"
    for s in result_parse["name_servers"]:
        if len(s) == 1:
            print "     |        " + str(result_parse["name_servers"])
            break
        print "     |        " + str(s)
    print "     | Org: " + str(result_parse["org"])
    print "     | Creation date: " + str(result_parse["creation_date"])
    print "     | Emails:"
    for e in result_parse["emails"]:
        if len(e) == 1:
            print "     |        " + str(result_parse["emails"])
            break
        print "     |        " + str(e)
    print "     |"
コード例 #11
0
def getDataFromRow(row, counter):
    print("Processing the domain: " + str(row['Domain']))
    print("\nCounter: " + str(counter))
    logging.info("Processing the domain: " + str(row['Domain']))
    logging.info("Counter: " + str(counter))

    id = counter

    features.domain = row['Domain']
    features.ip = getIp(features.domain)
    features.MXDnsResponse = getMXDnsResponse(features.domain)
    txtDnsReponse = getTXTDnsResponse(features.domain)
    dmarcResponse = getTXTDnsDmarcResponse(features.domain)
    features.TXTDnsResponse = 1 if txtDnsReponse is not None else 0
    features.hasSPFInfo = getSPFInfo(txtDnsReponse)
    features.hasDkimInfo = getDkim(txtDnsReponse)
    features.hasDmarcInfo = getDmarc(dmarcResponse)
    features.domainInAlexaDB = existsInAlexaDb(features.domain)
    features.commonPorts = getCommonPortsMultiThread(features.domain)

    features.httpResponseCode = getHttpResponseCode(features.domain)

    subdomains = getSubdomains(features.domain)
    features.subdomainNumber = len(subdomains) if subdomains is not None else 0

    features.entropy = entropyCalc(features.domain, False)
    features.entropyOfSubDomains = getSubdomainsEntropy(
        subdomains, features.domain)
    features.strangeCharacters = getStrangeCharacters(features.domain)
    features.TLD = getTldFromUrl(features.domain)

    features.domainReputation = 1 if getDomainReputation(
        features.domain) else 0
    features.consoantRatio = ratioCalculator(features.domain,
                                             Lists.CONSOANT.value)
    features.numericRatio = ratioCalculator(features.domain,
                                            Lists.NUMERIC.value)
    features.specialCharRatio = ratioCalculator(features.domain,
                                                Lists.SPECIALCHAR.value)
    features.vowelRatio = ratioCalculator(features.domain, Lists.VOWEL.value)
    features.consoantSequence = sequenceCalculator(features.domain,
                                                   Lists.CONSOANT.value)
    features.vowelSequence = sequenceCalculator(features.domain,
                                                Lists.VOWEL.value)
    features.numericSequence = sequenceCalculator(features.domain,
                                                  Lists.NUMERIC.value)
    features.specialCharSequence = sequenceCalculator(features.domain,
                                                      Lists.SPECIALCHAR.value)

    features.domainLength = len(features.domain)

    features.classExample = row['Class']

    features.countryCode = getCountryIsoCode(features.ip)
    features.ASN = getAsn(features.ip)
    features.ipReputation = 1 if getIpReputation(features.ip) else 0
    whoIsData = whois(features.ip)
    features.registeredOrg = getRegisteredOrg(whoIsData)
    features.registeredCountry = getRegisteredCountry(whoIsData)
    # return days
    features.lastUpdateDate, features.creationDate = getLastUpdateAndCreationDate(
        whoIsData)

    return id, [
        features.domain, features.MXDnsResponse, features.TXTDnsResponse,
        features.hasSPFInfo, features.hasDkimInfo, features.hasDmarcInfo,
        features.ip, features.domainInAlexaDB, features.commonPorts,
        features.countryCode, features.registeredCountry,
        features.creationDate, features.lastUpdateDate, features.ASN,
        features.httpResponseCode, features.registeredOrg,
        features.subdomainNumber, features.entropy,
        features.entropyOfSubDomains, features.strangeCharacters, features.TLD,
        features.ipReputation, features.domainReputation,
        features.consoantRatio, features.numericRatio,
        features.specialCharRatio, features.vowelRatio,
        features.consoantSequence, features.vowelSequence,
        features.numericSequence, features.specialCharSequence,
        features.domainLength, features.classExample
    ]