Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. #336988#
  2. echo "<script type="text/javascript" language="javascript" > CODE OF MALWARE </script>";
  3. #/336988#
  4.  
  5. /*336988*/
  6. CODE OF MALWARE
  7. /*/336988*/
  8.  
  9. <!--336988-->
  10. <script type="text/javascript" language="javascript" >CODE OF MALWARE</script>
  11. <!--/336988-->
  12.  
  13. '^.*336988.*[sS]*.*336988.*$'
  14.  
  15. $regex = New-Object System.Text.RegularExpressions.Regex "<!--68c8c7-->((.|n)*)<!--/68c8c7-->"
  16.  
  17. $regex = New-Object System.Text.RegularExpressions.Regex "/*68c8c7*((.|n)*)68c8c7*/"
  18.  
  19. Get-ChildItem . -Recurse -Include *.aspx,*asp,*.html,*.htm | where-object {$_.lastwritetime –gt $DateToCompare} | %{Write-Host Examining file: $_.fullname; $_} | ForEach-Object { DoWork $_.Name $_.DirectoryName}
  20.  
  21. Get-ChildItem . -Recurse -Include *.js | where-object {$_.lastwritetime –gt $DateToCompare} | %{Write-Host Examining file: $_.fullname; $_} | ForEach-Object { DoWork $_.Name $_.DirectoryName}
  22.  
  23. function tryFixFile($filepath, $filepathBackup)
  24. {
  25. $infile = [string]::join([environment]::newline, (get-content -path $filepath))
  26. $regex = New-Object System.Text.RegularExpressions.Regex "<!--68c8c7-->((.|n)*)<!--/68c8c7-->"
  27.  
  28. if($regex.IsMatch($infile))
  29. {
  30. $intAnswer = $WScriptObject.popup("File needs to be change: " + $filepath + " do you want to continue?", 0,"Change File",4)
  31. If ($intAnswer -eq 6)
  32. {
  33. Write-Host " Creating backup for file: " $filepath
  34. Copy-Item $filepath $filepathBackup
  35. $replace = $regex.Replace($infile,"")
  36. $replace | out-file $filepath
  37. } else
  38. {
  39. $a.popup("File " + $filepath + " won't be changed.")
  40. }
  41. }
  42. }
  43.  
  44. function DoWork($filename, $directory)
  45. {
  46. $filepath = $directory + '' + $filename
  47. $filepathBackup = $directory + '' + "Backup_" + $filename
  48.  
  49. $WScriptObject = new-object -comobject wscript.shell
  50.  
  51. tryFixFile $filepath $filepathBackup
  52. }
  53.  
  54.  
  55.  
  56. $pathToCheck = Read-Host 'WARNING!! Path to check/change?'
  57. if (Test-Path $pathToCheck)
  58. {
  59. Set-Location $pathToCheck
  60.  
  61. #files were affected no longer that 2 days ago, you can change this
  62. $DateToCompare = (Get-date).AddDays(-2)
  63.  
  64. Get-ChildItem . -Recurse -Include *.aspx,*asp,*.html,*.htm | where-object {$_.lastwritetime –gt $DateToCompare} | %{Write-Host Examining file: $_.fullname; $_} | ForEach-Object { DoWork $_.Name $_.DirectoryName}
  65. }else
  66. {
  67. write-host "Path doesn't exist"
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement