Coder Social home page Coder Social logo

rtcp's Introduction

rtcp.py

@desc:
利用python的socket端口转发,用于远程维护。
如果连接不到远程,会sleep 36s,最多尝试200(即两小时)。

@usage:
./rtcp.py stream1 stream2
stream为:l:port或c:host:port
l:port表示监听指定的本地端口
c:host:port表示监听远程指定的端口

使用场景:
一:
A服务器在内网,公网无法直接访问这台服务器,但是A服务器可以联网访问公网的B服务器(假设IP为222.2.2.2)。
我们也可以访问公网的B服务器。我们的目标是访问A服务器的22端口。那么可以这样:
1. 在B服务器上运行:
./rtcp.py l:10001 l:10002
表示在本地监听了10001与10002两个端口,这样,这两个端口就可以互相传输数据了。
2. 在A服务器上运行:
./rtcp.py c:localhost:22 c:222.2.2.2:10001
表示连接本地的22端口与B服务器的10001端口,这两个端口也可以互相传输数据了。
3. 然后我们就可以这样来访问A服务器的22端口了:
ssh 222.2.2.2 -p 10002
原理很简单,这个命令执行后,B服务器的10002端口接收到的任何数据都会传给10001端口,此时,A服务器是连接了B服务器的10001端口的,数据就会传给A服务器,最终进入A服务器的22端口。

二:
不用更多举例了,rtcp.py的l与c两个参数可以进行灵活的两两组合,多台服务器之间只要搞明白数据流方向,那么就能满足很多场景的需求。

@author: watercloud, zd, knownsec team
@web: www.knownsec.com, blog.knownsec.com

rtcp's People

Contributors

evilcos avatar

Watchers

James Cloos avatar thanat0s avatar

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.