Skip to content

Instantly share code, notes, and snippets.

View xer0xe9's full-sized avatar

xer0xE9 xer0xe9

View GitHub Profile
@xer0xe9
xer0xe9 / resolver.py
Created August 1, 2018 10:39 — forked from DamnedFacts/resolver.py
Forward and Reverse DNS lookups with Python
import sys
"""
Resolve the DNS/IP address of a given domain
data returned is in the format:
(name, aliaslist, addresslist)
@filename resolveDNS.py
@version 1.01 (python ver 2.7.3)
@author LoanWolffe
"""
@xer0xe9
xer0xe9 / http_over_tcp_consumer_producer.py
Created July 25, 2018 09:19
Writing a basic wget-like utility with scapy (HTTP over TCP)
#!/usr/bin/env python
#> iptables -A OUTPUT -p tcp --tcp-flags RST RST -s <src-ip> -j DROP
from scapy.all import *
import logging, time
from threading import Thread, current_thread, Event
from scapy_http import http
import Queue
logger = logging.getLogger(__name__)
@xer0xe9
xer0xe9 / scapy_tcp_handshake.py
Created March 30, 2018 04:49 — forked from tintinweb/scapy_tcp_handshake.py
simple scapy tcp three-way handshake
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Author : [email protected] <github.com/tintinweb>
'''
A simple TCP three-way handshake example
#> python scapy_tcp_handshake.py
DEBUG:__main__:init: ('oststrom.com', 80)
DEBUG:__main__:start
DEBUG:__main__:SND: SYN
@xer0xe9
xer0xe9 / bash-colors.md
Created November 9, 2017 05:57 — forked from iamnewton/bash-colors.md
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple
@xer0xe9
xer0xe9 / sed cheatsheet
Created November 9, 2017 05:39 — forked from ssstonebraker/sed cheatsheet
Sed Cheatsheet
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
@xer0xe9
xer0xe9 / colors.py
Created October 20, 2017 09:16 — forked from dnmellen/colors.py
Auxiliary Python module to get styled terminal outputs in a pythonic way
# encoding: utf-8
# Copyright 2013 Diego Navarro Mellén. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are
# permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of
# conditions and the following disclaimer.
#
# Outbound UDP Flood protection in a user defined chain.
iptables -N udp-flood
iptables -A OUTPUT -p udp -j udp-flood
iptables -A udp-flood -p udp -m limit --limit 50/s -j RETURN
iptables -A udp-flood -j LOG --log-level 4 --log-prefix 'UDP-flood attempt: '
iptables -A udp-flood -j DROP