Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Win32::Lanman

by SyN/AcK (Scribe)
on Jul 16, 2003 at 04:20 UTC ( [id://274681]=modulereview: print w/replies, xml ) Need Help??

Item Description: A module that handles all of the Lanman functionallity for Win32

Review Synopsis:

I've been very impressed with this module! It provides all types of functionallity for working with the Windows NetBIOS shares. Its amazing what information you can get with a simple connection to the IPC$ share. I've used this module to create a script that will test the password strength of networks I administer with a brute-force attack method. If a pass can be cracked in under 15 minutes, its changed. It has great functionallity allowing you to pull back user information, share information, password policies, Transport information, etc. etc. Deffinitely recommend taking a look at this!

I would, however, like to see a module that is able to connect to the windows SMB shares and send and receive packets with out using the standard Windows API to do so. The reason being is that there is a hefty timeout delay for an incorrect password.

Per request, here are some source examples of how this can be useful:

1.) Make a connection to the IPC$ share.

if (ConnectIPC($server, "", "", "")) { $this->{f_resultsTB}->AppendText("Null Session to $server successf +ul. \n"); # Now try getting some information $this->{f_resultsTB}->AppendText("Connecting to Registry...\n"); $this->{f_resultsTB}->AppendText("Succesful!\n"); \&RegConnect($server);

What have we done here? We've established a connection to the server's ($server) IPC$ share with null credentials, i.e., ConnectIPC(server, user, pass, domain), with null for user, pass, and domain.

2.) Enumerate users
$this->{f_resultsTB}->AppendText("[Local Users] \n"); @users = GetLocalUsers($server); if (@users) { foreach (@users) { $this->{f_resultsTB}->AppendText("$_ \n"); $user = (split(/:/,$_))[1]; $l_user = (split(/\\/,$user))[1]; \&GetUserInfo($server,$l_user); } } else { $this->{f_resultsTB}->AppendText("Did not retrieve local users +. \n"); }

Its important to recoginize that this should be within the if(ConnectIPC(...)) block. I will post the whole code bellow.

if (ConnectIPC($server, "", "", "")) { $this->{f_resultsTB}->AppendText("Null Session to $server successf +ul. \n"); # Now try getting some information $this->{f_resultsTB}->AppendText("Connecting to Registry...\n"); $this->{f_resultsTB}->AppendText("Succesful!\n"); \&RegConnect($server); $this->{f_resultsTB}->AppendText("[Local Users] \n"); @users = GetLocalUsers($server); if (@users) { foreach (@users) { $this->{f_resultsTB}->AppendText("$_ \n"); $user = (split(/:/,$_))[1]; $l_user = (split(/\\/,$user))[1]; \&GetUserInfo($server,$l_user); } } else { $this->{f_resultsTB}->AppendText("Did not retrieve local users +. \n"); } } else { $this->{f_resultsTB}->AppendText("Could not establish null ses +sion with $server. \n"); }

I apologize, this code has been made for Visual Perl.NET, hopefully some of you will find that helpful. Here is a link to the actual Perl script I used to help me figure out the module: Null.pl

Replies are listed 'Best First'.
(jeffa) Re: Win32::Lanman
by jeffa (Bishop) on Jul 16, 2003 at 15:36 UTC
    Not a very informative review, in my opinion. Neither was Programming Perl in the .NET Environment, but seeing as how it was your first, most of us went lightly. Please look over the existing Module Reviews to get a feel for which ones are good, and which ones are not. You don't have to go overboard like i did with my Lingua::Ispell review (that one was almost a tutorial), but you should at the very least try to include some sample code, like crenz's short but sweet review of Term::ProgressBar. Simply stating that you used the module with success is really not very helpful to others.

    Put more effort in it, and get a lot more out of it.

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)
    
      Actually, I had looked at a few reviews, and I didn't see them include source code, so I didn't either. I will edit my post to include some sample source code then. As for the book review, I will take constructive criticism on that if you will post it. I thought it was good, but I'm only trying to be helpful here, so let me know what you'd like to see.
        The best thing to do is sit down and read a lot of reviews. I was too ambiguous about code ... book reviews do not need to include code, but i think that module reviews benefit from good, easy to digest, cohesive code. There really are no rules for writing reviews for the Monastery, that's why i recommend that you read a lot of them and decide for yourself. As a bonus, you will learn a lot more than you probably ever wanted to know about Perl. ;) If you would like some recommendations, then check out ybiC's review of Data Munging and davorg's review of the mod_perl Cookbook. Steve_p even managed to get away with a review on a Java book. :D

        And as always, when in doubt, post your review to your scratch pad and politely ask the monks hanging around the Chatterbox to critique it.

        jeffa

        L-LL-L--L-LL-L--L-LL-L--
        -R--R-RR-R--R-RR-R--R-RR
        B--B--B--B--B--B--B--B--
        H---H---H---H---H---H---
        (the triplet paradiddle with high-hat)
        
        There, that should be better.
Re: Win32::Lanman
by Anonymous Monk on Jun 25, 2004 at 11:20 UTC
    where could we found this module ? imposible to find it on search.cpan.org
      It is available on cpan in Jens Helberg's directory. This folder also contains a ReadMe file with installation instructions:
      Win32::Lanman

      Martymart
      Wrong link in previous node, here's the correct link, still links to Jens Helbergs directory:
      Win32::Lanman

      Martymart
      Try a search engine
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2024-04-18 07:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found