Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 34
  1. #11
    Service Manager 2,500+ Posts rthonpm's Avatar
    Join Date
    Aug 2007
    Location
    Pennsyltucky
    Posts
    2,779
    Rep Power
    108

    Re: How to grab Wifi passwords with only 2 commands

    Quote Originally Posted by techsxge View Post
    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

  2. #12
    Field Supervisor 500+ Posts
    How to grab Wifi passwords with only 2 commands

    techsxge's Avatar
    Join Date
    Jan 2022
    Location
    N/A
    Posts
    661
    Rep Power
    28

    Re: How to grab Wifi passwords with only 2 commands

    Quote Originally Posted by techsxge View Post
    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

  3. #13
    Field Supervisor 500+ Posts
    How to grab Wifi passwords with only 2 commands

    techsxge's Avatar
    Join Date
    Jan 2022
    Location
    N/A
    Posts
    661
    Rep Power
    28

    Re: How to grab Wifi passwords with only 2 commands

    Quote Originally Posted by rthonpm View Post
    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

  4. #14
    Service Manager 2,500+ Posts rthonpm's Avatar
    Join Date
    Aug 2007
    Location
    Pennsyltucky
    Posts
    2,779
    Rep Power
    108

    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

  5. #15
    Field Supervisor 500+ Posts
    How to grab Wifi passwords with only 2 commands

    techsxge's Avatar
    Join Date
    Jan 2022
    Location
    N/A
    Posts
    661
    Rep Power
    28

    Re: How to grab Wifi passwords with only 2 commands

    Quote Originally Posted by rthonpm View Post
    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

  6. #16
    Retired 10,000+ Posts
    How to grab Wifi passwords with only 2 commands

    slimslob's Avatar
    Join Date
    May 2013
    Location
    Bakersfield, CA
    Posts
    33,989
    Rep Power
    983

    Re: How to grab Wifi passwords with only 2 commands

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

  7. #17
    Field Supervisor 500+ Posts
    How to grab Wifi passwords with only 2 commands

    techsxge's Avatar
    Join Date
    Jan 2022
    Location
    N/A
    Posts
    661
    Rep Power
    28

    Re: How to grab Wifi passwords with only 2 commands

    Quote Originally Posted by slimslob View Post
    Got a question, can either of them be used on a Mac?
    nope.

  8. #18
    Service Manager 2,500+ Posts
    How to grab Wifi passwords with only 2 commands

    skynet's Avatar
    Join Date
    Apr 2009
    Location
    You know by now
    Posts
    2,575
    Rep Power
    167

    Re: How to grab Wifi passwords with only 2 commands

    Quote Originally Posted by techsxge View Post
    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.
    When you think you have made a procedure idiot proof your company employs a better idiot.

  9. #19
    Retired 10,000+ Posts
    How to grab Wifi passwords with only 2 commands

    slimslob's Avatar
    Join Date
    May 2013
    Location
    Bakersfield, CA
    Posts
    33,989
    Rep Power
    983

    Re: How to grab Wifi passwords with only 2 commands

    Quote Originally Posted by skynet View Post
    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.

  10. #20
    Field Supervisor 500+ Posts
    How to grab Wifi passwords with only 2 commands

    techsxge's Avatar
    Join Date
    Jan 2022
    Location
    N/A
    Posts
    661
    Rep Power
    28

    Re: How to grab Wifi passwords with only 2 commands

    Quote Originally Posted by slimslob View Post
    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

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Get the Android App
click or scan for the Copytechnet Mobile App

-= -= -= -= -=


IDrive Remote Backup

Lunarpages Internet Solutions

Advertise on Copytechnet

Your Link Here