Skip to content

Instantly share code, notes, and snippets.

View panamantis's full-sized avatar

Jon panamantis

View GitHub Profile
@panamantis
panamantis / netcat
Created June 15, 2018 16:16 — forked from qbein/netcat
Replay pcap/pcapng TCP traffic using netcat
For development it may be useful to be able to replay TCP traffic (e.g. HTTP). The dump can be created using WireShark or tcpdump:
$ tcpdump -s 0 port http -i en0 -w dump.pcap
To generate data files that can be replayed through netcat we use tcptrace:
$ tcptrace -e input.pcapng
Finally replay the HTTP traffic using netcat to host 192.168.1.1 port 80
$ cat a2b_contents.dat | nc -v 192.168.1.1 80
If you need to replay the raw network traffic, we need to do some massaging using tcpprep and tcprewrite before using tcpreplay to replay the raw packages. Note that due to limitation of tcprewrite this will not replay any traffic to the network: http://tcpreplay.synfin.net/wiki/FAQ#Doestcpreplaysupportsendingtraffictoaserver.
@panamantis
panamantis / test.py
Created September 1, 2017 16:11 — forked from chintal/test.py
#!/usr/bin/env python
# encoding: utf-8
import os
import inspect
import time
import copy
from twisted.internet.protocol import Factory
@panamantis
panamantis / README.md
Created February 16, 2016 16:12
gooey
@panamantis
panamantis / pdfxtract.py
Created February 7, 2016 01:02 — forked from jmcarp/pdfxtract.py
Extract text from PDF document using PDFMiner
"""
Extract PDF text using PDFMiner. Adapted from
http://stackoverflow.com/questions/5725278/python-help-using-pdfminer-as-a-library
"""
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter#process_pdf
from pdfminer.pdfpage import PDFPage
from pdfminer.converter import TextConverter
from pdfminer.layout import LAParams
@panamantis
panamantis / _.md
Created June 10, 2013 16:44
clip scale bug
@panamantis
panamantis / _.md
Created June 5, 2013 23:43
Tributary inlet
@panamantis
panamantis / _.md
Created June 5, 2013 23:43
Tributary inlet
@panamantis
panamantis / _.md
Created May 2, 2013 12:03
Tributary inlet
@panamantis
panamantis / _.md
Created May 2, 2013 11:39
circle line
@panamantis
panamantis / _.md
Created April 18, 2013 21:22
b1 with ticks