diff --git a/README.md b/README.md index 96afa3d..152a5d3 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,7 @@ DVGA supports Beginner and Expert level game modes, which will change the exploi * Stored Cross Site Scripting * Log spoofing / Log Injection * HTML Injection + * SQL Injection * **Authorization Bypass** * GraphQL Interface Protection Bypass * GraphQL Query Deny List Bypass diff --git a/core/views.py b/core/views.py index eed48f7..dce149d 100644 --- a/core/views.py +++ b/core/views.py @@ -11,7 +11,7 @@ ) from flask_graphql import GraphQLView - +from sqlalchemy.sql import text from graphene_sqlalchemy import ( SQLAlchemyObjectType ) @@ -152,17 +152,22 @@ class Mutations(graphene.ObjectType): import_paste = ImportPaste.Field() class Query(graphene.ObjectType): - pastes = graphene.List(PasteObject, public=graphene.Boolean(), limit=graphene.Int()) + pastes = graphene.List(PasteObject, public=graphene.Boolean(), limit=graphene.Int(), filter=graphene.String()) paste = graphene.Field(PasteObject, id=graphene.Int(), title=graphene.String()) system_update = graphene.String() system_diagnostics = graphene.String(username=graphene.String(), password=graphene.String(), cmd=graphene.String()) system_health = graphene.String() read_and_burn = graphene.Field(PasteObject, id=graphene.Int()) - def resolve_pastes(self, info, public=False, limit=1000): + def resolve_pastes(self, info, public=False, limit=1000, filter=None): query = PasteObject.get_query(info) Audit.create_audit_entry(info) - return query.filter_by(public=public, burn=False).order_by(Paste.id.desc()).limit(limit) + result = query.filter_by(public=public, burn=False) + + if filter: + result = result.filter(text("title = '%s' or content = '%s'" % (filter, filter))) + + return result.order_by(Paste.id.desc()) def resolve_paste(self, info, id=None, title=None): query = PasteObject.get_query(info) diff --git a/templates/partials/solutions/solution_14.html b/templates/partials/solutions/solution_14.html index 6553c56..f99dc72 100644 --- a/templates/partials/solutions/solution_14.html +++ b/templates/partials/solutions/solution_14.html @@ -19,7 +19,9 @@
Exploitation Solution
-