Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1914561
  • 博文数量: 498
  • 博客积分: 2078
  • 博客等级: 大尉
  • 技术积分: 1645
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-18 22:43
个人简介

安大

文章分类

全部博文(498)

文章存档

2017年(1)

2016年(2)

2015年(21)

2014年(90)

2013年(101)

2012年(267)

2011年(16)

分类: 虚拟化

2014-08-12 12:40:42

tfn2k是目前功能最强性能最好的DDOS攻击工具,几乎不可能被察觉。使用了分布式客户服务器功能,加密技术及其它类的功能,它能被用于控制任意数量的远程机器,以产生随机匿名的拒绝服务攻击和远程访问。
它可以控制大量类UNIX平台的主机作为傀儡主机,同时向一台目标机发起synflood/udpflood/icmpflood等攻击行为。

网上下载的代码,感觉是作者故意留了些bug,导致编译有错误,使用也有错误。
这里就碰到问题,一一记录,留待之后备查。

  1. src/ip.h 里需要做一些修改,否则编译会有错误,发生重复定义;
  2. 提示open with O_CREAT in second argument needs 3 arguments时,给open函数加上第三个参数0777;
  3. aes_setkey函数中,使用key变量前,先对其置零;
  4. aes.h中,将typedef unsigned long u4byte;改成typedef unsigned int  u4byte; 在64位的系统下,GCC会认为unsigned long是8个字节,而tfn2k把它当4个字节使用,从而导致在aes_setkey函数中误用。 最终导致的问题就是,在使用tfn时,一直提示“Sorry, passwords do not match.” , 挺坑爹的, 原来tfn2k不兼容64位。
所有改动,见下面的patch。

点击(此处)折叠或打开

  1. ---
  2. aes.c | 1 +
  3. aes.h | 2 +-
  4. disc.c | 2 +-
  5. ip.h | 2 ++
  6. mkpass.c | 2 +-
  7. 5 files changed, 6 insertions(+), 3 deletions(-)
  8. diff --git a/aes.c b/aes.c
  9. index d918791..5186f16 100644
  10. --- a/aes.c
  11. +++ b/aes.c
  12. @@ -9,6 +9,7 @@ aes_setkey (char *password)
  13. {
  14. u4byte keylen = strlen (password) * 8;
  15. u4byte key[strlen (password) / 4];
  16. + memset(key, 0, sizeof(key));
  17. memcpy (key, password, strlen (password));
  18. return (set_key (key, keylen));
  19. }
  20. diff --git a/aes.h b/aes.h
  21. index ea65f17..cba4409 100644
  22. --- a/aes.h
  23. +++ b/aes.h
  24. @@ -12,7 +12,7 @@ void base64_out (char *, unsigned char *, int);
  25. typedef unsigned char u1byte; /* an 8 bit unsigned character type */
  26. typedef unsigned short u2byte; /* a 16 bit unsigned integer type */
  27. -typedef unsigned long u4byte; /* a 32 bit unsigned integer type */
  28. +typedef unsigned int u4byte; /* a 32 bit unsigned integer type */
  29. typedef signed char s1byte; /* an 8 bit signed character type */
  30. typedef signed short s2byte; /* a 16 bit signed integer type */
  31. typedef signed long s4byte; /* a 32 bit signed integer type */
  32. diff --git a/disc.c b/disc.c
  33. index 3303ac6..0ec6cf6 100644
  34. --- a/disc.c
  35. +++ b/disc.c
  36. @@ -27,7 +27,7 @@ main (void)
  37. {
  38. case 'y':
  39. case 'Y':
  40. - close (open ("agreed", O_WRONLY | O_CREAT | O_TRUNC));
  41. + close (open ("agreed", O_WRONLY | O_CREAT | O_TRUNC, 0777));
  42. break;
  43. default:
  44. system ("/bin/rm -f ./*");
  45. diff --git a/ip.h b/ip.h
  46. index 2c1c39d..62594dc 100644
  47. --- a/ip.h
  48. +++ b/ip.h
  49. @@ -121,10 +121,12 @@ struct icmp
  50. };
  51. #ifndef in_addr
  52. +/*
  53. struct in_addr
  54. {
  55. unsigned long int s_addr;
  56. };
  57. +*/
  58. #endif
  59. char *inet_ntoa (struct in_addr);
  60. diff --git a/mkpass.c b/mkpass.c
  61. index d32e92d..84f16c3 100644
  62. --- a/mkpass.c
  63. +++ b/mkpass.c
  64. @@ -84,7 +84,7 @@ dufus:
  65. goto dufus;
  66. for (i = 0; i <= strlen (p); i++)
  67. c[i] = p[i];
  68. - fd = open ("pass.c", O_WRONLY | O_TRUNC | O_CREAT);
  69. + fd = open ("pass.c", O_WRONLY | O_TRUNC | O_CREAT, 0777);
  70. write (fd, header, strlen (header));
  71. for (i = 0; i < 31; i++)
  72. {
  73. --

tfn2k的具体使用跟介绍,可以去看看维基百科,里面有相关链接。

阅读(3012) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

shuibiande2016-01-05 13:59:49

提示“Sorry, passwords do not match.”确实有这种情况,我试了好几遍,原来是不兼容问题,谢谢