Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Scan Win32 Machines in domain for P2P software

by Marza (Vicar)
on Jun 13, 2003 at 19:00 UTC ( [id://265768]=note: print w/replies, xml ) Need Help??


in reply to Scan Win32 Machines in domain for P2P software

Cool thanks for the mods!

Another thing I noticed is that if you make use of the exists command, you can eliminate this loop

foreach my $software (keys %bad_stuff) { if($subkey =~ $bad_stuff{$software}) { next if($installed_software{$machine.$software}++); print "Machine $machine could have $software installed\n"; } }

So it would be something like:

foreach my $subkey ($user_key->SubKeyNames,$software_key->SubKeyNames) + { if ( exists $bad_stuff{$subkey} ) { print "Machine $computer could have $subkey installed\n"; } }

Finally, one other thing concerning the getservers option:

GetServers("", $domain, SV_TYPE_ALL, \%machines) or die "GetServers failed: $!\n";

This will pick up samba servers which will error off since they don't have a registry.

If make use of SV_TYPE_SERVER_UNIX you could build an exclusion section to keep them out. Otherwise, you add to the run time as it tries to open a non-existent registry. I had to do that as I have about 20 of them. There are other issues such as a network appliance box but not everybody has those. I can post code if you are intersted. I figured you like to play so I didn't ;-)

Replies are listed 'Best First'.
Re: Re: Scan Win32 Machines in domain for P2P software
by davis (Vicar) on Jun 16, 2003 at 08:43 UTC
    if ( exists $bad_stuff{$subkey} ) {

    Careful. That line would only match if the target machine's registry contained the exact string that I used to key the $bad_stuff hash. I used the hash so that I use a regular expression match to increase flexibility in what the code would catch.

    E.g.: If the registry contained "LimeWireInstallDate" (Made up example), your version wouldn't catch it. I also assumed that it would be possible that software would install registry keys unrelated to the software name (it could use the software vendor's name instead, for example).

    The point about SV_TYPE_ is a good one though, thanks.


    davis
    It's not easy to juggle a pregnant wife and a troubled child, but somehow I managed to fit in eight hours of TV a day.

      Interesting. But is there a case where you only have "LimeWireInstallDate" and not the others?

      As to Gator. He is in the software directory of Lmachine" I would also add Comet System's comet cursor as it does massive tracking and all the women think it is SO cool! At least they are "honest" and give an uninstaller" Note: most spyware progs like SpyBot will take care of these two.

      "Comet Systems" => qr/comet systems/i, "Gator.com" => qr/gator.com/i,
      UPDATE

      Change that! I ran the uninstaller and surprise, the tracking stuff remained. Your spyware cleaner will fix it!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://265768]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (6)
As of 2024-04-26 09:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found