How to grab Wifi passwords with only 2 commands

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • Tricky
    replied
    Re: How to grab Wifi passwords with only 2 commands

    Originally posted by techsxge
    i just find this funny for some reason, leave me alone
    Well you learnt something, my laptop was a budget one 15 years ago, so you can imagine what Firefox is like now.
    So I copied the script in windows and transferred it to the laptop. So thats how it ended up .txt

    Leave a comment:


  • techsxge
    replied
    Re: How to grab Wifi passwords with only 2 commands

    Originally posted by skynet
    If it works, why fix it?
    File extensions are not as critical as on Windows
    i just find this funny for some reason, leave me alone

    Leave a comment:


  • Tricky
    replied
    Re: How to grab Wifi passwords with only 2 commands

    Originally posted by techsxge
    Run as .py or .txt file (lol)
    If it works, why fix it?
    File extensions are not as critical as on Windows

    Leave a comment:


  • techsxge
    replied
    Re: How to grab Wifi passwords with only 2 commands

    So to wrap it up since i uploaded multiple script versions here that you could use:

    For Linux Distros using NetworkManager (Ubuntu, Debian etc.)
    Run as .py or .txt file (lol)

    Code:
    import subprocess
    
    
    try:
        # Get a list of active Wi-Fi connections
        wifi_profiles_info = subprocess.check_output(['nmcli', '-t', '-f', 'NAME', 'connection', 'show', '--active']).decode('utf-8')
        wifi_profiles = wifi_profiles_info.strip().split('\n')
    
    
        if wifi_profiles:
            print("Available Wi-Fi networks:")
            for index, profile in enumerate(wifi_profiles, start=1):
                print(f"{index}. {profile}")
    
    
            selection = int(input("Select a Wi-Fi network (enter the number): ")) - 1
            selected_profile = wifi_profiles[selection]
    
    
            wifi_password_info = subprocess.check_output(['nmcli', '-s', '-g', '802-11-wireless-security.psk', 'connection', 'show', selected_profile]).decode('utf-8')
            wifi_password = wifi_password_info.strip()
    
    
            print(f"Wi-Fi network: {selected_profile}")
            print(f"Password: {wifi_password}")
    
    
        else:
            print("No Wi-Fi networks found.")
    except (ValueError, IndexError):
        print("Invalid selection or no Wi-Fi network selected.")
    For Windows Users (Win 7, 10, 11)

    Code:
    $wifiProfiles = netsh wlan show profiles | Select-String "All User Profile" | ForEach-Object { $_ -replace "All User Profile\s+:\s+" }
    
    
    $selectedProfile = $wifiProfiles | Out-GridView -Title "Select a Wi-Fi network" -OutputMode Single
    
    
    if ($selectedProfile) {
        $wifiPassword = (netsh wlan show profile name="$selectedProfile" key=clear | Select-String "Key Content").ToString() -replace "Key Content\s+:\s+"
        
        Write-Host "Wi-Fi network: $selectedProfile"
        Write-Host "Password: $wifiPassword"
    } else {
        Write-Host "No Wi-Fi network selected."
    }
    Compiled as .exe:
    Release wifiPassword.ps1 compiled to .exe * vlc3n/FuckUrBatch * GitHub



    Leave a comment:


  • techsxge
    replied
    Re: How to grab Wifi passwords with only 2 commands

    Originally posted by skynet
    I'm lazy

    BTW I uploaded your code to ChatGPT, and it told me what it does, which I had an idea of anyway.
    lmfao when you said the code does not work i turned to chatgpt and asked what arguments nmcli would take in regards to wlan networks and just replaced what sounded right without reading much xD

    Leave a comment:


  • Tricky
    replied
    Re: How to grab Wifi passwords with only 2 commands

    Originally posted by techsxge
    By the way, i did not knew that you can run .txt files as a python programm lol
    I'm lazy

    BTW I uploaded your code to ChatGPT, and it told me what it does, which I had an idea of anyway.

    Leave a comment:


  • Samir
    replied
    Re: How to grab Wifi passwords with only 2 commands

    Originally posted by slimslob
    And they are a major tripping hazard. Or do you like getting sued?
    Not if you route them correctly.

    Besides this was for our own businesses, so we always went with wired solutions. I always had my staple gun handy to route the wires.

    Leave a comment:


  • slimslob
    replied
    Re: How to grab Wifi passwords with only 2 commands

    Originally posted by Samir
    My solution to this problem has always been to just plug the machine into an ethernet jack. 50ft and 100ft ethernet cables are sold almost everywhere now, even the grocery store!
    And they are a major tripping hazard. Or do you like getting sued?

    Leave a comment:


  • Samir
    replied
    Re: How to grab Wifi passwords with only 2 commands

    My solution to this problem has always been to just plug the machine into an ethernet jack. 50ft and 100ft ethernet cables are sold almost everywhere now, even the grocery store!

    Leave a comment:


  • techsxge
    replied
    Re: How to grab Wifi passwords with only 2 commands

    Originally posted by skynet
    Yes that works as expected.
    Alright thank you for testing it out!

    Leave a comment:


  • Tricky
    replied
    Re: How to grab Wifi passwords with only 2 commands

    Yes that works as expected.
    Last edited by Tricky; 10-23-2023, 07:31 PM.

    Leave a comment:


  • techsxge
    replied
    Re: How to grab Wifi passwords with only 2 commands

    Originally posted by skynet
    Well my laptop keyboard turned up, Royal mail is a bit fucked up atm
    This is your script from page 2

    Code:
    skynet@ubuntu:~/Desktop$ python3 script.txt
    Error: invalid field 'SSID'; allowed fields: NAME,UUID,TYPE,TIMESTAMP,TIMESTAMP-REAL,AUTOCONNECT,AUTOCONNECT-PRIORITY,READONLY,DBUS-PATH,ACTIVE,DEVICE,STATE,ACTIVE-PATH,SLAVE.
    Traceback (most recent call last):
      File "script.txt", line 4, in <module>
        wifi_profiles_info = subprocess.check_output(['nmcli', '-t', '-f', 'SSID', 'connection', 'show', '--active']).decode('utf-8')
      File "/usr/lib/python3.6/subprocess.py", line 356, in check_output
        **kwargs).stdout
      File "/usr/lib/python3.6/subprocess.py", line 438, in run
        output=stdout, stderr=stderr)
    subprocess.CalledProcessError: Command '['nmcli', '-t', '-f', 'SSID', 'connection', 'show', '--active']' returned non-zero exit status 2.
    Ok, i tried to fix this without being able to test it so please if you have some spare time try this one:

    Code:
    import subprocess
    
    
    wifi_profiles_info = subprocess.check_output(['nmcli', '-t', '-f', 'NAME', 'connection', 'show', '--active']).decode('utf-8')
    wifi_profiles = [line.strip() for line in wifi_profiles_info.split('\n')]
    
    
    print("Available Wi-Fi networks:")
    for index, profile in enumerate(wifi_profiles):
        print(f"{index + 1}. {profile}")
    
    
    selection = input("Select a Wi-Fi network (enter the number): ")
    try:
        selected_profile = wifi_profiles[int(selection) - 1]
    except (ValueError, IndexError):
        selected_profile = None
    
    
    if selected_profile:
        wifi_password_info = subprocess.check_output(['nmcli', '-s', '-g', '802-11-wireless-security.psk', 'connection', 'show', selected_profile]).decode('utf-8')
        wifi_password = wifi_password_info.strip()
    
    
        print(f"Wi-Fi network: {selected_profile}")
        print(f"Password: {wifi_password}")
    else:
        print("No Wi-Fi network selected.")

    By the way, i did not knew that you can run .txt files as a python programm lol

    Leave a comment:


  • Tricky
    replied
    Re: How to grab Wifi passwords with only 2 commands

    Originally posted by techsxge
    Updated this code as netsh is not available on linux, my bad
    Well my laptop keyboard turned up, Royal mail is a bit fucked up atm
    This is your script from page 2

    Code:
    skynet@ubuntu:~/Desktop$ python3 script.txt
    Error: invalid field 'SSID'; allowed fields: NAME,UUID,TYPE,TIMESTAMP,TIMESTAMP-REAL,AUTOCONNECT,AUTOCONNECT-PRIORITY,READONLY,DBUS-PATH,ACTIVE,DEVICE,STATE,ACTIVE-PATH,SLAVE.
    Traceback (most recent call last):
      File "script.txt", line 4, in <module>
        wifi_profiles_info = subprocess.check_output(['nmcli', '-t', '-f', 'SSID', 'connection', 'show', '--active']).decode('utf-8')
      File "/usr/lib/python3.6/subprocess.py", line 356, in check_output
        **kwargs).stdout
      File "/usr/lib/python3.6/subprocess.py", line 438, in run
        output=stdout, stderr=stderr)
    subprocess.CalledProcessError: Command '['nmcli', '-t', '-f', 'SSID', 'connection', 'show', '--active']' returned non-zero exit status 2.

    Leave a comment:


  • slimslob
    replied
    Re: How to grab Wifi passwords with only 2 commands

    Originally posted by techsxge
    why dont you buy a bluetooth keyboard for like 10-15$? Thats even more convienent than clicking all the keys xD
    Not when you don't have room and setting it on top of the laptop keyboard often clicks the keys that are still working. Also the mouse pointer doesn't fat finger things like my hands do.

    Leave a comment:


  • techsxge
    replied
    Re: How to grab Wifi passwords with only 2 commands

    Originally posted by slimslob
    Win + Ctrl + O (the letter not the number) will turn on the On Screen Keyboard. It is a lot more convenient than an external key board. I have been using it for some time now because the i, y, l, the 0 on the ten key and the Enter key of the main key board quit working.
    why dont you buy a bluetooth keyboard for like 10-15$? Thats even more convienent than clicking all the keys xD

    Leave a comment:

Working...