Code Monkey home page Code Monkey logo

natpass's Introduction

natpass's People

Contributors

carr0t2 avatar dependabot[bot] avatar lwch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

natpass's Issues

编译报错

编译报错如下,应该是缺少了assets.go文件

# github.com/lwch/natpass/code/client/rule/shell
rule\shell\h_render.go:16:15: undefined: Asset
rule\shell\h_render.go:26:12: undefined: Asset
# github.com/lwch/natpass/code/client/rule/code
rule\code\h_render.go:18:15: undefined: Asset
rule\code\h_render.go:28:12: undefined: Asset
# github.com/lwch/natpass/code/client/dashboard
dashboard\h_render.go:21:15: undefined: Asset
dashboard\h_render.go:35:15: undefined: Asset
dashboard\h_render.go:45:15: undefined: Asset
dashboard\h_render.go:46:14: undefined: Asset
dashboard\h_render.go:47:15: undefined: Asset
# github.com/lwch/natpass/code/client/rule/vnc
rule\vnc\h_render.go:16:15: undefined: Asset
rule\vnc\h_render.go:26:12: undefined: Asset

关于预共享密钥

现在预共享密钥,主控端和被控端,都必须和服务器的保持一致是吗?是否可以支持分别设定密码呢?

2022/11/27 15:53:22 [ERROR]invalid handshake from 172.16.17.136:50278 + (/github/home/go/pkg/mod/github.com/lwch/[email protected]/log.go:30) github.com/lwch/logging.Error + (/github/workspace/code/server/handler/handler.go:64) github.com/lwch/natpass/code/server/handler.(*Handler).Handle

2022/11/27 15:53:22 [ERROR]invalid handshake from 172.16.17.136:50278

  • (/github/home/go/pkg/mod/github.com/lwch/[email protected]/log.go:30) github.com/lwch/logging.Error
  • (/github/workspace/code/server/handler/handler.go:64) github.com/lwch/natpass/code/server/handler.(*Handler).Handle

小建议

  • 代码目录结构:可否参照下相关golang开源项目或者规范靠一下呢,暂可忽略
  • windows支持:既然当前只支持windows vnc,不知是否有调测,配置文件是否单独抽出windows支持的配置路径格式,或者程序处理转义路径形式。windows报错,启动panic,尴尬
  • panic: 直接使用panic处理所有错误,太硬了,出问题哪里抛出的都不一定能直接找到,估摸的一层一层去找了,生产环境定然不能直接这样,推荐log信息埋点加时间event关键词是否会更友好点
  • 直接上tls: 个人感觉有必要,也有点硬,门槛拉高了,只是想使用下,或者放置个默认试用证书? 或者配置tls开启、关闭 客服考虑下
  • 开发者文档:暂可忽略

目前看想试用下跑起来有点费劲。测试各种panic 泪崩

锁屏时被控服务崩溃

在windows10下运行,当被控端锁屏时nt-cli.exe会报错,并且画面黑屏,应该如何处理

并发能力如何?

请问一下,设计并发能力和测试并发能力如何?有大概的数据吗?

建议把不同的链接方式区分一下 同时反馈几个问题

RDP
BAT

VNC
SSH

就这4种方式了

建议:在受控端手动指定可以用哪几种方式连接

我刚刚简单测试了一下
受控端是WIN10 用批处理临时运行
服务器是openwrt
客户端是openwrt

然后我用自己的电脑访问op的网址

问题1:
vnc的模式只能显示不能控制 定格了
问题2:
shell模式输错了命令按退格键删除 显示异常
问题3:
怎么退出? 点了连接以后不想连了,要怎么关闭这个会话?

我本意是想找一款远程桌面软件的 目前在虚拟机里面装的QQ,用windows自带的mstsc远程控制,但是QQ的界面卡卡的,想找一款免费的软件
以前用过radmin,效果不错,但是这个是收费的

按照文档运行没有任何日志,运行失败

在同一台机器上运行了服务端和控制端
[root@VM-8-5-centos natpass-server]# sudo systemctl start np-svr
[root@VM-8-5-centos natpass-server]# sudo systemctl start np-cli
启动后没有任何提示,也没有日志输出,打开对应端口也是失败的

三端启动报错

hi. 我在测试中遇到一些问题,所有配置文件仅修改了端口和服务器IP,local 可以跑起来看到设备列表,但是无法vnc 和shell,
有如下错误信息。
ser:

 + (/root/go/pkg/mod/github.com/lwch/[email protected]/log.go:30) github.com/lwch/logging.Error
  + (/build/code/server/handler/handler.go:64) github.com/lwch/natpass/code/server/handler.(*Handler).Handle
