mirror of
https://github.com/yogeshojha/rengine.git
synced 2026-09-30 13:44:54 +02:00
Metadata widget added
This commit is contained in:
@@ -48,6 +48,7 @@ class MetafinderDocumentSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = MetaFinderDocument
|
||||
fields = '__all__'
|
||||
depth = 1
|
||||
|
||||
|
||||
class MetafinderUserSerializer(serializers.ModelSerializer):
|
||||
|
||||
@@ -30,7 +30,8 @@ urlpatterns = [
|
||||
path('queryPorts/', ListPorts.as_view(), name='listPorts'),
|
||||
path('queryIps/', ListIPs.as_view(), name='listIPs'),
|
||||
path('querySubdomains/', ListSubdomains.as_view(), name='querySubdomains'),
|
||||
path('queryOsintUsers/', ListOsintUsers.as_view(), name='querySubdomains'),
|
||||
path('queryOsintUsers/', ListOsintUsers.as_view(), name='queryOsintUsers'),
|
||||
path('queryMetadata/', ListMetadata.as_view(), name='queryMetadata'),
|
||||
]
|
||||
|
||||
urlpatterns += router.urls
|
||||
|
||||
@@ -103,6 +103,17 @@ class ListOsintUsers(APIView):
|
||||
serializer = MetafinderUserSerializer(documents, many=True)
|
||||
return Response({"users": serializer.data})
|
||||
|
||||
|
||||
class ListMetadata(APIView):
|
||||
def get(self, request, format=None):
|
||||
req = self.request
|
||||
scan_id = req.query_params.get('scan_id')
|
||||
if scan_id:
|
||||
documents = MetaFinderDocument.objects.filter(scan_history__id=scan_id).distinct()
|
||||
serializer = MetafinderDocumentSerializer(documents, many=True)
|
||||
return Response({"metadata": serializer.data})
|
||||
|
||||
|
||||
class ListIPs(APIView):
|
||||
def get(self, request, format=None):
|
||||
req = self.request
|
||||
|
||||
Reference in New Issue
Block a user