26.07.2018 Views

hacking-the-art-of-exploitation

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

located. Then <strong>the</strong> actual bytes are shown, opposed to DWORDs, which means<br />

<strong>the</strong> bytes are reversed. Bearing this in mind, everything appears to be correct.<br />

reader@<strong>hacking</strong>:~/booksrc $ objdump -s -j .dtors ./dtors_sample<br />

./dtors_sample:<br />

file format elf32-i386<br />

Contents <strong>of</strong> section .dtors:<br />

80495ac ffffffff e8830408 00000000 ............<br />

reader@<strong>hacking</strong>:~/booksrc $<br />

An interesting detail about <strong>the</strong> .dtors section is that it is writable. An object<br />

dump <strong>of</strong> <strong>the</strong> headers will verify this by showing that <strong>the</strong> .dtors section isn’t<br />

labeled READONLY.<br />

reader@<strong>hacking</strong>:~/booksrc $ objdump -h ./dtors_sample<br />

./dtors_sample:<br />

file format elf32-i386<br />

Sections:<br />

Idx Name Size VMA LMA File <strong>of</strong>f Algn<br />

0 .interp 00000013 08048114 08048114 00000114 2**0<br />

CONTENTS, ALLOC, LOAD, READONLY, DATA<br />

1 .note.ABI-tag 00000020 08048128 08048128 00000128 2**2<br />

CONTENTS, ALLOC, LOAD, READONLY, DATA<br />

2 .hash 0000002c 08048148 08048148 00000148 2**2<br />

CONTENTS, ALLOC, LOAD, READONLY, DATA<br />

3 .dynsym 00000060 08048174 08048174 00000174 2**2<br />

CONTENTS, ALLOC, LOAD, READONLY, DATA<br />

4 .dynstr 00000051 080481d4 080481d4 000001d4 2**0<br />

CONTENTS, ALLOC, LOAD, READONLY, DATA<br />

5 .gnu.version 0000000c 08048226 08048226 00000226 2**1<br />

CONTENTS, ALLOC, LOAD, READONLY, DATA<br />

6 .gnu.version_r 00000020 08048234 08048234 00000234 2**2<br />

CONTENTS, ALLOC, LOAD, READONLY, DATA<br />

7 .rel.dyn 00000008 08048254 08048254 00000254 2**2<br />

CONTENTS, ALLOC, LOAD, READONLY, DATA<br />

8 .rel.plt 00000020 0804825c 0804825c 0000025c 2**2<br />

CONTENTS, ALLOC, LOAD, READONLY, DATA<br />

9 .init 00000017 0804827c 0804827c 0000027c 2**2<br />

CONTENTS, ALLOC, LOAD, READONLY, CODE<br />

10 .plt 00000050 08048294 08048294 00000294 2**2<br />

CONTENTS, ALLOC, LOAD, READONLY, CODE<br />

11 .text 000001c0 080482f0 080482f0 000002f0 2**4<br />

CONTENTS, ALLOC, LOAD, READONLY, CODE<br />

12 .fini 0000001c 080484b0 080484b0 000004b0 2**2<br />

CONTENTS, ALLOC, LOAD, READONLY, CODE<br />

13 .rodata 000000bf 080484e0 080484e0 000004e0 2**5<br />

CONTENTS, ALLOC, LOAD, READONLY, DATA<br />

14 .eh_frame 00000004 080485a0 080485a0 000005a0 2**2<br />

CONTENTS, ALLOC, LOAD, READONLY, DATA<br />

15 .ctors 00000008 080495a4 080495a4 000005a4 2**2<br />

CONTENTS, ALLOC, LOAD, DATA<br />

186 0x300

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!