How to grab Wifi passwords with only 2 commands

Collapse
X
 
  • Time
  • Show
Clear All
new posts

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

    Originally posted by skynet
    I will try it, but my desktop doesn't have Wi-Fi, my laptop does, but I cleaned the keyboard last week, and now it just repeats a certain key, kind of difficult putting the password in. Ordered a new one last week.
    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.

    Leave a comment:


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

    Originally posted by techsxge
    yep, i updated my script to not use netsh. Saw this myself after uploading it... Now it uses nmcli
    I will try it, but my desktop doesn't have Wi-Fi, my laptop does, but I cleaned the keyboard last week, and now it just repeats a certain key, kind of difficult putting the password in. Ordered a new one last week.

    Leave a comment:


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

    Originally posted by slimslob
    Got a question, can either of them be used on a Mac?
    nope.

    Leave a comment:


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

    Got a question, can either of them be used on a Mac?

    Leave a comment:


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

    Originally posted by rthonpm
    So glad the Linux world made nmcli all but a standard. It's a pain having to remember what tools work on what distribution.

    Sent from my Pixel 6 Pro using Tapatalk
    standardisation is like the biggest thing holding people back on using linux i feel like.
    nmcli should be supported by most ubuntu and redhat versions. Debian i am not too sure about

    Leave a comment:


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

    So glad the Linux world made nmcli all but a standard. It's a pain having to remember what tools work on what distribution.

    Sent from my Pixel 6 Pro using Tapatalk

    Leave a comment:


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

    Originally posted by rthonpm
    It's more than just changing the string. You're using native Windows commands like netsh which aren't understood by Linux. It would be like trying to get a script calling chkdsk to work in RHEL: it's not going to know what you're trying to do.

    Sent from my Pixel 6 Pro using Tapatalk
    yep, i updated my script to not use netsh. Saw this myself after uploading it... Now it uses nmcli

    Leave a comment:


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

    Originally posted by techsxge
    On linux it would be smarter to just do it with a python script. I quickly translated this code so forgive any mistakes:

    Code:
    import subprocess
    
    
    wifi_profiles_info = subprocess.check_output(['nmcli', '-t', '-f', 'SSID', '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.")
    Updated this code as netsh is not available on linux, my bad

    Leave a comment:


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

    Originally posted by techsxge
    not too sure if powershell is 1:1 supported by linux.

    In any case bin/sh would be for shell scripts, not powershell scripts.
    You would need to add:

    #!/usr/bin/pwsh -Command
    It's more than just changing the string. You're using native Windows commands like netsh which aren't understood by Linux. It would be like trying to get a script calling chkdsk to work in RHEL: it's not going to know what you're trying to do.

    Sent from my Pixel 6 Pro using Tapatalk

    Leave a comment:


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

    On linux it would be smarter to just do it with a python script. I quickly translated this code so forgive any mistakes:

    Code:
    import subprocess
    
    
    wifi_profiles_info = subprocess.check_output(['nmcli', '-t', '-f', 'SSID', '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.")
    Last edited by techsxge; 10-06-2023, 01:13 PM. Reason: Updated script as netsh does not exists on linux

    Leave a comment:


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

    Originally posted by skynet
    Can I add #!/bin/sh to the beginning of that script for Linux?
    not too sure if powershell is 1:1 supported by linux.

    In any case bin/sh would be for shell scripts, not powershell scripts.
    You would need to add:

    #!/usr/bin/pwsh -Command
    Last edited by techsxge; 10-06-2023, 01:03 PM. Reason: replaced powershell with pwsh

    Leave a comment:


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

    Originally posted by skynet
    Can I add #!/bin/sh to the beginning of that script for Linux?
    No.

    Sent from my Pixel 6 Pro using Tapatalk

    Leave a comment:


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

    Originally posted by techsxge
    I made a script that will let you extract the passwords from any recently connected wifi to just simplify this.

    Script:
    https://github.com/vlc3n/FuckUrBatch...fipassword.ps1


    Compiled to exe:
    Release wifiPassword.ps1 compiled to .exe * vlc3n/FuckUrBatch * GitHub
    Can I add #!/bin/sh to the beginning of that script for Linux?

    Leave a comment:


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

    I made a script that will let you extract the passwords from any recently connected wifi to just simplify this.

    Script:
    Collection of batch and powershell scripts for free use. Credits to a book i got gifted from a book shop 3 years ago that got me interested in batch scripts - vlc3n/FuckUrBatch


    Compiled to exe:
    Release wifiPassword.ps1 compiled to .exe * vlc3n/FuckUrBatch * GitHub

    Its open source, so you dont have to worry about any bloatware being installed or the script doing shady things.
    Last edited by techsxge; 10-06-2023, 01:04 PM.

    Leave a comment:


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

    yeah that works well, have used it before. only works though if the person has connected once to the network. then they forgot the password. and for whatever reason was disconnected. run both of those commands and you have the info you need. you can blow someone's mind with that trick. lol

    Leave a comment:

Working...