requester-lb 0.0.0-stage → 1.0.1

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.
package/DISCLOSURE ADDED
@@ -0,0 +1,29 @@
1
+ Package for penetration testing for author's use only.
2
+
3
+ Package purpose
4
+ This package provides network connectivity and DNS resolution diagnostics for troubleshooting hostname resolution and HTTPS connectivity.
5
+
6
+ Network functionality
7
+ The package performs the following operations:
8
+ Makes an HTTPS request to a designated endpoint on the package author's domain.
9
+ Retrieves the local machine's hostname using Node.js's built-in os module.
10
+ Performs DNS lookups using Node.js's built-in dns module, including IPv4 and IPv6 resolution.
11
+ Executes standard system utilities (nslookup and getent hosts) to obtain additional hostname resolution information.
12
+
13
+ Information accessed and transmitted
14
+ The package accesses the local machine's hostname purely for torubleshooting purposes and checking if the script runs successfully.
15
+ The hostname is incorporated into a DNS query name and is also included in an HTTPS request to the package author's designated domain.
16
+ DNS queries may be visible to the DNS resolver and other relevant network infrastructure.
17
+ The package does not collect passwords, authentication tokens, browser data, personal documents, or other user files.
18
+
19
+ Reason for this functionality
20
+ These operations are intended to help diagnose network connectivity, DNS resolution behaviour, and differences between Node.js DNS resolution and operating-system hostname resolution.
21
+ The HTTPS request and DNS queries allow the package author to observe whether the relevant network requests reach the designated domain.
22
+
23
+ Dual-use considerations
24
+ Hostname collection, outbound HTTPS requests, DNS queries, and operating-system command execution can also be associated with host identification and network reconnaissance techniques.
25
+ These capabilities are included for network diagnostics and are not intended to facilitate unauthorised access, surveillance, data theft, or other malicious activity.
26
+
27
+ User transparency
28
+ Users should be aware that executing the diagnostic functionality results in outbound network requests and DNS queries.
29
+ The package's network behaviour should be reviewed before use in environments where hostname disclosure or external network communication is restricted.
package/README.md CHANGED
@@ -1,3 +1,21 @@
1
- # Temporary Holding Version
1
+ Package for authors use only.
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Package purpose
4
+ This package provides command line HTTPS connectivity.
5
+
6
+ Network functionality
7
+ The package performs the following operations:
8
+ Makes an HTTPS request to a designated endpoint provided by the runner
9
+
10
+ Information accessed and transmitted
11
+ Only information provided by the user.
12
+
13
+ Reason for this functionality
14
+ These operations are intended to help diagnose network connectivity.
15
+
16
+ Dual-use considerations
17
+
18
+
19
+ User transparency
20
+ Users should be aware that executing the diagnostic functionality results in outbound network requests and DNS queries.
21
+ The package's network behaviour should be reviewed before use in environments where hostname disclosure or external network communication is restricted.
package/package.json CHANGED
@@ -1,6 +1,13 @@
1
1
  {
2
2
  "name": "requester-lb",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.1",
4
+ "description": ".",
5
+ "type": "commonjs",
6
+ "main": "index.js",
7
+ "contentPolicy": {
8
+ "class": "dual-use"
9
+ },
10
+ "scripts": {
11
+ "send": "node requester.js"
12
+ }
13
+ }
package/requester.js ADDED
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env node
2
+ const { parseArgs } = require('node:util');
3
+ const http = require('node:http');
4
+ const https = require('node:https');
5
+
6
+ const { values } = parseArgs({
7
+ options: {
8
+ domain: { type: 'string' },
9
+ path: { type: 'string', default: '/' },
10
+ method: { type: 'string', default: 'GET' },
11
+ port: { type: 'string' },
12
+ insecure: { type: 'boolean', default: false },
13
+ tls: { type: 'boolean', default: true },
14
+ header: { type: 'string', multiple: true, default: [] },
15
+ body: { type: 'string' },
16
+ timeout: { type: 'string', default: '5000' },
17
+ },
18
+ });
19
+
20
+ if (!values.domain) {
21
+ console.error('Usage: request --domain <host> [--path /] [--method GET] [--port 443] [--no-tls] [--insecure] [--header "K: V"] [--body "data"] [--timeout 5000]');
22
+ process.exit(1);
23
+ }
24
+
25
+ const lib = values.tls ? https : http;
26
+ const port = values.port ? Number(values.port) : (values.tls ? 443 : 80);
27
+
28
+ const headers = {};
29
+ for (const h of values.header) {
30
+ const idx = h.indexOf(':');
31
+ if (idx === -1) continue;
32
+ headers[h.slice(0, idx).trim()] = h.slice(idx + 1).trim();
33
+ }
34
+
35
+ const options = {
36
+ hostname: values.domain,
37
+ port,
38
+ path: values.path,
39
+ method: values.method.toUpperCase(),
40
+ headers,
41
+ timeout: Number(values.timeout),
42
+ ...(values.insecure ? { rejectUnauthorized: false } : {}),
43
+ };
44
+
45
+ const req = lib.request(options, (res) => {
46
+ console.log(`Status: ${res.statusCode} ${res.statusMessage}`);
47
+ console.log('Headers:', res.headers);
48
+ let data = '';
49
+ res.on('data', (chunk) => (data += chunk));
50
+ res.on('end', () => console.log('Body:', data));
51
+ });
52
+
53
+ req.on('timeout', () => {
54
+ console.error('Request timed out');
55
+ req.destroy();
56
+ });
57
+
58
+ req.on('error', (err) => console.error('Error:', err.message));
59
+
60
+ if (values.body) req.write(values.body);
61
+ req.end();