Skip to content

Instantly share code, notes, and snippets.

@Gavriel770U
Gavriel770U / zip_brute.py
Created August 6, 2024 21:18
Zip Password Bruteforcer For Magshimim+ Summer Camp 2024 CTF
from zipfile import ZipFile
file_name = "password.zip"
with ZipFile(file_name, "r") as zip:
for pwd in range(1000,10000):
try:
zip.extractall(path="uncompressed", pwd=(str(pwd)).encode("utf-8"))
print(pwd)
print("SUCCESS")
break
@Gavriel770U
Gavriel770U / bot.py
Last active August 8, 2024 20:56
bot.py
def score(src, planet, pw):
scoring = planet.growth_rate() * 10 - planet.num_ships()
#distance
for my_planet in pw.my_planets():
total_distance = pw.distance(my_planet, planet)
scoring -= total_distance
#fleets for planet
@Gavriel770U
Gavriel770U / settime.bat
Last active March 14, 2024 17:14
`.bat` file that synchronizes your timezone with your computers time. Often used because of the time error of switching from OS to OS.
@echo off
REM --> Check for permissions
IF "%PROCESSOR_ARCHITECTURE%" EQU "amd64" (
>nul 2>&1 "%SYSTEMROOT%\SysWOW64\cacls.exe" "%SYSTEMROOT%\SysWOW64\config\system"
) ELSE (
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
)
REM --> If error flag set, we do not have admin.
@wteuber
wteuber / encrypt_decrypt.rb
Last active April 30, 2025 19:20
Simply encrypt and decrypt Strings in Ruby.
require 'openssl'
class String
def encrypt(key)
cipher = OpenSSL::Cipher.new('DES-EDE3-CBC').encrypt
cipher.key = Digest::SHA1.hexdigest key
s = cipher.update(self) + cipher.final
s.unpack('H*')[0].upcase
end