Skip to content

Commit e1d2983

Browse files
committed
Added more to the Introduction to PEDA and Pwntools section on PEDA
1 parent c0f6b7a commit e1d2983

File tree

12 files changed

+396
-18
lines changed

12 files changed

+396
-18
lines changed

Diff for: .gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
*.pyc
22
.vagrant
33
ubuntu-xenial-16.04-cloudimg-console.log
4+
.gdb_history
5+
peda-*.txt

Diff for: README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ expected of the following topics:
1717

1818
1. [Setting Up the Environment]
1919
2. How Does a Linux Binary Work?
20-
3. Introduction to PEDA and Pwntools
20+
3. [Introduction to PEDA and Pwntools]
2121
4. Classic Exploitation Theory
2222
5. Linux Binary Protections
2323
6. The Classic Exploitation Technique
@@ -33,3 +33,5 @@ expected of the following topics:
3333

3434

3535
[Setting Up The Environment]: ./lessons/1_setting_up_environment/lessonplan.md
36+
[Introduction to PEDA and Pwntools]: ./lessons/3_intro_to_tools/lessonplan.md
37+

Diff for: Vagrantfile

+7-7
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ Vagrant.configure("2") do |config|
6767
config.vm.provision "shell", inline: <<-SHELL
6868
dpkg --add-architecture i386
6969
apt-get update
70-
apt-get install -y libc6:i386 libncurses5:i386 libstdc++6:i386 gdb python python-pip libssl-dev gcc git
71-
pip install --upgrade pip
72-
pip install pwntools
73-
pip install ipython
74-
pip install ropper
75-
git clone https://github.com/longld/peda.git /home/ubuntu/peda
76-
echo "source ~/peda/peda.py" >> /home/ubuntu/.gdbinit
70+
apt-get install -y libc6:i386 libncurses5:i386 libstdc++6:i386 gdb python python-pip libssl-dev gcc git binutils socat
71+
pip install --upgrade pip
72+
pip install pwntools
73+
pip install ipython
74+
pip install ropper
75+
git clone https://github.com/longld/peda.git /home/ubuntu/peda
76+
echo "source ~/peda/peda.py" >> /home/ubuntu/.gdbinit
7777
SHELL
7878
end

Diff for: lessons/1_setting_up_environment/lessonplan.md

+50-10
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ prepare the testing environment.
1010
First, install vagrant and virtualbox. Vagrant can be downloaded from [this
1111
link](vagrantdl). Virtualbox can be downloaded from [here](virtualboxdl).
1212

13-
Next, clone the repository onto your host machine.
13+
Next, clone the repository onto your host machine. If you have messed up
14+
somewhere along the course and want to revert the state of the repository, just
15+
delete the entire directory and perform this step again.
1416

1517
```shell
1618
amon@bethany:~$ git clone https://github.com/nnamon/linux-exploitation-course.git
@@ -80,19 +82,57 @@ drwx------ 2 ubuntu ubuntu 4096 Jan 8 10:54 .ssh
8082
ubuntu@ubuntu-xenial:~$
8183
```
8284
85+
The course repository directory you clone previously will be mounted at
86+
`/vagrant` so you can use your preferred text editor.
87+
88+
## Windows Users
89+
90+
For Windows users there are two options:
91+
92+
1. Start a virtual machine containing Ubuntu 16.04 and run the provisioning
93+
script found below. Next, manually clone the course repository into the
94+
machine. Note that directory locations may be different from the code
95+
listings in the course if you go down this route. The choice of
96+
virtualisation software you choose is up to you.
97+
2. Install Vagrant and Virtualbox for Windows. This allows you to follow the
98+
instructions above almost identically.
99+
100+
One caveat with Option 2 is that your Windows Installation might not have SSH
101+
installed previously. When you invoke `vagrant ssh`, you might receive a message
102+
as follows:
103+
104+
```shell
105+
D:\linux-exploitation-course>vagrant ssh
106+
`ssh` executable not found in any directories in the %PATH% variable. Is an
107+
SSH client installed? Try installing Cygwin, MinGW or Git, all of which
108+
contain an SSH client. Or use your favorite SSH client with the following
109+
authentication information shown below:
110+
111+
Host: 127.0.0.1
112+
Port: 2222
113+
Username: ubuntu
114+
Private key:
115+
D:/linux-exploitation-course/.vagrant/machines/default/virtualbox/private_key
116+
```
117+
118+
In that case, simply follow the instructions to SSH into the newly provisioned
119+
system with an SSH client of your choice such as Putty.
120+
83121
## What Was Installed?
84122
85123
This is the entire provisioning script:
86124
87-
```ruby
88-
config.vm.provision "shell", inline: <<-SHELL
89-
dpkg --add-architecture i386
90-
apt-get update
91-
apt-get install -y libc6:i386 libncurses5:i386 libstdc++6:i386 gdb python python-pip libssl-dev gcc
92-
pip install --upgrade pip
93-
pip install pwntools
94-
pip install ipython
95-
SHELL
125+
```bash
126+
#!/bin/bash
127+
dpkg --add-architecture i386
128+
apt-get update
129+
apt-get install -y libc6:i386 libncurses5:i386 libstdc++6:i386 gdb python python-pip libssl-dev gcc git binutils
130+
pip install --upgrade pip
131+
pip install pwntools
132+
pip install ipython
133+
pip install ropper
134+
git clone https://github.com/longld/peda.git /home/ubuntu/peda
135+
echo "source ~/peda/peda.py" >> /home/ubuntu/.gdbinit
96136
```
97137
98138
[vagrantdl]: https://www.vagrantup.com/downloads.html

Diff for: lessons/3_intro_to_tools/2_interactive.c

Whitespace-only changes.

Diff for: lessons/3_intro_to_tools/Makefile

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
all: 1_sample 2_interactive
2+
3+
1_sample:
4+
gcc -o ./build/1_sample ./src/1_sample.c
5+
6+
2_interactive:
7+
gcc -o ./build/2_interactive ./src/2_interactive.c

Diff for: lessons/3_intro_to_tools/build/1_sample

8.41 KB
Binary file not shown.

Diff for: lessons/3_intro_to_tools/build/2_interactive

8.85 KB
Binary file not shown.

0 commit comments

Comments
 (0)