Skip to content

An AR/VR/XR application made within a Unity Engine that will Map out wireless network connections to visualize signal strengths, access points, vulnerabilities, and more coming soon. Development was on the Meta Quest/ Meta Quest 2.

Notifications You must be signed in to change notification settings

Orgzales/Unity-XR-NetworkMapper-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

OX-r TRAIL (AUGMENTED REALITY WIRELESS NETWORK SECURITY MAPPER)

An AR/VR/XR application made within a Unity Engine that will Map out wireless network connections to visualize signal strengths, access points, vulnerabilities, and more coming soon. Development was on the Meta Quest/ Meta Quest 2, however, applications with Android-supported AR/VR headsets should be supported. Some Code is supported with Windows Machines such as Apple Vision Pro but not fully tested. (My Stetson University Senior Research Project for the year 2023 Fall- Spring 2024)

OX_Trail_Logo

Some Commands:

- netsh wlan show profiles
- netsh wlan show interface

Some Plugins:

  • MRTK Toolkit
  • Andriod Unity Engine
  • ARCORE XR

Added This project to Backdrop Builds V3 (Feb 26, 2024): https://backdropbuild.com/builds/v3/xr-wireless-network-mapper

Linkdin: https://www.linkedin.com/in/orion-gonzales-030b78196/ Toolkit Testing: Linkdin Post XR BackDropBuild:Update Post Watch Short Demo Video of Program: Youtube Demo

Unity Andriod -> Meta Quest 2

AndroidJavaObject activity = new AndroidJavaClass("com.unity3d.player.UnityPlayer").GetStatic<AndroidJavaObject>("currentActivity");
AndroidJavaObject wifiManager = activity.Call<AndroidJavaObject>("getSystemService", "wifi");
		
AndroidJavaObject wifiInfo = wifiManager.Call<AndroidJavaObject>("getConnectionInfo");
AndroidJavaObject connectivityManager = activity.Call<AndroidJavaObject>("getSystemService", "connectivity");
AndroidJavaObject networkInfo = connectivityManager.Call<AndroidJavaObject>("getNetworkInfo", 1);
AndroidJavaObject detailedState = networkInfo.Call<AndroidJavaObject>("getDetailedState");
		
AndroidJavaObject activeNetwork = connectivityManager.Call<AndroidJavaObject>("getActiveNetwork");
AndroidJavaObject networkCapabilities = connectivityManager.Call<AndroidJavaObject>("getNetworkCapabilities", activeNetwork);

Step 0 Plans (Augest 2023)

- ๐Ÿ—ธ Activate Passthrough mode / AR - Finished
- ๐Ÿ—ธ Test Unity Webservices - Testing Process
- ๐Ÿ—ธ Get Hand Tracking to operate - Finished
- ๐Ÿ—ธ Get Developer Acess - RSA Finger Print Finished

Step 1 Plans

- ๐Ÿ—ธ Build APK Files for Wireless AR - FINISHED
- ๐Ÿ—ธ WIFI Engines added for detecting nearby signals  - Quest 2 Shows SSID
- ๐Ÿ—ธ Custom Marking Code that marks WIFI Strengths: - COMPLETED
	- ๐Ÿ—ธ No Signal = Red | -67dbm is Good signal (Max bars)
	- ๐Ÿ—ธ Weak Signal = Yellow | -68dbm to -79dbm is Okay signal (Half Bars)
	- ๐Ÿ—ธ Strong Signal = Green | -80dbm or lower is Very poor signal (Single or SOS bars)

Step 2 Plans

- ๐Ÿ—ธ Get Recording with passthrough enabled - OBS/Wireless Computer (Not possible on quest 2) Wired Recording
- ๐Ÿ—ธ Have Flags or Tracking Color Floor based on signal
	- ๐Ÿ—ธ Find a way to create a cube in the exact spot that the wifi connection is updated - CUBES SPAWN
	- ๐Ÿ—ธ Create the cube's color based on the wifi connection - Wifi Points are Created based on dBs
	- ๐Ÿ—ธ Have a radius possibly for the cubes to prevent to many being created - Prevents Cubes spawning within 2ft
- ๐Ÿ—ธ Get netgear router to purposly to show unsecure authencation - DONE

