SharePoint 2007 does not have PowerShell support.
In Visual Studio create a console application that loops through all the site collections and sites. You need to run this program on the SharePoint 2007 server.
http://msdn.microsoft.com/en-us/library/office/ms462161(v=office.14).aspx
static void Main(string[] args)
{
SPFarm farm = SPFarm.Local;
//Get all SharePoint Web services
SPWebService service = farm.Services.GetValue<SPWebService>("");
foreach (SPWebApplication webapp in service.WebApplications)
{
Console.WriteLine(webapp.Name);
//Enumerate through each site collection
foreach (SPSite site in webapp.Sites)
{
//Console.WriteLine(site.Url);
//Enumerate through each sub-site
foreach (SPWeb web in site.AllWebs)
{
...
For every site print the users and security settings.
You will find plenty of samples online.
Note: This can be a lengthy and resource intensive operation. Make sure you Dispose() all your objects properly.