I have fixed a number of validation issues and workload calculations on the Brute Force calculator.
The script now checks to make sure you enter numbers and if not, strips non-numbers. It also limits the length of each category to 2 characters and a total length of password to 50 characters (I don’t think many people have a password over 50 characters).
The script also now multiplies the times 8 to account for growth of technology.
I got hacked not too long ago, so I decided to setup snort patched with snortsam to stop the intruders. This acually works very well.
They got in by brute forcing a log in page for the web mail interface. The intruders also used the compose mail page to send spam after they broke in.
I wrote my own snort rule to detect and block brute forcing and sending spam through the web mail (It will only block if you have snortsam properly setup). This rule blocks anyone that does an HTTP POST more than 20 times within 10 seconds (I believe it is a ratio - average of 2 times per second).
alert tcp any any -> X.X.X.X 80 ( content: “POST”; depth: 4; nocase; msg: “Webmail Brute Force Attempt or Spam Attack”; threshold: type both, track by_src, count 20, seconds 10; classtype: misc-activity; sid:123456789; rev:1; fwsam: src, 10 minutes;)
HINT: Replace X.X.X.X with the IP of your web server. Take out the “fwsam: src, 5 minutes;” if you are not using snortsam (you should be ;p). Replace 123456789 with your own custom ID and make it large so it doesn’t conflict with default snort rules.
Have you wrote any custom snort rules or do you have a suggestion to improve this rule? Show us in the comments.
Open source PHPIDS is a customizable intrusion detection system for your web applications. PHPIDS uses a set of filter rules to detect specific strings in URLs that indicate a possible hacking attempt.
PHPIDS can do everything from log the attacks to email you the IP address of the attacker. Be sure to check out the example.php inside of the docs folder for instructions on installation.
Hackosis.com just added Gravatars to the comments section! In light of the situation I decided to tell you how to add Gravatars to your custom Wordpress theme’s comment section if not already done. Most old themes won’t have this.
Gravatars can be used in Wordpress 2.5+ and must be enabled in the Wordpress settings under discussion.
A gravatar, or globally recognized avatar, is quite simply an avatar image that follows you from weblog to weblog appearing beside your name when you comment on gravatar enabled sites. Avatars help identify your posts on web forums, so why not on weblogs?
To add Gravatars I simply added the following to my Wordpress theme’s comments.php file right before “<cite><?php comment_author_link() ?></cite> Says:”. Of course you do need to include the PHP opening and closing tags. Change the size variable to one suitable:
PHP and MySQL are one of the most used technologies on the web today. By using about 7 different script files we can add, update, and delete rows from a MySQL table.
Lets get started. I will explain each section of the script files so you have an understanding of how it works. You can download the project in a zip file above. The download also includes the example MySQL schema structure so you can test the script right away.
All examples in this post assume that you have already typed the php opening and closing tags. I cannot inlcude them on my page due to Wordpress plugins that I am running.
ALSO, because my PHP color coder sometimes runs off the page, you may have to click “show plain code” to view all typed PHP code.
HEADER.PHP:
Header.php stores the HTML header that include the title, etc. I am not going into detail since this is not a HTML tutorial.
I always start my PHP files with comments to indicate the purpose of the script and give contact details in case anyone has questions. Comments in PHP are indicated with ‘//’ for single lines and ‘/*’, ‘*/’ for multiple line comments: Read the rest of this entry …
What the above code will do is redirect anyone that doesn’t have a referrer that has ‘hackosis.com’ somewhere in the URL to your homepage. You could also state a message such as “Hotlinking images is not allowed”. In this case it would be appropriate to display the image in the first part of the if statement.
I hope you find this helpful and if you need any other tips on PHP code snippets, please let us know in the comments.