Step 3 Plans

- ๐Ÿ—ธ Have it display the wifi scuirty to connected router.
- ๐Ÿ—ธ If authencation type is bad, give a alert to the cube being made.
	- ๐Ÿ—ธ 0 = Open or None = !!!!!DANGER!!!!! | Red
	- ๐Ÿ—ธ 1 = Wired Equivalent Privacy (WEP) = !!! HIGH ALERT !!! | Yellow
	- ๐Ÿ—ธ 2 = Wi-Fi Protected Access 2 (WPA2) = @ Secure @  | Green
	- ๐Ÿ—ธ 3 = Wi-Fi Protected Access 3 (WPA3) = #Protected# | Blue

Step 4 Plans

- ๐Ÿ—ธ Have the Marked down cubes display information
	-  ๐Ÿ—ธ When cubed is touched, have it display previous data 
	-  ๐Ÿ—ธ Displays SSID BSSID and dBm when cube was created
- ๐Ÿ—ธ Possibly show the range of the cube that was created wiht new prefab. 
- ๐Ÿ—ธ Accident: Have program test if wifi/router has access to Better secuirty | (NEEDS MORE TESTING)
	- ๐Ÿ—ธ EX: Router is set to no security, but it still is able to check if it can have wpa2

Calling from Managers

wifiSSID = wifiInfo.Call<string>("getSSID").Replace("\"", "");
wifiBSSID = wifiInfo.Call<string>("getBSSID");
wifiSignalStrength = wifiInfo.Call<int>("getRssi");
int LinkSpeed = wifiInfo.Call<int>("getLinkSpeed"); //Speed in Mbps
int frequencyInt = wifiInfo.Call<int>("getFrequency"); // Frequency in MHz
DataSpeedRate = LinkSpeed;
Freq_Network = frequencyInt;

string stateString = detailedState.Call<string>("toString");
string capabilities = wifiInfo.Call<string>("toString");
int securityTypeIndex = capabilities.IndexOf("Security type: ");
int endOfSecurityTypeIndex = capabilities.IndexOf(",", securityTypeIndex);
string securityTypeValue = capabilities.Substring(securityTypeIndex + 15, endOfSecurityTypeIndex - securityTypeIndex - 15);

bool hasInternet = networkCapabilities.Call<bool>("hasCapability", 12);
bool hasWep = networkCapabilities.Call<bool>("hasCapability", 15);
bool hasWpa2 = networkCapabilities.Call<bool>("hasCapability", 13);
bool hasWpa3 = networkCapabilities.Call<bool>("hasCapability", 26);

Step 5 Plans (January 2024)

- ๐Ÿ—ธ Make New prefabs of Cubes to be Wifi Pillars
	- ๐Ÿ—ธ Have a radius transparcy
	- ๐Ÿ—ธ Change height of pillar based on dBm signal
	- ๐Ÿ—ธ Still have a cube on top that displays data
	- ๐Ÿ—ธ Keep other old properties
	- ๐Ÿ—ธ Depending on secuirty, create a symbol on top
	- ๐Ÿ—ธ Make small background for Debug Text.
	- ๐Ÿ—ธ Change color hex code based on signal. 
- ๐Ÿ—ธ Increase the rate of the cubes
- ๐Ÿ—ธ Have a button on the Prefab to delete itself. 
	- ๐Ÿ—ธ Small button on bottom of Prefab to set for false for now

Step 6 Plans

- ๐Ÿ—ธ Has data display in a AR-hud so position does not matter and better layout
	- ๐Ÿ—ธ add enough transparency 
	- ๐Ÿ—ธ Remake a grid layout for better visualization
	- ๐Ÿ—ธ Add Have the following display
		- ๐Ÿ—ธ Both netwokr security and potential network secuirty
		- ๐Ÿ—ธ Transmit Rate + receive Rate
		- ๐Ÿ—ธ add this to prefab
