diff --git a/.~lock.out.csv# b/.~lock.out.csv# deleted file mode 100644 index e837d1f..0000000 --- a/.~lock.out.csv# +++ /dev/null @@ -1 +0,0 @@ -,FRAMEWORKWIN/Cole,frameworkwin,19.09.2022 23:09,file:///C:/Users/Cole/AppData/Roaming/LibreOffice/4; \ No newline at end of file diff --git a/main.py b/main.py index 938e1e6..b571868 100644 --- a/main.py +++ b/main.py @@ -13,8 +13,11 @@ settings = None netdata_res = None procdata_res = None +win32 = platform == "win32" +linux = platform == "linux" or platform == "linux2" +macos = platform == "darwin" # Get unique system values -if platform == "win32": +if win32: sysid = hex(uuid.getnode()) # Python is running as Administrator (so netstat can get filename, to block, etc), # so we use this to see who is actually logged in @@ -23,13 +26,13 @@ if platform == "win32": userid, sysdom = username.rsplit("\\", 1) def run_ps(cmd): - if platform == "win32": + if win32: completed = subprocess.run(["powershell", "-Command", cmd], capture_output=True) return completed def netstat(): print("netstat started") - if platform == "win32": + if win32: data = run_ps("netstat -n -o -b") return data @@ -41,7 +44,7 @@ def netstat_done(res): def process_netstat(data): print("netstat processing") - if platform == 'win32': + if win32: #output = data.stdout #print(output) output = data.stdout.decode().split('\r\n') # split stdout into lines diff --git a/out.csv b/out.csv index 8e2f02e..9b6f58c 100644 --- a/out.csv +++ b/out.csv @@ -1,7 +1,14 @@ -0xf44ee3942e7d,FRAMEWORKWIN,Cole,1663647380 -firefox.exe,TCP,[2620:f3:8000:5060:5939:a4c0:4f5b:113f]:53387,[2607:f8b0:4009:81c::200a]:443,ESTABLISHED,8008 -firefox.exe,TCP,[2620:f3:8000:5060:5939:a4c0:4f5b:113f]:53386,[2607:f8b0:4009:81c::200a]:443,ESTABLISHED,8008 -firefox.exe,TCP,[2620:f3:8000:5060:5939:a4c0:4f5b:113f]:53377,[2606:4700:3035::ac43:ca7b]:443,TIME_WAIT,0 +0xf44ee3942e7d,FRAMEWORKWIN,Cole,1663648244 +Unknown,TCP,[2620:f3:8000:5060:5939:a4c0:4f5b:113f]:53494,[2606:4700:3035::ac43:ca7b]:443,TIME_WAIT,0 +Unknown,TCP,[2620:f3:8000:5060:5939:a4c0:4f5b:113f]:53484,[2607:f8b0:4009:80b::200a]:443,TIME_WAIT,0 +Unknown,TCP,[2620:f3:8000:5060:5939:a4c0:4f5b:113f]:53483,[2607:f8b0:4009:80b::200a]:443,TIME_WAIT,0 +Unknown,TCP,[2620:f3:8000:5060:5939:a4c0:4f5b:113f]:53482,[2607:f8b0:4009:80b::200a]:443,TIME_WAIT,0 +Unknown,TCP,[2620:f3:8000:5060:5939:a4c0:4f5b:113f]:53481,[2607:f8b0:4009:80b::200a]:443,TIME_WAIT,0 +Unknown,TCP,[2620:f3:8000:5060:5939:a4c0:4f5b:113f]:53480,[2607:f8b0:4009:80b::200a]:443,TIME_WAIT,0 +firefox.exe,TCP,[2620:f3:8000:5060:5939:a4c0:4f5b:113f]:53479,[2607:f8b0:4009:808::2003]:80,ESTABLISHED,8008 +firefox.exe,TCP,[2620:f3:8000:5060:5939:a4c0:4f5b:113f]:53478,[2607:f8b0:4009:80b::200a]:443,TIME_WAIT,0 +firefox.exe,TCP,[2620:f3:8000:5060:5939:a4c0:4f5b:113f]:53474,[2607:f8b0:4009:81a::200a]:443,ESTABLISHED,8008 +firefox.exe,TCP,[2620:f3:8000:5060:5939:a4c0:4f5b:113f]:53473,[2607:f8b0:4009:81a::200a]:443,ESTABLISHED,8008 python.exe,TCP,127.0.0.1:51987,127.0.0.1:51986,ESTABLISHED,17244 python.exe,TCP,127.0.0.1:51986,127.0.0.1:51987,ESTABLISHED,17244 VSCodium.exe,TCP,127.0.0.1:51978,127.0.0.1:51977,ESTABLISHED,17828 @@ -36,6 +43,7 @@ tailscaled.exe,TCP,127.0.0.1:41112,127.0.0.1:50530,ESTABLISHED,8076 nxserver.bin,TCP,127.0.0.1:31770,127.0.0.1:49766,ESTABLISHED,8116 nxnode.bin,TCP,127.0.0.1:28488,127.0.0.1:50402,ESTABLISHED,11608 nxclient.bin,TCP,127.0.0.1:26068,127.0.0.1:50408,ESTABLISHED,11836 +nxclient.bin,TCP,127.0.0.1:25001,127.0.0.1:53491,TIME_WAIT,0 nxclient.bin,TCP,127.0.0.1:25001,127.0.0.1:50406,ESTABLISHED,11836 nxnode.bin,TCP,127.0.0.1:23938,127.0.0.1:50405,ESTABLISHED,11608 nxserver.bin,TCP,127.0.0.1:22921,127.0.0.1:49762,ESTABLISHED,8116 @@ -54,10 +62,13 @@ nxserver.bin,TCP,127.0.0.1:6363,127.0.0.1:49761,ESTABLISHED,8116 mDNSResponder.exe,TCP,127.0.0.1:5354,127.0.0.1:49674,ESTABLISHED,4076 mDNSResponder.exe,TCP,127.0.0.1:5354,127.0.0.1:49670,ESTABLISHED,4076 nxserver.bin,TCP,127.0.0.1:4742,127.0.0.1:50778,ESTABLISHED,8116 -firefox.exe,TCP,104.194.122.206:53385,104.192.142.9:443,ESTABLISHED,8008 -firefox.exe,TCP,104.194.122.206:53384,142.250.190.78:443,ESTABLISHED,8008 -firefox.exe,TCP,104.194.122.206:53383,54.201.164.58:443,ESTABLISHED,8008 -firefox.exe,TCP,104.194.122.206:53382,35.186.227.140:443,ESTABLISHED,8008 +nxserver.bin,TCP,127.0.0.1:1045,127.0.0.1:53489,TIME_WAIT,0 +nxserver.bin,TCP,104.194.122.206:53497,208.59.79.12:443,TIME_WAIT,0 +firefox.exe,TCP,104.194.122.206:53493,142.250.190.78:443,ESTABLISHED,8008 +firefox.exe,TCP,104.194.122.206:53477,146.75.78.2:443,ESTABLISHED,8008 +firefox.exe,TCP,104.194.122.206:53476,162.159.130.232:443,TIME_WAIT,0 +firefox.exe,TCP,104.194.122.206:53475,162.159.133.232:443,ESTABLISHED,8008 +firefox.exe,TCP,104.194.122.206:53454,35.186.227.140:443,TIME_WAIT,0 VSCodium.exe,TCP,104.194.122.206:53314,76.76.21.61:443,ESTABLISHED,3816 VSCodium.exe,TCP,104.194.122.206:53313,76.76.21.164:443,ESTABLISHED,3816 firefox.exe,TCP,104.194.122.206:53289,162.159.135.234:443,ESTABLISHED,8008