欢迎来到 嗅灵易学

零基础也能上手的脚本技术课,一对一答疑带你入门

[原创]破壳漏洞分析(CVE-2014-6271)

[原创]破壳漏洞分析(CVE-2014-6271)

更新一下,之前静态分析代码得出的结论有问题。
新的文件大小超过了限制,上传不了。
就简单的在这里补充一下,
在调用yyparse解析成功之后程序先后三次调用了execute_command_internal函数,每次处理的command都不一样,先进入了cm_connection分支,在这个case下会调用execute_connection函数,
case cm_connection:
      exec_result = execute_connection (command, asynchronous,
                                        pipe_in, pipe_out, fds_to_close);
      break;
分析execute_connection函数可以知道,
() { :; }; echo Vulneribiltiy由于有一个‘;’被解析成了2个command,这两个command由一个connection数据结果来管理,
/* Structure used to represent the CONNECTION type. */
typedef struct connection {
  int ignore;                        /* Unused; simplifies make_command (). */
  COMMAND *first;                /* Pointer to the first command. */
  COMMAND *second;                /* Pointer to the second command. */
  int connector;                /* What separates this command from others. */
} CONNECTION;
在execute_connection中会先后再次调用execute_command_internal来执行这两个command,
/* Just call execute command on both sides. */
    case ';':
      if (ignore_return)
        {
          if (command->value.Connection->first)
            command->value.Connection->first->flags |= CMD_IGNORE_RETURN;
          if (command->value.Connection->second)
            command->value.Connection->second->flags |= CMD_IGNORE_RETURN;
        }
      QUIT;
      execute_command (command->value.Connection->first);
      QUIT;
      exec_result = execute_command_internal (command->value.Connection->second,
                                      asynchronous, pipe_in, pipe_out,
                                      fds_to_close);

      break;

注意:上传附件及图片大小不得大于30M。

⚠️ 版权声明:
本博客所有内容(含教程、源码、工具)仅供个人技术学习与研究交流使用,严禁商用、倒卖、二次分发及非法用途。
未经作者书面授权,任何组织或个人不得转载、复制或用于其他平台,违者将追究相关责任。

0 0 0 举报
复制成功