Preventing Brute Force Logins on Websites

I think database-persisted short lockout period for the given account (1-5 minutes) is the only way to handle this. Each userid in your database contains a timeOfLastFailedLogin and numberOfFailedAttempts. When numbeOfFailedAttempts > X you lockout for some minutes. This means you’re locking the userid in question for some time, but not permanently. It also means … Read more

Is it possible to reverse a SHA-1 hash?

No, you cannot reverse SHA-1, that is exactly why it is called a Secure Hash Algorithm. What you should definitely be doing though, is include the message that is being transmitted into the hash calculation. Otherwise a man-in-the-middle could intercept the message, and use the signature (which only contains the sender’s key and the timestamp) … Read more

IIS7, web.config to allow only static file handler in directory /uploads of website

Add the following to a web.config file in the folder containing the files you wish to be served only as static content: <configuration> <system.webServer> <handlers> <clear /> <add name=”StaticFile” path=”*” verb=”*” modules=”StaticFileModule,DefaultDocumentModule,DirectoryListingModule” resourceType=”Either” requireAccess=”Read” /> </handlers> <staticContent> <mimeMap fileExtension=”.*” mimeType=”application/octet-stream” /> </staticContent> </system.webServer> </configuration>

Send mail via Gmail with PowerShell V2’s Send-MailMessage

Here’s my PowerShell Send-MailMessage sample for Gmail… Tested and working solution: $EmailFrom = “notifications@somedomain.com” $EmailTo = “me@earth.com” $Subject = “Notification from XYZ” $Body = “this is a notification from XYZ Notifications..” $SMTPServer = “smtp.gmail.com” $SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer, 587) $SMTPClient.EnableSsl = $true $SMTPClient.Credentials = New-Object System.Net.NetworkCredential(“username”, “password”); $SMTPClient.Send($EmailFrom, $EmailTo, $Subject, $Body) Just change $EmailTo, and … Read more

If you use HTTPS will your URL params will be safe from sniffing? [duplicate]

Yes your URL would be safe from sniffing; however, one hole that is easily overlooken is if your page references any third party resources such as Google Analytics, Add Content anything, your entire URL will be sent to the third party in the referer. If its really sensitive it doesn’t belong in the query string. … Read more