{"id":286333,"date":"2017-05-15T11:05:02","date_gmt":"2017-05-15T07:05:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=286333"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2017-05-15T07:05:02","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=286333","title":{"rendered":"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 JPEG \u0438\u0437 \u043d\u0438\u043e\u0442\u043a\u0443\u0434\u0430"},"content":{"rendered":"<p>\u0412\u043e\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 <a href=\"http:\/\/code.google.com\/p\/american-fuzzy-lop\">afl<\/a>; \u043c\u0435\u043d\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u0443\u0434\u0438\u0432\u0438\u043b\u043e, \u0447\u0442\u043e \u043e\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442!<\/p>\n<p>  <code>$ mkdir in_dir<br \/>  $ echo 'hello' &gt;in_dir\/hello<br \/>  $ .\/afl-fuzz -i in_dir -o out_dir .\/jpeg-9a\/djpeg<\/code> <\/p>\n<p>  \u0412 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438, \u044f \u0441\u043e\u0437\u0434\u0430\u043b \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043e \u0441\u043b\u043e\u0432\u043e\u043c &quot;hello&quot; \u0438 \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b \u0444\u0430\u0437\u0437\u0435\u0440 \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u043e\u0442\u043e\u043a \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0436\u0438\u0434\u0430\u0435\u0442 \u043d\u0430 \u0432\u0445\u043e\u0434\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 JPEG (<i>djpeg<\/i> \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0434\u0451\u0442 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u043e\u0439 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 <i><a href=\"http:\/\/www.ijg.org\/\">IJG jpeg<\/a><\/i>; <i><a href=\"http:\/\/libjpeg-turbo.virtualgl.org\/\">libjpeg-turbo<\/a><\/i> \u0442\u043e\u0436\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u043e\u0434\u043e\u0439\u0442\u0438). \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043c\u043e\u0438 \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0435 \u043f\u043e\u0445\u043e\u0436\u0438 \u043d\u0430 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u0442\u0430\u043a \u0447\u0442\u043e \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u0431\u044b\u0441\u0442\u0440\u043e \u043e\u0442\u0432\u0435\u0440\u0433\u0430\u0435\u0442 \u0438\u0445:<\/p>\n<p>  <code>$ .\/djpeg '..\/out_dir\/queue\/id:000000,orig:hello'<br \/>  Not a JPEG file: starts with 0x68 0x65<\/code> <br \/>  <a name=\"habracut\"><\/a><br \/>  \u041e\u0431\u044b\u0447\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u0444\u0430\u0437\u0437\u0438\u043d\u0433 \u0431\u044b\u043b \u0431\u044b \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u044b\u043c: \u043f\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443, \u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0448\u0430\u043d\u0441\u043e\u0432, \u0447\u0442\u043e \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0439 \u0444\u0430\u0437\u0437\u0435\u0440 \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u0441\u043b\u043e\u0432\u043e &quot;hello&quot; \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 JPEG. \u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0434\u0435\u0441\u044f\u0442\u043a\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0432\u044b\u0441\u0442\u0440\u043e\u044f\u0442\u0441\u044f \u0434\u0440\u0443\u0433 \u0437\u0430 \u0434\u0440\u0443\u0433\u043e\u043c, \u0430\u0441\u0442\u0440\u043e\u043d\u043e\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u043c\u0430\u043b\u0430.<\/p>\n<p>  \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, <i>afl-fuzz<\/i> \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0441\u0432\u043e\u0438\u0445 \u0446\u0435\u043b\u044f\u0445 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0430 \u2014 \u0438 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u044b \u0438\u043b\u0438 \u043e\u043a\u043e\u043b\u043e \u0442\u043e\u0433\u043e \u043e\u043d \u0437\u0430\u043c\u0435\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0445\u043e\u0442\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0431\u0430\u0439\u0442\u0430 \u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <i>0xff<\/i> \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u0432\u043d\u0435\u0448\u043d\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u044b\u0439 \u0432\u044b\u0432\u043e\u0434, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u043d\u043e\u0439 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u043f\u0443\u0442\u044c \u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u041e\u0431\u043b\u0430\u0434\u0430\u044f \u044d\u0442\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439, \u043e\u043d \u0440\u0435\u0448\u0430\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u043a\u0430\u043a \u043e\u0441\u043d\u043e\u0432\u0443 \u0434\u043b\u044f \u0431\u0443\u0434\u0443\u0449\u0438\u0445 \u0440\u0430\u0443\u043d\u0434\u043e\u0432 \u0444\u0430\u0437\u0437\u0438\u043d\u0433\u0430:<\/p>\n<p>  <code>$ .\/djpeg '..\/out_dir\/queue\/id:000001,src:000000,op:int8,pos:0,val:-1,+cov'<br \/>  Not a JPEG file: starts with 0xff 0x65<\/code> <\/p>\n<p>  \u041e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044f \u0437\u0430\u0442\u0435\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u043e\u043a\u043e\u043b\u0435\u043d\u0438\u044f, \u0444\u0430\u0437\u0437\u0435\u0440 \u043f\u043e\u0447\u0442\u0438 \u0441\u0440\u0430\u0437\u0443 \u0437\u0430\u043c\u0435\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0430\u0439\u0442\u0430 \u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <i>0xd8<\/i> \u0434\u0435\u043b\u0430\u0435\u0442 \u043d\u0435\u0447\u0442\u043e \u0434\u0430\u0436\u0435 \u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435:<\/p>\n<p>  <code>$ .\/djpeg '..\/out_dir\/queue\/id:000004,src:000001,op:havoc,rep:16,+cov'<br \/>  Premature end of JPEG file<br \/>  JPEG datastream contains no image<\/code> <\/p>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0444\u0430\u0437\u0437\u0435\u0440 \u0443\u043c\u0443\u0434\u0440\u0438\u043b\u0441\u044f \u0441\u0438\u043d\u0442\u0435\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0444\u0430\u0439\u043b\u0430 \u2014 \u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u043d\u044f\u043b \u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u044c. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0442\u0430\u043a\u0443\u044e \u0432\u044b\u0434\u0430\u0447\u0443 \u043a\u0430\u043a \u043e\u0441\u043d\u043e\u0432\u0443 \u0434\u043b\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0440\u0430\u0443\u043d\u0434\u0430 \u0444\u0430\u0437\u0437\u0438\u043d\u0433\u0430, \u043e\u043d \u0431\u044b\u0441\u0442\u0440\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043f\u043e\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f \u0432\u0441\u0451 \u0433\u043b\u0443\u0431\u0436\u0435 \u0438 \u0433\u043b\u0443\u0431\u0436\u0435 \u0432 \u0441\u0443\u0442\u044c. \u0427\u0435\u0440\u0435\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043e\u0442\u0435\u043d \u043f\u043e\u043a\u043e\u043b\u0435\u043d\u0438\u0439 \u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043e\u0442\u0435\u043d \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u043e\u0432 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 <i>execve()<\/i> \u043e\u043d \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u0432\u0441\u0451 \u0431\u043e\u043b\u044c\u0448\u0435 \u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b \u0434\u043b\u044f \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 JPEG \u2014 SOF&#8217;\u044b, \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0425\u0430\u0444\u0444\u043c\u0430\u043d\u0430, \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043a\u0432\u0430\u043d\u0442\u043e\u0432\u0430\u043d\u0438\u044f, \u043c\u0430\u0440\u043a\u0435\u0440\u044b SOS \u0438 \u0442.\u00a0\u0434.:<\/p>\n<p>  <code>$ .\/djpeg '..\/out_dir\/queue\/id:000008,src:000004,op:havoc,rep:2,+cov'<br \/>  Invalid JPEG file structure: two SOI markers<br \/>  ...<br \/>  $ .\/djpeg '..\/out_dir\/queue\/id:001005,src:000262+000979,op:splice,rep:2'<br \/>  Quantization table 0x0e was not defined<br \/>  ...<br \/>  $ .\/djpeg '..\/out_dir\/queue\/id:001282,src:001005+001270,op:splice,rep:2,+cov' &gt;.tmp; ls -l .tmp<br \/>  -rw-r--r-- 1 lcamtuf lcamtuf 7069 Nov 7 09:29 .tmp<\/code> <\/p>\n<p>  \u041f\u0435\u0440\u0432\u0430\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0430\u044f \u0447\u0435\u0440\u0435\u0437 \u0448\u0435\u0441\u0442\u044c \u0447\u0430\u0441\u043e\u0432 \u0444\u0430\u0437\u0437\u0438\u043d\u0433\u0430 \u043d\u0430 8-\u044f\u0434\u0435\u0440\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u0435\u0441\u044c\u043c\u0430 \u0441\u043a\u0440\u043e\u043c\u043d\u043e: \u044d\u0442\u043e \u0447\u0438\u0441\u0442\u044b\u0439 \u0441\u0435\u0440\u044b\u0439 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a \u0432\u044b\u0441\u043e\u0442\u043e\u0439 3\u00a0\u043f\u0438\u043a\u0441\u0435\u043b\u044f \u0438 \u0448\u0438\u0440\u0438\u043d\u043e\u0439 748\u00a0\u043f\u0438\u043a\u0441\u0435\u043b\u0435\u0439. \u041d\u043e \u0441 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u0435\u0451 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u0444\u0430\u0437\u0437\u0435\u0440 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u043a\u0430\u043a \u043e\u0441\u043d\u043e\u0432\u0443 \u2014 \u0438 \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u0448\u0438\u0440\u043e\u043a\u0438\u0439 \u0441\u043f\u0435\u043a\u0442\u0440 \u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0443\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/295\/d9c\/cdb\/295d9ccdbcef6a6dab38a1021ea75eff.jpg\"\/><\/p>\n<p>  \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0441\u0438\u043d\u0442\u0435\u0437 \u043f\u043e\u043b\u043d\u043e\u0433\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438\u0437 \u043d\u0438\u043e\u0442\u043a\u0443\u0434\u0430 \u2014 \u044d\u0442\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439, \u0438 \u0432\u0440\u044f\u0434 \u043b\u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435. \u041d\u043e \u0432 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0437\u0430\u0438\u0447\u043d\u044b\u0445 \u0446\u0435\u043b\u044f\u0445 \u0444\u0430\u0437\u0437\u0435\u0440\u044b \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442 \u0434\u043b\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043b\u044e\u0431\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435. \u041e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043e\u0441\u043d\u0430\u0441\u0442\u043a\u043e\u0439, \u044d\u0432\u043e\u043b\u044e\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0437\u0437\u0438\u043d\u0433 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043c\u0435\u043d\u0435\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, JPEG \u0441 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0438\u0432\u043d\u044b\u043c \u0438\u043b\u0438 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c, \u0447\u0451\u0440\u043d\u043e-\u0431\u0435\u043b\u044b\u0435 JPEG) \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0443 \u0433\u0438\u0433\u0430\u043d\u0442\u0441\u043a\u043e\u043c\u0443 \u0432\u044b\u0441\u043e\u043a\u043e\u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c\u0443 \u043a\u043e\u0440\u043f\u0443\u0441\u0443 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0444\u0430\u0437\u0437\u0438\u043d\u0433.<\/p>\n<p>  \u0417\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043b\u0443\u0447\u0430\u044f \u0441 <i>libjpeg<\/i> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e, \u0447\u0442\u043e \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u0435\u0437 \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438: \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 &quot;hello&quot; \u043d\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0433\u043e, \u0444\u0430\u0437\u0437\u0435\u0440 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u0442 \u043e \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u043e\u043d \u043d\u0435 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0438 \u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u0441 \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439. \u041d\u0435\u0442 \u0434\u0430\u0436\u0435 \u043a\u0430\u043a\u0438\u0445-\u0442\u043e \u043a\u043b\u044e\u0447\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0442\u0440\u0430\u0432\u0438\u0442\u044c <i>afl-fuzz<\/i> \u043d\u0430 \u043c\u043d\u043e\u0433\u0438\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u0432\u0438\u0434\u044b \u043f\u0430\u0440\u0441\u0435\u0440\u043e\u0432 \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u0436\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438: \u0441 <i>bash<\/i> \u043e\u043d \u0431\u0443\u0434\u0435\u0442 <a href=\"http:\/\/lcamtuf.blogspot.com\/2014\/10\/bash-bug-how-we-finally-cracked.html\">\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b<\/a>; \u0441 <i>giflib<\/i> \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c GIF&#8217;\u044b; \u0441 <i>fileutils<\/i> \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u0444\u0430\u0439\u043b\u044b ELF \u0438 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0444\u043b\u0430\u0433\u0438, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0438 \u0434\u043b\u044f Atari 68xxx, \u0437\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u044b\u0435 \u0441\u0435\u043a\u0442\u043e\u0440\u044b x86 \u0438 UTF-8 \u0441 BOM. \u041f\u043e\u0447\u0442\u0438 \u0432\u043e \u0432\u0441\u0435\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0432\u043b\u0438\u044f\u043d\u0438\u0435 \u043e\u0441\u043d\u0430\u0441\u0442\u043a\u0438 \u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0442\u043e\u0436\u0435 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e.<\/p>\n<p>  \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u0435 \u0432\u0441\u0451 \u0442\u0430\u043a \u0433\u043b\u0430\u0434\u043a\u043e. \u041f\u043e \u0441\u0443\u0442\u0438 \u0441\u0432\u043e\u0435\u0439 <i>afl-fuzz<\/i> \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439 \u0434\u043b\u044f \u0431\u0440\u0443\u0442\u0444\u043e\u0440\u0441\u0430. \u042d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0435\u0451 \u043f\u0440\u043e\u0441\u0442\u043e\u0439, \u0431\u044b\u0441\u0442\u0440\u043e\u0439 \u0438 \u043d\u0430\u0434\u0451\u0436\u043d\u043e\u0439, \u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0430\u0442\u043e\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u0432 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u043f\u043e\u0438\u0441\u043a\u0430 \u043c\u043e\u0433\u0443\u0442 \u0441\u0442\u0430\u0442\u044c \u043d\u0435\u043f\u0440\u0435\u043e\u0434\u043e\u043b\u0438\u043c\u044b\u043c \u043f\u0440\u0435\u043f\u044f\u0442\u0441\u0442\u0432\u0438\u0435\u043c \u0434\u043b\u044f \u0444\u0430\u0437\u0437\u0435\u0440\u0430. \u0412\u043e\u0442 \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<p>  <code>if (strcmp(header.magic_password, &quot;h4ck3d by p1gZ&quot;)) goto terminate_now;<\/code> <\/p>\n<p>  \u041d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e <i>afl-fuzz<\/i> \u0432\u0440\u044f\u0434 \u043b\u0438 \u0441\u0443\u043c\u0435\u0435\u0442 \u00ab\u0438\u0437\u043e\u0431\u0440\u0435\u0441\u0442\u0438\u00bb \u0441 \u043d\u0443\u043b\u044f \u0444\u0430\u0439\u043b\u044b PNG \u0438\u043b\u0438 \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b HTML \u2014 \u0438 \u0435\u043c\u0443 \u043d\u0443\u0436\u043d\u0430 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u043f\u043e\u043b\u0443\u0447\u0448\u0435, \u0447\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e &quot;hello&quot;. \u0427\u0442\u043e\u0431\u044b \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u043c\u0438 \u043a\u043e\u0434\u0430 \u043a\u0430\u043a \u0432 \u0432\u044b\u0448\u0435\u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0444\u0430\u0437\u0437\u0435\u0440\u0443 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0446\u0435\u043b\u0435\u0432\u043e\u0433\u043e \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0430 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043d\u0430 \u0438\u043d\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435. \u0423\u0447\u0451\u043d\u044b\u0435 \u0434\u043e\u0431\u0438\u043b\u0438\u0441\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430 \u0432 \u044d\u0442\u043e\u043c \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0438, \u043d\u043e \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0435\u0449\u0451 \u0433\u043e\u0434\u044b \u0436\u0434\u0430\u0442\u044c \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b \u0431\u044b\u0441\u0442\u0440\u043e, \u043f\u0440\u043e\u0441\u0442\u043e \u0438 \u043d\u0430\u0434\u0451\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u043c\u0438 \u043a\u043e\u0434\u043e\u0432\u044b\u043c\u0438 \u0431\u0430\u0437\u0430\u043c\u0438.<\/p>\n<p>  <font color=\"gray\">\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u0441\u043f\u0440\u043e\u0441\u0438\u043b\u0438 \u043c\u0435\u043d\u044f \u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0432\u0435\u0449\u0430\u0445, \u043f\u043e\u0434 \u0432\u043b\u0438\u044f\u043d\u0438\u0435\u043c \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043e\u0437\u0434\u0430\u043d <i>afl-fuzz<\/i>; \u044f \u0441\u043e\u0431\u0440\u0430\u043b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u043c\u0435\u0442\u043a\u0438 \u0432 <a href=\"http:\/\/lcamtuf.coredump.cx\/afl_demo\/long_story.txt\">\u044d\u0442\u043e\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0435<\/a>.<\/font><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/328652\/\"> https:\/\/habrahabr.ru\/post\/328652\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0412\u043e\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 <a href=\"http:\/\/code.google.com\/p\/american-fuzzy-lop\">afl<\/a>; \u043c\u0435\u043d\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u0443\u0434\u0438\u0432\u0438\u043b\u043e, \u0447\u0442\u043e \u043e\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442!<\/p>\n<p>  <code>$ mkdir in_dir<br \/>  $ echo 'hello' &gt;in_dir\/hello<br \/>  $ .\/afl-fuzz -i in_dir -o out_dir .\/jpeg-9a\/djpeg<\/code> <\/p>\n<p>  \u0412 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438, \u044f \u0441\u043e\u0437\u0434\u0430\u043b \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043e \u0441\u043b\u043e\u0432\u043e\u043c &quot;hello&quot; \u0438 \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b \u0444\u0430\u0437\u0437\u0435\u0440 \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u043e\u0442\u043e\u043a \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0436\u0438\u0434\u0430\u0435\u0442 \u043d\u0430 \u0432\u0445\u043e\u0434\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 JPEG (<i>djpeg<\/i> \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0434\u0451\u0442 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u043e\u0439 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 <i><a href=\"http:\/\/www.ijg.org\/\">IJG jpeg<\/a><\/i>; <i><a href=\"http:\/\/libjpeg-turbo.virtualgl.org\/\">libjpeg-turbo<\/a><\/i> \u0442\u043e\u0436\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u043e\u0434\u043e\u0439\u0442\u0438). \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043c\u043e\u0438 \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0435 \u043f\u043e\u0445\u043e\u0436\u0438 \u043d\u0430 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u0442\u0430\u043a \u0447\u0442\u043e \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u0431\u044b\u0441\u0442\u0440\u043e \u043e\u0442\u0432\u0435\u0440\u0433\u0430\u0435\u0442 \u0438\u0445:<\/p>\n<p>  <code>$ .\/djpeg '..\/out_dir\/queue\/id:000000,orig:hello'<br \/>  Not a JPEG file: starts with 0x68 0x65<\/code>   <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-286333","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/286333","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=286333"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/286333\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=286333"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=286333"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=286333"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}