{"id":392,"date":"2015-08-11T13:17:22","date_gmt":"2015-08-11T05:17:22","guid":{"rendered":"http:\/\/www.huike007.cn\/?p=392"},"modified":"2015-08-11T13:17:22","modified_gmt":"2015-08-11T05:17:22","slug":"linux-bash%e6%bc%8f%e6%b4%9e%e4%bf%ae%e5%a4%8d%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"http:\/\/www.huike007.cn\/?p=392","title":{"rendered":"Linux Bash\u6f0f\u6d1e\u4fee\u590d\u65b9\u6cd5"},"content":{"rendered":"<p>\u65e5\u524dLinux\u5b98\u65b9\u5185\u7f6eBash\u4e2d\u65b0\u53d1\u73b0\u4e00\u4e2a\u975e\u5e38\u4e25\u91cd\u5b89\u5168\u6f0f\u6d1e\uff0c\u9ed1\u5ba2\u53ef\u4ee5\u5229\u7528\u8be5Bash\u6f0f\u6d1e\u5b8c\u5168\u63a7\u5236\u76ee\u6807\u7cfb\u7edf\u5e76\u53d1\u8d77\u653b\u51fb\uff0c\u4e3a\u4e86\u907f\u514d\u60a8Linux\u670d\u52a1\u5668\u53d7\u5f71\u54cd\uff0c\u5efa\u8bae\u60a8\u5c3d\u5feb\u5b8c\u6210\u6f0f\u6d1e\u4fee\u8865\uff0c\u4fee\u590d\u65b9\u6cd5\u5982\u4e0b\uff1a<br \/>\n\u6f0f\u6d1e\u68c0\u6d4b\u65b9\u6cd5<br \/>\n\u53ef\u4ee5\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u6765\u68c0\u67e5\u7cfb\u7edf\u5b58\u5728\u6b64\u6f0f\u6d1e\uff1a<br \/>\nenv x='() { :;}; echo vulnerable&#8217; bash -c &#8220;echo this is a test&#8221;<br \/>\n\u4fee\u590d\u524d<br \/>\n\u8f93\u51fa\uff1a<br \/>\nvulnerable<br \/>\nthis is a test<br \/>\n\u4f7f\u7528\u4fee\u8865\u65b9\u6848\u4fee\u590d\u540e<br \/>\nbash: warning: x: ignoring function definition attempt<br \/>\nbash: error importing function definition for `x<br \/>\nthis is a test<br \/>\n\u7279\u522b\u63d0\u793a\uff1a\u8be5\u4fee\u590d\u4e0d\u4f1a\u6709\u4efb\u4f55\u5f71\u54cd\uff0c\u5982\u679c\u60a8\u7684\u811a\u672c\u4f7f\u7528\u4ee5\u4e0a\u65b9\u5f0f\u5b9a\u4e49\u73af\u5883\u53d8\u91cf\uff0c\u4fee\u590d\u540e\u60a8\u7684\u811a\u672c\u6267\u884c\u4f1a\u62a5\u9519\u3002<br \/>\n\u5efa\u8bae\u4fee\u8865\u65b9\u6848<br \/>\n<strong>centos:<\/strong><br \/>\nyum -y update bash<br \/>\n<strong>ubuntu:<\/strong><br \/>\n14.04 64bit<br \/>\nwget<span class=\"Apple-converted-space\"><span style=\"font-family: Verdana;\">?<\/span><\/span><a href=\"http:\/\/mirrors.aliyun.com\/fix_stuff\/bash_4.3-7ubuntu1.1_amd64.deb\" target=\"_blank\" rel=\"external\">http:\/\/mirrors.aliyun.com\/fix_stuff\/bash_4.3-7ubuntu1.1_amd64.deb<\/a><span style=\"font-family: Verdana;\"><span class=\"Apple-converted-space\">?<\/span>&amp;&amp; dpkg -i bash_4.3-7ubuntu1.1_amd64.deb<\/span><span class=\"Apple-converted-space\"><span style=\"font-family: Verdana;\">?<\/span><\/span><br \/>\n14.04 32bit<span class=\"Apple-converted-space\"><span style=\"font-family: Verdana;\">?<\/span><\/span><br \/>\nwget<span class=\"Apple-converted-space\"><span style=\"font-family: Verdana;\">?<\/span><\/span><a href=\"http:\/\/mirrors.aliyun.com\/fix_stuff\/bash_4.3-7ubuntu1.1_i386.deb\" target=\"_blank\" rel=\"external\">http:\/\/mirrors.aliyun.com\/fix_stuff\/bash_4.3-7ubuntu1.1_i386.deb<\/a><span style=\"font-family: Verdana;\"><span class=\"Apple-converted-space\">?<\/span>&amp;&amp; dpkg -i??bash_4.3-7ubuntu1.1_i386.deb<\/span><span class=\"Apple-converted-space\"><span style=\"font-family: Verdana;\">?<\/span><\/span><br \/>\n12.04 64bit<span class=\"Apple-converted-space\"><span style=\"font-family: Verdana;\">?<\/span><\/span><br \/>\nwget<span class=\"Apple-converted-space\"><span style=\"font-family: Verdana;\">?<\/span><\/span><a href=\"http:\/\/mirrors.aliyun.com\/fix_stuff\/bash_4.2-2ubuntu2.2_amd64.deb\" target=\"_blank\" rel=\"external\">http:\/\/mirrors.aliyun.com\/fix_stuff\/bash_4.2-2ubuntu2.2_amd64.deb<\/a><span style=\"font-family: Verdana;\"><span class=\"Apple-converted-space\">?<\/span>&amp;&amp; dpkg -i??bash_4.2-2ubuntu2.2_amd64.deb<\/span><span class=\"Apple-converted-space\"><span style=\"font-family: Verdana;\">?<\/span><\/span><br \/>\n12.04 32bit<span class=\"Apple-converted-space\"><span style=\"font-family: Verdana;\">?<\/span><\/span><br \/>\nwget<span class=\"Apple-converted-space\"><span style=\"font-family: Verdana;\">?<\/span><\/span><a href=\"http:\/\/mirrors.aliyun.com\/fix_stuff\/bash_4.2-2ubuntu2.2_i386.deb\" target=\"_blank\" rel=\"external\">http:\/\/mirrors.aliyun.com\/fix_stuff\/bash_4.2-2ubuntu2.2_i386.deb<\/a><span style=\"font-family: Verdana;\"><span class=\"Apple-converted-space\">?<\/span>&amp;&amp; dpkg -i??bash_4.2-2ubuntu2.2_i386.deb<\/span><span class=\"Apple-converted-space\"><span style=\"font-family: Verdana;\">?<\/span><\/span><br \/>\n10.10 64bit<span class=\"Apple-converted-space\"><span style=\"font-family: Verdana;\">?<\/span><\/span><br \/>\nwget<span class=\"Apple-converted-space\"><span style=\"font-family: Verdana;\">?<\/span><\/span><a href=\"http:\/\/mirrors.aliyun.com\/fix_stuff\/bash_4.1-2ubuntu3.1_amd64.deb\" target=\"_blank\" rel=\"external\">http:\/\/mirrors.aliyun.com\/fix_stuff\/bash_4.1-2ubuntu3.1_amd64.deb<\/a><span style=\"font-family: Verdana;\"><span class=\"Apple-converted-space\">?<\/span>&amp;&amp; dpkg -i bash_4.1-2ubuntu3.1_amd64.deb<\/span><span class=\"Apple-converted-space\"><span style=\"font-family: Verdana;\">?<\/span><\/span><br \/>\n10.10 32bit<span class=\"Apple-converted-space\"><span style=\"font-family: Verdana;\">?<\/span><\/span><br \/>\nwget<span class=\"Apple-converted-space\"><span style=\"font-family: Verdana;\">?<\/span><\/span><a href=\"http:\/\/mirrors.aliyun.com\/fix_stuff\/bash_4.1-2ubuntu3.1_i386.deb\" target=\"_blank\" rel=\"external\">http:\/\/mirrors.aliyun.com\/fix_stuff\/bash_4.1-2ubuntu3.1_i386.deb<\/a><span style=\"font-family: Verdana;\"><span class=\"Apple-converted-space\">?<\/span>&amp;&amp; dpkg -i bash_4.1-2ubuntu3.1_i386.deb<\/span><span class=\"Apple-converted-space\"><span style=\"font-family: Verdana;\">?<\/span><\/span><br \/>\n<strong>debian:<\/strong><br \/>\n7.5 64bit &amp;&amp; 32bit<span class=\"Apple-converted-space\"><span style=\"font-family: Verdana;\">?<\/span><\/span><br \/>\napt-get -y install &#8211;only-upgrade bash<br \/>\n6.0.x 64bit<span class=\"Apple-converted-space\"><span style=\"font-family: Verdana;\">?<\/span><\/span><br \/>\nwget<span class=\"Apple-converted-space\"><span style=\"font-family: Verdana;\">?<\/span><\/span><a href=\"http:\/\/mirrors.aliyun.com\/debian\/pool\/main\/b\/bash\/bash_4.1-3%2bdeb6u1_amd64.deb\" target=\"_blank\" rel=\"external\">http:\/\/mirrors.aliyun.com\/debian\/pool\/main\/b\/bash\/bash_4.1-3%2bdeb6u1_amd64.deb<\/a><span style=\"font-family: Verdana;\"><span class=\"Apple-converted-space\">?<\/span>&amp;&amp;??dpkg -i bash_4.1-3+deb6u1_amd64.deb<\/span><span class=\"Apple-converted-space\"><span style=\"font-family: Verdana;\">?<\/span><\/span><br \/>\n6.0.x 32bit<span class=\"Apple-converted-space\"><span style=\"font-family: Verdana;\">?<\/span><\/span><br \/>\nwget<span class=\"Apple-converted-space\"><span style=\"font-family: Verdana;\">?<\/span><\/span><a href=\"http:\/\/mirrors.aliyun.com\/debian\/pool\/main\/b\/bash\/bash_4.1-3%2bdeb6u1_i386.deb\" target=\"_blank\" rel=\"external\">http:\/\/mirrors.aliyun.com\/debian\/pool\/main\/b\/bash\/bash_4.1-3%2bdeb6u1_i386.deb<\/a><span style=\"font-family: Verdana;\"><span class=\"Apple-converted-space\">?<\/span>&amp;&amp;??dpkg -i bash_4.1-3+deb6u1_i386.deb<\/span><span class=\"Apple-converted-space\"><span style=\"font-family: Verdana;\">?<\/span><\/span><br \/>\n<strong>opensuse:<\/strong><br \/>\n13.1 64bit<span class=\"Apple-converted-space\"><span style=\"font-family: Verdana;\">?<\/span><\/span><br \/>\nwget<span class=\"Apple-converted-space\"><span style=\"font-family: Verdana;\">?<\/span><\/span><a href=\"http:\/\/mirrors.aliyun.com\/fix_stuff\/bash-4.2-68.4.1.x86_64.rpm\" target=\"_blank\" rel=\"external\">http:\/\/mirrors.aliyun.com\/fix_stuff\/bash-4.2-68.4.1.x86_64.rpm<\/a><span style=\"font-family: Verdana;\"><span class=\"Apple-converted-space\">?<\/span>&amp;&amp; rpm -Uvh bash-4.2-68.4.1.x86_64.rpm<\/span><span class=\"Apple-converted-space\"><span style=\"font-family: Verdana;\">?<\/span><\/span><br \/>\n13.1 32bit<span class=\"Apple-converted-space\"><span style=\"font-family: Verdana;\">?<\/span><\/span><br \/>\nwget<span class=\"Apple-converted-space\"><span style=\"font-family: Verdana;\">?<\/span><\/span><a href=\"http:\/\/mirrors.aliyun.com\/fix_stuff\/bash-4.2-68.4.1.i586.rpm\" target=\"_blank\" rel=\"external\">http:\/\/mirrors.aliyun.com\/fix_stuff\/bash-4.2-68.4.1.i586.rpm<\/a><span style=\"font-family: Verdana;\"><span class=\"Apple-converted-space\">?<\/span>&amp;&amp; rpm -Uvh bash-4.2-68.4.1.i586.rpm<\/span><span class=\"Apple-converted-space\"><span style=\"font-family: Verdana;\">?<\/span><\/span><br \/>\n<strong>aliyun linux:<\/strong><br \/>\n5.x 64bit<span class=\"Apple-converted-space\"><span style=\"font-family: Verdana;\">?<\/span><\/span><br \/>\nwget<span class=\"Apple-converted-space\"><span style=\"font-family: Verdana;\">?<\/span><\/span><a href=\"http:\/\/mirrors.aliyun.com\/centos\/5\/up\" target=\"_blank\" rel=\"external\">http:\/\/mirrors.aliyun.com\/centos\/5\/up<\/a>dates\/x86_64\/RPMS\/bash-3.2-33.el5.1.x86_64.rpm &amp;&amp; rpm -Uvh bash-3.2-33.el5.1.x86_64.rpm<br \/>\n5.x 32bit<span class=\"Apple-converted-space\"><span style=\"font-family: Verdana;\">?<\/span><\/span><br \/>\nwget<span class=\"Apple-converted-space\"><span style=\"font-family: Verdana;\">?<\/span><\/span><a href=\"http:\/\/mirrors.aliyun.com\/centos\/5\/up\" target=\"_blank\" rel=\"external\">http:\/\/mirrors.aliyun.com\/centos\/5\/up<\/a>dates\/i386\/RPMS\/bash-3.2-33.el5.1.i386.rpm &amp;&amp; rpm -Uvh bash-3.2-33.el5.1.i386.rpm<span class=\"Apple-converted-space\"><span style=\"font-family: Verdana;\">?<\/span><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u65e5\u524dLinux\u5b98\u65b9\u5185\u7f6eBash\u4e2d\u65b0\u53d1\u73b0\u4e00\u4e2a\u975e\u5e38\u4e25\u91cd\u5b89\u5168\u6f0f\u6d1e\uff0c\u9ed1\u5ba2\u53ef\u4ee5\u5229\u7528\u8be5Bash\u6f0f\u6d1e\u5b8c\u5168\u63a7\u5236\u76ee\u6807\u7cfb\u7edf\u5e76\u53d1\u8d77\u653b [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[180,178],"tags":[349],"_links":{"self":[{"href":"http:\/\/www.huike007.cn\/index.php?rest_route=\/wp\/v2\/posts\/392"}],"collection":[{"href":"http:\/\/www.huike007.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.huike007.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.huike007.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.huike007.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=392"}],"version-history":[{"count":1,"href":"http:\/\/www.huike007.cn\/index.php?rest_route=\/wp\/v2\/posts\/392\/revisions"}],"predecessor-version":[{"id":393,"href":"http:\/\/www.huike007.cn\/index.php?rest_route=\/wp\/v2\/posts\/392\/revisions\/393"}],"wp:attachment":[{"href":"http:\/\/www.huike007.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=392"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.huike007.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=392"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.huike007.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=392"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}