diff --git a/packages/fakenet-ng.vm/fakenet-ng.vm.nuspec b/packages/fakenet-ng.vm/fakenet-ng.vm.nuspec index c8e368d78..80c61a528 100755 --- a/packages/fakenet-ng.vm/fakenet-ng.vm.nuspec +++ b/packages/fakenet-ng.vm/fakenet-ng.vm.nuspec @@ -2,7 +2,7 @@ fakenet-ng.vm - 3.3.0.20250117 + 3.3.0.20250128 FakeNet-NG is a dynamic network analysis tool. Mandiant diff --git a/packages/fakenet-ng.vm/tools/chocolateyinstall.ps1 b/packages/fakenet-ng.vm/tools/chocolateyinstall.ps1 index b725673ee..6b5a00d4f 100755 --- a/packages/fakenet-ng.vm/tools/chocolateyinstall.ps1 +++ b/packages/fakenet-ng.vm/tools/chocolateyinstall.ps1 @@ -37,7 +37,7 @@ try { # Replace `default.ini` with our modified one that includes change for 'internet_detector'. # IMPORTANT: Keep our modified `default.ini` in-sync on updates to package. - $fakenetConfigDir = Get-ChildItem "C:\Tools\fakenet\*\configs" + $fakenetConfigDir = @(Get-ChildItem "C:\Tools\fakenet\*\configs")[0] Copy-Item "$packageToolDir\default.ini" -Destination $fakenetConfigDir # Create shortcut in Desktop to FakeNet tool directory diff --git a/packages/internet_detector.vm/internet_detector.vm.nuspec b/packages/internet_detector.vm/internet_detector.vm.nuspec index 6dfbbf8b8..3beedebf3 100644 --- a/packages/internet_detector.vm/internet_detector.vm.nuspec +++ b/packages/internet_detector.vm/internet_detector.vm.nuspec @@ -2,7 +2,7 @@ internet_detector.vm - 1.0.0.20241217 + 1.0.0.20250128 Elliot Chernofsky and Ana Martinez Gomez Tool that changes the background and a taskbar icon if it detects internet connectivity diff --git a/packages/internet_detector.vm/tools/chocolateyinstall.ps1 b/packages/internet_detector.vm/tools/chocolateyinstall.ps1 index 13f3835cd..96f2fcbc5 100644 --- a/packages/internet_detector.vm/tools/chocolateyinstall.ps1 +++ b/packages/internet_detector.vm/tools/chocolateyinstall.ps1 @@ -11,7 +11,7 @@ New-Item -Path $toolDir -ItemType Directory -Force -ea 0 VM-Assert-Path $toolDir # Install pyinstaller 6.11.1 (needed to build the Python executable with a version capable of executing in admin cmd) and tool dependencies ('pywin32') -$dependencies = "pyinstaller==6.11.1,pywin32" +$dependencies = "pyinstaller==6.11.1,pywin32==306,icmplib==3.0.4" VM-Pip-Install $dependencies # This wrapper is needed because PyInstaller emits an error when running as admin and this mitigates the issue. diff --git a/packages/internet_detector.vm/tools/internet_detector.pyw b/packages/internet_detector.vm/tools/internet_detector.pyw index c21733bf8..fab39e5c7 100644 --- a/packages/internet_detector.vm/tools/internet_detector.pyw +++ b/packages/internet_detector.vm/tools/internet_detector.pyw @@ -20,8 +20,7 @@ import winerror import winreg import threading -import requests -import urllib3 +import icmplib import signal import ctypes import time @@ -30,12 +29,12 @@ import re # Define constants CHECK_INTERVAL = 2 # Seconds -CONNECT_TEST_URL_AND_RESPONSES = { - "https://www.msftconnecttest.com/connecttest.txt": "Microsoft Connect Test", # HTTPS Test #1 - "http://www.google.com": "Google", # HTTP Test - "https://www.wikipedia.com": "Wikipedia", # HTTPS Test #2 - "https://www.youtube.com": "YouTube", # HTTPS Test #3 -} +TEST_IPS = [ + "8.8.8.8", # Google + "8.8.4.4", # Google + "1.1.1.1", # Cloudflare + "1.0.0.1" # Cloudflare +] SPI_SETDESKWALLPAPER = 20 SPIF_UPDATEINIFILE = 0x01 SPIF_SENDWININICHANGE = 0x02 @@ -306,12 +305,12 @@ def extract_title(data): return None def check_internet(): - for url, expected_response in CONNECT_TEST_URL_AND_RESPONSES.items(): + for ip_address in TEST_IPS: try: # Perform internet connectivity tests - response = requests.get(url, timeout=5, verify=False) - if expected_response in (extract_title(response.text) or response.text): - print(f"Internet connectivity detected via URL: {url}") + ip_host = icmplib.ping(ip_address, count=1, timeout=CHECK_INTERVAL) + if ip_host.is_alive: + print(f"Internet connectivity detected via IP: {ip_address}") return True except: pass @@ -468,7 +467,6 @@ def main_loop(): if __name__ == "__main__": signal.signal(signal.SIGINT, signal_handler) - urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) default_transparency = get_transparency_effects() # Try to load default settings from the registry