2022/07/11 11:46:59 [ERROR]invalid handshake from 
  + (/root/go/pkg/mod/github.com/lwch/[email protected]/log.go:30) github.com/lwch/logging.Error
  + (/build/code/server/handler/handler.go:64) github.com/lwch/natpass/code/server/handler.(*Handler).Handle
panic: runtime error: index out of range [0] with length 0

goroutine 56 [running]:
github.com/lwch/logging.(*rotateSizeLogger).rotate(0xc000190000)
	/root/go/pkg/mod/github.com/lwch/[email protected]/rotate_size.go:99 +0x951
github.com/lwch/logging.(*Logger).Error(0xb9d900, {0x88a118, 0x27}, {0xc0001010e0, 0x3, 0x3})
	/root/go/pkg/mod/github.com/lwch/[email protected]/log.go:90 +0x9b
github.com/lwch/logging.Error(...)
	/root/go/pkg/mod/github.com/lwch/[email protected]/log.go:30
github.com/lwch/natpass/code/server/handler.(*Handler).Handle(0xc0001940c0, {0x929ec0?, 0xc00000e248?})
	/build/code/server/handler/handler.go:67 +0xdc
created by main.run
	/build/code/server/main.go:141 +0x165

cli local:

  + (/root/go/pkg/mod/github.com/lwch/[email protected]/log.go:30) github.com/lwch/logging.Error
  + (/build/code/client/conn/conn.go:114) github.com/lwch/natpass/code/client/conn.(*Conn).loopRead
2022/07/11 11:46:59 [INFO]x.x.x.x:8976 connected
2022/07/11 11:46:59 [ERROR]read message: EOF
  + (/root/go/pkg/mod/github.com/lwch/[email protected]/log.go:30) github.com/lwch/logging.Error
  + (/build/code/client/conn/conn.go:114) github.com/lwch/natpass/code/client/conn.(*Conn).loopRead

cli remote(win 10)

panic: runtime error: index out of range [0] with length 0

goroutine 35 [running]:
github.com/lwch/logging.(*rotateSizeLogger).rotate(0xc000094000)
        /root/go/pkg/mod/github.com/lwch/[email protected]/rotate_size.go:99 +0x951
github.com/lwch/logging.(*Logger).Error(0x14268c0, {0x15169df, 0xe}, {0xc000210170, 0x1, 0x1})
        /root/go/pkg/mod/github.com/lwch/[email protected]/log.go:90 +0x9b
github.com/lwch/logging.Error(...)
        /root/go/pkg/mod/github.com/lwch/[email protected]/log.go:30
github.com/lwch/natpass/code/network.(*Conn).loopWrite(0xc000222040)
        /build/code/network/network.go:127 +0x248
created by github.com/lwch/natpass/code/network.NewConn
        /build/code/network/network.go:42 +0x137

客户端开发计划

你好,大佬 请问有客户端开发计划嘛,网页版的感觉不是特别好用,用了一下rustdesk,感觉很流畅,想弄一个跟rustdesk差不多的东西,奈何rust语言有点复杂,golang的发现很少

有一个问题

请问 前端显示各种shell 是canvs 实现得嘛, 连接应该都是websocket 长连接把

增加port转发的规则

现在支持shell, VNC的,不知道能否考虑支持port(tcp or udp)转发的规则配置,能把被控端网络内的某个端口(自己或者网络内其他机器的)转发到控制端本地的某个端口

Got some error stright after deployment

~/natpass_0.9.0 
❯ bat server.yaml
──────────────
1 │ listen: 6154 # 监听端口号
2 │ #include common.yaml
3 │ #tls:
4 │ # key: /dir/to/tls/key/file # tls密钥
5 │ # crt: /dir/to/tls/crt/file # tls证书

Below log of errors which was occurred after I tried to open -> http://vpsip:6541 if i do http://vpsip:8080 - I cant connect ether

