Brozy123 commited on
Commit
941b50c
·
verified ·
1 Parent(s): 8cd764e

Update network_fix.js

Browse files
Files changed (1) hide show
  1. network_fix.js +15 -0
network_fix.js CHANGED
@@ -17,6 +17,21 @@ function applyAdvancedFixes() {
17
  console.log("[*] NetworkFix: Initializing Domain Hijacking...");
18
 
19
  dns.setDefaultResultOrder('ipv4first');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
 
21
  const target_domain = DOMAINS[current_index];
22
  console.log(`[*] NetworkFix: Forcing traffic through ${target_domain}...`);
 
17
  console.log("[*] NetworkFix: Initializing Domain Hijacking...");
18
 
19
  dns.setDefaultResultOrder('ipv4first');
20
+
21
+ // Force IPv4 on all lookups
22
+ const _oldLookup = dns.lookup;
23
+ dns.lookup = function(hostname, options, callback) {
24
+ let opt = options;
25
+ if (typeof opt === 'function') {
26
+ callback = opt;
27
+ opt = { family: 4 };
28
+ } else if (!opt) {
29
+ opt = { family: 4 };
30
+ } else if (typeof opt === 'object') {
31
+ opt.family = 4;
32
+ }
33
+ return _oldLookup(hostname, opt, callback);
34
+ };
35
 
36
  const target_domain = DOMAINS[current_index];
37
  console.log(`[*] NetworkFix: Forcing traffic through ${target_domain}...`);