Like what I have to say? Subscribe to my blog via RSS or email, and you'll be notified whenever there's a new blog post!
 
Subscribe to Alvin Poh's Blog by RSS reader
Subscribe to Alvin Poh's Blog by Email

Gadgets, Technology, Public speaking and IT from an undergraduate's perspective.

Protect Your Wireless Network with MAC Address Filtering…A Bad Idea

To secure your wireless network, you can use a variety of means, and one of which is by selecting only what MAC addresses are allowed. This is known as MAC filtering, and it can serve as a basic deterrent against most opportunistic attackers.

However, just using MAC filtering alone will probably be a bad idea. It doesn’t take much determination or knowledge at all to spoof a MAC address. In fact, it’s actually quite easy to spoof a MAC address, and can be done within 2 steps.

Step 1. Download and run any freely available security tool, for example Nmap. Set it to listen in on network traffic and pick out the MAC address.
Step 2. Change your MAC address to the one you picked out.

In fact, Nmap even allows you to spoof your MAC address by running the “-spoof-mac” command line option. This was originally intended to hide the true source of Nmap probes.

If you don’t have Nmap, you can just spoof your MAC address with the software that comes with most operating systems.

Here are some examples:

1. Linux: ifconfig eth0 hw ether 02:a1:13:d4:00:12

2. MS Windows: the MAC address is stored in a registry key (location of that key varies from one MS Windows version to the next, but you can easily find that and just edit it yourself). Alternatively, download a free tool such as Macshift to help you change your MAC address.

Now that you know how easy it is to spoof your MAC address, start worrying even more, because these simple steps are run automatically and very, very quickly by malware. This means that if you are using MAC filtering to protect your wireless network, you should seriously consider something a little more robust.

Tags: , , , , , , ,

Related posts

Subscribe to my blog: RSS reader    Email

Edit .htaccess to increase PHP’s max file upload

To increase the upload file size limit on your website, you need to edit PHP’s configuration settings. Unfortunately, not everyone has their own web server, so most of the time people are constrained by the limits of shared hosting. But you can still modify your base php.ini file by creating your own php.ini with the edits that you want.

Your php.ini file needs to be in every folder that’s going to be affected, or at least in the folder where the php script is being called from. Unfortunately if you have dozens of folders that need this edit, then you’ll need dozens of php.ini files.

An alternative is to then use .htaccess. By just placing a.htaccess file in your root folder, all folders beneath it will also have the change. The code to change your PHP max file upload size is:

RewriteEngine On
php_value post_max_size 1000M
php_value upload_max_filesize 1000M
php_value max_execution_time 6000000

You can edit it to suit your needs. 1000M = 1GB, so edit accordingly. Do note that your host will need to allow PHP edits though.

Tags: , , , , , , , , , , , , , , , , , , , , , , , , , ,

Related posts

Subscribe to my blog: RSS reader    Email

How To Edit .htaccess So That SSI Include Code Will Run

If you have tried adding in SSI include codes into your HTML files, but find that it doesn’t work, the problem may be that you might not have enabled SSI yet.

The easier way to do so is to edit your .htaccess file to have these lines of code:

AddHandler server-parsed .html
Options Indexes FollowSymLinks Includes

By setting this, you are telling your server to parse all HTML files. There’s a drawback though — ALL HTML files are parsed — even if they don’t have SSI or include code in them. So, there’s a bit of an overhead. Otherwise, this is fine.

Tags: , , , , , , ,

Related posts

Subscribe to my blog: RSS reader    Email

Recursively Delete Selected Files or Folders In Windows

I was looking around for a way to recursively delete files and folders of a specific name in Windows. For example, imagine having “/folderA/folderB/file1.doc” and “/folderA/folderC/file1.doc”, and I wanted to remove all instances of file1.doc. Now imagine this file1.doc being presented in hundreds of folders. Deleting each file manually would drive anyone crazy.

I know Unix has a more powerful commandline interface, so operations like this should be a snap, but I was certain Windows had a similar functionality too. So I went about searching for a simple solution to do so. I was so intent on finding a simple batch file or DOS command that would do the recursive delete that I didn’t think of anything else until it suddenly slammed into me like a bullet train.

I could just use the search function in Windows! Yes that’s right — the normal Windows search is already a powerful enough function that accepts wildcards and does recursive searching. So I went to Windows search, specified my folder, and put in my filename. Sure enough, all the hundred or more instances of that file popped up almost instantly. From there it was just a matter of selecting all of them and deleting them. Everything took less than 10 seconds!

Tags: , , , , ,

Related posts

Subscribe to my blog: RSS reader    Email

How to Learn and Use Regular Expressions (Regex)

Whoever would have thought that something that looks like gibberish would actually have such powerful usages. Look at this example:

\d\d[/]\d\d[/]\d\d[ ][-][ ]

Would you believe that it’s actually an expression that matches anything of the format of “12/06/08″? Amazing.

I’ve been putting off learning about regular expressions (regex) for the longest time because it seems overly complicated — but I was forced to learn more about it after a recent application demanded of it. And boy was I glad to have finally jumped into it — it’s simply one of the best ways to search for any text pattern.

With regular expressions, you can search for any number of characters, specify whether it’s a number or letter, and even specify a range, like only accept alphabets between B and E. Or only numbers from 1-5.

So if you think about it, the sample regular expression string up there can actually be improved upon. For instance, since the date format is dd/mm/yy, we know that dd can go higher than 31, nor can it go lower than 1. And similarly, we know that for mm, it’s between 01 to 12. The tricky part is yy, because it can vary, depending on how you’re going to use this date. If your application’s more geared towards the future, then keeping the first digit to 0 or 1, and the 2nd digit from 0 to 9 should be just fine.

So as you can see, if you’re a developer, then regular expressions (regex) should be something that you are very familiar and comfortable with, because it makes your life so much easier!

Tags: , , , , , , ,

Related posts

Subscribe to my blog: RSS reader    Email

Close
E-mail It