ubuntuvnc 19:36   ~/natpass_0.9.0 
❯ ./np-svr -conf server.yaml
2022/07/11 20:09:38 [ERROR]read handshake from 45.15.16.60:51496 1 times, err=read tcp 185.102.170.197:6154->45.15.16.60:51496: i/o timeout

  • (/root/go/pkg/mod/github.com/lwch/[email protected]/log.go:30) github.com/lwch/logging.Error
  • (/build/code/server/handler/handler.go:67) github.com/lwch/natpass/code/server/handler.(*Handler).Handle
    2022/07/11 20:09:38 [ERROR]read handshake from 45.15.16.60:51492 1 times, err=read tcp 185.102.170.197:6154->45.15.16.60:51492: i/o timeout
  • (/root/go/pkg/mod/github.com/lwch/[email protected]/log.go:30) github.com/lwch/logging.Error
  • (/build/code/server/handler/handler.go:67) github.com/lwch/natpass/code/server/handler.(*Handler).Handle
    2022/07/11 20:09:39 [ERROR]read handshake from 45.15.16.60:51496 2 times, err=EOF
  • (/root/go/pkg/mod/github.com/lwch/[email protected]/log.go:30) github.com/lwch/logging.Error
  • (/build/code/server/handler/handler.go:67) github.com/lwch/natpass/code/server/handler.(*Handler).Handle
    2022/07/11 20:09:39 [ERROR]read handshake from 45.15.16.60:51496 3 times, err=EOF
  • (/root/go/pkg/mod/github.com/lwch/[email protected]/log.go:30) github.com/lwch/logging.Error
  • (/build/code/server/handler/handler.go:67) github.com/lwch/natpass/code/server/handler.(*Handler).Handle
    2022/07/11 20:09:39 [ERROR]read handshake from 45.15.16.60:51496 4 times, err=EOF
  • (/root/go/pkg/mod/github.com/lwch/[email protected]/log.go:30) github.com/lwch/logging.Error
  • (/build/code/server/handler/handler.go:67) github.com/lwch/natpass/code/server/handler.(*Handler).Handle
    2022/07/11 20:09:39 [ERROR]read handshake from 45.15.16.60:51496 5 times, err=EOF
  • (/root/go/pkg/mod/github.com/lwch/[email protected]/log.go:30) github.com/lwch/logging.Error
  • (/build/code/server/handler/handler.go:67) github.com/lwch/natpass/code/server/handler.(*Handler).Handle
    2022/07/11 20:09:39 [ERROR]read handshake from 45.15.16.60:51496 6 times, err=EOF
  • (/root/go/pkg/mod/github.com/lwch/[email protected]/log.go:30) github.com/lwch/logging.Error
  • (/build/code/server/handler/handler.go:67) github.com/lwch/natpass/code/server/handler.(*Handler).Handle
    2022/07/11 20:09:39 [ERROR]read handshake from 45.15.16.60:51496 7 times, err=EOF
  • (/root/go/pkg/mod/github.com/lwch/[email protected]/log.go:30) github.com/lwch/logging.Error
  • (/build/code/server/handler/handler.go:67) github.com/lwch/natpass/code/server/handler.(*Handler).Handle
    2022/07/11 20:09:39 [ERROR]read handshake from 45.15.16.60:51496 8 times, err=EOF
  • (/root/go/pkg/mod/github.com/lwch/[email protected]/log.go:30) github.com/lwch/logging.Error
  • (/build/code/server/handler/handler.go:67) github.com/lwch/natpass/code/server/handler.(*Handler).Handle
    2022/07/11 20:09:39 [ERROR]read handshake from 45.15.16.60:51496 9 times, err=EOF
  • (/root/go/pkg/mod/github.com/lwch/[email protected]/log.go:30) github.com/lwch/logging.Error
  • (/build/code/server/handler/handler.go:67) github.com/lwch/natpass/code/server/handler.(*Handler).Handle
    2022/07/11 20:09:39 [ERROR]read handshake from 45.15.16.60:51496 10 times, err=EOF
  • (/root/go/pkg/mod/github.com/lwch/[email protected]/log.go:30) github.com/lwch/logging.Error
  • (/build/code/server/handler/handler.go:67) github.com/lwch/natpass/code/server/handler.(*Handler).Handle
    2022/07/11 20:09:43 [ERROR]read handshake from 45.15.16.60:51492 2 times, err=read tcp 185.102.170.197:6154->45.15.16.60:51492: i/o timeout
  • (/root/go/pkg/mod/github.com/lwch/[email protected]/log.go:30) github.com/lwch/logging.Error
  • (/build/code/server/handler/handler.go:67) github.com/lwch/natpass/code/server/handler.(*Handler).Handle
    2022/07/11 20:09:48 [ERROR]read handshake from 45.15.16.60:51492 3 times, err=read tcp 185.102.170.197:6154->45.15.16.60:51492: i/o timeout
  • (/root/go/pkg/mod/github.com/lwch/[email protected]/log.go:30) github.com/lwch/logging.Error
  • (/build/code/server/handler/handler.go:67) github.com/lwch/natpass/code/server/handler.(*Handler).Handle
    2022/07/11 20:09:53 [ERROR]read handshake from 45.15.16.60:51492 4 times, err=read tcp 185.102.170.197:6154->45.15.16.60:51492: i/o timeout
  • (/root/go/pkg/mod/github.com/lwch/[email protected]/log.go:30) github.com/lwch/logging.Error
  • (/build/code/server/handler/handler.go:67) github.com/lwch/natpass/code/server/handler.(*Handler).Handle
    2022/07/11 20:09:58 [ERROR]read handshake from 45.15.16.60:51492 5 times, err=read tcp 185.102.170.197:6154->45.15.16.60:51492: i/o timeout
  • (/root/go/pkg/mod/github.com/lwch/[email protected]/log.go:30) github.com/lwch/logging.Error
  • (/build/code/server/handler/handler.go:67) github.com/lwch/natpass/code/server/handler.(*Handler).Handle
    2022/07/11 20:10:03 [ERROR]read handshake from 45.15.16.60:51492 6 times, err=read tcp 185.102.170.197:6154->45.15.16.60:51492: i/o timeout
  • (/root/go/pkg/mod/github.com/lwch/[email protected]/log.go:30) github.com/lwch/logging.Error
  • (/build/code/server/handler/handler.go:67) github.com/lwch/natpass/code/server/handler.(*Handler).Handle

