UntzUntz LAN Scan
-----------------
Version 1.3c
Contained In This File:
1. Purpose
2. Why
3. Requirements
4. Installation
5. Problems & Questions
6. Current Features and Information
Purpose:
-------
This program will use 'smbclient' to creating a listing of all files
contained within the local area network (that are shared). They can be
shared on a Microsoft Windows machine or another Samba enabled machine.
Why:
---
I wrote this because I setup a network where most people (about 35)
shared a lot of files between each other. Finding a song or file that
is contained on maybe one machine out of 100,000 files - is a pain.
So now! You can search!
Requirements:
------------
The main requirement is the 'smbclient' program. If you do not have
Samba installed, go to http://www.samba.org to download it.
You'll also need a web server running to use the CGI program
Perhaps in the future another medium for searching could be developed.
Installation:
------------
Compiling:
g++ -O untzcgi-X.X.cpp -o untzcgi
g++ -O untzlanscan-X.X.cpp -o untzlanscan
Installation:
Copy the 'untzcgi' program into your web server's CGI directory
cp untzcgi /usr/local/apache/cgi-bin/
Copy the 'untzlanscan' program to /usr/local/bin
cp untzlanscan /usr/local/bin
Copy the 'untzls.conf' file to /etc/ directory
cp untzls.conf /etc/
You probably want to put this into your cron daemon so it will scan
the network every once and a while. Here is what I use:
59 * * * * /usr/local/bin/untzlanscan
This will run the scan every hour.
Configuration:
Edit the file, /etc/untzls.conf to reflect your configuration.
Here's the skinny on the configuration options:
ip address
This option is the IP address of the master browser
on the network. I'm pretty sure any computer will
work but the master browser has a better chance of
having all the computer listed.
temp
This is probably best set as /tmp
Basically it is a place where the program creates some
temporary files and holds the database.
smbclient
This is the path to 'smbclient' program.
If you do not have this program you will need to
download the Samba packet from http://www.samba.org
logo jpeg
This is the URL to a small image file in the upper left
hand corner of the search screen. Keep in mind there is
no size constraint in the IMG tag - so it might look kinda
wierd if you put a 640x480 size jpeg in there.
username
This is the name of the user smbclient will use to
connect to systems. If you have lax security the
user 'guest' is probably your best bet.
password
OPTIONAL. If you are connecting to systems that require
a user and a password, set the password option.
One thing to keep in mind is that this password is held in
clear text. You may want to consider creating a user
that only has READ and LIST options on the systems that
this program will be connecting to.
Default: None
workgroup
OPTIONAL. If given this will add this to the smbclient
for use as the workgroup option.
Default: None
results per page
OPTIONAL. This is the configuration option to specify the
number of results to print out per page. If it is not
given and not passes to the CGI script, it will default
to 15.
Default: 15
allow user robots
OPTIONAL. A value of yes or no (or YES/NO)
This will specify whether you want to give the user the
ability to block certain directories.
Default: Yes, the user can specify his/her own robots.txt
server robots
OPTIONAL. This points to a file which specifies a list of
machines shares, and directories to block. See under the
'Usage' section on the format of the file.
Default: None
page header
OPTIONAL. This points to a file that defines a header for
each search results page. For more information on the
variables that can be contained within this file, please
see the section 'Template' section below under 'Usage'
page footer
OPTIONAL. This points to a file that defines a footer for
each search results page. For more inf on the variables
see below.
search template
OPTIONAL. This points to a file that defines a structure
for each result. See below for more details.
force file
OPTIONAL. This points to a file that tells the crawler to
scan the shares contained. This can be used it for some
reason the smb client cannot see a share or if the share
name is being cut off by smbclient. The format of the
file is simply one //COMPUTER/SHARE per line.
Usage:
-----
Search Form
-----------
Creating a main search web page is easy!
Simply use the following code in your webpage: