> For the complete documentation index, see [llms.txt](https://johnermac.gitbook.io/johnermac/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://johnermac.gitbook.io/johnermac/post-exploitation/data-exfiltration/icmp/xxd.md).

# XXD

its used for converting binary data into a hex representation and vice versa. The xxd tool is primarily used for examining binary files, creating binary patches, and manipulating binary data.

### Basic Usage

Hexadecimal to binary conversion:

```css
xxd -r hexdump.txt binary_output.bin
```

Binary to hexadecimal conversion:

```css
xxd binary_input.bin hexdump.txt
```

Specifying input and output formats:

```css
xxd -g 4 binary_input.bin hexdump.txt
```

Skipping a specific number of bytes:

```css
xxd -s 16 binary_input.bin hexdump.txt
```

Limiting the number of bytes to display:

```python
xxd -l 64 binary_input.bin hexdump.txt
```

*XXD provides several other options for controlling the format and output, such as:*

* &#x20;*`-c` (or `--cols`) to specify the number of bytes per line*
* *`-e` (or `--endian`) to set the endianness*
* *`-v` (or `--version`) to display the version information*

## How to extract files using XXD

<figure><img src="https://3593245608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkPEBr0Ohu5Y49JHmv4La%2Fuploads%2FklOR0gcIRZHYadZmPJD6%2Fimage.png?alt=media&amp;token=a487b950-e903-48b0-9e03-b71009df2e4d" alt=""><figcaption><p>Send the File through PING</p></figcaption></figure>

<figure><img src="https://3593245608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkPEBr0Ohu5Y49JHmv4La%2Fuploads%2Fg7cnv2KY84OyEijbEJ8U%2Fimage.png?alt=media&amp;token=b7d0e735-64f8-45b1-a20f-ab79a54d17b2" alt=""><figcaption><p>Wireshark Results</p></figcaption></figure>
