Gitroot

https://download.vulnhub.com/gitroot/GitRoot.ova

靶场IP:192.168.2.20

扫描对外端口服务

┌──(root㉿kali)-[~/Desktop]
└─# nmap -p1-65535 -sV 192.168.2.20
Starting Nmap 7.92 ( https://nmap.org ) at 2022-09-13 08:43 EDT
Nmap scan report for 192.168.2.20
Host is up (0.00024s latency).
Not shown: 65532 closed tcp ports (reset)
PORT      STATE SERVICE   VERSION
22/tcp    open  ssh       OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0)
80/tcp    open  http      Apache httpd 2.4.38 ((Debian))
11211/tcp open  memcache?
1 service unrecognized despite returning data. If you know the service/version, please submit the following fingerprint at https://nmap.org/cgi-bin/submit.cgi?new-service :
SF-Port11211-TCP:V=7.92%I=7%D=9/13%Time=63207B0C%P=x86_64-pc-linux-gnu%r(R
SF:PCCheck,27,"\x81\0\0\0\0\0\0\x81\0\0\0\x0f\0\0\0\x02\0\0\0\0\0\0\0\0Unk
SF:nown\x20command");
MAC Address: 08:00:27:DF:CD:B2 (Oracle VirtualBox virtual NIC)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 86.36 seconds

访问80端口

image-20220913204538917

配置本地hosts

访问:http://wp.gitroot.vuln

image-20220913204642561

爆破子域名

配置本地hosts

访问:http://repo.gitroot.vuln

image-20220913214559249

爆破目录

使用GitDumper 下载git源码

image-20220913214858736

他会列出各种各样的文件,但我们会保留这个:

image-20220913215023006

我们有两个有趣的文件,好吧,实际上我们只有一个," pablo_HELP.txt "文件已被删除,但我们会拯救它!

新文件的内容:

现在,我们将使用**GitTools** Kit Extractor工具(包括" pablo_HELP ")恢复所有文件

pablo_HELP 文件

没什么用,我们继续检查 .php 文件,我们在文件" set.php "中发现了一些凭据。

我们在 WordPress 和 SSH 中都使用了凭据,但没有成功。虽然我们已经知道用户的名字,但我们还是使用" rockyou "字典对 SSH 服务进行了暴力攻击。

发现密码:pablo/mastergitar

ssh登录

我们不断列出" Pablo "文件夹的内容,我们找到一个名为" public "的文件夹,在其中,我们有一条消息邀请我们检查一个新的 git 存储库。

我们发现一条消息告诉我们检查 git repo。因此,让我们使用 find 检查 .git 目录。

我们将看看 /opt/auth/.git。在那个目录里面,我们发现有很多使用 git branch 的分支。所以我们可以查看日志,看看是否有对我们很重要的东西。由于有很多重复的单词,我在日志目录中使用了这个命令。

查看commit内容

切换到beth用户

查看addToMyRepo.txt文件

如果您想提交到我的存储库,您可以将 zip 文件添加到 ~jen/public/repos/ 并解压缩并将其添加到我的存储库

谢谢!

在tmp目录下创建

创建提交后 (chmod 777 incase)

压缩我们的 .git 目录

将我们的zip文件复制到Jen Repos,在那里它将解压缩并放入公共文件夹

image-20230208145700851

最后更新于

这有帮助吗?