Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 34
  1. #21
    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,985
    Rep Power
    983

    Re: How to grab Wifi passwords with only 2 commands

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

  2. #22
    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
    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.
    When you think you have made a procedure idiot proof your company employs a better idiot.

  3. #23
    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 skynet View Post
    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

  4. #24
    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

    Yes that works as expected.
    Last edited by skynet; 10-23-2023 at 08:31 PM.
    When you think you have made a procedure idiot proof your company employs a better idiot.

  5. #25
    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 skynet View Post
    Yes that works as expected.
    Alright thank you for testing it out!

  6. #26
    Self-Taught
    Join Date
    Oct 2023
    Location
    HSV and SFO
    Posts
    27
    Rep Power
    1

    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!

  7. #27
    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,985
    Rep Power
    983

    Re: How to grab Wifi passwords with only 2 commands

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

  8. #28
    Self-Taught
    Join Date
    Oct 2023
    Location
    HSV and SFO
    Posts
    27
    Rep Power
    1

    Re: How to grab Wifi passwords with only 2 commands

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

  9. #29
    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
    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.
    When you think you have made a procedure idiot proof your company employs a better idiot.

  10. #30
    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 skynet View Post
    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

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