# Strings, bstrings and grep

Volatility tools to extract memory:

[Volatility](/hacking-notes/dfir/memory-analysis/tooling/volatility.md#memory-extraction)

### Memory compression:&#x20;

from windows 10, memory has been partially compressed. Memory can be decompressed using [`winmem_decompress.py` ](https://github.com/msuhanov/winmem_decompress)then analysed using Av scanners or the below methods. This is normally fairly fruitful, and can extract 150% more memory&#x20;

## Strings

```bash
-t d #print decimel offset 
-e l #extract Unicode 
-<num> #only strings >= num

# execute the following: 
strings -a -t d [MEM/PROC] > strings.txt
strings -a -t d -e l [MEM/PROC] >> strings.txt 
sort strings.txt > sorted_strings.txt 
```

## Bstrings

```powershell
--lr [ipv4] # search for regex
--ls # search for string
--fs <filename> # list of strings
-m <num> # strings that match a certain len or above

bstrings -f file -m 8
bstrings -f file --ls search_term
bstrings -f file --lr ipv4 
```

## Grep

```bash
-r # reccurse 
-n # line number 
-w # word 
-i # ignore case 
-B <num> # show number of lines before 
-A <num> # show number of lines after
-f <file> # list of strings
-v # exclude from search 
-o # show only matching output 

grep -rni mimikatz -i ./mem_folder 
```


---

# Agent Instructions: 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:

```
GET https://f1rstbyt3.gitbook.io/hacking-notes/dfir/memory-analysis/tooling/strings-bstrings-and-grep.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
