Forum Thread: Is There a Way to Narrow a Existing Txt File?

Is There a Way to Narrow a Existing Txt File?

I am new to this Null Byte community, but I've become very interseted in the hacking topic, since here it is easy to find most of the information that I need to get started.

After reading quite a few topicts related to Wi-fi cracking with aircrack-ng I decided to try on my own, and to my surprise I could crack some of the Wi-fi nearby without any problem using a word list that I found online, it took me minutes to crack, but after trying the same methods in others I took hours and no password was found. Then I noticed that my word list contain some massive amout of useless data that I could simply be deleted to speed up my process.

Is there a way of narrowing this list to have a minimum 8 words length or higher?

8 Responses

honestly you could use some scripting language here like Python or Ruby .... Am not good in the language myself so sorry I cannot help ... just wanted to throw some light

I myself am not a pro scripter but I'm sure that you could also use bash scripting to get this done. I'd recommend looking into grep, and I also found this article for finding lengths of words. Good luck :)


*Grabs Popcorn* Getting a refill be right back. I need a drink now. Right Back

Try this on the shell

cat "/path/to/passwordlist.txt" | grep -E [A-Za-z0-9]{8} > newlist.txt

Will create a newlist.txt in current dir with passwords that are at least 8 chars

Thanks for the tips, I will study on that! :)

cat is one of the most commonly-used commands in Linux. It can be used to:
Display text files
Copy text files into a new document
Append the contents of a text file to the end of another text file, combining them
-- Merge: cat .. etc >
-- Remove Dupes: cat | uniq >


pw-inspector reads passwords in and prints those which meet the requirements. Use for hacking: trim your dictionary file to the pw requirements of the target.

-- 8-30 chars: cat | pw-inspector -m 8 -M 30 >


sed is a stream editor. A stream editor is used to perform basic text transformations on an input stream (a file, or input from a pipeline).

sort sorts the contents of a text file, line by line.
-- Numbers: sort -n
-- Reverse #'s: sort -nr
-- Sort, merge and remove duplicates- sort -nu

uniq filters out adjacent, matching lines from input file INPUT, writing the filtered data to output file OUTPUT.

# uniq does not detect repeated lines unless they are adjacent. You may want to sort the input first, or use sort -u instead of uniq.

Put it together:
cat | sort | uniq | pw-inspector -m 8 -M 63 >

Clean existing wordlist:
cat | sed 's/^a-zA-Z0-9//g' >

init 0

Thank you so much TRIPHAT and CYBERHIT, It worked!!! Now my file has 25% less it`s original size and I will use the extra info about cat to build a even better word list. =)

Share Your Thoughts

  • Hot
  • Active