OP 22 November, 2019 - 10:21 AM
(This post was last modified: 16 June, 2020 - 06:36 AM by UberFuck.
Edit Reason: changed from pastr.io to ghostbin
)
This thread is intended to help people perform some basic file manipulation tasks in Python. I plan on updating the thread as time goes on with more examples as they come up.
Examples as of 2020-03-25:
FAQ:
Q: Why not use some awesome website that can do the same task?
A: A few reasons, but a couple would be: 1) you may not want to post some content to a public website (ie a combolist or dumpfile) 2) If the content is very large then it might not be very efficient
Q: Why not use some specialized program to perform the task?
A: Unfortunately, a lot of the programs posted related to hacking/cracking are infected with malware. Scripting these tasks is easy and you know exactly what *your code* it's doing.
Q: Why not use Notepad++ to edit a file?
A: That might work with smaller files and when you only need to do it once (or a few times), but it normally doesn't scale very well when working with large files or doing a task it repeatedly.
Q: Why Python?
A: Because it's easy and works with multiple operating systems. Honestly, I normally use PowerShell to perform basic tasks in Windows, but have found Python to perform better when working with large files.
If you found the code helpful, please leave a like.
Examples as of 2020-03-25:
- Convert a EMAIL:PASS combolist file to USER:PASS
- Convert a dumpfile in the format USER:HASH:EMAIL:IP to EMAIL:HASH
- Convert a dumpfile in the format USER:HASH:PASS to USER:PASS
- Convert a dumpfile in the format EMAIL:USERNAME:PASS to EMAIL:PASS format
- Remove captures from a combolist
- Remove duplicate lines from a file
- Remove trailing value from a dumpfile (example: input file contains Value1:Value2...ValueN:TRAIL and convert to Value1:Value2...ValueN)
- Split large file into multiple smaller files
- Sort lines in a file in ascending order (0-9, A-Z)
- Randomize / shuffle lines in a file
- Merge multiple files into one file
- Create combolist from username file and password list
- Cleanup combolist that is using semicolon (;) as a delimiter instead of colon (:)
- Create zip file with compression
- Extract zip file contents
FAQ:
Q: Why not use some awesome website that can do the same task?
A: A few reasons, but a couple would be: 1) you may not want to post some content to a public website (ie a combolist or dumpfile) 2) If the content is very large then it might not be very efficient
Q: Why not use some specialized program to perform the task?
A: Unfortunately, a lot of the programs posted related to hacking/cracking are infected with malware. Scripting these tasks is easy and you know exactly what *your code* it's doing.
Q: Why not use Notepad++ to edit a file?
A: That might work with smaller files and when you only need to do it once (or a few times), but it normally doesn't scale very well when working with large files or doing a task it repeatedly.
Q: Why Python?
A: Because it's easy and works with multiple operating systems. Honestly, I normally use PowerShell to perform basic tasks in Windows, but have found Python to perform better when working with large files.
If you found the code helpful, please leave a like.