Free Newsletters
InfoWorld Daily

InfoWorld
Log-in | Register

Hack Tales: Network auditing on a shoestring

Complete map of network shares and access rights kept business auditors happy


What do you do when the auditors are breathing down your neck, wanting to see an exhaustive report on the Windows network security of a 2,000-user network across eight sites? That’s easy. Break out a text editor and start writing some Perl.

Return to special report

DOWNLOAD PDF

Download InfoWorld's special report Heroic hacks and inspired work-arounds


That’s what my colleague Matt Prigge and I did when we were tasked with locating every share available on a network and documenting who had access to their files. At first blush, it was a Herculean effort. When we started coding and the pieces began to fall into place, however, it became much simpler.

The first order of business was determining how the data would be stored. We opted to place everything in a MySQL database running on a Linux server, with all back-end code running on a Windows 2003 Server with ActivePerl -- because the polling processes required the Win32 Perl APIs. The reporting and searching front end would be written in PHP (PHP: Hypertext Preprocessor) and run on another Linux server. Because the common ground was MySQL, this presented the easiest path.

The polling process first searched Active Directory for the list of Computer records. When these had been found, it used a Domain Admin account to inspect the relevant registry keys on every computer in the domain and search for open file shares. If any shares were found, the poller would walk the file share with Administrator privileges to determine the size of the share and catalog the permissions on every folder to a depth of six directory levels.

The scripts would then insert all the data found for each share into the MySQL database, keyed on the machine name. Very quickly, the database grew very large, as it was inspecting not only known server shares but even shares on workstations that IT may not ever have known existed.

The polling process took several hours to complete every time it ran, so this process became a daily event, starting at 9 a.m., when most workstations in the network were powered on and available via the network. The process located hundreds of shares and logged thousands of folders, files, and user access rights into the database.

To present this information in a relatively simple way, we wrote a PHP-based Web front end that allowed an administrator to search the database with a domain username, a computer name, a share name, or a folder name. Searching the database with a username or a Windows security group name would list every share that the user or group had access to, sorted by computer name. Additionally, the admin could drill down six levels deep in every share to find individual user permissions on specific folders in each share. The database was updated daily, so the information was always current, although time constraints eliminated the possibility of capturing historical data for later perusal.

To top it all off, the same PHP front end made possible a full dump of all share data, using CSS to present the entire database in a printable format. When the auditors came calling, we were able to present them with a stack of paper 3 inches thick, containing information about every share available on every computer in the network, cross-referenced with a list of every security group and every user in the organization. If they needed to spot-check the data, the Web front end was ready and waiting. Needless to say, although we were fairly sure they didn’t actually grasp what they were seeing, the auditor’s report gave top marks to the IT department, and the IT director bought three rounds that night.

Paul Venezia is senior contributing editor of the InfoWorld Test Center.

Talkback:

commentPost a Comment

 

MOST COMMENTS

 
 





SLM AND BSM: THE FUTURE OF IT MANAGEMENT. ARE YOU READY?
Driven by globalization and competition, businesses increasingly look to IT to enable them to quickly adapt to changing business conditions, speed the delivery of products and services, and automate processes, all at lower costs. Additionally, service quality and positive customer experiences are also top priorities. The only way to meet these expectations is to cohesively manage IT-across the enterprise-from a business service point-of-view.

»  Click here to view this Webcast
  Virtualization Solutions Guide
This comprehensive IT Strategy Guide covers Virtualization and puts you at the forefront of the discussion. You'll learn all you need to know from the cost of virtualization, how to implement it for your business, how to back it up safely and which products are best. Sponsored by Riverbed

»  Click here to download now

- Special Advertising Partners -
WHITE PAPERS
 

» Technology White Papers Library

Technology White Papers by Topic

Technology White Papers E-mail Alert

Find out when the latest white paper is available:
 
 
INFOWORLD MARKETPLACE
 
» BUY A LINK NOW
 
 

Video

 
 
 

Podcasts

 
IFW Daily 11/21/2008

A look at the week that was: Yahoo's Yang steps down, Adobe shows off ...

 
 
 

Columnists

 
 
 

Resource Center


Ads by techwords beta  [See your link here]
 




Sponsored Technology Links

 
 
 HOME  NEWS  BLOGS  PODCASTS  VIDEOS  TECHNOLOGIES  TEST CENTER  EVENTS   About | Advertise | Awards | RSS | Contact Us 

Copyright © 2008, Reprints, Permissions, Licensing, IDG Network, Privacy Policy, Terms of Service.
All Rights reserved. InfoWorld is a leading publisher of technology information and product reviews on topics including viruses,
phishing, worms, firewalls, security, servers, storage, networking, wireless, databases, and web services.

CIO :: ComputerWorld :: CSO :: Demo :: GamePro :: Games.net :: IDG Connect :: IDG World Expo
Industry Standard :: IT World :: JavaWorld :: LinuxWorld :: MacUser :: Macworld :: Network World :: PC World :: Playlist