Git Product home page Git Product logo

rtcp's Introduction

rtcp.py

简介

  • 利用 Python 的 Socket 端口转发,用于远程维护
  • 如果连接不到远程,会 sleep 36s,最多尝试 200 次(即两小时)

用法

  • ./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 端口。那么可以这样:

  • 在 B 服务器上运行:./rtcp.py l:10001 l:10002

    • 表示在本地监听了 10001 与 10002 两个端口,这样,这两个端口就可以互相传输数据了
  • 在 A 服务器上运行:./rtcp.py c:localhost:22 c:222.2.2.2:10001

    • 表示连接本地的 22 端口与 B 服务器的 10001 端口,这两个端口也可以互相传输数据了
  • 然后我们就可以这样来访问 A 服务器的 22 端口了:ssh -p 10002 222.2.2.2

    • 原理很简单,这个命令执行后,B 服务器的 10002 端口接收到的任何数据都会传给 10001 端口
    • 此时,A 服务器是连接了 B 服务器的 10001 端口的,数据就会传给 A 服务器,最终进入 A 服务器的 22 端口

贡献者

  • watercloud
  • zd
  • kun
  • Knownsec R&D Team

rtcp's People

Contributors

akun avatar evilcos avatar

Watchers

 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.