Skip to content

Commit

Permalink
fix escape chars
Browse files Browse the repository at this point in the history
  • Loading branch information
kimocoder committed Aug 21, 2023
1 parent 3f0c36e commit 3a0ebdb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion wifite/attack/pmkid.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def save_pmkid(self, pmkid_hash):
# TODO Rename this here and in `save_pmkid`
def _extracted_from_save_pmkid_21(self, arg0):
# Generate filesystem-safe filename from bssid, essid and date
essid_safe = re.sub('[^a-zA-Z\d]', '', self.target.essid)
essid_safe = re.sub('[^a-zA-Z0-9]', '', self.target.essid)
bssid_safe = self.target.bssid.replace(':', '-')
date = time.strftime('%Y-%m-%dT%H-%M-%S')
result = f'pmkid_{essid_safe}_{bssid_safe}_{date}{arg0}'
Expand Down
4 changes: 2 additions & 2 deletions wifite/attack/wpa.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def load_handshake(bssid, essid):
return None

if essid:
essid_safe = re.escape(re.sub('[^a-zA-Z\d]', '', essid))
essid_safe = re.escape(re.sub('[^a-zA-Z0-9]', '', essid))
else:
essid_safe = '[a-zA-Z0-9]+'
bssid_safe = re.escape(bssid.replace(':', '-'))
Expand All @@ -223,7 +223,7 @@ def save_handshake(handshake):

# Generate filesystem-safe filename from bssid, essid and date
if handshake.essid and type(handshake.essid) is str:
essid_safe = re.sub('[^a-zA-Z\d]', '', handshake.essid)
essid_safe = re.sub('[^a-zA-Z0-9]', '', handshake.essid)
else:
essid_safe = 'UnknownEssid'
bssid_safe = handshake.bssid.replace(':', '-')
Expand Down

0 comments on commit 3a0ebdb

Please sign in to comment.