- ๐Ÿ—ธ Create a data base of current properties of each scan for wifi network
	- ๐Ÿ—ธ Make a new hud that will say the following
		- ๐Ÿ—ธ New button on top tab to switch screens
		- ๐Ÿ—ธ (Network SSID + Network BSSID)
			- ๐Ÿ—ธ Good signal = int 
			- ๐Ÿ—ธ Ok Signal = int
			- ๐Ÿ—ธ Bad Signal = int
			- ๐Ÿ—ธ Secure = int
			- ๐Ÿ—ธ VUlnerable = int
		- ๐Ÿ—ธ New network...
	- ๐Ÿ—ธ Create Script that keeps the DataBase updating
		- ๐Ÿ—ธ Create Dictionary that keeps each data of network
		- ๐Ÿ—ธ Make sure No_Connection is included to the previous network
- ๐Ÿ—ธ make new prefab for BSSID connection
	- ๐Ÿ—ธ Same SSID but DIFFERENT BSSID = New Pillars
	- ๐Ÿ—ธ Create the new prefab 
	- ๐Ÿ—ธ text should always be showing
		- ๐Ÿ—ธ text = previous bssid -> new bssid 
	- ๐Ÿ—ธ should not be created when first connection
	- ๐Ÿ—ธ prefabs should disappear and reappear based same as wifi clones
- ๐Ÿ—ธ Create a button that delete wifiobjects on click
	- ๐Ÿ—ธ One button: Toggle = Overwrite Nearby Connections.
	- ๐Ÿ—ธ One button: Press = Get rid of all wifi objects within radius.
- ๐Ÿ—ธ SPELL CHECK

Step 7 Plans

- ๐Ÿ—ธ Add Demo Button 
	- ๐Ÿ—ธ Toggle if strength values become random for demo purposes
	- ๐Ÿ—ธ Toggle to make random secuirty/vulnerable values
- ๐Ÿ—ธ Clean Up code & Bug Check
	- ๐Ÿ—ธ Add Data receive  & Transmit code
	- ๐Ÿ—ธ Add Best secuirty and Current secuirty 
	- ๐Ÿ—ธ Add these to Screen and Wifi Prefabs
	- ๐Ÿ—ธ Remove unnessary code from here on out 
- ๐Ÿ—ธ Remove Delete object button higher
- ๐Ÿ—ธ Create Wifi prefab background transparent 
- ๐Ÿ—ธ Fix When no connection during database:
	- ๐Ÿ—ธ Add No Connection counter
	- ๐Ÿ—ธ Remove increment of VUlnerable counter
- ๐Ÿ—ธ Do final test for APK.9
	- ๐Ÿ—ธ Test to make sure no connection doesn't interfere
	- ๐Ÿ—ธ Make Sure BSSID Prefabs Work under correct conditions
	- ๐Ÿ—ธ Test DATA Speeds + Resize Screen to fit new data
	- ๐Ÿ—ธ Change color for corespsonding speed of DATA & Frequency
	- ๐Ÿ—ธ Edit base perfab for BSSID quality
- ๐Ÿ—ธ Added network's Frequency

Step 8 Plans

- ๐Ÿ—ธ Made Seperate Dictionary for later Database for the BSSID history
	- ๐Ÿ—ธ Keep track of each connection of a bssid within the same network
	- ๐Ÿ—ธ Display own text to data base screen
	- ๐Ÿ—ธ if no connection BSSID shouldn't change
- ๐Ÿ—ธ Create Prefabs name based on SSID
- ๐Ÿ—ธ IF change to new SSID, set all objects to false
	- ๐Ÿ—ธ If changed back reverse the true and false condition
- ๐Ÿ—ธ This will be to mimic saving for future functions. 
	- ๐Ÿ—ธ If no connection, defualt to previous SSID
