svn泄露遇到的小姿势
0x01 顺手
首先发现一个域名有.svn目录,但是被ban,主要文件entries也无法访问。
顺手试了一下.git,虽然也是403,但是index文件可下载,可以上工具脱代码了。
0x02 姿势
某svn子域名下,svn目录被ban,entires也无法访问
但是新版svn客户端出维护了一个wc.db的数据库文件,发现可下载,下载后用sqllite软件打开即可查看文件名和目录,如果是不能解析的文件就可以下载下来。
--------------------------------------分割------------------------------------------------
如何允许所有ip访问SSH映射的端口
0x01
将内网的端口映射到公网的一台服务器上,最常见的就是使用SSH把端口转发到公网服务器上。 网络上的文章均提到想要让转发出来的端口监听所有连接需要使用ssh在本地再转发一次,看起来像是多此一举,难道SSH不能直接让远程端口监听所有连接吗?
0x02 网上怎么说
按照需求我们使用的是远程端口转发,在内网用ssh连接远程主机,在远程主机上开一个端口,使用命令格式如下
ssh -R <remote host>:<remote port>:<local host>:<local port> user@ssh hostname
remote host默认是绑定本地环回网卡,部分文章提到要共享转发的端口,SSH提供了Gateway关键字和-g参数,但是很多人都在文章中说测试-g参数失败,或者不知道Gateway关键字怎么操作。
0x03 你皮任你皮
经过测试,即使在命令中指定remote host为其他ip,在vps上查看发现端口还是绑定在127.0.0.1,这就很尴尬了。
直接找官方求助,在该页面上看到sshd配置项关于Gateway的描述:
GatewayPorts Specifies whether remote hosts are allowed to connect to ports forwarded for the client. By default, sshd binds remote port forwardings to the loopback address. This prevents other remote hosts from connecting to forwarded ports. GatewayPorts can be used to specify that sshd should allow remote port forwardings to bind to non-loopback addresses, thus allowing other hosts to connect. The argument may be no to force remote port forwardings to be available to the local host only, yes to force remote port forwardings to bind to the wildcard address, or clientspecified to allow the client to select the address to which the forwarding is bound. The default is no.
意思就是说,为了安全考虑,远程端口转发默认是绑定在本地的,要指定remote host就要把服务端的GatewayPorts设置成yes或者clientspecified。而且,-g参数只和-L参数一起使用的时候才有效。
于是进入/etc/ssh/sshd_config修改ssh server配置文件,修改或增加一行GatewayPorts clientspecified,然后重启ssh服务,即可使用-R或-g -L指定remote host进行端口转发了。
0x04 总结
指定remote host需要ssh server端支持,与ssh client无关。
|