If you already have a working environment that you used for HeapLAB Part 1, you should have
no issues using it for Part 2. No additional tools are needed,
just make sure you grab the HeapLAB_Part2.tar.gz file from this video's resources and extract
it with the command 'tar xzf', followed by the name of the archive.
Be aware that your pwntools and pwndbg versions may differ from mine,
keep watching if you want to remedy this.
When starting a new environment from scratch, I highly recommend using Ubuntu.
The course was developed on Ubuntu 20.04 but it works on 18.04 as well.
If you decide to use a different distro, it may work but I can't guarantee it and won't be able to
help if you run into problems.
I also recommend using a fresh Ubuntu install as some packages can interfere with the course material.
For example, the gtk3-nocsd package exports an LD_PRELOAD directive that can cause
crashes.
You can get the latest Ubuntu desktop image by visiting 'ubuntu.com' and clicking the download
tab at the top of the page.
You can install Ubuntu on your host or create a new a virtual machine, I'll be using an Ubuntu
20.04 VM virtualised under VMware.
Thank you to the Ubuntu maintainers for making your distro available for free.
Once your Ubuntu desktop is ready, it's time to install the pwntools, pwndbg and one-gadget tools.
Let's begin with pwntools.
You can find the pwntools GitHub page at 'github.com/gallopsled/pwntools' where simple
installation steps are detailed.
I won't go through these steps with you because guaranteed the day I published the course, they'll
change the instructions.
So just do what the GitHub page tells you.
We use relatively little pwntools functionality in this course,
so having a different version to mine shouldn't be an issue.
Nonetheless, the pwntools version I use in the videos is 4.2.2.
If you want to install that specific version, you can use the following command.
Thank you to the pwntools developers and maintainers, including Zach Riggle, for making this awesome
tool available for free.
Next, install a pwndbg.
It can be found at 'github.com/pwndbg/pwndbg' along with its own simple installation
guide.
In the videos I use pwndbg version 1.1.0, build cfe93ab.
If you want to match your version to mine, navigate to your pwndbg clone directory and check out
the appropriate version.
Thank you to the pwndbg maintainers, again, including Zach, for making it available for free.
Lastly, install one-gadget, the GitHub page is 'github.com/david942j/one _gadget'.
Note that it requires the installation of Ruby first.
Props to david942j for coming up with this great free tool.
It's still the best one gadget finder I've come across.
Once you've installed all three tools, copy the HeapLAB_Part2.tar.gz file included in this lecture's
resources into your environment.
You can download it directly or if you're working inside a VM, copy it across via a shared folder or
shared clipboard.
Extract the archive with the command 'tar xzf', followed by the name of the archive, you can extract
it anywhere you like as long as the internal directory structure remains intact.
As it did in part one, the archive contains everything we need to get started.
There's also an updated version of the HeapLAB PDF.
A separate copy of the PDF is also supplied in this lecture's resources, in case you want to browse
it outside of your environment.
Lastly, you can install a text editor or idea of your choice, just like in part one, I'll be using
vim.
Now that our environment is set up, we have everything we need to begin HeapLAB Part 2.