- ๐Ÿ—ธ Mimic Finding Shadow ITs Networks that are hidden
	- ๐Ÿ—ธ install ARcore XR plugin
	- ๐Ÿ—ธ Detect Hidden SSIDs when scanning
		- ๐Ÿ—ธ Add list to new data screen in AR
		- ๐Ÿ—ธ Make script for popup for new SSID
			- ๐Ÿ—ธ Ask if it's white or black listed
			- ๐Ÿ—ธ Remove any Duplicates with shadow scan
			- ๐Ÿ—ธ get how many hidden networks within area 
				- ๐Ÿ—ธ make prefab that holds this info
				- ๐Ÿ—ธ add info of number of white or black listed 
		- ๐Ÿ—ธ When new hidden SSID is scanned, popup window appears
			- ๐Ÿ—ธ When Popup window alert prefab Instantiates, be in correct position
				- ๐Ÿ—ธ Rotation of screen is locked
				- ๐Ÿ—ธ Y-axis position is locked 
				- ๐Ÿ—ธ Dynamic X+Z Axis within MRTK Scene
			- ๐Ÿ—ธ Using IEnumerators, only make a screen when user gives input
			- ๐Ÿ—ธ Cycle through all hidden/surrounding SSIDs
			- ๐Ÿ—ธ Accumulate the user input within the White List & Black List networks
		- ๐Ÿ—ธ Create new dictionary for sudo database of shadow itself
			- ๐Ÿ—ธ make new dictionary (Whitelsited or blacklisted)
	- ๐Ÿ—ธ Have SSIDs become white or black listed
- ๐Ÿ—ธ Create a button that repeats the Shadow IT scan
	- ๐Ÿ—ธ button should clear out Allprevious SSID scan history to rescan in current location
		- ๐Ÿ—ธ button should keep white + black List data
	- ๐Ÿ—ธ New prefab should be placed where rescan
		- ๐Ÿ—ธ Should display both white + black lists data
	- ๐Ÿ—ธ if network gets changed it will remove it from previous list
	- ๐Ÿ—ธ prefabs should not change when network changes
		- ๐Ÿ—ธ Have delete button with shadow prefab
	- ๐Ÿ—ธ Make button not pressable when the scan is already happening to prevent crash
	- ๐Ÿ—ธ Add the color violet to these prefabs to have some material 
	- ๐Ÿ—ธ Within Shadow Scan Prefab create two seperate text boxes for each data set
		- ๐Ÿ—ธ Within Text Details, insert Delete button here instead
		- ๐Ÿ—ธ Stop from users accidentally deleting info 
	- ๐Ÿ—ธ Change function if Demo mode is activated
		- ๐Ÿ—ธ Should have set list of SSIDs ready for example scanning 
		- ๐Ÿ—ธ User can see if Prefab is a Demo or not 

Method For Start of ShadowITScan

    private IEnumerator ScanForHiddenSSIDs()
    {
        yield return new WaitForSeconds(1.0f);

        AndroidJavaObject activity = new AndroidJavaClass("com.unity3d.player.UnityPlayer").GetStatic<AndroidJavaObject>("currentActivity");
        AndroidJavaObject wifiManager = activity.Call<AndroidJavaObject>("getSystemService", "wifi");
        wifiManager.Call<bool>("startScan"); //works for restarting scan
        AndroidJavaObject scanResults = wifiManager.Call<AndroidJavaObject>("getScanResults");

        int scanResultsCount = scanResults.Call<int>("size");
        int hiddenFound = 0;

        for (int i = 0; i < scanResultsCount; i++)
        {
            AndroidJavaObject scanResult = scanResults.Call<AndroidJavaObject>("get", i);
            string ssid = scanResult.Get<string>("SSID");
            int signalStrength = scanResult.Get<int>("level"); //works

            if (string.IsNullOrEmpty(ssid)) //For Rouge or unnamed ssid networks 
            {
                ssid = "Hidden/NoName SSID Found #" + hiddenFound.ToString();
                hiddenFound++;
            }

            string SSIDInfo = ssid + " (" + signalStrength.ToString() + " dBm)";

            if (!allSSIDs.Contains(ssid))
            {
                allSSIDs.Add(ssid);
                CurrentSSID = ssid;
                SSIDSignal[ssid] = signalStrength;
                ShowPopup(SSIDInfo);
                yield return new WaitUntil(() => popupClosed);
                popupClosed = false; // Reset
            }

        }
        Other_Spawner_ManagerScript.SpawnShadowITPrefab(); //makes new prefab
        NoActiveScanning = true; //Scanning ends here when prefab is created
        SetWhiteText();
        SetBlackText();
        InvokeRepeating("UpdateSignals", 2.0f, 6.0f);
    }

Step 9 Plans

- ๐Ÿ—ธ Fix Shadow Prefab Delte Bug
- ๐Ÿ—ธ Fix StartCourtine Bug
	- ๐Ÿ—ธ List and Dictionary should clear each scan
	- ๐Ÿ—ธ Update the text of the Screen after scan if finished
	- ๐Ÿ—ธ Set all important varaibles when button is press not during scan
- ๐Ÿ—ธ Add signal strength tracking on hidden ssids scan 
	- ๐Ÿ—ธ Have each one colorized based on dBm
	- ๐Ÿ—ธ Add signal Str to shadow Prefab
	- ๐Ÿ—ธ add a tracking function within Shadow Scan function to keep updated signals 
		- ๐Ÿ—ธ When user travels, the function updates the scan signals  
		- ๐Ÿ—ธ When the user rescans the hidden SSIDs, the scan should stop to prevent crashes
		- ๐Ÿ—ธ Update the database screen when the function repeats 
		- ๐Ÿ—ธ If new SSID or HIDDEN SSID is detected notify the user 
		- ๐Ÿ—ธ if a SSID within the list of tracking and there is no signal update the signal to -999
		- ๐Ÿ—ธ Repeat this for Demo Mode 
			- ๐Ÿ—ธ Add in a random function to mimic a new network detected 
		- ๐Ÿ—ธ Change color of dBm based on new Hidden SSID and no signal to be more noticable
- ๐Ÿ—ธ During Shadow SSID Scan, if a network with no ssid is detected or found, rename it to "Hidden Network Found" 
- ๐Ÿ—ธ Get Wifi Pineapple configured to see if mimicing networking risk can be detected
	- ๐Ÿ—ธ Test with same SSID as Stetson vs Stetson Named SSID
	- Record Results of VR application w/ Wifi_Pineapple + NETGEAR
- ๐Ÿ—ธ Make a seperate manager script that handles all other non-connection strength prefab spawns.
	- ๐Ÿ—ธ Shadow IT Prefab
	-  Regular Anchor Prefab

ReScanning Hidden SSID AndriodJavaObjects

AndroidJavaObject activity = new AndroidJavaClass("com.unity3d.player.UnityPlayer").GetStatic<AndroidJavaObject>("currentActivity");
AndroidJavaObject wifiManager = activity.Call<AndroidJavaObject>("getSystemService", "wifi");
wifiManager.Call<bool>("startScan"); //works for restarting scan
AndroidJavaObject scanResults = wifiManager.Call<AndroidJavaObject>("getScanResults");
int scanResultsCount = scanResults.Call<int>("size");

Step 10 plans

- ๐Ÿ—ธ Create an Anchor point that the prefabs spawn locations are based
	- ๐Ÿ—ธ Install ARCORE XR Plugin
	- ๐Ÿ—ธ Create Anchor Prefab
		- ๐Ÿ—ธ Each Anchor should have different name
		- ๐Ÿ—ธ Anchor should have ability to be deleted with each isntance within 
		- ๐Ÿ—ธ Not being affected by the override or delete commands 
	- ๐Ÿ—ธ Have a button to drop an anchor 
	- ๐Ÿ—ธ Allow the user to grab ancor and adjust it 
		- ๐Ÿ—ธ This is incase the VR adjusts or resets user's position. 
	- ๐Ÿ—ธ Have these anchors be storeable
		- ๐Ÿ—ธ Have the Wifi Scans, Bssid Scans, or Shadow Scans within hierarchy 
		- ๐Ÿ—ธ When a new Anchor is set, it should automatically become the new Origin for scans
		- ๐Ÿ—ธ Anchors should not switch between networks
			- ๐Ÿ—ธ Example: User places anchor in roomA with WifiA
			- ๐Ÿ—ธ User scans with Wifi A, then switches network to WifiB
			- ๐Ÿ—ธ The anchor would continue to store wifi maps on both networks 
			- ๐Ÿ—ธ When the user shrinks the anchor to see full map, switching networks would adjust to same size aswell.
- ๐Ÿ—ธ Add the following functions to Anchor
	- ๐Ÿ—ธ Delete Anchor button to delete all prefabs
	- ๐Ÿ—ธ Activate button to change which Anchor you would use
		- ๐Ÿ—ธ Text should change when Anchor is active or not
		- ๐Ÿ—ธ Wifi Scans woul switch to the anchor that has been activated
	- ๐Ÿ—ธ Ability to move the anchor only on the X & Y axis
		- ๐Ÿ—ธ Make sure Rotation is locked to avoid slanted objects
		- ๐Ÿ—ธ Size of anchors can be modified. 
