<commit_before>---
layout: post
title:  "Vulnhub - Brainpan3"
date:   2015-09-21 18:03:59
categories: boot2root Pwnable
---

Brainpan3 is a typical boot2root VM that we boot and attempt to gain root access. This one is a bit long, but I hope it is entertaining and informative. Strap in!

### Tools of the trade
Two toolsets are used heavily throughout this writeup:

* [Pwndbg](https://github.com/zachriggle/pwndbg) 
* [Binjitsu](https://github.com/binjitsu/binjitsu/) 

## Recon
First things first, let's see where the heck this box is on our virtual network. 

```
nmap -p- 192.168.224.0/24 -Pn --open -T5
```

```
-p- : Poke all 65536 ports
-Pn : Assume each IP address is alive
--open : Only show open ports
-T5 : Scan at the speed of Buzz Lightgear
```

We see an IP with a weird port of `1337` open.

```<commit_msg>Add recon notes<commit_after>---
layout: post
title:  "Vulnhub - Brainpan3"
date:   2015-09-21 18:03:59
categories: boot2root Pwnable
---

Brainpan3 is a typical boot2root VM that we boot and attempt to gain root access. This one is a bit long, but I hope it is entertaining and informative. Strap in!

### Tools of the trade
Two toolsets are used heavily throughout this writeup:

* [Pwndbg - Fancy GDB wrapper](https://github.com/zachriggle/pwndbg) 
* [Binjitsu - Python CTF Framework](https://github.com/binjitsu/binjitsu/) 

## Recon
First things first, let's see where the heck this box is on our virtual network. 

```
nmap -p- 192.168.224.0/24 -Pn --open -T5
```

```
-p- : Poke all 65536 ports
-Pn : Assume each IP address is alive
--open : Only show open ports
-T5 : Scan at the speed of Buzz Lightgear
```

We see an IP with a weird port of `1337` open.

```
{'fraction_non_alphanumeric': 0.11235955056179775, 'fraction_numerical': 0.04849201655824956, 'mean_word_length': 3.4643799472295513, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '517905', 'n_tokens_mistral': 655, 'n_tokens_neox': 573, 'n_words': 238}