This kind of thing is going to happen from time to time, how to defend against it? Why, aim some Purebasic at it of course:
Code: Select all
InitNetwork()
Repeat
  If ReceiveHTTPFile("http://www.<mywebsite>.com/index.htm", "d:\index.htm")
    a$ = MD5FileFingerprint("d:\index.htm")          ; Downloaded index
    b$ = MD5FileFingerprint("d:\_website\index.htm") ; Original index
    If a$<>b$
      If CreateMail(0, "<myemail>@<myhost>.com", "Emergency!")
        SetMailBody(0, "Website index has been attacked !")
        AddMailRecipient(0, "<myemail>@<myhost>.com", #PB_Mail_To)
        Result = SendMail(0, "smtp.<mysmtpserver>.com", 25, 1)
        Repeat
          Progress = MailProgress(0)
          Delay(300)
        Until Progress = #PB_Mail_Finished Or Progress = #PB_Mail_Error
        If Progress = #PB_Mail_Finished
          MessageRequester("Emergency!", "Website index has been attacked! Emails sent.")
        Else
          MessageRequester("Emergency", "Website index has been attacked! Unable to send emails.")
        EndIf
      EndIf
    EndIf
  EndIf
  Delay(1000*60*10) ; 10 minutes
ForEver




