Wiki source for UsingProjectEvilOnpfSense
=====Using Project Evil (A.K.A. ndisulator) on pfSense=====
The process by which one may use an ndis-supported wireless interface on pfSense is rather uncomplicated, involving the following steps:
1) Install the pfSense [[http://www.pfsense.com/mirror.php?section=downloads/developers downloads/developers]] ISO, you'll need the system sources and compiler which is included with this version
1) Obtain the windows NDIS driver files for your wireless card
1) Use **ndisgen** to create a proper module to be loaded with kldload
1) Install the module in the correct location and insure it will be loaded with subsequent system boots
In more detail:
=== Install the pfSense developer ISO ===
Retrieve the developer ISO from [[http://www.pfsense.com/mirror.php?section=downloads/developers downloads/developers]] and install it as per the usual method. Once installed, booted and allowed to bootstrap, it should function as normal but you'll have much more to work with in the way of sources and tools.
=== Obtain the NDIS driver files for your wireless card ===
Download the appropriate windows driver for your wireless card and find the proper firmware, .sys, and .inf files within its archive. As an example, the Linksys WMP54G windows driver archive, **wmp54g_driver_utility_v1.4.zip**, contains in its Drivers directory, the following files: **bcmwl5.sys**, **bcmwl5.inf**, and **bcm43xx.cat**. In this case, only the .sys and .inf files are necessary. Some hardware may need firmware files as well, they should be included in the driver archive. Extract the requisite .sys and .inf files and move them to a directory on your pfsense box remember where you put them.
=== Use ndisgen to create a proper module to be loaded with kldload ===
**ndisgen** builds the kernel module needed for ndis use. Running the program presents you with a shell of sorts which has a few useful functions. Among them are reading general ndis information, converting drivers, and converting firmware files. In the case of the Linksys WMP54G, no firmware files are necessary. Carrying on with the "Convert driver" option, you're prompted for the locations of the .inf and .sys files, respectively, with full paths. In my case, these were **/usr/src/sys/modules/if_ndis/bcmwl5.inf** and **/usr/src/sys/modules/if_ndis/bcmwl5.sys**. Once entered, the shell prompts the user for firmware files to be converted (leave this blank if there are none) and then a prompt to build the ndis driver itself. This created, in the case of the Linksys WMP54G, the file **bcmwl5_sys.ko**.
=== Install the module in the correct location and ensure it will be loaded with subsequent system boots ===
Installing the module in the correct location is as simple as "cp bcmwl5_sys.ko /boot/kernel/". You may also copy this file to the /boot/kernel/ of a livecd image of pfsense as well, this can be done with the fetch tool. (remember if you are on the embedded platform you will need to do a **mount -w /** first) Some kernel moduals that are created with **ndisgen** can be bigger then the free space on a 64mb image of pfsense, if that is the case you will need to build your own embeded image changing the size of the image that is built to have enough space to handle your new driver. If you'd like to load it now, load the two modules in the correct order:
<<kldload ndis
kldload bcmwl5_sys<<
::c::
To insure the modules will be loaded with subsequent system boots, add the following to /boot/loader.conf:
<<ndis_load="YES"
bcmwl5_sys_load="YES"<<
::c::
-----
At this point you should be able to assign and configure the interface (I used OPT1) as a normal wireless interface. Good luck!
The process by which one may use an ndis-supported wireless interface on pfSense is rather uncomplicated, involving the following steps:
1) Install the pfSense [[http://www.pfsense.com/mirror.php?section=downloads/developers downloads/developers]] ISO, you'll need the system sources and compiler which is included with this version
1) Obtain the windows NDIS driver files for your wireless card
1) Use **ndisgen** to create a proper module to be loaded with kldload
1) Install the module in the correct location and insure it will be loaded with subsequent system boots
In more detail:
=== Install the pfSense developer ISO ===
Retrieve the developer ISO from [[http://www.pfsense.com/mirror.php?section=downloads/developers downloads/developers]] and install it as per the usual method. Once installed, booted and allowed to bootstrap, it should function as normal but you'll have much more to work with in the way of sources and tools.
=== Obtain the NDIS driver files for your wireless card ===
Download the appropriate windows driver for your wireless card and find the proper firmware, .sys, and .inf files within its archive. As an example, the Linksys WMP54G windows driver archive, **wmp54g_driver_utility_v1.4.zip**, contains in its Drivers directory, the following files: **bcmwl5.sys**, **bcmwl5.inf**, and **bcm43xx.cat**. In this case, only the .sys and .inf files are necessary. Some hardware may need firmware files as well, they should be included in the driver archive. Extract the requisite .sys and .inf files and move them to a directory on your pfsense box remember where you put them.
=== Use ndisgen to create a proper module to be loaded with kldload ===
**ndisgen** builds the kernel module needed for ndis use. Running the program presents you with a shell of sorts which has a few useful functions. Among them are reading general ndis information, converting drivers, and converting firmware files. In the case of the Linksys WMP54G, no firmware files are necessary. Carrying on with the "Convert driver" option, you're prompted for the locations of the .inf and .sys files, respectively, with full paths. In my case, these were **/usr/src/sys/modules/if_ndis/bcmwl5.inf** and **/usr/src/sys/modules/if_ndis/bcmwl5.sys**. Once entered, the shell prompts the user for firmware files to be converted (leave this blank if there are none) and then a prompt to build the ndis driver itself. This created, in the case of the Linksys WMP54G, the file **bcmwl5_sys.ko**.
=== Install the module in the correct location and ensure it will be loaded with subsequent system boots ===
Installing the module in the correct location is as simple as "cp bcmwl5_sys.ko /boot/kernel/". You may also copy this file to the /boot/kernel/ of a livecd image of pfsense as well, this can be done with the fetch tool. (remember if you are on the embedded platform you will need to do a **mount -w /** first) Some kernel moduals that are created with **ndisgen** can be bigger then the free space on a 64mb image of pfsense, if that is the case you will need to build your own embeded image changing the size of the image that is built to have enough space to handle your new driver. If you'd like to load it now, load the two modules in the correct order:
<<kldload ndis
kldload bcmwl5_sys<<
::c::
To insure the modules will be loaded with subsequent system boots, add the following to /boot/loader.conf:
<<ndis_load="YES"
bcmwl5_sys_load="YES"<<
::c::
-----
At this point you should be able to assign and configure the interface (I used OPT1) as a normal wireless interface. Good luck!