Navigation X
ALERT
Click here to register with a few steps and explore all our cool stuff we have to offer!



 10135

[PYTHON] Examples - Basic File Manipulation

by UberFuck - 22 November, 2019 - 10:21 AM
This post is by a banned member (UberFuck) - Unhide
UberFuck  
Godlike
1.557
Posts
375
Threads
5 Years of service
#1
(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:
  • 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
**Disclaimer  - These are intended to be simple examples for people to follow and make their own.  They are not necessarily the most efficient methods - however, they work well and will still perform better than most other options.
 

Hidden Content
You must register or login to view this content.


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
This post is by a banned member (SWAPNILISMADARCHOD) - Unhide
This post is by a banned member (amandalaurel) - Unhide
30
Posts
0
Threads
5 Years of service
#3
(22 November, 2019 - 10:21 AM)foxegado Wrote: Show More
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 2019-11-24:
  • 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
  • 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
**Disclaimer  - These are intended to be simple examples for people to follow and make their own.  They are not necessarily the most efficient methods - however, they work well and will still perform better than most other options.
 

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

Thanks for share
This post is by a banned member (mrl667) - Unhide
mrl667  
Registered
14
Posts
0
Threads
4 Years of service
#4
thanks mate
This post is by a banned member (Masterboi) - Unhide
This post is by a banned member (jonsnowy) - Unhide
This post is by a banned member (ColdVexx) - Unhide
ColdVexx  
Registered
13
Posts
0
Threads
5 Years of service
#7
Thank you for the help, im learning python rn and its supper fun! I hope to one day be able to make my own cracking tools
This post is by a banned member (wdc78563) - Unhide

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
or
Sign in
Already have an account? Sign in here.


Forum Jump:


Users browsing this thread: 1 Guest(s)