tcpproxy | Intercepting TCP proxy to modify raw TCP streams | Proxy library

 by   ickerwx Python Version: Current License: MIT

kandi X-RAY | tcpproxy Summary

kandi X-RAY | tcpproxy Summary

tcpproxy is a Python library typically used in Networking, Proxy applications. tcpproxy has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has low support. You can download it from GitHub.

This tool opens a listening socket, receives data and then runs this data through a chain of proxy modules. After the modules are done, the resulting data is sent to the target server. The response is received and again run through a chain of modules before sending the final data back to the client. To intercept the data, you will either have to be the gateway or do some kind of man-in-the-middle attack. Set up iptables so that the PREROUTING chain will modify the destination and send it to the proxy process. The proxy will then send the data on to whatever target was specified. This tool is inspired by and partially based on the TCP proxy example used in Justin Seitz' book "Black Hat Python" by no starch press.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              tcpproxy has a low active ecosystem.
              It has 258 star(s) with 79 fork(s). There are 13 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 4 open issues and 15 have been closed. On average issues are closed in 41 days. There are 1 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of tcpproxy is current.

            kandi-Quality Quality

              tcpproxy has 0 bugs and 0 code smells.

            kandi-Security Security

              tcpproxy has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              tcpproxy code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              tcpproxy is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              tcpproxy releases are not available. You will need to build from source code and install.
              Build file is available. You can build the component from source.
              Installation instructions are not available. Examples and code snippets are available.
              tcpproxy saves you 354 person hours of effort in developing the same functionality from scratch.
              It has 847 lines of code, 59 functions and 15 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed tcpproxy and discovered the below as its top functions. This is intended to give you an instant insight into tcpproxy implemented functionality, and help decide if they suit your requirements.
            • Start a proxy thread
            • Log a message
            • Process data
            • Check if the client is a clientHello
            • Update source and destination hosts
            • Receive data from a socket
            • Returns True if local_socket is used to start TLS
            • Prints a message
            • Enable SSL
            • Evaluate response
            • Detect line break
            • Generates a list of module instances
            • Parse module options
            • Print module help text
            • Generate a list of modules from a string
            • Check if an ip is a valid IPv4 address
            • Parse command line arguments
            • List proxy modules
            • Print a message
            Get all kandi verified functions for this library.

            tcpproxy Key Features

            No Key Features are available at this moment for tcpproxy.

            tcpproxy Examples and Code Snippets

            No Code Snippets are available at this moment for tcpproxy.

            Community Discussions

            QUESTION

            Transform http.Response into array of bytes
            Asked 2021-Sep-05 at 08:20

            I am trying to develop a tcp proxy, in this tcp proxy I will have to manipulate both http and tcp requests.

            At the moment for the incoming request I detect if it is an http or tcp request, if it is an http then I parse it into an http.Request:

            ...

            ANSWER

            Answered 2021-Sep-05 at 08:20

            An http.Request object has a Write method:

            Source https://stackoverflow.com/questions/69055373

            QUESTION

            Why is My TCP Istio EnvoyFilter Not Working?
            Asked 2021-May-11 at 09:41

            I am trying to set TCP idleTimeout via an Envoy Filter, so that outbound connections external domain some.app.com will be terminated if they are idle for 5s:

            ...

            ANSWER

            Answered 2021-May-11 at 09:41

            This is a community wiki answer. Feel free to expand it.

            As already discussed in the comments, the EnvoyFilter was not yet supported in Istio version 1.2 and actually that version is no longer in support since Dec 2019.

            I strongly recommend upgrading to the latest Istio and Envoy versions. Also, after you upgrade please notice that the filter name you want to use was deprecated and replaced. You should now use envoy.filters.network.tcp_proxy instead of envoy.tcp_proxy.

            Please remember that things are getting deprecated for a reason and keeping the old versions will sooner or later bring you more trouble. Try to keep things more up-to-date.

            More details can be found in the latest docs.

            Source https://stackoverflow.com/questions/67295392

            QUESTION

            How to add external authorization for tcp_proxy filter?
            Asked 2021-Apr-21 at 14:41

            I have TCP proxied a service, using envoy. How can I add external authorization to it? following is my envoy.yaml:

            ...

            ANSWER

            Answered 2021-Apr-21 at 14:41

            You'll need to insert the envoy.filters.network.ext_authz filter into the filter chain before the envoy.filters.network.tcp_proxy and setup a cluster that will actually make the Authz decision.

            The envoy docs have a good example to follow.

            Source https://stackoverflow.com/questions/67191157

            QUESTION

            ISTIO Ingress Gateway logs
            Asked 2020-Aug-14 at 15:09

            We have set up Istio, and we are using ISTIO ingress gateway for inbound traffic. We have set up TLS for TCP port. Sample code can be found here.

            We also enabled logs by following this ISTIO guide

            We tested the TLS connection using openssl and it works fine.

            However, when we try to connect from an application, the TLS negotiation fails. I have provided more details with wireshark here

            We would like to get logs from ISTIO on the TLS negotiation ... and find why it fails.

            Istio Gateway YAML

            ...

            ANSWER

            Answered 2020-Aug-14 at 15:09

            After getting the message of no matching filter chain, I found the filter chain for the port 31020 with the domain that I have provided in my Gateway config. It looks like while connecting my application(ODBC), the host was not being provided.

            The solution is simply to replace the host domain by '*'

            Source https://stackoverflow.com/questions/63000327

            QUESTION

            Why is my Python proxy not accepting connections?
            Asked 2020-Aug-02 at 02:15

            I am trying to develop a TCP proxy library using Python 3. I have based my code on Python 2 example code, written by LiveOverflow. His original code is found in his video. My proxy library is intended to work like this: there is a proxy object containing a server-side object and a client-side object. The client-side object mimics a server, while the server-side object mimics a client. The two pass data to each other through the parent proxy object. To initiate the proxy, the script using the library instantiates the proxy with the port the client side is going to host on and the ip address and port the server side is going to connect to. Here is the code:

            TCP.py:

            ...

            ANSWER

            Answered 2020-Aug-02 at 02:15

            I have solved the issue. Browsers use a random port to send http/https requests. As I understand, this can be circumvented by adding a colon and the desired port number to the end of the url.

            Source https://stackoverflow.com/questions/62546884

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install tcpproxy

            You can download it from GitHub.
            You can use tcpproxy like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

            Support

            I want to thank the following people for spending their valuable time and energy on improving this little tool:.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/ickerwx/tcpproxy.git

          • CLI

            gh repo clone ickerwx/tcpproxy

          • sshUrl

            git@github.com:ickerwx/tcpproxy.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Proxy Libraries

            frp

            by fatedier

            shadowsocks-windows

            by shadowsocks

            v2ray-core

            by v2ray

            caddy

            by caddyserver

            XX-Net

            by XX-net

            Try Top Libraries by ickerwx

            pattern

            by ickerwxPython

            arpspoof

            by ickerwxPython

            portscanner

            by ickerwxPython

            etfplot

            by ickerwxPython