{"id":1466,"date":"2008-11-17T22:43:00","date_gmt":"2008-11-17T13:43:00","guid":{"rendered":"https:\/\/hdmr.org\/d\/?e=188"},"modified":"2008-11-17T22:43:00","modified_gmt":"2008-11-17T13:43:00","slug":"blogn-188","status":"publish","type":"post","link":"https:\/\/hdmr.org\/d\/?e=188","title":{"rendered":"CGI\u7248PHP\u306f\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u5411\u4e0a\u306b\u5f79\u7acb\u3064\u306e?"},"content":{"rendered":"<p>\u305d\u3046\u3044\u3048\u3070PHP6\u304b\u3089\u30bb\u30fc\u30d5\u30e2\u30fc\u30c9\u304c\u5ec3\u6b62\u3055\u308c\u308b\u305d\u3046\u3067\u3059\u306d\u3002<br \/>PHP\u3092Apache\u306b\u7d44\u307f\u8fbc\u3093\u3067\u52d5\u4f5c\u3055\u305b\u308b\u5834\u5408\u3001<br \/>\u4f55\u3067\u3082\u304b\u3093\u3067\u3082apache\u30e6\u30fc\u30b6\u30fc\u306a\u3069Apache\u306e\u52d5\u4f5c\u3059\u308b\u30e6\u30fc\u30b6\u30fc\u3067\u52d5\u4f5c\u3059\u308b\u3002<br \/>\u307e\u3041\u305d\u3046\u3044\u3046\u610f\u5473\u3067\u306f\u3042\u308b\u7a0b\u5ea6\u5b89\u5fc3\u3068\u8a00\u3048\u307e\u3059\u306d\u3002<br \/>\u3051\u3069\u3001\u3053\u308c\u3067\u3044\u308d\u3044\u308d\u5b9f\u9a13\u3057\u3066\u305f\u306e\u3060\u304c\u3001\u591a\u4eba\u6570\u3067\u5171\u6709\u3059\u308b\u30b5\u30fc\u30d0\u30fc\u3067\u306f\u554f\u984c\u304c\u3042\u308b\u3002<br \/>\/home\/foo\/public_html\/foo.txt\u3068\u3044\u3046\u306e\u3092\u7f6e\u3044\u3066\u304a\u304f\u3001<br \/>\u3053\u308c\u306fPHP\u304b\u3089\u6539\u5909\u51fa\u6765\u308b\u3088\u3046\u306b\u3068\u3001\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u3092666\u3068\u3057\u3066\u304a\u304f\u308f\u3051\u3060\u3002<br \/>\u3068\u3053\u308d\u304c\u3001\u3053\u3053\u3067\/home\/bar\/public_html\/hack.php\u3068\u3044\u3046\u306e\u3092\u4f5c\u308b\u3002<\/p>\n<pre>&lt;?<br \/>$fh=fopen('\/home\/foo\/public_html\/foo.txt','a') or die('\u00d7');<br \/>fwrite($fh,'Hack!!') and print('\u25cb');<br \/>fclose($fh);<br \/>?&gt;<\/pre>\n<p>\u3059\u308b\u3068\u6539\u5909\u3067\u304d\u3066\u3057\u307e\u3046\u3002\u3053\u308c\u306f\u56f0\u308b!!<br \/>\u3068\u3044\u3046\u308f\u3051\u3067\u3053\u3046\u3044\u3046\u3053\u3068\u3092\u9632\u3050\u305f\u3081\u306b\u30bb\u30fc\u30d5\u30e2\u30fc\u30c9\u304c\u3042\u308b\u308f\u3051\u3060\u3002<br \/>PHP\u30d5\u30a1\u30a4\u30eb\u3068\u64cd\u4f5c\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u306e\u6240\u6709\u8005\u304c\u4e00\u7dd2\u3067\u3042\u308b\u304b\u78ba\u8a8d\u3059\u308b\u3068\u304b\u3001\u5371\u967a\u306a\u95a2\u6570\u306e\u5236\u9650\u3068\u304b\u3002<br \/>\u3068\u3044\u3046\u308f\u3051\u3067\u5171\u6709\u30b5\u30fc\u30d0\u30fc\u3067\u306f\u3088\u304f\u4f7f\u308f\u308c\u3066\u3044\u308b\u624b\u6bb5\u3067\u3059\u3002<\/p>\n<hr \/>\n<p>CGI\u3067\u306f\u3069\u3046\u3057\u3066\u308b\u306e\u304b\u3068\u3044\u3046\u8a71\u3060\u304c\u3001SuExec\u3068\u3044\u3046\u4ed5\u7d44\u307f\u3067\u3084\u3063\u3066\u308b\u3002<br \/>CGI\u306e\u5b9f\u884c\u3092\u3042\u308b\u30e6\u30fc\u30b6\u30fc\u3067\u5b9f\u884c\u3059\u308b\u3068\u3002<br \/>\u3069\u3046\u3082CentOS\u306eApache\u3067\u306f\u5404\u30e6\u30fc\u30b6\u30fc\u306epublic_html\u306b\u3064\u3044\u3066\u306f\u5404\u30e6\u30fc\u30b6\u30fc\u3067\u5b9f\u884c\u3055\u305b\u308b\u3068\u3002<br \/>\u3053\u3046\u306a\u3063\u3066\u308b\u3089\u3057\u3044\u3002\u3042\u308a\u304c\u305f\u3044\u8a71\u3060\u3002<br \/>\u306a\u306e\u3067\u305d\u308c\u306b\u5fdc\u3058\u305f\u8a2d\u5b9a\u306b\u3057\u3066\u6b32\u3057\u3044\u3068\u3002<br \/>\u3059\u306a\u308f\u3061CGI\u304b\u3089\u8aad\u307f\u66f8\u304d\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u306f\u4ed6\u4eba\u304b\u3089\u30a2\u30af\u30bb\u30b9\u51fa\u6765\u308b\u3088\u3046\u306b\u3057\u306a\u3044\u3068\u3002<br \/>\u307e\u3041\u3069\u3046\u3082\u305d\u3046\u3044\u3046\u3053\u3068\u3089\u3057\u3044\u3002<\/p>\n<hr \/>\n<p>\u306a\u3093\u304b\u3053\u308c\u898b\u3066\u308b\u3068PHP\u3068CGI\u306e\u5171\u5b58\u304c\u5371\u967a\u306a\u6c17\u304c\u3057\u3066\u304d\u305f\u3002<br \/>\u3059\u306a\u308f\u3061PHP\u306e\u5404\u30e6\u30fc\u30b6\u30fc\u306e\u6a29\u9650\u3067\u5b9f\u884c\u3059\u308b\u3079\u304d\u3067\u306f\u3068\u3044\u3046\u3053\u3068\u3002<br \/>\u3042\u304f\u307e\u3067\u3082PHP\u306e\u30bb\u30fc\u30d5\u30e2\u30fc\u30c9\u306f\u81ea\u4e3b\u898f\u5236\u3068\u3082\u8a00\u3046\u3079\u304d\u5185\u5bb9\u3002<br \/>\u5b8c\u74a7\u306a\u3093\u3066\u3042\u308a\u3048\u306a\u3044\u3002<br \/>\u305d\u306e\u5834\u5408\u8003\u3048\u3089\u308c\u308b\u306e\u306fFastCGI+CGI\u7248PHP\u3002<br \/>\u4e00\u5fdc\u30bb\u30fc\u30d5\u30e2\u30fc\u30c9\u306e\u4ee3\u66ff\u6848\u3068\u3057\u3066\u3082\u3063\u3068\u3082\u6709\u529b\u306a\u65b9\u6cd5\u3067\u3059\u3002<br \/>CGI\u3060\u3063\u305f\u3089PHP\u306e\u3044\u3061\u3044\u3061\u8d77\u52d5\u3057\u306a\u304f\u3066\u3082\u3088\u3044\u306e\u3067\u9ad8\u901f\u3068\u3044\u3046\u30e1\u30ea\u30c3\u30c8\u304c\u306a\u304f\u306a\u308b\u306e\u3067\u306f?<br \/>\u3068\u601d\u3046\u306e\u3060\u304c\u3001\u3069\u3046\u3082FastCGI\u4e0a\u3067PHP\u3092\u52d5\u4f5c\u3055\u305b\u305f\u3068\u304d\u306f\u3061\u3087\u3063\u3068\u90fd\u5408\u304c\u9055\u3046\u3089\u3057\u3044\u3002<br \/>\u3069\u3046\u3082PHP\u306e\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\u304c\u5e38\u99d0\u3059\u308b\u3089\u3057\u3044\u3002<br \/>\u4ed6\u306f\u305d\u306eCGI\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u5e38\u99d0\u3059\u308b\u3089\u3057\u3044\u3002<br \/>\u3068\u89e3\u3057\u305f\u304c\u8a73\u7d30\u4e0d\u660e\u3002<br \/>\u305f\u3060FastCGI\u3067PHP\u3092\u52d5\u304b\u3059\u5206\u306b\u306f\u307b\u3068\u3093\u3069mod_php5\u3068\u4e8b\u60c5\u306f\u5909\u308f\u3089\u306a\u3044\u3089\u3057\u3044\u3002<br \/>\u304d\u3061\u3093\u3068\u8a2d\u5b9a\u3092\u3059\u308c\u3070\u3001\u305f\u3060\u305d\u306e\u30e6\u30fc\u30b6\u30fc\u6a29\u9650\u3067\u52d5\u304fPHP\u306b\u306a\u308b\u306f\u305a\u3002<br \/>\u3053\u308c\u306f\u8abf\u3079\u3066\u307f\u308b\u4fa1\u5024\u304c\u3042\u308a\u305d\u3046\u3067\u3059\u306d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u305d\u3046\u3044\u3048\u3070PHP6\u304b\u3089\u30bb\u30fc\u30d5\u30e2\u30fc\u30c9\u304c\u5ec3\u6b62\u3055\u308c\u308b\u305d\u3046\u3067\u3059\u306d\u3002PHP\u3092Apache\u306b\u7d44\u307f\u8fbc\u3093\u3067\u52d5\u4f5c\u3055\u305b\u308b\u5834\u5408\u3001\u4f55\u3067\u3082\u304b\u3093\u3067\u3082apache\u30e6\u30fc\u30b6\u30fc\u306a\u3069Apache\u306e\u52d5\u4f5c\u3059\u308b\u30e6\u30fc\u30b6\u30fc\u3067\u52d5\u4f5c\u3059\u308b\u3002\u307e\u3041\u305d\u3046\u3044\u3046\u610f\u5473\u3067\u306f\u3042\u308b\u7a0b\u5ea6\u5b89\u5fc3\u3068 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-1466","post","type-post","status-publish","format-standard","hentry","category-computer"],"_links":{"self":[{"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=\/wp\/v2\/posts\/1466","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1466"}],"version-history":[{"count":0,"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=\/wp\/v2\/posts\/1466\/revisions"}],"wp:attachment":[{"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1466"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1466"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1466"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}