- ๐Ÿ—ธ Can anchors be inside of anchors? 
	- ๐Ÿ—ธ Technically yes but for now gonna attempt to avoid that. 
- ๐Ÿ—ธ Have the user be able to shrink and adjust of whole mapped out anchor
	- ๐Ÿ—ธ This could allow the impressive display within the AR enviroment
	- ๐Ÿ—ธ Easier to export photos and videos built into the VR functions
- ๐Ÿ—ธ Make Origin Anchor not able to be deleted
	- ๐Ÿ—ธ If Current Active Anchor is Deleted, the program will default to the Origin Anchor.

Step 11 Plans

- ๐Ÿ—ธ Clean Up Scene 1
	- ๐Ÿ—ธ Keep Scene 0 as Backup 
- ๐Ÿ—ธ FIX BSSID Bug. 
- ๐Ÿ—ธ FIX WHITE + BLACK LIST BUG. 
- ๐Ÿ—ธ Make custom script to turn Diagnostics off
-  Double check bugs and clean unneeded code	
- ๐Ÿ—ธ Make and Change splash screen 
- ๐Ÿ—ธ Add LOGO to Popup Screen 
- ๐Ÿ—ธ Add hidden button for anchors to make scans visible or not
- ๐Ÿ—ธ Make a new Tutorial/info Screen about OXr Trail
	- ๐Ÿ—ธ One Screen should display what the program does
	- ๐Ÿ—ธ Second Screen should explain button controls
- ๐Ÿ—ธ Readjust all prefabs in opening scene
- Find out how to make popup logs in the quest 2 manager 

Step 12 Plans

-  Finish Research Paper + Presentation Video Field Testing 
-  If there is time will continue the rest in this step 
-  Add a button or UI to let user create their own cubes for info
	-  The custom cube can hold info such as room number and etc. 
-  Save objects layout when logging off or switching
	-  first, find a way to save scene
		-  Save position/direction that previous was looking
		-  When in that position, recreate all objects
		-  Reload save
	-  Second, find a way to save all objects
		-  Save all locations of (x,y,z) cords of objects
		-  Save data of those prefabs 
	-  When log off or shut down, reloading saves all locations 

APK Versions

- APK 0.0.1: Testing Mixed Reality 
- APK 0.0.2: Getting SSID
- APK 0.0.3: Getting SSID + BSSID
- APK 0.0.4: Getting SSID + BSSID + RSSI/Signal
- APK 0.0.5: Takes all 3 and makes prefabs base on location
- APK 0.0.6: Added Auth/Secuirty Detection
- APK 0.0.7: debugging Auth/Secuirty Detection
- APK 0.0.8: New Prefabs/screen + Quality of Life
- APK 0.0.9: Sudo DataBase + Access Points + Data Rates + New Prefabs 
- APK 0.1.0: Shadow IT Scan function 
- APK 0.1.1: BackDrop Build Demo 
- APK 0.1.2: Anchor Points 
- APK 0.1.3: Offical Release V1 

Future Cybersecuirty Ideas

- Packet Sniffing 
- Historic Log Organization 
- Simulate Network Traffic 
- Simulate firewall 
- Simulate Shadow IT 
- Mac Adress Filtering

Some Sources

- https://math.stackexchange.com/questions/2833778/converting-between-different-scales
- https://www.crowdstrike.com/cybersecurity-101/cloud-security/shadow-it/
- https://cai.io/resources/thought-leadership/shadow-IT-meaning-risks
- https://skarredghost.com/2022/01/05/how-to-oculus-spatial-anchors-unity-2/ 
- https://docs.unity3d.com/Packages/com.unity.xr.arcore@4.1/manual/index.html

About

An AR/VR/XR application made within a Unity Engine that will Map out wireless network connections to visualize signal strengths, access points, vulnerabilities, and more coming soon. Development was on the Meta Quest/ Meta Quest 2.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages