Skip to content

Instantly share code, notes, and snippets.

@pramos
pramos / tcpscan.go
Created January 14, 2023 13:55
Go Scripts to Scan TCP Ports
package main
import (
"flag"
"fmt"
"log"
"net"
"time"
)
@pramos
pramos / httpdumper.go
Last active February 7, 2023 17:23
Go Script to Parse Network or PCAPs and Extract Files from HTTP Streams
package main
import (
"bufio"
"bytes"
"compress/gzip"
"flag"
"fmt"
"io"
"io/ioutil"
@pramos
pramos / livecap.go
Created July 18, 2022 05:30
Go Script to capture Network Traffic with gopacket
package main
import (
"flag"
"fmt"
"log"
"time"
"github.com/google/gopacket"
"github.com/google/gopacket/pcap"
@pramos
pramos / devices.go
Last active July 17, 2022 20:38
Go Script to enumerate all available network interfaces on a machine. Relies on gopacket.
package main
import (
"fmt"
"log"
"github.com/google/gopacket/pcap"
)
func main() {
@pramos
pramos / pcap_file_extraction.py
Created March 13, 2022 13:47
Python Script to extract PE Files from PCAP Files using Scapy
import logging
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
import argparse
from pathlib import Path
from scapy.all import *
from scapy.all import TCP
format_str = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
def get_http_headers(http_payload):
@pramos
pramos / pcap_parsing_rdpcap.py
Last active August 2, 2021 19:50
Extracting URLs from pcap file with Scapy using rdpcap()
import sys
import re
from scapy.all import *
from memory_profiler import profile
@profile
def get_url_from_payload(payload):
http_header_regex = r"(?P<name>.*?): (?P<value>.*?)\r\n"
start = payload.index(b"GET ") +4
@pramos
pramos / pcap_parsing_pcapreader.py
Last active August 2, 2021 19:50
Extracting URLs from pcap file with Scapy using PcapReader()
import sys
import re
from scapy.all import *
from memory_profiler import profile
@profile
def get_url_from_payload(payload):
http_header_regex = r"(?P<name>.*?): (?P<value>.*?)\r\n"
start = payload.index(b"GET ") +4
@pramos
pramos / tmux.conf
Created August 19, 2018 20:18 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000