This commit is contained in:
2025-12-31 16:00:29 +00:00
commit 3688f93d5d
310 changed files with 93400 additions and 0 deletions

393
2021/05/07/ssh.html Normal file
View File

@@ -0,0 +1,393 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- Begin Jekyll SEO tag v2.8.0 -->
<title>网络任意互联指南 | Mayx的博客</title>
<meta name="generator" content="Jekyll v3.9.5" />
<meta property="og:title" content="网络任意互联指南" />
<meta name="author" content="mayx" />
<meta property="og:locale" content="zh_CN" />
<meta name="description" content="SSH真的是太厉害了" />
<meta property="og:description" content="SSH真的是太厉害了" />
<meta property="og:site_name" content="Mayx的博客" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2021-05-07T00:00:00+08:00" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="网络任意互联指南" />
<meta name="google-site-verification" content="huTYdEesm8NaFymixMNqflyCp6Jfvd615j5Wq1i2PHc" />
<meta name="msvalidate.01" content="0ADFCE64B3557DC4DC5F2DC224C5FDDD" />
<meta name="yandex-verification" content="fc0e535abed800be" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"BlogPosting","author":{"@type":"Person","name":"mayx"},"dateModified":"2021-05-07T00:00:00+08:00","datePublished":"2021-05-07T00:00:00+08:00","description":"SSH真的是太厉害了","headline":"网络任意互联指南","mainEntityOfPage":{"@type":"WebPage","@id":"/2021/05/07/ssh.html"},"publisher":{"@type":"Organization","logo":{"@type":"ImageObject","url":"https://avatars0.githubusercontent.com/u/17966333"},"name":"mayx"},"url":"/2021/05/07/ssh.html"}</script>
<!-- End Jekyll SEO tag -->
<link rel="canonical" href="https://mabbs.github.io/2021/05/07/ssh.html" />
<link type="application/atom+xml" rel="alternate" href="/atom.xml" title="Mayx的博客" />
<link rel="alternate" type="application/rss+xml" title="Mayx的博客(RSS)" href="/rss.xml" />
<link rel="alternate" type="application/json" title="Mayx的博客(JSON Feed)" href="/feed.json" />
<link rel="stylesheet" href="/assets/css/style.css?v=1767196818" />
<!--[if !IE]> -->
<link rel="stylesheet" href="/Live2dHistoire/live2d/css/live2d.css" />
<!-- <![endif]-->
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="Mayx的博客" />
<link rel="webmention" href="https://webmention.io/mabbs.github.io/webmention" />
<link rel="pingback" href="https://webmention.io/mabbs.github.io/xmlrpc" />
<link rel="preconnect" href="https://summary.mayx.eu.org" crossorigin="anonymous" />
<link rel="prefetch" href="https://www.blogsclub.org/badge/mabbs.github.io" as="image" />
<link rel="blogroll" type="text/xml" href="/blogroll.opml" />
<link rel="me" href="https://github.com/Mabbs" />
<script src="/assets/js/jquery.min.js"></script>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-ajaxtransport-xdomainrequest/1.0.3/jquery.xdomainrequest.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script>
var lastUpdated = new Date("Thu, 01 Jan 2026 00:00:18 +0800");
var BlogAPI = "https://summary.mayx.eu.org";
</script>
<script src="/assets/js/main.js"></script>
<!--[if !IE]> -->
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=UA-137710294-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-137710294-1');
</script>
<script src="/assets/js/instant.page.js" type="module"></script>
<!-- <![endif]-->
</head>
<body>
<!--[if !IE]> --><noscript><marquee style="top: -15px; position: relative;"><small>发现当前浏览器没有启用JavaScript这不影响你的浏览但可能会有一些功能无法使用……</small></marquee></noscript><!-- <![endif]-->
<!--[if IE]><marquee style="top: -15px; position: relative;"><small>发现当前浏览器为Internet Explorer这不影响你的浏览但可能会有一些功能无法使用……</small></marquee><![endif]-->
<div class="wrapper">
<header class="h-card">
<h1><a class="u-url u-uid p-name" rel="me" href="/">Mayx的博客</a></h1>
<img src="https://avatars0.githubusercontent.com/u/17966333" fetchpriority="high" class="u-photo" alt="Logo" style="width: 90%; max-width: 300px; max-height: 300px;" />
<p class="p-note">Mayx's Home Page</p>
<form action="/search.html">
<input type="text" name="keyword" id="search-input-all" placeholder="Search blog posts.." />&#160;<input type="submit" value="搜索" />
</form>
<br />
<p class="view"><a class="u-url" href="/Mabbs/">About me</a></p>
<ul class="downloads">
<li style="width: 270px; border-right: none;"><a href="/MayxBlog.tgz">Download <strong>TGZ File</strong></a></li>
</ul>
</header>
<section class="h-entry">
<small><time class="date dt-published" datetime="2021-05-07T00:00:00+08:00">7 May 2021</time> - 字数统计3400 - 阅读大约需要10分钟 - Hits: <span id="/2021/05/07/ssh.html" class="visitors">Loading...</span></small>
<h1 class="p-name">网络任意互联指南</h1>
<p class="view">by <a class="p-author h-card" href="//github.com/Mabbs">mayx</a></p>
<div id="outdate" style="display:none;">
<hr /><p>
这是一篇创建于 <span id="outime"></span> 天前的文章,其中的信息可能已经有所发展或是发生改变。
</p>
</div>
<script>
daysold = Math.floor((new Date().getTime() - new Date("Fri, 07 May 2021 00:00:00 +0800").getTime()) / (24 * 60 * 60 * 1000));
if (daysold > 90) {
document.getElementById("outdate").style.display = "block";
document.getElementById("outime").innerHTML = daysold;
}
</script>
<hr />
<b>AI摘要</b>
<p id="ai-output">这篇文章介绍了SSH的多种功能如内网穿透、端口映射、代理隧道等它能让用户在面临防火墙限制时实现网络任意互联。作者惊叹于SSH的全能性但同时也指出其速度较慢的局限。文章建议对于内网穿透使用frp等更易用的替代工具对于代理隧道Shadowsocks或V2ray等高效、反检测性强的服务是更好的选择。作者最后感慨SSH的强大对网络互联的深入理解也由此提高。</p>
<hr />
<ul><li><a href="#起因">起因</a></li><li><a href="#万能的ssh">万能的SSH</a><ul><li><a href="#内网穿透">内网穿透</a></li><li><a href="#端口映射">端口映射</a></li><li><a href="#代理隧道">代理隧道</a></li></ul></li><li><a href="#ssh部分功能的上位替代">SSH部分功能的上位替代</a><ul><li><a href="#内网穿透-1">内网穿透</a></li><li><a href="#代理隧道-1">代理隧道</a></li></ul></li><li><a href="#任意互联示例">任意互联示例</a></li><li><a href="#总结">总结</a></li></ul>
<hr />
<main class="post-content e-content" role="main"><p>SSH真的是太厉害了<!--more--></p>
<h1 id="起因">
<a href="#起因"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 起因
</h1>
<p>最近一段时间我对网络的各种连法很感兴趣比如说内网穿透端口映射或者说打隧道之类的。一般来说做这些事情应该都要装一些软件才行不过最近我发现居然平时很常用的SSH竟然包含所有我想要的这些功能真的是让我感觉很神奇。所以也许我已经火星了但是今天我还是想记录一下。</p>
<h1 id="万能的ssh">
<a href="#万能的ssh"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 万能的SSH
</h1>
<p>如果你以为SSH就只是加密了的Telnet那可真是大错特错我感觉SSH想做的事情要更厉害它可能是想做一个加密的TCP上面可以跑各种应用而且防火墙还不知道里面跑的内容是什么。 </p><p>
不过最终它也没能取代TCP毕竟它本来就是基于TCP的而且其他很多功能用的人也很少这让我感觉很可惜……不过确实SSH啥都能干就是速度慢了亿点点…… </p><p>
所以我今天就来说一说它的功能和一些上位替代。</p>
<h2 id="内网穿透">
<a href="#内网穿透"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 内网穿透
</h2>
<p>假如我有一台电脑在家,然后我还租了一个垃圾云服务器,服务器的性能很差但是家里的电脑性能很好。假如有一天我想在外面去玩我的电脑要怎么办呢? </p><p>
一般来说家里的电脑都是在内网之中,而服务器都是在公网,任何一个地方都能访问,现在我如果想访问家里的电脑直接连难度很大,几乎是做不到的对吧,于是这时候我们可以让家里的电脑去连服务器,这样我们就有一条链路连接到家里的电脑了,然后我们再用别的设备去连服务器,这样我们就能间接访问我们的电脑了。 </p><p>
具体要怎么做呢很简单用SSH就能解决这个问题首先一般服务器上都装的是Linux系统一般都是自带OpenSSH的而且还是SSH服务端现在的Windows 10也是默认自带OpenSSH的只不过是客户端。所以首先我们要做的就是用家里的电脑去连服务器。这时候的连接不能直接SSH连过去普通的连没有任何作用只是登录到远程服务器上了而已我们必须要加上一些参数就像这样</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ssh <span class="nt">-R</span> 3389:127.0.0.1:3389 root@remote-ip
</code></pre></div></div>
<p>执行这条指令之后系统仍然会正常的去连接到远程服务器上,但是你如果执行一下<code class="language-plaintext highlighter-rouge">netstat -nlp</code>的话就可以发现SSH在本地也监听了一个3389的端口。不过默认的配置下SSH只会在服务器上映射这个端口在服务器外是连不上的另外如果说我只想穿透而不想打开服务器终端要该怎么办呢 </p><p>
首先默认不登录终端这个方法很简单,加点参数就可以,就像这样:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ssh <span class="nt">-CfNR</span> 3389:127.0.0.1:3389 root@remote-ip
</code></pre></div></div>
<p>这样启动穿透之后就不会在家里的电脑上一直开着服务器终端了,只会有一个黑框而已,当然因为用了<code class="language-plaintext highlighter-rouge">-f</code>参数你即使把黑框关了也不会影响。另外还有就是映射到服务器外这个问题其实这个问题也很好解决在sshd配置文件里把<code class="language-plaintext highlighter-rouge">GatewayPorts no</code>改成<code class="language-plaintext highlighter-rouge">GatewayPorts yes</code>,设置好了之后别忘了在服务器的防火墙和服务器托管商的防火墙那里放行端口。</p>
<h2 id="端口映射">
<a href="#端口映射"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 端口映射
</h2>
<p>假如上面的穿透你设置好了但是你说你不知道sshd配置文件在哪里防火墙关不掉服务器不是你的好家伙那内网穿透还搞什么没关系SSH比你想象的要厉害假如你没办法开服务器的端口那你可以把服务器上面的端口映射到本机上。 </p><p>
那么现在内网穿透已经搞好了,但是由于各种各样的原因你访问不到服务器的端口,这时候你在外面,可以在外面用电脑执行以下命令:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ssh <span class="nt">-CfNL</span> 3390:127.0.0.1:3389 root@remote-ip
</code></pre></div></div>
<p>这样一波操作你家里的那台电脑上的3389端口就被映射到了你现在用的电脑上的3390端口了当然效率很低这个没办法毕竟SSH这些功能没有完全流行起来也是因为它的效率确实低而且还容易断也没个自带的断线重连……</p>
<h2 id="代理隧道">
<a href="#代理隧道"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 代理隧道
</h2>
<p>虽然说我现在很想吐槽一下SSH并且想要赶紧说说它的一些上位替代不过我还是先把所有的SSH厉害的功能讲完吧。 </p><p>
SSH更厉害的功能就是随手开代理又叫做动态端口映射一般来说如果想要在服务器上配置一个代理很麻烦而且也很费时间但是如果用SSH隧道开一个代理就只用一条命令而且还不需要在服务器上做任何配置真的是非常的方便。
具体是什么命令呢?很简单,就是这样:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ssh <span class="nt">-CfND</span> 127.0.0.1:1080 root@remote-ip
</code></pre></div></div>
<p>执行这条命令之后就会在本机开一个监听地址为<code class="language-plaintext highlighter-rouge">127.0.0.1:1080</code>的socks5代理你可以使用Proxifier之类的socks5客户端去连接它然后就能直接通过这个代理用服务器上网了。假如你还想把这个代理共享给其他同在局域网的人用可以把<code class="language-plaintext highlighter-rouge">127.0.0.1</code>改成<code class="language-plaintext highlighter-rouge">0.0.0.0</code>并且加一个<code class="language-plaintext highlighter-rouge">-g</code>的参数,这样同网络的人也就可以通过你的电脑连接到隧道上了。 </p><p>
当然这个相比于上面那个端口映射要厉害一些不过如果没有socks5客户端就只能用上面那个了。 </p><p>
另外如果有国外的服务器也可以使用这种方式穿过防火长城而且因为它是走的SSH隧道基本上很难通过流量分析看出来你在做什么可惜就是效率太低很慢所以即使它抗封锁能力不错但是用的人不是很多…… </p><p>
所以呢SSH作为系统自带的软件功能已经是非常强大了有这些功能基本上可以在一定程度上无视防火墙随便穿轻松透而且再加上scp、sftp等功能连接不同的电脑真的是从未如此轻松。 </p><p>
很可惜这么好的软件效率太低了我试了一下用把同网络下的树莓派做成代理速度基本上只能达到10Mbps左右可能看1080p的直播没有问题再高一些的蓝光视频还是不太行会时不时的卡另外就更不用说连接国外的服务器了看网页确确实实没有问题视频的话也只是勉强能看体验还是不够好。虽然它作为默认安装的软件很不错但是我们还是要考虑体验的嘛所以我就来说说它的一些上位替代品吧。</p>
<h1 id="ssh部分功能的上位替代">
<a href="#ssh部分功能的上位替代"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> SSH部分功能的上位替代
</h1>
<h2 id="内网穿透-1">
<a href="#内网穿透-1"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 内网穿透
</h2>
<p>假如想要自己做一个内网穿透,目前以我自己的感受来说,感觉还是<a href="https://github.com/fatedier/frp">frp</a>最好用应该说不愧是Golang写的程序配置简单即开即用。下载一个frps的程序放在公网的服务器上基本上用默认的配置就可以直接使用不过为了安全还是建议稍微改一改默认情况下是没有验证和加密的。内网机器的话就用frpc连接就可以了具体怎么搭建官方文档已经说的很清楚了这里就不再多描述。另外如果没有公网服务器也可以试试SakuraFrp不过他们家貌似看起来快凉了国内节点要花1CNY实名认证国外节点目前凉的差不多了而且貌似经常受到攻击现在想充钱也充不了还是挺糟糕的。 </p><p>
不过他们倒是挺良心的给了个<a href="https://www.natfrp.com/peer_vendors.php">友商列表</a>,如果自己没服务器的话用这些服务商也是个不错的选择。</p>
<h2 id="代理隧道-1">
<a href="#代理隧道-1"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 代理隧道
</h2>
<p>要是整正儿八经的隧道还是得用Shadowsocks或者是V2ray之类的一是反检测还是很厉害的二是效率高这些隧道软件速度是真的没话说确实相比SSH隧道而言要快很多。如果要搭Shadowsocks-libev可以看看<a href="https://gfw.report/blog/ss_tutorial/zh/">这篇文章</a>V2ray的话GitHub上有很多那种一键脚本直接用的话也没问题包括也有更稳当的Cloudflare+ws+tls模式非常的不错。 </p><p>
还有就是个人经验吧,如果真想好好上,最好不要自己租云服务器,因为大多数人没经验,不知道哪个线路好,搭出来性价比没有机场高,速度也没机场快,节点少,而且被封的成本更高,所以真要用还是去租机场比较合适。 </p><p>
因为我实际上对搞这些隧道并没有什么特别厉害的经验 <del>(不然我为啥不去开机场😂?)</del> ,所以这里就不再过多描述了。</p>
<h1 id="任意互联示例">
<a href="#任意互联示例"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 任意互联示例
</h1>
<p>既然目前已经有办法任意访问或者映射端口那么内网对于我们来说就不会有太多阻碍了不过如果完全没有公网IP我确实真想不出来怎么搞就是nat穿透还要一个接线的服务器。这些东西假如以后打CTF还是蛮有用的有时候CTF会特地出几个内网隔离的机器要用跳板除了用NCSSH也算是个不错的选择了。有防火墙直接把靶服务映射到自己机器上打打起来和没防火墙一个手感。再不行直接代理接过去装作目标主机扫描的时候也会方便很多。反弹shell连不到自己主机把自己映射到跳板机上吧各种连接轻松搞定。 </p><p>
就是不打CTF就说在外面突然想下论文学校能上知网挂个树莓派在学校frp连到公网服务器SSH隧道开代理然后就能随便下论文了。</p>
<h1 id="总结">
<a href="#总结"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 总结
</h1>
<p>我现在又感觉互联的网络回来了看来就是有内网、防火墙也阻挡不了两台逻辑上能连接的主机。SSH真的是很厉害啊……虽然我才知道这一点不过这也就是学习的过程嘛了解了这个也许对网络有了更深入的认识吧……</p></main>
<small style="display: block">tags: <a rel="category tag" class="p-category" href="/search.html?keyword=%E7%BD%91%E7%BB%9C"><em>网络</em></a> - <a rel="category tag" class="p-category" href="/search.html?keyword=SSH"><em>SSH</em></a> - <a rel="category tag" class="p-category" href="/search.html?keyword=%E6%8C%87%E5%8D%97"><em>指南</em></a> <span style="float: right;"><a href="https://gitlab.com/mayx/mayx.gitlab.io/tree/master/_posts/2021-05-07-ssh.md">查看原始文件</a></span></small>
<h4 style="border-bottom: 1px solid #e5e5e5;margin: 2em 0 5px;">推荐文章</h4>
<p id="suggest-container">Loading...</p>
<script>
var suggest = $("#suggest-container");
$.get(BlogAPI + "/suggest?id=/2021/05/07/ssh.html&update=" + lastUpdated.valueOf(), function (data) {
if (data.length) {
getSearchJSON(function (search) {
suggest.empty();
var searchMap = {};
for (var i = 0; i < search.length; i++) {
searchMap[search[i].url] = search[i];
}
var tooltip = $('<div class="content-tooltip"></div>').appendTo('body').hide();
for (var j = 0; j < data.length; j++) {
var item = searchMap[data[j].id];
if (item) {
var link = $('<a href="' + item.url + '">' + item.title + '</a>');
var contentPreview = item.content.substring(0, 100);
if (item.content.length > 100) {
contentPreview += "……";
}
link.hover(
function(e) {
tooltip.text($(this).data('content'))
.css({
top: e.pageY + 10,
left: e.pageX + 10
})
.show();
},
function() {
tooltip.hide();
}
).mousemove(function(e) {
tooltip.css({
top: e.pageY + 10,
left: e.pageX + 10
});
}).data('content', contentPreview);
suggest.append(link);
suggest.append(' - ' + item.date + '<br />');
}
}
});
} else {
suggest.html("暂无推荐文章……");
}
});
</script>
<br />
<div class="pagination">
<span class="prev">
<a href="/2021/04/18/hide.html">
上一篇Mayx的运维笔记 - 隐藏自己
</a>
</span>
<br />
<span class="next">
<a href="/2021/05/15/vulnerability.html">
下一篇:论如何发现一个计算机漏洞
</a>
</span>
</div>
<!--[if !IE]> -->
<link rel="stylesheet" href="/assets/css/gitalk.css">
<script src="/assets/js/gitalk.min.js"></script>
<div id="gitalk-container"></div>
<script>
var gitalk = new Gitalk({
clientID: '36557aec4c3cb04f7ac6',
clientSecret: 'ac32993299751cb5a9ba81cf2b171cca65879cdb',
repo: 'mabbs.github.io',
owner: 'Mabbs',
admin: ['Mabbs'],
id: '/2021/05/07/ssh', // Ensure uniqueness and length less than 50
distractionFreeMode: false, // Facebook-like distraction free mode
proxy: "https://cors-anywhere.mayx.eu.org/?https://github.com/login/oauth/access_token"
})
gitalk.render('gitalk-container')
</script>
<!-- <![endif]-->
</section>
<!--[if !IE]> -->
<div id="landlord" style="left:5px;bottom:0px;">
<div class="message" style="opacity:0"></div>
<canvas id="live2d" width="500" height="560" class="live2d"></canvas>
<div class="live_talk_input_body">
<form id="live_talk_input_form">
<div class="live_talk_input_name_body" >
<input type="checkbox" id="load_this" />
<input type="hidden" id="post_id" value="/2021/05/07/ssh.html" />
<label for="load_this">
<span style="font-size: 11px; color: #fff;">&#160;想问这篇文章</span>
</label>
</div>
<div class="live_talk_input_text_body">
<input name="talk" type="text" class="live_talk_talk white_input" id="AIuserText" autocomplete="off" placeholder="要和我聊什么呀?" />
<button type="submit" class="live_talk_send_btn" id="talk_send">发送</button>
</div>
</form>
</div>
<input name="live_talk" id="live_talk" value="1" type="hidden" />
<div class="live_ico_box" style="display:none;">
<div class="live_ico_item type_info" id="showInfoBtn"></div>
<div class="live_ico_item type_talk" id="showTalkBtn"></div>
<div class="live_ico_item type_music" id="musicButton"></div>
<div class="live_ico_item type_youdu" id="youduButton"></div>
<div class="live_ico_item type_quit" id="hideButton"></div>
<input name="live_statu_val" id="live_statu_val" value="0" type="hidden" />
<audio src="" style="display:none;" id="live2d_bgm" data-bgm="0" preload="none"></audio>
<input id="duType" value="douqilai" type="hidden" />
</div>
</div>
<div id="open_live2d">召唤伊斯特瓦尔</div>
<!-- <![endif]-->
<footer>
<p>
<small>Made with ❤ by Mayx<br />Last updated at 2026-01-01 00:00:18<br /> 总字数614622 - 文章数178 - <a href="/atom.xml" >Atom</a> - <a href="/README.html" >About</a></small>
</p>
</footer>
</div>
<script src="/assets/js/scale.fix.js"></script>
<!--[if !IE]> -->
<script src="/assets/js/main_new.js"></script>
<script src="/Live2dHistoire/live2d/js/live2d.js"></script>
<script src="/Live2dHistoire/live2d/js/message.js"></script>
<!-- <![endif]-->
</body>
</html>