Aug-18-2019, 06:12 PM
I am on step 4 now.
I think I am doing pretty good but I have a couple issues. I am uncertain if it is actually removing dupes but keeping count of number of times a user name attempts to log in.
My other issue is my print string is wrong and I cant figure out how to make the first {} my count and second {} the user name. I am certain it is in my format
I think I am doing pretty good but I have a couple issues. I am uncertain if it is actually removing dupes but keeping count of number of times a user name attempts to log in.
My other issue is my print string is wrong and I cant figure out how to make the first {} my count and second {} the user name. I am certain it is in my format
intruder_log = {} with open("auth.log.1") as auth_log: for line in auth_log: if "Failed password" in line: start = line.find("invalid user") end = line.find(" from") name = line[start + 13:end] if name in intruder_log: intruder_log[name] += 1 else: intruder_log[name] = 1 for key in intruder_log: print("Attackers tried {} times to log in as {}".format, key["name"])