Kulyutmaz is a project developed for the regional TUBITAK competition's programming field thart aims to create a more advanced phishing e-mail detection algorithm using website content checking and a neural network that we have trained.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

31 lines
714 B

import sys
log_file = sys.argv[1]
file_prev = ""
tags = tuple(sys.argv[2].split(","))
def str_diff(str1:str,str2:str) -> str:
return str1[len(str2):]
while 1:
try:
new_log = ""
with open("logs/" + log_file,"r") as f:
file_current = f.read()
if file_prev != file_current:
for log in str_diff(file_current,file_prev).split("\n"):
for tag in tags:
if log.startswith("[{}]".format(tag)):
new_log += log + "\n"
print(new_log, end="")
file_prev = file_current
except KeyboardInterrupt:
print("Interrupt detected, quitting!")
exit(0)
break