Skip to content

Instantly share code, notes, and snippets.

@0xpizza
0xpizza / async_tcp_scan.py
Last active November 20, 2021 15:25
TCP Network scanner using asyncio for Python 3.7
#!/usr/bin/python3.7
import asyncio
import ipaddress
import re
import sys
MAX_NUMBER_WORKERS = 200
from Crypto.Cipher import AES
from sys import argv
import os
AES_KEY_LEN = 32 # AES-256 GCM
AES_NONCE_LEN = 12 # NIST SP800-38D recommends 96 bits
AES_HMAC_LEN = 16 # for later
FOUR_KiB = 2**10*4 # standard OS block size
EXT = '.happyencryption'
import hashlib
from tkinter import *
from tkinter.ttk import *
from tkinter.filedialog import askopenfilename
# how to use checkbutton: https://stackoverflow.com/questions/4236910/getting-tkinter-check-box-state
FOUR_KIBIBYTES = 2**10*4
def compute_hashes(file_path, *hashes):
@0xpizza
0xpizza / aclient.py
Created March 26, 2019 23:25
async chat
import queue
import asyncio
import threading
from tkinter import *
from tkinter.ttk import *
async def receiver(r):
while True:
import os
import base64
import hashlib
class Scrypt():
@staticmethod
def _make_bytes(pw, encoding):
if isinstance(pw, str):
try:
pw = pw.encode(encoding)
import sqlite3
import hashlib
import base64
from tkinter import *
from cryptography.fernet import Fernet
DB_FILE_NAME = 'my.db'
@0xpizza
0xpizza / a.py
Last active April 12, 2019 19:31
class ItemToPurchase:
def __init__(self, item_name, item_description, item_price, item_quantity):
self.item_name = item_name
self.item_description = item_description
self.item_price = float(item_price)
self.item_quantity = float(item_quantity)
def print_item_cost(self):
totalCost = self.item_quantity * self.item_price
print('%s %d @ $%d = $%d' % (self.item_name, self.item_quantity, self.item_price, totalCost))
#!python3
# coding: utf-8
import hashlib
import threading
from tkinter import *
from tkinter.ttk import *
from tkinter import messagebox
from tkinter.scrolledtext import ScrolledText
@0xpizza
0xpizza / crypt.py
Last active October 18, 2019 22:28
non-fancy symmetric key encryption
#!/usr/bin/env python3
# coding: ascii
import os
import sys
import gzip
import base64
import getpass
import threading
@0xpizza
0xpizza / pokedex.py
Last active September 5, 2019 22:41
National Pokedex according to Bulbapedia
import urllib
from dataclasses import dataclass
from tkinter import *
from tkinter.ttk import *
import requests