Welcome To Snipplr


Everyone's Recent Snippets Tagged security



Apache can be used to ban undesirable people and bots from your website. With this code, we’re telling Apache that everyone is allowed to visit our blog except the person with the IP addresses
1 309 posted 11 years ago by mariusscheel
If your WordPress blog is outdated even by a few days and there's a security hole in your old version you could be seriously compromised without even knowing it. Trust me. This has happened to two of my clients and the fix is not easy. Usually, once...
0 340 posted 11 years ago by josephknight
Replace "mysite" with your own and this will block access to sites attempting to link to your images. Note, it's not necessarily always a bad thing for people to link to your images. If you run a blog, portfolio, or sales gallery, etc, you may actual...
2 343 posted 11 years ago by josephknight
The problem As a WordPress user, you probably know how important the wp-config.php file is. This file contains all of the information required to access your precious database: username, password, server name and so on. Protecting the wp-config.php...
0 318 posted 11 years ago by josephknight
The problem Protecting dynamic websites is especially important. Most developers always protect their GET and POST requests, but sometimes this is not enough. We should also protect our blog against script injections and any attempt to modify the PH...
3 386 posted 11 years ago by josephknight
If you want to serialize a password in some custom object you are working with, create another member that is the encrypted bytes and serialize/deserialize that. For simply encrypting/decrypting a file, you can use [System.IO.File.Encrypt](http://...
0 310 posted 11 years ago by pckujawa
From the Big Spaceship Labs website. This is a useful workaround for the following error message ... SecurityError: Error #2142: Security sandbox violation: local SWF files cannot use the LoaderContext.securityDomain property.
7 514 posted 11 years ago by adrianparr
If you weren't already aware, you can use a product like [Reflector.NET](http://www.red-gate.com/products/reflector/) to see all of the source code (that's right, the code) of a .NET assembly (DLL, EXE, etc). This is a real problem when your code is...
1 386 posted 11 years ago by pckujawa
This is useful for escaping multiple values in a POST array.
0 351 posted 11 years ago by bradless
Put this at the top of your CodeIgniter models, controllers, libraries and helpers to restrict direct access to them.
1 715 posted 11 years ago by AzizLight
In addition to the recommendations on the Wordpress Website. Limit the amount of PHP files that a writable by Apache. The directory's and files that need to be writable, do not always need to be executed by PHP directly. This makes it a bit har...
1 286 posted 12 years ago by occam
0 310 posted 12 years ago by d020
Ideal if you have a laptop. If someone steals it, he will not be able to read all your mails and documents with precious information (about passwords, accounts, credit cards, private stuffs, etc...). This snippet is considering that you are using...
0 254 posted 12 years ago by Dorgendubal
This little function helps to fight common security issue with SQL injections, it can sanitize any global variable like $_POST, $_GET, $_SERVER etc and escape unsafe characters.
5 581 posted 12 years ago by naz
That's not complete enough! but as useful as a knife :/
8 618 posted 12 years ago by lajevardi
This is a method of my database class which let me sift the unsafe data inputs down.
3 436 posted 12 years ago by lajevardi
[quote]$_SERVER['HTTP_REFERRER']'s problem is that can be spoofed, but it's better than nothing if you really want that.[/quote]
1 410 posted 12 years ago by luizlopes
2 324 posted 12 years ago by fruehjahr
Since network shares by default only get LocalIntranet permissions, it's relatively common to want to use CasPol to fully trust some shares that you control and know are safe. To trust everything on the share \\ShawnFa-Srv\Tools, use the command...
2 350 posted 13 years ago by hoffstein
1. Allows encryption between client and server 2. Bypasses filtered port, if any on the standard port for the given service.
1 365 posted 13 years ago by iblis
This is good to add to folders which are chmod to 777.
1 299 posted 13 years ago by luizlopes
This was taken out of a presentation by eZ systems on PHP Best Practices
0 328 posted 13 years ago by luizlopes
4 333 posted 13 years ago by iTony
this is not the ultimate secure way, but it's at least not displaying the email link
3 297 posted 13 years ago by iTony
Typically won't work if the ASP.Net service identity (in the machine.config ProcessModel section) is a local account.
1 610 posted 13 years ago by rengber
So you don't have to type the password everytime you log in to that remote ssh server. Don't enter a passphrase when prompted, just hit enter. This example is for Mac OS X but is likely to work on *nix plats too.
5 339 posted 14 years ago by micmath