Giter Site home page Giter Site logo

dliv3 / venom Goto Github PK

View Code? Open in Web Editor NEW
1.9K 40.0 344.0 1.02 MB

Venom - A Multi-hop Proxy for Penetration Testers

License: MIT License

Shell 1.00% Go 98.16% Python 0.84%
pentesting pentest-tool redteam ctf proxy golang security venom socks5 ssh-tunnel

venom's People

Contributors

dliv3 avatar ier005 avatar spikei 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

venom's Issues

运行socks server时,admin节点panic崩溃

版本1.1.0,released on 10 Jun

在运行一段时间后,报错:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x53e5e6]

goroutine 13303 [running]:
github.com/Dliv3/Venom/admin/dispather.localSocks5Server(0x5d0200, 0xc00000e010, 0xc00005e2c0, 0x40, 0xc000110000, 0xc000044000, 0x1, 0x1)
        /Users/dlive/Code/Go/src/github.com/Dliv3/Venom/admin/dispather/sender.go:427 +0xb6
created by github.com/Dliv3/Venom/netio.InitTCP.func1
        /Users/dlive/Code/Go/src/github.com/Dliv3/Venom/netio/init.go:56 +0x1e1

how to goto admin node ?

no help message for the admin node id ? and how can I goto admin node ? I tried goto 0 and goto admin node which failed.

cpu占用百分之百

环境:windows tomcat
webshell运行agent 端口复用模式 成功连接,停止tomcat后,agent CPU占用百分之百

断线重连?

agent连admin,admin有节点了,很好。
但是我用完之后就退出admin,等两天我还想继续用,我又打开admin,但是agent不会自动练上来,那我岂不是又要跑到agent机器去重启程序?

admin连agent如何管理?

我的需求是,一堆机器,先互相通过agent连接,然后admin可以随时连上某台agent对整个agent网络进行管理。
所以我做实验:A机器(win10) admin B机器(win7) agent
agent -lport 8888
admin -rhost 172.0.0.231 -rport 8888

admin连上之后show,就只有一个A,没有任何节点
难道A不能管理B吗?那A连上B之后有什么用?

长时间未与节点交互后自动断开

不知道是不是BUG,信息如下。希望有一个断线重连的机制。

node disconnect: read tcp 192.168.43.30:58929->118.195.145.245:9930: wsarecv: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

还有上一个兄弟反应的无法跳转回admin节点的情况,只能在子节点之间跳转

看到这个项目有点开心,想写点东西供你参考。

  1. 节点可视化。你的操作逻辑基本在复用Termite,但show的时候展示的信息太少了。当连接的同级节点比较多之后,是很难把节点ID和对应的主机对应关系记住的,Termite中之所以会把ID及各种系统类型,自定义配置等内容统一展示出来,正是为了应对这种难于长期记忆的问题,提示信息越多,对使用者越友好。
  2. ID分配机制。时间有限,只是粗略的看了一下代码,没看到ID分配机制的部分。从文档中推测是在show的时候触发的ID分配过程。这就要考虑每两次ID刷新时,主机是不是还能够维持上一次的ID,如果ID会改变的话,使用的时候也会比较困惑。尤其是像当前这种只展示了拓扑关系和ID值的方式,在这样的场景下,会更难用。
  3. 把shell绑定到本地端口会更舒服。你现阶段shell指令是直接复用当前控制台的。然而shell控制台是个很基础的需求,它和文件同步类指令要交替使用,才能完成一个完整的控制效果。这样的话,经常来回切换shell模式会比较繁琐,不如绑到一个独立的端口,用起来顺手。而且,shell绑定到端口,也可以方便和其他小组成员分享主机权限,只要大家都在同一局域网,就可以直接nc访问了。
  4. 可执行文件大小问题。项目是用Go写的,后面在IOT环境的扩展问题会很多。其中最核心的问题,是ELF文件太大(IOT的编译大部分都要通过static编译,因为IoT设备环境太复杂了,各种基础库都会遇到,这样的话产品文件就会更大)。而 IoT 设备内存相对又比较小,老些的设备内存只有几十M,加上网络也不会太稳定,这样的前提下,传输的文件越大,成功率就越低。虽然项目中考虑了部分代码选择性编译控制文件大小,然而实际效果有限,毕竟产品中大部分内容都是Go的运行环境(其实说产品中有90%的代码是Go运行环境都不为过,找个IDA看一眼就行,挺明显的)。我当初也是纠结了很久才选择的 C。其实Go还会带来个潜在的问题,那就是 IoT设备的 CPU 资源也有限,如果某程序长时间占用CPU和 内存资源导致系统反应过慢,可能会被 watchdog 误认为设备假死,触发设备重启,那之前的工作很可能就白做了。

SOCKS5 DNS 解析问题

很棒的项目,点赞!

