-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanalyzer.py
More file actions
50 lines (36 loc) · 1.63 KB
/
Copy pathanalyzer.py
File metadata and controls
50 lines (36 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
print(r"""
/$$
| $$
/$$$$$$$ /$$ /$$| $$$$$$$ /$$$$$$$ /$$ /$$$$$$ /$$$$$$
/$$_____/| $$ | $$| $$__ $$ /$$_____//$$$$$$|__/ /$$__ $$ /$$__ $$
| $$ | $$ | $$| $$ \ $$| $$$$$$|______/ /$$| $$ \ $$| $$$$$$$$
| $$ | $$ | $$| $$ | $$ \____ $$ | $$| $$ | $$| $$_____/
| $$$$$$$| $$$$$$$| $$$$$$$/ /$$$$$$$/ | $$| $$$$$$/| $$$$$$$
\_______/ \____ $$|_______/ |_______/ | $$ \______/ \_______/
/$$ | $$ /$$ | $$
| $$$$$$/ | $$$$$$/
\______/ \______/
""")
with open("keylog1.txt" , "r") as file:
content = file.readlines()
key_count = {} #dictionary
lines =0
timestampstart = content[0].strip()
for i in range(0,len(content) , 2): #this moves 2 steps ex 0 , 2 ,4..
content[i] + content[i+1]
lines+=1
key = content[i+1].strip() #this part is used to remove new lines at end f each line
if key in key_count:
key_count[key]+=1
else:
key_count[key]=1
most_freq = max(key_count , key=key_count.get)
timestampend = content[-2].strip()
print("=== Keylogger Analysis ===")
print(f"Session Start : {timestampstart}")
print(f"Session End : {timestampend}")
print(f"Total Keys : {lines}")
print(f"Most Frequent : {most_freq}")
print("Key Counts :")
for key, count in sorted(key_count.items(), key=lambda x: x[1], reverse=True):
print(f" {key} : {count}")