i created malware with Python (it's SCARY easy!!)

About this video

For education only, and on a disposable cloud Linux box he says he can delete afterwards, he writes working ransomware in Python and then explores a malware sample library. He creates test text files, then builds a script that uses os.listdir to collect files in the current directory, deliberately excluding the script itself, its key file, and the decryptor, and checking os.path.isfile so directories are skipped. Using Fernet from the cryptography library, which a guest segment describes as symmetric encryption using 128-bit AES, he generates a key, saves it to thekey.key, reads each file in binary mode, encrypts the contents, and writes the ciphertext back, adding a ransom message demanding 100 Bitcoin in his demo printout. He then copies the script into a decryptor that loads the saved key, decrypts instead of encrypts, and only proceeds if the user enters the secret phrase ‘coffee’. Finally he clones a GitHub repo he calls MalwareShowcase, installs its requirements with pip3, and briefly runs a file-infection example, warning viewers to only experiment on a throwaway machine.

Key takeaways

  • The ransomware builds its target list with os.listdir, filtering out itself, the key file, the decryptor, and directories
  • Fernet.generate_key() creates the symmetric key, which the script saves to thekey.key for later decryption
  • Encryption loop: open each file in ‘rb’, Fernet(key).encrypt the contents, then rewrite the file in ‘wb’
  • The decryptor mirrors the encryptor but loads the saved key, calls decrypt, and requires the correct secret phrase first
  • He insists on using only a disposable/throwaway Linux machine or VM for malware experiments, never a real system

Episode details: published May 16, 2022 · 25:18 long. Summary written by Self Growth Videos from the episode itself. Business results and any income figures mentioned are NetworkChuck’s own claims, shared for education — they are not typical or guaranteed.


← Previous: this BASH script will KILL you. · Next: i bet you can’t do this (because you still suck at subnetting) →

All NetworkChuck videos · NetworkChuck profile · NetworkChuck on YouTube

Sister brand · Vacation Club Promo

All-inclusive resort stays from $435

Qualified couples: promotional Mexico and Caribbean packages at real resorts. Short presentation during your stay — enjoy the rest of the trip.

Qualifications apply · presentation during stay · no purchase required

Subscribe YouTube Suggest