内网穿透cpolar连内网armbian

admin 2023年6月10日04:51:39评论6 views字数 1334阅读4分26秒阅读模式

上面的主机虽能上网,但是是内网,外面无法ssh连接进来,下面介绍如何使用内网穿透工具cpoalr远程。

官网:https://dashboard.cpolar.com/

下面以远程控制我的USB 随身wifi armbian为例:

  1. 在我的armbian上首先安装openssh
  2. apt-get install openssh-server service sshd start
  3.  注册cpolar账号
  4.  安装cpolar
curl -l https://www.cpolar.com/static/downloads/install-release-cpolar.sh |sudo bashsystemctl enable cpolarsystemctl start cpolar

内网穿透cpolar连内网armbian

4. 绑定token,登陆官网查看获取,绑定:

点击“”“验证”

内网穿透cpolar连内网armbian

在被控制机执行,token替换你的:

cpolar authtoken ODE3NmZjNtYzViMjdmY2I4YTUwsystemctl restart cpolar

回到cpolar的官网,点击“状态”:

内网穿透cpolar连内网armbian

内网穿透cpolar连内网armbian

其他使用功能参考:https://www.cpolar.com/blog/ssh-remote-linux-centos?channel=0&invite=4W3F

内网穿透cpolar连内网armbian

解决端口老换的问题:定时爬取端口,通过pushplus 推送到微信,以下为代码:

#!/usr/bin/env python3# coding: utf-8import requestsimport re,timenow = time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time()))def getdata():
    session = requests.session()    url = "https://dashboard.cpolar.com/login"    #login    data = {        "login":"your_nme",        "password":"xxxx_your_sc"        }    session.post(url,data=data)    resp = session.get("https://dashboard.cpolar.com/status")    content = resp.text    content = re.findall('"#ZgotmplZ" target="_blank">tcp://(.+)</a></th>',content)[0]    return content +" -" + now#send msgdef Pushplus(content):    #print(content)    token = '1b81b959bb_your_xxxx'    title = 'Today_ssh_code'    url = 'http://www.pushplus.plus/send?token=' + token + '&title=' + title + '&content=' + content + '&template=txt'    #print(url)    requests.get(url)Pushplus(getdata())

内网穿透cpolar连内网armbian

加个定时任务就行了,以下是效果:

内网穿透cpolar连内网armbian

 

原文始发于微信公众号(网络铅笔头):内网穿透cpolar连内网armbian

免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2023年6月10日04:51:39
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   内网穿透cpolar连内网armbianhttps://cn-sec.com/archives/2086959.html
                  免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉.

发表评论

匿名网友 填写信息