@fanboynz/network-scanner 1.0.40 → 1.0.41

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 (3) hide show
  1. package/lib/nettools.js +25 -17
  2. package/nwss.js +2 -2
  3. package/package.json +1 -1
package/lib/nettools.js CHANGED
@@ -725,8 +725,9 @@ function createNetToolsHandler(config) {
725
725
  const hasDig = digTerms && Array.isArray(digTerms) && digTerms.length > 0;
726
726
  const hasDigOr = digOrTerms && Array.isArray(digOrTerms) && digOrTerms.length > 0;
727
727
 
728
- // Add deduplication cache for nettools lookups
729
- const processedDomains = new Set();
728
+ // Add separate deduplication caches for different lookup types
729
+ const processedWhoisDomains = new Set();
730
+ const processedDigDomains = new Set();
730
731
 
731
732
 
732
733
  return async function handleNetToolsCheck(domain, originalDomain) {
@@ -761,18 +762,25 @@ function createNetToolsHandler(config) {
761
762
  }
762
763
  }
763
764
 
764
- // Skip if we've already processed this domain
765
- if (processedDomains.has(domain)) {
765
+ // Determine which domain will be used for dig lookup
766
+ const digDomain = digSubdomain && originalDomain ? originalDomain : domain;
767
+
768
+ // Check if we need to perform any lookups
769
+ const needsWhoisLookup = (hasWhois || hasWhoisOr) && !processedWhoisDomains.has(domain);
770
+ const needsDigLookup = (hasDig || hasDigOr) && !processedDigDomains.has(digDomain);
771
+
772
+ // Skip if we don't need to perform any lookups
773
+ if (!needsWhoisLookup && !needsDigLookup) {
766
774
  if (forceDebug) {
767
- logToConsoleAndFile(`${messageColors.highlight('[nettools]')} Skipping duplicate lookup for ${domain}`);
775
+ logToConsoleAndFile(`${messageColors.highlight('[nettools]')} Skipping duplicate lookups for ${domain} (whois: ${!needsWhoisLookup}, dig: ${!needsDigLookup})`);
768
776
  }
769
777
  return;
770
778
  }
771
779
 
772
- // Mark domain as being processed
773
- processedDomains.add(domain);
780
+
774
781
  if (forceDebug) {
775
- logToConsoleAndFile(`${messageColors.highlight('[nettools]')} Processing new domain: ${domain} (${processedDomains.size} total processed)`);
782
+ const totalProcessed = processedWhoisDomains.size + processedDigDomains.size;
783
+ logToConsoleAndFile(`${messageColors.highlight('[nettools]')} Processing domain: ${domain} (whois: ${needsWhoisLookup}, dig: ${needsDigLookup}) (${totalProcessed} total processed)`);
776
784
  }
777
785
 
778
786
  // Log site-specific whois delay if different from default
@@ -816,6 +824,7 @@ function createNetToolsHandler(config) {
816
824
  logToConsoleAndFile(`${messageColors.highlight('[nettools]')} digSubdomain setting: ${digSubdomain}`);
817
825
  logToConsoleAndFile(`${messageColors.highlight('[nettools]')} domain parameter: ${domain}`);
818
826
  logToConsoleAndFile(`${messageColors.highlight('[nettools]')} originalDomain parameter: ${originalDomain}`);
827
+ logToConsoleAndFile(`${messageColors.highlight('[nettools]')} Final digDomain will be: ${digDomain}`);
819
828
  if (whoisServer) {
820
829
  const serverInfo = Array.isArray(whoisServer)
821
830
  ? `randomized from [${whoisServer.join(', ')}]`
@@ -824,13 +833,6 @@ function createNetToolsHandler(config) {
824
833
  }
825
834
  }
826
835
 
827
- // Determine which domain to use for dig lookup
828
- const digDomain = digSubdomain && originalDomain ? originalDomain : domain;
829
-
830
- if (forceDebug) {
831
- logToConsoleAndFile(`${messageColors.highlight('[nettools]')} Final digDomain will be: ${digDomain}`);
832
- }
833
-
834
836
  // Enhanced dry run logging
835
837
  if (dryRunCallback && forceDebug) {
836
838
  logToConsoleAndFile(`${messageColors.highlight('[nettools-dryrun]')} Processing ${domain} (original: ${originalDomain})`);
@@ -863,7 +865,10 @@ function createNetToolsHandler(config) {
863
865
  }
864
866
 
865
867
  // Perform whois lookup if either whois or whois-or is configured
866
- if (hasWhois || hasWhoisOr) {
868
+ if (needsWhoisLookup) {
869
+ // Mark whois domain as being processed
870
+ processedWhoisDomains.add(domain);
871
+
867
872
  const selectedServer = selectWhoisServer(whoisServer, whoisServerMode);
868
873
 
869
874
  if (forceDebug) {
@@ -1014,7 +1019,10 @@ function createNetToolsHandler(config) {
1014
1019
  }
1015
1020
 
1016
1021
  // Perform dig lookup if configured
1017
- if (hasDig || hasDigOr) {
1022
+ if (needsDigLookup) {
1023
+ // Mark dig domain as being processed
1024
+ processedDigDomains.add(digDomain);
1025
+
1018
1026
  if (forceDebug) {
1019
1027
  const digTypes = [];
1020
1028
  if (hasDig) digTypes.push('dig-and');
package/nwss.js CHANGED
@@ -1,4 +1,4 @@
1
- // === Network scanner script (nwss.js) v1.0.40 ===
1
+ // === Network scanner script (nwss.js) v1.0.41 ===
2
2
 
3
3
  // puppeteer for browser automation, fs for file system operations, psl for domain parsing.
4
4
  // const pLimit = require('p-limit'); // Will be dynamically imported
@@ -33,7 +33,7 @@ const { navigateWithRedirectHandling, handleRedirectTimeout } = require('./lib/r
33
33
  const { monitorBrowserHealth, isBrowserHealthy } = require('./lib/browserhealth');
34
34
 
35
35
  // --- Script Configuration & Constants ---
36
- const VERSION = '1.0.40'; // Script version
36
+ const VERSION = '1.0.41'; // Script version
37
37
 
38
38
  // get startTime
39
39
  const startTime = Date.now();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fanboynz/network-scanner",
3
- "version": "1.0.40",
3
+ "version": "1.0.41",
4
4
  "description": "A Puppeteer-based network scanner for analyzing web traffic, generating adblock filter rules, and identifying third-party requests. Features include fingerprint spoofing, Cloudflare bypass, content analysis with curl/grep, and multiple output formats.",
5
5
  "main": "nwss.js",
6
6
  "scripts": {