-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstats.py
More file actions
63 lines (49 loc) · 1.58 KB
/
Copy pathstats.py
File metadata and controls
63 lines (49 loc) · 1.58 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
51
52
53
54
55
56
57
58
59
60
61
62
63
import psutil, sys
from system_info import getUserDetails
from network import getConnections, packetSniff
from proc_infos import getProcesses
def getStats():
try:
stats = {}
stats['title'] = 'Wanna Know ?'.upper()
stats['users'] = getUserDetails()
network = {}
network['connections'] = getConnections()
network['interfaces'] = packetSniff()
stats['network'] = network
stats['processes'] = getProcesses()
return stats
except Exception as e:
pass
# This other main function can be commented out for debugging purposes when there seems
# to be an issue with gathering the data, needs to be adjusted to the debugging purpose.
# def main():
# stats = {}
# stats['title'] = 'Wanna Know ?'
# stats['users'] = getUserDetails()
#
# network = {}
# network['connections'] = getConnections()
# network['interfaces'] = packetSniff()
#
# stats['network'] = network
# stats['processes'] = getProcesses()
# stats = getStats()
#
# print('\n<--- Users Connected--->\n')
# print(stats['users'])
#
# print('\n<--- Network Connections --->\n')
# print(stats['network']['connections'])
#
# print('\n<--- Interfaces --->\n')
# print(stats['network']['interfaces'])
# print('\n<--- Running Processes --->\n')
# print('<--- General --->\n')
# print(stats['processes']['other'])
# # for p in processes[0]:
# # print(p)
# print('\n<--- Apple --->\n')
# print(stats['processes']['apple'])
# if __name__ == "__main__":
# main()