first commit
Some checks failed
Vulhub Format Check and Lint / format-check (push) Has been cancelled
Vulhub Format Check and Lint / markdown-check (push) Has been cancelled
Vulhub Docker Image CI / longtime-images-test (push) Has been cancelled
Vulhub Docker Image CI / images-test (push) Has been cancelled

This commit is contained in:
2025-09-06 16:08:15 +08:00
commit 63285f61aa
2624 changed files with 88491 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
from django.contrib import admin
from .models import Collection, Collection2
# Register your models here.
admin.site.register(Collection)
admin.site.register(Collection2)

View File

@@ -0,0 +1,5 @@
from django.apps import AppConfig
class VulnConfig(AppConfig):
name = 'vuln'

View File

@@ -0,0 +1,15 @@
from django.contrib.gis.db import models
# Create your models here.
class Names(models.Model):
name = models.CharField(max_length=128)
def __str__(self):
return self.name
class Collection(Names):
path = models.LineStringField()
class Collection2(Names):
point = models.PointField()

View File

@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

View File

@@ -0,0 +1,27 @@
from django.shortcuts import render, HttpResponse
from django.contrib.gis.geos import Point
from django.contrib.gis.measure import D
from django.contrib.gis.db.models.functions import Distance
from django.contrib.gis.db.models import Union
from .models import Collection, Collection2
# Create your views here.
def vuln(request):
query = request.GET.get('q', default=0.05)
qs = Collection.objects.annotate(
d=Distance(
Point(0.01, 0.01, srid=4326),
Point(0.01, 0.01, srid=4326),
tolerance=query,
),
).filter(d=D(m=1)).values('name')
return HttpResponse(qs)
def vuln2(request):
query = request.GET.get('q')
qs = Collection2.objects.aggregate(
Union('point', tolerance=query),
).values()
return HttpResponse(qs)