BIL

Browser Interface Layer
Making HTML Dangerous
Copyleft (C) 2003 Brett McNamara

Why BIL?

For many people, the primary application that they use to interact with their computer is the web browser. In response to this, the makers of web browsers have made them far more than simply a window on static content. Browsers are often complete user environments capable of doing almost any required function. Except one...

A web browser cannot interact with a computer's resources unless given explicit, special permissions. The is a very good thing, because no one wants the anonymous page they visit on the web to suddenly decide to erase their hard drive.

Who / What BIL?

BIL (Browser Interface Layer) is a very small, unobtrusive platform that lets a simple web page do one of those things it should never be able to do; run an arbitrary program on the user's computer. It does this by sitting in a computer's memory and pretending to be a web server. The browser thinks it's a web server and talks to it normally. When the browser issues a specific run command, BIL launches the requested program.

This program was originally designed to allow the HTML directory of a CD distribution to not only be browsed, but installed from. CDs often launch a browser when the CD is auto played. While this makes a lot of sense, it doesn't always work, depending on the user's browser set up. BIL also helps with this.

When BIL is run, it launches the user's default browser and points it at a startup page. The startup page is being served up by BIL so that it can respond to those special run requests. BIL's little kitty icon will be seen on the task bar. BIL dies when the browser it launched does, or when the user right clicks on the icon and tells it to go away. If closed from the icon, BIL will also close the browser it launched.

What BIL is not.

BIL is not a web server. Or rather, it could conceivably be used for that purpose, but it would be very very bad. For security reasons, requests are only accepted from the machine that BIL is running on.

BIL Setup

BIL is ready to go out of the box. However, it does have a few customizable options. Of particular interested might be the language detection options.

BIL uses a standard INI file to store options. It will look for a bil.ini file in same directory that started bil.exe. It it doesn't find this file, it will simply run with the default values.

Section: BID
ParameterDefaultDescription
port8105 The port BIL to listens to for browser requests.
portScan5 Number of ports to scan, if the requested port is unavailable.
portScanIncrement200 Amount to add to starter port for scanning (e.g. 8305, 8505...).
documentRoot\htdocs Directory that translates to "/" in BIL.
systemRootRun. Directory that BIL will consider the root for run requests.
Section: DocumentStartup
ParameterDefaultDescription
default/index.html The default startup page to use, unless a matching language is found.
XXX Where XXX is the three letter code that Windows uses to identify the user's language. These values are always uppercase. Examples include, German(DEU), U.S. English(ENU), Modern Spanish(ESN),French(FRA)

Execute that program

The syntax for running a program is fairly simplistic; it's run.html?cmd=program_path. The path will always be relative to the systemRootRun. Absolute paths are not supported.

Test Links

If you're not running this page through BIL, all of these links will fail. Otherwise, they should confirm that BIL is doing it's job.

Run Test
If all is well, you should see a little DOS window appear in front of the browser.
Bad Run Test
We're trying to run a file that doesn't exist, we should be told it can't be found.
Current BIL Setup
BIL has a special page that tells you what the current settings are.

Download

Download file: bil.zip

The zip also contains the source code and make files. It has been successfully complied with both GNU GCC and VC++.

This program is released under the GPL (GNU General Public License). It is free software and comes with ABSOLUTELY NO WARRANTY. See a copy of the GPL for details.

While this is trully free software and may be abused within the contraints of the GPL, I wouldn't mind being contacted if BIL finds it's way into an interesting place. Currently, BIL should be used on the next edition of TheOpenCD.

BIL Home