ssh 怎么通过跳板机传文件到内网_黑客攻击内网穿透

声明:严禁用作非法目的,谢绝一切形式的转载。

如何实现远程打卡?远程打卡的问题在于你和公司处在不同的局域网之中,要实现远程打卡,虽然有些软件可以使用(比如向日葵、teamviwer等),但是实现功能也仅仅限于远程桌面控制(在免费的情况下,网速只能呵呵了)。如果想做其他的一些事情就无能为力了,比如访问内网的web服务、提升权限等等。

网络概况

425f7fc1942a51a66e9ff394ea815860.png

本文不讲解怎么进行远程打卡。反过来讲解怎样在公司中访问在家庭里面的电脑,反之是同样的道理。(怕被和谐)

在上面的图中,第二个箭头画反了。直接通过公司局域网访问家庭局域网肯定是不行的。考虑借助公网来进行内网穿透,本文使用的工具是frpc。本文使用的公网ip是47.92.90.25,笔者自己租用的阿里云服务器,域名是www.hacksprit.top。

至于阿里云如何配置,域名如何进行绑定可以私信我。

frp

frp is a fast reverse proxy to help you expose a local server behind a NAT or firewall to the Internet. As of now, it supports TCP and UDP, as well as HTTP and HTTPS protocols, where requests can be forwarded to internal services by domain name. frp also has a P2P connect mode.

架构

27f693a73d9668ca30879fe64e2a26c3.png

基本使用
安装及配置文件
  1. Firstly, download the latest programs from Release page according to

    your operating system and architecture.

  2. Put frps and frps.ini onto your server A with public IP.(公网ip)

  3. Put frpc and frpc.ini onto your server B in LAN (that can't be connected

    from public Internet).(局域网ip)

准备条件

家庭局域网开启ssh服务,开启一个PHP的web服务。其他服务根据需要自行安装,本文仅仅测试ssh服务和web服务。

(1) ssh服务 安装ssh服务

sudo apt-get install openssh-server

启动ssh服务

sudo /etc/init.d/ssh start

查看ssh服务是否启动成功

ssh -o port=22 burning@127.0.0.1

如果成功启动可看到如下所示的页面:f239b5b76f8033ade30832f538fa3957.png(2) Web服务 通过如下的命令就可以开启一个web服务。

wget -O install.sh https://download.xp.cn/install.sh && sudo bash install.sh

d0793eb1e8c51d092d42b2284d9fe901.pngNginx的反向代理在后续文章中会介绍。简单来说就是Nginx代理内网服务器对外提供服务。而正向代理代理的是客户端的请求。

公司局域网ip地址

3fc4a3539737a12daeed9510c0967b39.png

frp的配置和使用

(1) 公网47.92.90.25做为frp的服务器。编辑frps.ini。22a01d44dceee8c8ca9815ec60a603e9.png运行frps,开启服务端。设置http端口是7002。阿里云需要开启相应的端口,通过安全规则进行配置。

./frps -c frps.ini

765f02901ec966fd7388c2360c4fcf38.png(2) 家庭局域网192.168.42.36做为frp的客户端。编辑frpc.ini。

[common]server_addr = 47.92.90.25server_port = 7000[ssh]type = tcplocal_ip = 127.0.0.1local_port = 22remote_port = 6000[web]type = http         local_port = 80   custom_domains = www.hacksprit.top

local_port = 80 是本地web服务的端口。

启动客户端frpc

./frpc -c frpc.ini

在frp服务器端看到如下信息:6810f00c795d2fd8078bb65f03e50619.png(2) 通过公司局域网进行测试

首先测试web服务: 在浏览器中输入www.hacksprit.top:7002成功访问到家庭局域网开启的服务。70741e1f803d3981922f38b46026a111.png再测试ssh服务: 在终端输入命令

ssh -o port=6000 burning@47.92.90.25

最终成功访问家庭局域网的ssh服务。753d346d6e8758f69fc955d8168e7d65.png

写在最后

远程控制服务与此类似,添加相应的配置,就能轻松实现远程桌面控制。

公众号

更过内容,欢迎关注我的微信公众号:无情剑客。

6ac8b8e9d0bc838d025952c14051ed2e.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值