Strings Beispiele: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
| Zeile 157: | Zeile 157: | ||
Befehle: | Befehle: | ||
| − | strings invoice-helper | grep -Ei 'version|build|user|/home' | + | <!--strings invoice-helper | grep -Ei 'version|build|user|/home'--> |
| − | strings invoice-helper | grep -E '/etc/|/var/|/srv/|/tmp' | + | <!--strings invoice-helper | grep -E '/etc/|/var/|/srv/|/tmp'--> |
| − | strings invoice-helper | grep -Ei 'http|https|api' | + | <!--strings invoice-helper | grep -Ei 'http|https|api'--> |
| − | + | <!--strings invoice-helper | grep -Ei 'key|/bin/sh'--> | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | --> | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | <!-- | ||
| − | |||
| − | |||
| − | |||
| − | strings | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | --> | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
Version vom 9. Februar 2026, 17:42 Uhr
strings – Praktische Nutzung in der IT-Forensik
Ziel
Dieses Kapitel zeigt den praktischen Einsatz des Linux-Werkzeugs strings in der IT-Forensik. Alle Beispiele sind lokal reproduzierbar und basieren auf selbst erzeugten Dateien. Es werden keine externen Samples oder Malware benötigt.
Werkzeug
- strings
- file
- grep
- gcc
Szenario 1 – Analyse eines verdächtigen Programms
Datei erzeugen
Die Beispieldatei wird lokal erzeugt und simuliert ein Programm mit hartkodierten Artefakten.
- cat > sample1.c <<'EOF'
#include <stdio.h>
#include <stdlib.h>
int main() {
printf("Connecting to http://evil.example.com\n");
printf("user=admin password=secret123\n");
system("/bin/sh");
return 0;
}
EOF
- gcc sample1.c -o sample1.bin
Wo liegt die Datei
- ls -l sample1.bin
Erste Einordnung der Datei
- file sample1.bin
Strings extrahieren
- strings sample1.bin
Zielgerichtete Auswertung
- Netzwerkindikatoren
- strings sample1.bin | grep -Ei 'http|https|ftp'
- Zugangsdaten
- strings sample1.bin | grep -Ei 'user|pass|password'
- Systempfade und Shells
- strings sample1.bin | grep -Ei '/bin/|/etc/'
Forensische Bewertung
- Das Programm enthält Klartext-Zugangsdaten
- Es nutzt eine Shell (/bin/sh)
- Es verweist auf ein externes Netzwerkziel
- Das Programm wurde nicht ausgeführt
Szenario 2 – Analyse eines Datenträger-Images
Image erzeugen
Es wird ein simuliertes USB-Image mit Klartextartefakten erstellt.
- dd if=/dev/zero of=usb.dd bs=1M count=5
- echo "admin@example.com" | dd of=usb.dd conv=notrunc
- echo "https://intranet.local/login" | dd of=usb.dd conv=notrunc seek=1024
Strings auf dem Image
- strings usb.dd
Typische Filter
- Mailadressen
- strings usb.dd | grep '@'
- URLs
- strings usb.dd | grep -Ei 'http|https'
Forensische Bewertung
- Auch in scheinbar leeren Images finden sich Klartextdaten
- Gelöschte oder überschrieben geglaubte Inhalte können sichtbar bleiben
Grenzen von strings
- Keine Zeitstempel
- Kein Beweis für Ausführung
- Kein Kontext
- Nur Hinweisquelle
Typische Einsatzphase
- Triage
- Erstbewertung
- Hypothesenbildung
- Vorbereitung weiterführender Analyse
Aufgaben
Zusatz – Untersuchungsobjekt Programm
Datei erzeugen
- cat > invoice-helper.c <<'EOF'
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
char *a = "InvoiceHelper 1.8.2";
char *b = "last build: 2024-10-14";
char *c = "build user: accounting";
char *d = "/home/accounting/tools/invoice/";
char *e = "config=/etc/invoice/helper.conf";
char *f = "export path=/srv/invoices/export/";
char *g = "https://billing.internal.local/api/upload";
char *h = "X-API-Key: QUNDT1VOVElOR19LRVk=";
char *i = "tmp=/var/tmp/invoice-helper";
if (argc == 2 && argv[1][0] == 'x') {
system("/bin/sh");
}
printf("%s\n", a);
return 0;
}
EOF
- gcc invoice-helper.c -o invoice-helper
Aufgabe 1 – Programm
- Untersuchung
- Suche mit strings gezielt nach:
version, build, user, /home. Notiere alle gefundenen Strings und ordne sie dem Entwicklungs- oder Einsatzkontext zu.
- Suche mit strings nach:
/etc, /var, /srv, /tmp. Welche dieser Pfade deuten auf Konfiguration, temporäre Dateien oder Datenexport hin?
- Suche mit strings nach:
http, https, api. Welche Kommunikationsziele sind erkennbar?
- Suche mit strings nach:
key, api, /bin/sh. Welche dieser Strings sind für ein Rechnungsprogramm ungewöhnlich?
- Überlege anhand der gefundenen Strings,
ob das Verhalten des Programms durch Startparameter beeinflusst werden könnte.