Giter VIP home page Giter VIP logo

tcpprox's Introduction

TcpProx

A small command-line TCP proxy utility written in Python

Tim Newsham 29 Oct 2012

Overview

This is a small command-line TCP proxy utility written in python. It is designed to have very minimal requirements - it runs directly from python (tested in python 2.7) from a single source file (unless the auto-certificate option is used). When running, the proxy accepts incoming TCP connections and copies data to a TCP connection to another machine. Options allow for SSL and IPv6 connections and for the logging of all data. Data is logged in a format that preserves connection, timing and direction information and a small utility is provided to dump out the information in various formats. A small utility is also provided for generating CA and SSL certificates. This utility is the only component that relies on an external python library, but it can be run on a different machine if necessary.

QUICKSTART

  • A normal TCP proxy is straightforward:

  • For SSL, first create and install a CA cert

    • $ ./ca.py -c
    • $ ./pkcs12.sh ca # if you need a pkcs12 certificate
    • take ca.pem or ca.pfx and install it as a root certificate in your testing browser
  • Run the proxy using an auto-generated certificate:

  • Or manually generate a certificate (possibly on another machine) and then run the proxy using that certificate:

  • To view data logged to a file by prox.py, use proxcat:

    • $ ./proxcat.py -x log.txt

DEPENDENCIES

TcpProx requires a python interpreter and the M2Crypto package from http://www.heikkitoivonen.net/m2crypto/. The prox.py program can be run with only the prox.py file and without the M2Crypto package installed if the -A option is not used.

tcpprox's People

Contributors

gpikemz avatar jnovak-praetorian avatar newsham avatar timnewsham avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tcpprox's Issues

Use Python 3

Hi,
When trying to use the script with python 3 it shouts

    print "error:", fmt % args
                 ^
SyntaxError: Missing parentheses in call to 'print'

Add support for startTLS handshakes

It would be nice to be able to use tcpprox to mitm protocols doing startTLS handshakes (mainly for xmpp but also imap, pop3, ldap, rdp, etc...) because there are no good tools to do this.

The small script that I have for this basically forwards data in plaintext until it detects the beginning of an SSL handshake (by looking at the first bytes of the packet). Once it has detected the SSL client hello, it completes the handshake with the client and starts the SSL handshake with the server (using ssl.wrap_socket() ). After finishing both handshakes, it just keeps on forwarding data in the SSL channels (just like tcpprox).

Let me know if you want that script... thanks!

Generates 1024 bit certs

The default changed to 2048 in be3ef0a and then back in the next commit - although for some really strange reason it doesn't show in the github diff?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.