5

I need to configure a set of new machines. They all need a set of common WLAN connections I currently have on my machine. I know how to manually retrieve the settings including the passwords using the network-manager GUI.

What I'm looking for are 2 scripts: one to extract all wireless settings (at least SSID and security type/password) into a text format file (XML would be fine), so I can edit and polish it. The other one (unsurprisingly) to write them back (on a new machine).

Any pointers are welcome!

Clarification: I don't want to snoop out passwords in the wireless world, just to ease the process of documenting and distributing what is stored on one machine already.

2 Answers 2

3

It turns out, a simple copy operation will suffice! With a little more snooping around on askUbuntu it turns out that all network connections are stored in /etc/NetworkManager/system-connections/, so I just need to copy them (root access required) around using any of the distribution methods I'd pick.

To document the settings (we love spreadsheets) a simple script (solved with a little help) one can use this script:

#!/bin/bash
#Document wifi passwords
echo ssid,password > knownwifi.csv
for f in /etc/NetworkManager/system-connections/*
   do
      ssid=$(awk -F= '$1=="ssid" {print $2}' "$f")
      pwd=$(   awk -F= '$1=="psk"    {print $2}' "$f")
      #We are only interested in password protected Wifi
      if [ x$pwd != 'x' ]
         then
           echo "$ssid,$pwd"
      fi
   done >> knownwifi.csv
echo done

You need to run that script as root and you might want to add additional values from connection setting. Opens nicely in a spreadsheet of your choice

0

This is So Easy

Lets begin .

We'll need : airmon-ng ,airodump-ng thats all :D

So install them : sudo apt-get install aircrack-ng

after that check for your wifi card name :

iwconfig

It will display your wifi card name mine is : wlan0

  1. Change your wlan0 interface to monitor mode to get any APs informations :

    sudo airmon-ng start wlan0
    

Now we have the mon0 interface to use it and listen to the wifi world :D

  1. now begin the wifi scan :

    sudo airodum-ng mon0
    

Now you will see all the APs information hit Ctrl + C when you see them all ( give it some minutes e.g : 2 min )

Now you will have some thing like this

BSSID              PWR  Beacons    #Data, #/s  CH  MB   ENC  CIPHER AUTH ESSID                                                         

 00:04:3F:00:39:8A  -64       53       11    0   6  54 . WPA2 CCMP   MGT  <length: 0>                                                  
 00:19:70:8F:B1:DF  -71        6        0    0   1  54e. WPA2 CCMP   PSK  ACHRAF                                                        
 00:04:ED:BB:9F:06  -71        3        0    0   1  54   WEP  WEP         Ali casillas                                                  
 00:19:70:75:7B:A8  -72        2        0    0   1  54e. WPA2 CCMP   PSK  D.info                                                        
 00:19:70:4A:0E:E9  -69        5        3    0   7  54e. WPA  CCMP   PSK  Electro youssef Dreambox                                      
 94:0C:6D:B4:80:9D  -72        2        0    0   1  54   WPA  TKIP   PSK  TP-LINK_B4809D 

thats all if you just want to have this information . (unless you want to ... )

or you can just take all your wifi paswwords :

Network or wifi passwords can be found in /etc/NetworkManager/system-connections. There is a file for each connection with its configuration, also you need root privileges to read them but the password isn't encrypted.

this is what you were sharing for : it is already solved

3
  • 1
    That looks easy - but that's not what I'm looking for. I want to retrieve the passwords stored on my machine. I don't need to crack anything - I can see them in the UI. It is just tedious to open all the connection profiles one by one by hand
    – stwissel
    Jul 9, 2013 at 2:59
  • okey but you didn't say about taking it from np-manager ;) okey i'll see they should be stored somewhere
    – ucefkh
    Jul 9, 2013 at 13:57
  • actually I did :-) : "I currently have on my machine. I know how to manually retrieve the settings including the passwords using the network-manager GUI." -- they are stored somewhere in an XML file, but not cleartext
    – stwissel
    Jul 10, 2013 at 1:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .