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

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
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:

In reply to Win32::Lanman by SyN/AcK

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others exploiting the Monastery: (5)
    As of 2020-06-02 02:28 GMT
    Find Nodes?
      Voting Booth?
      Do you really want to know if there is extraterrestrial life?

      Results (12 votes). Check out past polls.