packetsnitch 1.5.599

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/.eslintrc.json +28 -0
  2. package/.webpack/x64/main/index.js +2 -0
  3. package/.webpack/x64/main/index.js.map +1 -0
  4. package/.webpack/x64/renderer/assets/css/rubikglitch.woff2 +0 -0
  5. package/.webpack/x64/renderer/assets/css/style.css +1916 -0
  6. package/.webpack/x64/renderer/assets/images/loading.gif +0 -0
  7. package/.webpack/x64/renderer/assets/images/logo.webp +0 -0
  8. package/.webpack/x64/renderer/assets/images/packet-snitch-tag.webp +0 -0
  9. package/.webpack/x64/renderer/main_window/index.html +3 -0
  10. package/.webpack/x64/renderer/main_window/index.js +3 -0
  11. package/.webpack/x64/renderer/main_window/index.js.LICENSE.txt +36 -0
  12. package/.webpack/x64/renderer/main_window/index.js.map +1 -0
  13. package/.webpack/x64/renderer/main_window/preload.js +2 -0
  14. package/.webpack/x64/renderer/main_window/preload.js.map +1 -0
  15. package/backend/common/GeoLite2-City.mmdb +0 -0
  16. package/backend/common/mac-vendors-export.csv +56923 -0
  17. package/backend/common/service-names-port-numbers.csv +15368 -0
  18. package/backend/requirements.txt +14 -0
  19. package/backend/snitch.py +3611 -0
  20. package/forge.config.js +80 -0
  21. package/package.json +102 -0
  22. package/ps-icon.ico +0 -0
  23. package/snitch.spec +44 -0
  24. package/src/assets/css/rubikglitch.woff2 +0 -0
  25. package/src/assets/css/style.css +1916 -0
  26. package/src/assets/images/loading.gif +0 -0
  27. package/src/assets/images/logo.webp +0 -0
  28. package/src/assets/images/packet-snitch-tag.webp +0 -0
  29. package/src/back-comm.js +70 -0
  30. package/src/decoders.js +579 -0
  31. package/src/filter.js +461 -0
  32. package/src/front.js +10 -0
  33. package/src/index.html +1036 -0
  34. package/src/logging.js +150 -0
  35. package/src/main.js +571 -0
  36. package/src/preload.js +73 -0
  37. package/src/renderer.js +30 -0
  38. package/src/ui/common-frontend.js +13 -0
  39. package/src/ui/context-menu.js +88 -0
  40. package/src/ui/decoders.js +1 -0
  41. package/src/ui/main-frontend.js +4957 -0
  42. package/src/ui/panels/crypt-panel.js +565 -0
  43. package/src/ui/panels/data-panel.js +151 -0
  44. package/src/ui/panels/data-tools-panel.js +939 -0
  45. package/src/ui/panels/install-screen.js +59 -0
  46. package/src/ui/panels/keystore-panel.js +1248 -0
  47. package/src/ui/panels/list-panel.js +403 -0
  48. package/src/ui/panels/stats-panel.js +351 -0
  49. package/src/ui/panels/summary-panel.js +63 -0
  50. package/webpack.main.config.js +11 -0
  51. package/webpack.plugins.js +13 -0
  52. package/webpack.preload.config.js +7 -0
  53. package/webpack.renderer.config.js +30 -0
  54. package/webpack.rules.js +35 -0
@@ -0,0 +1,151 @@
1
+ function createDataPanel(options) {
2
+ const {
3
+ constants,
4
+ documentRef,
5
+ statusUpdate,
6
+ writeLogEntry,
7
+ doError,
8
+ getIsFileLoaded,
9
+ getJsonCapture,
10
+ getHostFilterValue,
11
+ getHostsList,
12
+ getFilterInputValue,
13
+ getFilteredPackets,
14
+ getPacketsForHost,
15
+ setActiveMainTab,
16
+ handlePacketNavigation,
17
+ getIndex,
18
+ setIndex,
19
+ setActivePacketCursor,
20
+ setCurrentIp,
21
+ setCurrentPacketKey,
22
+ getCurrentPacketKey,
23
+ syncBookmarkDropdown,
24
+ infoPanel,
25
+ popHexGrid,
26
+ populateDataTypes,
27
+ } = options;
28
+ const { MAIN_TAB_DATA } = constants;
29
+
30
+ function logCurrentPacketDisplay(action) {
31
+ const packetsForHost = getPacketsForHost();
32
+ const index = getIndex();
33
+ if (!packetsForHost || !packetsForHost[index]) return;
34
+ const packetInfo = packetsForHost[index]["Packet Info"];
35
+ const selectedHost = getHostFilterValue() || "Unknown host";
36
+ const sourceIp = packetInfo?.["IP"]?.["Source IP"] || "Unknown source";
37
+ const destinationIp =
38
+ packetInfo?.["IP"]?.["Destination IP"] || "Unknown destination";
39
+ const packetIndex = packetInfo?.["Index"] ?? index;
40
+ const packetTimestamp = packetInfo?.["Packet Timestamp"] || "Unknown time";
41
+ writeLogEntry(
42
+ `Displayed packet action=${action} host=${selectedHost} packet=${packetIndex} source=${sourceIp} destination=${destinationIp} timeframe=${packetTimestamp}`,
43
+ );
44
+ }
45
+
46
+ function initializeDataView() {
47
+ setActiveMainTab(MAIN_TAB_DATA);
48
+ statusUpdate(`Status: Displaying packet information for ${getHostFilterValue()}`);
49
+ if (getJsonCapture() == "") {
50
+ statusUpdate("Status: No JSON file loaded, please upload a file first");
51
+ doError("No file loaded! Upload one of JSON or PCAP first!");
52
+ return;
53
+ }
54
+ documentRef.getElementById("prev-btn").style.display = "block";
55
+ documentRef.getElementById("next-btn").style.display = "block";
56
+ documentRef.getElementById("welcome").style.display = "none";
57
+ if (documentRef.getElementById("host_filter").value == "") {
58
+ documentRef.getElementById("host_filter").value = getHostsList()[1];
59
+ }
60
+
61
+ const hasActiveFilterQuery = getFilterInputValue().trim() !== "";
62
+ const filteredPackets = getFilteredPackets();
63
+ const packetsForHost = getPacketsForHost();
64
+ const shouldReuseFilteredPackets =
65
+ Array.isArray(filteredPackets) &&
66
+ (hasActiveFilterQuery || packetsForHost === filteredPackets);
67
+ handlePacketNavigation(shouldReuseFilteredPackets ? "filtered" : "first-load");
68
+ }
69
+
70
+ function showPreviousPacket() {
71
+ statusUpdate("Status: Displaying capture analysis summary");
72
+ if (!getIsFileLoaded()) {
73
+ statusUpdate("Status: No JSON file loaded, please upload a file first");
74
+ doError("No file loaded! Upload one of JSON or PCAP first!");
75
+ return;
76
+ }
77
+ let index = getIndex();
78
+ const packetsForHost = getPacketsForHost();
79
+ if (index > 0) {
80
+ index -= 1;
81
+ setIndex(index);
82
+ setActivePacketCursor(index);
83
+
84
+ const currentIp = packetsForHost[index]["Packet Info"]["IP"]["Source IP"];
85
+ const currentPacketKey =
86
+ currentIp + ":" + packetsForHost[index]["Packet Info"]["Index"];
87
+ setCurrentIp(currentIp);
88
+ setCurrentPacketKey(currentPacketKey);
89
+ syncBookmarkDropdown(currentPacketKey);
90
+ infoPanel(packetsForHost);
91
+ popHexGrid(
92
+ packetsForHost[index]["Packet Info"]["Raw data"]["Payload"]["Hex Encoded"],
93
+ );
94
+ populateDataTypes(packetsForHost);
95
+ logCurrentPacketDisplay("prev");
96
+ }
97
+ }
98
+
99
+ function showNextPacket() {
100
+ statusUpdate("Status: Displaying capture analysis summary");
101
+ if (!getIsFileLoaded()) {
102
+ statusUpdate("Status: No JSON file loaded, please upload a file first");
103
+ doError("No file loaded! Upload one of JSON or PCAP first!");
104
+ return;
105
+ }
106
+ let index = getIndex();
107
+ const packetsForHost = getPacketsForHost();
108
+ if (index < packetsForHost.length - 1) {
109
+ index += 1;
110
+ setIndex(index);
111
+ setActivePacketCursor(index);
112
+ const currentIp = packetsForHost[index]["Packet Info"]["IP"]["Source IP"];
113
+ const currentPacketKey =
114
+ currentIp + ":" + packetsForHost[index]["Packet Info"]["Index"];
115
+ setCurrentIp(currentIp);
116
+ setCurrentPacketKey(currentPacketKey);
117
+ }
118
+ syncBookmarkDropdown(getCurrentPacketKey());
119
+ infoPanel(packetsForHost);
120
+ popHexGrid(
121
+ packetsForHost[index]["Packet Info"]["Raw data"]["Payload"]["Hex Encoded"],
122
+ );
123
+ populateDataTypes(packetsForHost);
124
+ logCurrentPacketDisplay("next");
125
+ }
126
+
127
+ function bindDataPanelEvents() {
128
+ documentRef.getElementById("data-btn").addEventListener("click", () => {
129
+ if (!getIsFileLoaded()) {
130
+ doError("Please upload a JSON file before accessing host data.");
131
+ return;
132
+ }
133
+ initializeDataView();
134
+ });
135
+
136
+ documentRef
137
+ .getElementById("prev-btn")
138
+ .addEventListener("click", showPreviousPacket);
139
+ documentRef.getElementById("next-btn").addEventListener("click", showNextPacket);
140
+ }
141
+
142
+ return {
143
+ initializeDataView,
144
+ bindDataPanelEvents,
145
+ logCurrentPacketDisplay,
146
+ };
147
+ }
148
+
149
+ module.exports = {
150
+ createDataPanel,
151
+ };