Skip to content

Instantly share code, notes, and snippets.

View momansoury's full-sized avatar
❄️
cool

Mohammad Mansoury momansoury

❄️
cool
View GitHub Profile
@pklaus
pklaus / ping.py
Created March 5, 2011 09:50
A pure python ping implementation using raw socket.
#!/usr/bin/env python2
"""
Other Repositories of python-ping
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* https://github.com/l4m3rx/python-ping supports Python2 and Python3
* https://bitbucket.org/delroth/python-ping
@sivachandran
sivachandran / SimpleTcpRedirector.py
Created March 4, 2012 01:42
A simple TCP redirector in python
#!/usr/bin/env python
import socket
import threading
import select
import sys
terminateAll = False
class ClientThread(threading.Thread):
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active December 11, 2025 14:31
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@nbari
nbari / chunk_upload.py
Last active October 7, 2024 16:10
python chunk upload files
#!/usr/bin/env python
import os
import requests
import uuid
from random import randint
from uuid import uuid4
def read_in_chunks(file_object, chunk_size=65536):
while True:
@albardol
albardol / proxy.py
Created July 25, 2014 18:56
Api proxy
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from werkzeug.wrappers import Request, Response
from werkzeug.wsgi import responder
from werkzeug.serving import run_simple
from werkzeug.routing import Map, Rule
from StringIO import StringIO
from httplib import HTTPResponse
import requests
@itsbalamurali
itsbalamurali / proxy.py
Created October 24, 2014 11:59
proxy
#! /usr/bin/env python
import os, socket, thread, select
__version__ = '0.1.0 Draft 1'
BUFLEN = 8192
VERSION = 'Python Proxy/'+__version__
HTTPVER = 'HTTP/1.1'
class ConnectionHandler:
@eXenon
eXenon / scapy_bridge.py
Last active May 12, 2024 03:00
Use scapy as a modifying proxy
#!/usr/bin/python2
"""
Use scapy to modify packets going through your machine.
Based on nfqueue to block packets in the kernel and pass them to scapy for validation
"""
import nfqueue
from scapy.all import *
import os
@eXenon
eXenon / ssl.py
Last active December 4, 2021 18:57
Quick SSL Packet Parser / Builder
# Constants - taken from dpkt/ssl.py
import struct
# SSLv3/TLS versions
SSL3_V = 0x0300
TLS1_V = 0x0301
TLS11_V = 0x0302
TLS12_V = 0x0303
@Preston-Landers
Preston-Landers / pyuac.py
Last active May 26, 2025 13:44
pyuac - elevate a Python process with UAC on Windows
#!/usr/bin/env python
# -*- coding: utf-8; mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vim: fileencoding=utf-8 tabstop=4 expandtab shiftwidth=4
"""
THIS CODE IS OUTDATED! Please use this instead:
https://pypi.org/project/pyuac/
https://github.com/Preston-Landers/pyuac
@gkbrk
gkbrk / slowloris.py
Last active December 20, 2024 00:02
Slowloris implementation in Python. https://github.com/gkbrk/slowloris
import socket
import random
import time
import sys
log_level = 2
def log(text, level=1):
if log_level >= level:
print(text)