Skip to content

Commit

Permalink
cf changelog Linux 0.71
Browse files Browse the repository at this point in the history
  • Loading branch information
AlessandroZ committed Jun 4, 2015
1 parent e11607d commit b6bd676
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 19 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
LaZagne 0.71 (04/06/2015)
- Only Linux
* Wifi password module from WPA Supplicant implemented (by rpesche)

LaZagne 0.7 (29/05/2015)
- For Windows / Linux
* Fix mozilla bug (special characters were not printed)
Expand Down
2 changes: 1 addition & 1 deletion Linux/src/config/constant.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
class constant():
folder_name = 'results'
MAX_HELP_POSITION = 27
CURRENT_VERSION = 0.7
CURRENT_VERSION = 0.71
output = None
file_logger = None
verbose = False
Expand Down
4 changes: 2 additions & 2 deletions Linux/src/config/manageModules.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from softwares.chats.jitsi import Jitsi
# wifi
from softwares.wifi.wifi import Wifi
from softwares.wifi.wpa_supplicant import wpa_supplicant
from softwares.wifi.wpa_supplicant import Wpa_supplicant
# databases
from softwares.databases.squirrel import Squirrel
from softwares.databases.dbvis import DbVisualizer
Expand Down Expand Up @@ -43,7 +43,7 @@ def get_modules():
SQLDeveloper(),
Squirrel(),
Wifi(),
wpa_supplicant(),
Wpa_supplicant(),
kde()
]
return moduleNames
47 changes: 31 additions & 16 deletions Linux/src/softwares/wifi/wpa_supplicant.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
#######################
#
# By rpesche
#
#######################

from config.header import Header
from config.write_output import print_debug, print_output
from config.moduleInfo import ModuleInfo
import re
import os

class wpa_supplicant(ModuleInfo):
class Wpa_supplicant(ModuleInfo):

filestr = '/etc/wpa_supplicant/wpa_supplicant.conf'


def __init__(self):
options = {'command': '-wp', 'action': 'store_true', 'dest': 'wpa_supplicant', 'help': 'WPA Supplicant - Need root Privileges'}
ModuleInfo.__init__(self, 'wpa_supplicant', 'wifi', options)
Expand All @@ -27,33 +32,43 @@ def parse_file_network(self, fd):
if re.match('^[ \t]*}', line):
return (ssid, password)



def parse_file(self):
pwdFound = []
fd = open(self.filestr)

fd = None
try:
fd = open(self.filestr)
except Exception, e:
print_debug('DEBUG', '{0}'.format(e))
print_debug('INFO', 'Could not open the file: %s ' % self.filestr)

for line in fd:
if "network=" in line:
values = {}
(ssid,password) = self.parse_file_network(fd)
if ssid and password:
values['PASSWORD'] = password
values['SSID'] = ssid
pwdFound.append(values)
if fd:
for line in fd:
if "network=" in line:
values = {}
(ssid,password) = self.parse_file_network(fd)
if ssid and password:
values['PASSWORD'] = password
values['SSID'] = ssid
pwdFound.append(values)
fd.close()
return pwdFound;


def check_file_access(self):
if not os.path.exists(self.filestr):
print_debug('WARNING', 'the path "%s" does not exist' %(self.filestr))
print_debug('WARNING', 'The path "%s" does not exist' %(self.filestr))
return -1
return 0

def run(self):
Header().title_info('Wifi (from WPA Supplicant)')
if self.check_file_access():
return
pwdFound = self.parse_file()

# check root access
if os.getuid() != 0:
print_debug('INFO', 'You need more privileges (run it with sudo)\n')
return

pwdFound = self.parse_file()
print_output("wpa_supplicant", pwdFound)
Binary file modified Linux/standalone/32bits/LaZagne-32bits
Binary file not shown.
Binary file modified Linux/standalone/64bits/LaZagne-64bits
Binary file not shown.

0 comments on commit b6bd676

Please sign in to comment.