Skip to content

Commit bebff91

Browse files
Implement safe Web API diagnostic modules for Bluetooth, USB, IndexedDB, and Cache Storage
1 parent bb13947 commit bebff91

4 files changed

Lines changed: 122 additions & 38 deletions

File tree

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,34 @@
11
/**
2-
* Bluetooth_Probe (Stub)
3-
* Level 2
4-
* Disabled per security policy.
2+
* Pinpoint Module: Web Bluetooth Availability Audit
3+
* Level 2: Advanced Profiling
54
*/
65
export default {
76
id: 'bluetooth_probe',
8-
title: 'Bluetooth_Probe',
7+
title: 'Bluetooth_Audit',
98
level: 2,
10-
info: 'Bluetooth probe module (Disabled).',
11-
steps: ['Module disabled per safety policies.'],
9+
info: "Audits Web Bluetooth API availability and permission support in the current browsing context.",
10+
steps: ["Check navigator.bluetooth support.", "Query Bluetooth availability state.", "Check user gesture requirement."],
1211
run: async () => {
12+
if (!('bluetooth' in navigator)) {
13+
return {
14+
supported: false,
15+
message: "Web Bluetooth API is not supported by this browser or context."
16+
};
17+
}
18+
19+
let isAvailable = false;
20+
try {
21+
if (navigator.bluetooth.getAvailability) {
22+
isAvailable = await navigator.bluetooth.getAvailability();
23+
}
24+
} catch (e) {
25+
isAvailable = false;
26+
}
27+
1328
return {
14-
status: 'NOT_IMPLEMENTED',
15-
message: 'This module is not implemented and disabled per security policy constraints.'
29+
supported: true,
30+
adapterAvailable: isAvailable,
31+
requiresUserGesture: true
1632
};
1733
}
1834
};

src/modules/level2/usb_probe.js

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,38 @@
11
/**
2-
* USB_Probe (Stub)
3-
* Level 2
4-
* Disabled per security policy.
2+
* Pinpoint Module: WebUSB Device Access Audit
3+
* Level 2: Advanced Profiling
54
*/
65
export default {
76
id: 'usb_probe',
8-
title: 'USB_Probe',
7+
title: 'USB_Access_Audit',
98
level: 2,
10-
info: 'USB device probe module (Disabled).',
11-
steps: ['Module disabled per safety policies.'],
9+
info: "Audits WebUSB API support and enumerates paired USB devices authorized by the user.",
10+
steps: ["Check navigator.usb support.", "Query paired USB devices via navigator.usb.getDevices().", "Report authorized device descriptors."],
1211
run: async () => {
13-
return {
14-
status: 'NOT_IMPLEMENTED',
15-
message: 'This module is not implemented and disabled per security policy constraints.'
16-
};
12+
if (!('usb' in navigator)) {
13+
return {
14+
supported: false,
15+
message: "WebUSB API is not supported by this browser or context."
16+
};
17+
}
18+
19+
try {
20+
const devices = await navigator.usb.getDevices();
21+
return {
22+
supported: true,
23+
authorizedDeviceCount: devices.length,
24+
devices: devices.map(d => ({
25+
vendorId: d.vendorId,
26+
productId: d.productId,
27+
productName: d.productName || 'Unknown',
28+
manufacturerName: d.manufacturerName || 'Unknown'
29+
}))
30+
};
31+
} catch (e) {
32+
return {
33+
supported: true,
34+
error: e.message
35+
};
36+
}
1737
}
1838
};

src/modules/level3/cache_exfil.js

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,42 @@
11
/**
2-
* Cache_Exfil (Stub)
3-
* Level 3
4-
* Disabled per security policy.
2+
* Pinpoint Module: Cache Storage Inventory Audit
3+
* Level 3: Critical Intelligence
54
*/
65
export default {
76
id: 'cache_exfil',
8-
title: 'Cache_Exfil',
7+
title: 'Cache_Storage_Audit',
98
level: 3,
10-
info: 'Cache API exfil module (Disabled).',
11-
steps: ['Module disabled per safety policies.'],
9+
info: "Enumerates current origin Cache API cache keys and entry counts for progressive web app diagnostics.",
10+
steps: ["Access window.caches interface.", "Query caches.keys() array.", "Inspect entry count per cache bucket."],
1211
run: async () => {
13-
return {
14-
status: 'NOT_IMPLEMENTED',
15-
message: 'This module is not implemented and disabled per security policy constraints.'
16-
};
12+
if (!('caches' in window)) {
13+
return {
14+
supported: false,
15+
message: "Cache Storage API is not supported by this browser."
16+
};
17+
}
18+
19+
try {
20+
const keys = await caches.keys();
21+
const details = await Promise.all(keys.map(async (key) => {
22+
const cache = await caches.open(key);
23+
const requests = await cache.keys();
24+
return {
25+
cacheName: key,
26+
storedItemCount: requests.length
27+
};
28+
}));
29+
30+
return {
31+
supported: true,
32+
totalCacheBuckets: keys.length,
33+
buckets: details
34+
};
35+
} catch (e) {
36+
return {
37+
supported: true,
38+
error: e.message
39+
};
40+
}
1741
}
1842
};
Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,42 @@
11
/**
2-
* IndexedDB_Raid (Stub)
3-
* Level 3
4-
* Disabled per security policy.
2+
* Pinpoint Module: IndexedDB Storage & Database Enumerator
3+
* Level 3: Critical Intelligence
54
*/
65
export default {
76
id: 'indexeddb_raid',
8-
title: 'IndexedDB_Raid',
7+
title: 'IndexedDB_Audit',
98
level: 3,
10-
info: 'IndexedDB raid module (Disabled).',
11-
steps: ['Module disabled per safety policies.'],
9+
info: "Enumerates current origin IndexedDB database metadata and object store names using standard storage APIs.",
10+
steps: ["Check indexedDB API support.", "Query indexedDB.databases() list.", "Extract database names and version metadata."],
1211
run: async () => {
13-
return {
14-
status: 'NOT_IMPLEMENTED',
15-
message: 'This module is not implemented and disabled per security policy constraints.'
16-
};
12+
if (!('indexedDB' in window)) {
13+
return {
14+
supported: false,
15+
message: "IndexedDB API is not supported by this browser."
16+
};
17+
}
18+
19+
try {
20+
if (indexedDB.databases) {
21+
const dbs = await indexedDB.databases();
22+
return {
23+
supported: true,
24+
databaseCount: dbs.length,
25+
databases: dbs.map(db => ({
26+
name: db.name,
27+
version: db.version
28+
}))
29+
};
30+
}
31+
return {
32+
supported: true,
33+
message: "indexedDB.databases() enumeration not supported by browser version."
34+
};
35+
} catch (e) {
36+
return {
37+
supported: true,
38+
error: e.message
39+
};
40+
}
1741
}
1842
};

0 commit comments

Comments
 (0)