This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This code is based on https://github.com/m4tx/pyTFTP project | |
import os | |
import errno | |
import logging | |
import socket | |
import argparse | |
from pathlib import Path, PurePosixPath | |
from threading import Thread | |
from typing import List, NewType, Tuple, Union, Dict |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# | |
# -*- coding: utf-8 -*- | |
# | |
# curl -o /dev/null http://SERVER_IP:SERVER_PORT | |
# time printf 'GET / HTTP/1.1\n\n' | netcat SERVER_IP SERVER_PORT > /dev/null | |
import os | |
import argparse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# | |
# -*- coding: utf-8 -*- | |
# | |
import socket | |
import argparse | |
from ipaddress import ip_address | |
def run_server(ip: ip_address, port: int) -> None: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# | |
# -*- coding: utf-8 -*- | |
import socket | |
from email.utils import formatdate | |
from ipaddress import ip_address | |
import argparse | |
import socketserver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tolgahan@rpi:~ $ uname -a | |
Linux rpi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux | |
tolgahan@rpi:~ $ openssl version | |
OpenSSL 1.1.1w 11 Sep 2023 | |
tolgahan@rpi:~ $ openssl speed -aead -evp aes-128-gcm | |
tolgahan@rpi:~ $ openssl speed -aead -evp aes-256-gcm | |
tolgahan@rpi:~ $ openssl speed -aead -evp chacha20-poly1305 | |
type 2 bytes 31 bytes 136 bytes 1024 bytes 8192 bytes 16384 bytes | |
aes-128-gcm 1679.44k 18536.78k 29135.42k 36059.82k 36956.84k 37120.68k | |
aes-256-gcm 1365.87k 15148.50k 22993.66k 28058.28k 28740.27k 28813.99k |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -ex | |
set -o pipefail | |
# THIS MUST BE USED WITH AN SSH-AGENT THAT SUPPORTS CONFIRMATION/NOTIFICATION UPON A SIGNATURE REQUEST. | |
# Mount the sock to the docker | |
# docker run --user $(id -u):$(id -g) --rm -it -v "$HOME/.ssh/sshsock:/sshsock" -e SSH_AUTH_SOCK=/sshsock/sock ubuntu bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
"""Extend Python's built in HTTP server to save files | |
curl or wget can be used to send files with options similar to the following | |
curl -X PUT --upload-file somefile.txt http://localhost:8000 | |
wget -O- --method=PUT --body-file=somefile.txt http://localhost:8000/somefile.txt | |
__Note__: curl automatically appends the filename onto the end of the URL so | |
the path can be omitted. | |
Windows upload & download | |
powershell -ep bypass -c "$wc=New-Object Net.WebClient;$wc.UploadFile('http://target.com/upload.bin', 'PUT', 'c:\\upload.bin');" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
wget -O /tmp/filegator_latest.zip https://raw.githubusercontent.com/filegator/static/master/builds/filegator_latest.zip | |
mkdir /tmp/filegator | |
unzip /tmp/filegator_latest.zip -d /tmp/filegator | |
cd /var/www/html/filegator | |
sudo find . ! -name . -prune ! -path ./private \ | |
! -path ./repository \ | |
! -path ./configuration.php \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# download hosts file | |
wget -O /opt/adblock/hostfiles/someonewhocares.hosts https://someonewhocares.org/hosts/zero/hosts | |
wget -O /opt/adblock/hostfiles/winhelp2002.hosts http://winhelp2002.mvps.org/hosts.txt | |
wget -O /opt/adblock/hostfiles/tgccloud.hosts https://tgc.cloud/downloads/hosts.txt | |
wget -O /opt/adblock/hostfiles/stevensblack.hosts https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts | |
wget -O /opt/adblock/hostfiles/hblock.hosts https://hblock.molinero.dev/hosts | |
wget -O /opt/adblock/hostfiles/spotify_x0uid_spotifyablock.hosts https://raw.githubusercontent.com/x0uid/SpotifyAdBlock/master/hosts | |
wget -O /opt/adblock/hostfiles/spotify_saminnet_spotify_adblock_script.hosts https://raw.githubusercontent.com/saminnet/spotify-adblock-script/master/block.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Linux rock64 4.4.167-1213-rockchip-ayufan-g34ae07687fce #1 SMP Tue Jun 18 20:44:49 UTC 2019 aarch64 aarch64 aarch64 GNU/Linux | |
rock64@rock64:~$openssl speed -aead -evp aes-128-gcm | |
rock64@rock64:~$openssl speed -aead -evp aes-256-gcm | |
rock64@rock64:~$openssl speed -aead -evp chacha20-poly1305 | |
type 2 bytes 31 bytes 136 bytes 1024 bytes 8192 bytes 16384 bytes | |
---- ------- -------- --------- ---------- ---------- ----------- | |
aes-128-gcm 2326.81k 29137.11k 108788.53k 360005.63k 482115.58k 492399.27k | |
aes-256-gcm 2256.78k 28163.19k 102470.97k 320374.44k 420995.35k 423843.16k | |
chacha20-poly1305 807.76k 11608.37k 32482.65k 129967.34k 167075.84k 169951.23k |
NewerOlder