另外有一个关于建立了 SOCKS5 连接后 DNS 无法解析的问题。在目标内网起了 agent,端口映射至 VPS,然后外网攻击机 admin 连接 VPS 的端口,建立好连接,起 SOCKS5 服务,在攻击机本地监听了 7777 端口,至此一切正常。

接着浏览器设置代理,代理本地 7777 端口,使攻击机可以访问目标内网的 web 服务,但是以域名访问时无法解析(例 wiki.xxx.com),以目标内网 IP 请求时可以访问,说明 DNS 请求没有通过 SOCKS5 隧道转发至 agent 去请求目标内网的 DNS 服务器。

奇怪了,SOCKS5 不是默认会连带 DNS 请求一起走隧道吗?测试了其他的突破内网访问限制的方式,比如 goagent,ssr 等,都出现了这种问题,求一波解答,感谢!

另外,在以域名访问时,agent 报错如下图:

venom

交互 shell 阻塞,未正常结束

image

在其中一个节点shell长时间交互后,此时exit退回admin管控,未能未退,阻塞在这里(不知道是否与交互式时启动代理, 例如后台运行开启socks5有关),Ctrl + C等也结束不了,能否向MSF一样, Ctrl + C 后Tem shell 回到 meterpreter。短时间交互 exit 回退是OK的。

CentOS CPU占用 100%

是 Bug 么?agent_linux_x64。
环境 CentOS 云服务器,运行命令 nohup ./agent_linux_x64 -lport 9898 -passwd xxx &

Screenshot 2021-01-21 上午10 14 58
Screenshot 2021-01-21 上午10 16 05

开启交互式shell时,victim节点异常退出会导致admin节点死锁

hey,感谢您的工具,很不错
我在使用时发现了一些小bug

ENV:
admin node: Windows
victim node: Windows

(admin node) >>>
[+]Remote connection:  127.0.0.1:6754
[+]A new node connect to admin node success
(admin node) >>> shell
you should select node first
(admin node) >>> goto 1
node 1
(node 1) >>> shell
You can execute commands in this shell :D, 'exit' to exit.
Microsoft Windows [Version 10.0.17134.765]
(c) 2018 Microsoft Corporation。保留所有权利。

E:\GoWorkplace\src\github.com\Dliv3\Venom\agent>ls
ls
agent.exe
agent.go
cli
dispather
init

E:\GoWorkplace\src\github.com\Dliv3\Venom\agent>node disconnect:  read tcp 127.0.0.1:4444->127.0.0.1:6754: wsarecv: An existing connection was forcibly closed by the remote host.
Ctrl-C
Ctrl-C
Ctrl-C
Ctrl-C

当victim关闭tcp连接后,admin节点卡死。研究后发现是因为通信的channel阻塞:

if shellPacketRet.Success == 1 {
		c := make(chan bool, 2)
		go CopyStdin2Node(os.Stdin, peerNode, c)
		go CopyNode2Stdout(peerNode, os.Stdout, c)
		<-c
		<-c
...



func CopyNode2Stdout(input *node.Node, output io.Writer, c chan bool) {
	for {
		var packetHeader protocol.PacketHeader
		var shellPacketRet protocol.ShellPacketRet
		err := node.CurrentNode.CommandBuffers[protocol.SHELL].ReadPacket(&packetHeader, &shellPacketRet)
...



func (buffer *Buffer) ReadLowLevelPacket() (protocol.Packet, error) {
	packet := <-buffer.Chan
        // blocking here

我试着修复了该bug,已提交pr #2


还添加了goto命令的节点0,与admin节点绑定。场景:当某个victim节点退出时命令行会继续显示(node 1),可以通过goto 0跳转回(node admin),不过建议未来能根据路由动态更新命令提示符

我对venom的端口映射(内网穿透)存在疑惑

我的环境为 内网肉鸡 IP :192.168.79.130(安装agent端)
公网机器IP : 118.118.118.118(假设)(安装admin端)
本机IP : 192.168.1.1
肉鸡通过运行了venome的agent 连接到了 公网机器
公网机器 goto 1 进入内网肉鸡的管理页面,运行socks 7777 按理说已经设置了socks5的代理
但是我本机 无法通过设置socks5 118.118.118.118:7777 来连接肉鸡架设的web页面
同样的 无法通过在node1 运行 lforward 127.0.0.1 8888 3389 把肉鸡的3389映射到公网机器的8888端口
通过本机访问118.118.118.118:8888 来访问肉鸡的3389

通过查阅其他人的文章,他们都是直接在内网中实验,例如
内网肉鸡 IP :192.168.79.130
kali机器IP : 192.168.79.1(安装admin端)
然后直接在kali中访问映射的端口如127.0.0.1:8888 我也测试过确实可以访问。

是不是意味着映射的端口只可以在本地访问,其他机器无法访问到映射的端口,或者是不是映射的端口只是允许本地访问。
ps: 我的vps的防火墙,业务组全部都是关的,测试过frp 没有问题。我想进行的是内网穿透

希望各位老师傅解答一下我的疑惑

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.