Merge pull request #931 from molangning/patch-3

Removed swear words from passwords
This commit is contained in:
g0tmi1k
2024-02-13 15:56:14 +00:00
committed by GitHub
31 changed files with 2756 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
This is SecLists script directory where stuff like automated tasks and cleaner scripts can be found. You are welcome to use them to modify files here to your liking.
Below are scripts you can use to clean/modify/mutate files to your liking
- - -
`swear-words-remover.py` removes swear words from a target directory and outputs them in the same root directory as the passwords
e.g. target dir is `Passwords/Common-Credentials` and suffix is `-without-curse-words` so passwords will be in `Passwords/Common-Credentials`
- - -
`os-names-mutate.py` mutates `Fuzzing/os-names.txt` to include possible mutations of OS names in a url.
By default this script outputs the results in `Fuzzing/os-names-mutated.txt`
+72
View File
@@ -0,0 +1,72 @@
#!/usr/bin/python3
# Beware of the Scunthorpe problem!
# https://en.wikipedia.org/wiki/Scunthorpe_problem
import os
print("[+] Curse words remover")
SOURCE_FOLDER="Miscellaneous/list-of-swear-words"
TARGET_DIRS=["Passwords/Common-Credentials"]
curse_words=[]
TARGET_SUFFIX="-without-curse-words"
for root,_,file_list in os.walk(SOURCE_FOLDER):
for file in file_list:
if not file.endswith(".txt"):
continue
curse_words+=open(os.path.join(root,file)).read().split('\n')
# dedupe them
curse_words=list(dict.fromkeys(curse_words))
target_files=[]
for i in TARGET_DIRS:
for root,_,file_list in os.walk(i):
for file in file_list:
if not file.endswith(".txt"):
continue
target_files.append(os.path.join(root,file))
print("[+] Got %s files to check"%(len(target_files)))
for i in target_files:
print("[+] Checking %s"%(i))
counter=0
contents=open(i).read().split('\n')
root,file=i.rsplit("/",1)
root+=TARGET_SUFFIX
clean_contents=[]
for password in contents:
has_curse_word=False
if not password:
continue
for curse_word in curse_words:
if curse_word in password:
has_curse_word=True
break
if has_curse_word:
counter+=1
continue
clean_contents.append(password)
contents="\n".join(clean_contents)
if not os.path.isdir(root):
os.makedirs(root)
if counter==0:
print("[+] No curse words found in %s"%(i))
else:
print("[!] Removed %i swear words from %s"%(counter,i))
open(os.path.join(root,file),"w").write(contents)