
Vulnerabilità Django: CVE-2020-7471 Potenziale SQL injection tramite StringAgg(delimiter) Ambiente di vulnerabilità e POC
Questo repository fornisce l'ambiente e il POC per la vulnerabilità CVE-2020-7471 Potential SQL injection via StringAgg(delimiter)
Installare la versione vulnerabile di django, quella che ho testato è
pip install django==3.0.2 -i https://pypi.tuna.tsinghua.edu.cn/simple
Seguire https://www.runoob.com/postgresql/windows-install-postgresql.html per completare l'installazione del database postgres
Creare un nuovo database
CREATE DATABASE test;
Modificare la configurazione del database in sqlvul_projects/settings.py. Se nel passaggio precedente hai utilizzato la configurazione predefinita (inclusa l'impostazione della password a postgres), non è necessario modificare alcuna configurazione e puoi saltare questo passaggio
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'test', # 数据库名称
'USER': 'postgres',
'PASSWORD': 'postgres', # 数据库用户密码
'HOST': '127.0.0.1', # 数据库地址
'PORT': '5432',
}
}
Inizializzare le tabelle dei dati tramite django
python3 manage.py migrate
python3 manage.py makemigrations vul_app
python3 manage.py migrate vul_app
Quindi eseguire lo script POC CVE-2020-7471.py e il gioco è fatto.