intruders

few scripts that checks two letter domains with .mk tld
Log | Files | Refs | README

commit f980206aba4c78ad6841e6ba220ba981b0fe2abd
parent 2cde1d58aa5e26a9c7d4374a6551b580d266a2f0
Author: tin <ichtinnotl@gmail.com>
Date:   Sun, 30 Dec 2018 12:58:42 +0100

removes old commented code

Diffstat:
intruders.py | 145++-----------------------------------------------------------------------------
1 file changed, 2 insertions(+), 143 deletions(-)

diff --git a/intruders.py b/intruders.py @@ -198,146 +198,4 @@ def main(): return None -main() - - -# def create_database(): -# conn = sqlite3.connect('mk_domains.db') -# c = conn.cursor() - -# try: -# c.execute('''CREATE TABLE full_log -# (domain_name text, address text, register_date text, expire_date text)''') - -# c.execute('''CREATE TABLE clean_log -# (address text, totalRegistered int)''') - -# c.execute('''CREATE TABLE unregistered_domains_log -# (unregistered text)''') - -# conn.commit() -# conn.close() -# except Exception as e: -# print(e) - -# return None - -# def main(): -# create_database() - -# countSavesInDatabase = 0 - -# for (x, y) in itertools.product(alphabet, repeat = 2): -# domain = x + y + ".mk" -# command = f"whois {domain} | grep 'domain:\|registered:\|expire:\|address:'" - -# try: -# output = str((subprocess.check_output(command, shell=True)), 'UTF-8') -# except Exception: -# addresses["UNREGISTERED_DOMAINS"] += 1 -# logUnregisteredDomain(domain) -# continue - -# domain_name, address_name, register_date, expire_date = beautifyOutput(output) -# saveAsFullLog = writeFullLog(domain_name, address_name, register_date, expire_date) - -# if saveAsFullLog: -# countSavesInDatabase += 1 -# print(f"Query number {countSavesInDatabase} was successfully written in database.") -# else: -# print("Cannot write full log to database for some reason.") # 'for some reason' :D - -# # chill or hammer? -# # time.sleep(3) - -# saveAsCleanLog = writeCleanLog() - -# if saveAsCleanLog: -# print("Clean log was successfully written in database.") -# else: -# print("Cannot write clean log to database.") - -# print("done.") -# return True - -# def beautifyOutput(output): -# output = output.splitlines() - -# for line in output: -# """ Get info from the domain line """ -# if line.startswith("domain:"): -# domain_name = line.partition(':')[2].strip() - -# """ Get info from the address line """ -# if line.startswith("address:"): -# address_name = line.partition(':')[2].strip() - -# if address_name in addresses: -# addresses[address_name] += 1 -# break -# elif len(address_name) == 2 and address_name.isupper(): -# addresses["OTHER_COUNTRY_CODES"] += 1 -# break -# else: -# pass - -# """ Get info from the registered line """ -# if line.startswith("registered:"): -# register_date = line.partition(':')[2].strip() - -# """ Get info from the expire line """ -# if line.startswith("expire:"): -# expire_date = line.partition(':')[2].strip() - -# return domain_name, address_name, \ -# register_date, expire_date - -# def writeFullLog(domain_name, address_name, register_date, expire_date): -# conn = sqlite3.connect('two_letter_mk_domains_log.db') -# c = conn.cursor() - -# query = f"INSERT INTO full_log VALUES ('{domain_name}', '{address_name}', '{register_date}', '{expire_date}')" -# c.execute(query) -# conn.commit() -# conn.close() - -# return True - -# def writeCleanLog(): -# total_foreign_domains = 0 -# skipAddress = ["MK", "UNREGISTERED_DOMAINS"] - -# for address in addresses: -# if address in skipAddress: -# pass -# else: -# total_foreign_domains += addresses[address] - -# addresses['TOTAL_FOREIGN_DOMAINS'] = total_foreign_domains - -# conn = sqlite3.connect('two_letter_mk_domains_log.db') -# c = conn.cursor() - -# for address in addresses: -# query = f"INSERT INTO clean_log VALUES ('{address}', '{addresses[address]}')" -# c.execute(query) -# conn.commit() - -# conn.close() -# # pprint.pprint(addresses) - -# return True - - -# def logUnregisteredDomain(unregistered): -# conn = sqlite3.connect('two_letter_mk_domains_log.db') -# c = conn.cursor() - -# query = f"INSERT INTO unregistered_domains_log VALUES ('{unregistered}')" -# c.execute(query) -# conn.commit() -# conn.close() - -# return None - -# main() +main()+ \ No newline at end of file