Server environments : Linux version 5.4.0-29-generic (buildd@lgw01-amd64-035) (gcc version 9.3.0 (Ubuntu 9.3.0-10ubuntu2)) #33-Ubuntu SMP Wed Apr 29 14:32:27 UTC 2020

编译出错

执行 build_all ,在编译 linux amd64 时出错,详细日志如下:
代码分支 v0.8.3

`natpass git:(heads/v0.8.3) ✗ ./build_all
[+] Building 3.3s (7/7) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 37B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/debian:stable-slim 3.2s
=> [1/3] FROM docker.io/library/debian:stable-slim@sha256:091320245c2637337fc612baf22430ec1735fd395e2c97e2c90136137d156f63 0.0s
=> CACHED [2/3] WORKDIR /build 0.0s
=> CACHED [3/3] RUN sed -i "s|deb.debian.org|mirrors.ustc.edu.cn|g" /etc/apt/sources.list && sed -i "s|security.debian.org|mirrors.ustc.edu.cn|g" /etc/apt/sources.list && 0.0s
=> exporting to image 0.0s
=> => exporting layers 0.0s
=> => writing image sha256:02faaa823400e4098f801bf50b212737f81314da3cbe5348d46615083e9cd7de 0.0s
=> => naming to docker.io/library/natpass 0.0s

Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them
2022/03/07 08:44:13 [INFO]go env...
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/root/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/root/go"
GOPRIVATE=""
GOPROXY="https://goproxy.cn,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.17.7"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/build/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3024449258=/tmp/go-build -gno-record-gcc-switches"
2022/03/07 08:44:35 [INFO]build target linux/amd64...
2022/03/07 08:44:36 [INFO]build server...
2022/03/07 08:44:41 [INFO]build client...
# github.com/lwch/rdesktop/keycode
/usr/bin/ld: skipping incompatible /usr/lib/i386-linux-gnu/libX11.so when searching for -lX11
/usr/bin/ld: skipping incompatible /usr/lib/i386-linux-gnu/libX11.a when searching for -lX11
/usr/bin/ld: cannot find -lX11
/usr/bin/ld: skipping incompatible /usr/lib/i386-linux-gnu/libX11.so when searching for -lX11
collect2: error: ld returned 1 exit status
panic: exit status 2

goroutine 1 [running]:
github.com/lwch/runtime.Assert(...)
/root/go/pkg/mod/github.com/lwch/[email protected]/assert.go:6
main.build({{0x4f09db, 0x5}, {0x4f0972, 0x5}, {0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, ...})
/build/contrib/build/build_all.go:207 +0x132f
main.main()
/build/contrib/build/build_all.go:114 +0x305
exit status 2`

目标鼠标位置不对

mac - control- window
控制时,鼠标位置不对,左右差很多,可能我mac用外挂显示器吗?

建议

能否添加远程打开设备web界面的功能
理由:
很多边端设备是嵌入式设备,没有桌面环境,但是提供了web访问界面

[ERROR]invalid handshake from X.X.X.X:XXXXX + (/github/home/go/pkg/mod/github.com/lwch/[email protected]/log.go:30) github.com/lwch/logging.Error + (/github/workspace/code/server/handler/handler.go:64) github.com/lwch/natpass/code/server/handler.(*Handler).Handle

控制端出现上述的报错内容,控制端和服务端的时间一致,common.yaml配置文件的secret的值也一致
报错内容
image

控制端的时间
image
服务端的时间
image
服务端的common.yaml
image
控制端的common.yaml
image

Originally posted by @SkewwG in #59 (comment)

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.