Results 1 to 7 of 7

Thread: Accessing SAM

  1. #1

    Thread Starter
    Hyperactive Member vbzero's Avatar
    Join Date
    Aug 2000
    Location
    Vienna
    Posts
    347

    Exclamation

    I tried to access the SAM file which is located in the WindowsNT system directory.
    The exact path is C:\WINNT\system32\config and the
    filename is SAM.

    When I try to access this file in any way e.g. using the
    TYPE command in the command prompt, or using notepad
    to read the file, I get an error message that this file
    is used by another process and is not accessable.

    I can't even copy it. I can only read its attributes.

    The SAM file saves the passwords under WindowsNT.
    I can't read the file alltough I'm the administrator.

    Is there a way to gain access to SAM?

    thx, vbzero

  2. #2
    Fanatic Member
    Join Date
    Oct 2000
    Location
    London
    Posts
    1,008
    Naughty, naughty. As an Administrator, you should know better. You can't access it because it is locked out by kernel processes in NT itself. Access is via the control panel applets for managing passwords. Mind you, you could always close down NT and boot into DOS.... But I didn't tell you that.

    Paul.
    Not nearly so tired now...

    Haven't been around much so be gentle...

  3. #3

    Thread Starter
    Hyperactive Member vbzero's Avatar
    Join Date
    Aug 2000
    Location
    Vienna
    Posts
    347

    Question

    I know that I could boot into DOS - I'm searching for a way to get the SAM data using an application.

    This should be able on any computer - not on mine.
    I said that I'm the admin because I thought the program
    may needs administrative rights.

    thx, vbzero

  4. #4
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Japan
    Posts
    840
    Provided it's not a NTFS partition that is.

    If you want to access user and password information you have to ask NT very nicely using the API

    NetUserAdd
    NetUserGetInfo
    NetUserChangePassword

    etc

    They're a pain in the ass because you have to pass pointers to Null terminated Unicode strings. I ended up using byte arrays and passing VarPtr(Userid(1)) and stuff like that.

    There is a class floating arround here for doing it but the add user function causses a GPF if it's called more than once.

    I ended up chucking it and writing my own function for add user (I didn't need the others) to import lists of users into NT


    Paul Dwyer
    Network Engineer
    Aussie In Tokyo

    Using Powerbasic 6 & VB6 SP4 (Please also add your VB Version to your signature!)

  5. #5

    Thread Starter
    Hyperactive Member vbzero's Avatar
    Join Date
    Aug 2000
    Location
    Vienna
    Posts
    347

    Arrow

    This sounds pretty good but where can I find some code examples for that or maybe do you know where exactly the
    passwords are saved?

    Is it possible to decode the SAM-file?

    thx, vbzero

  6. #6
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Japan
    Posts
    840
    I worked through it from here

    http://msdn.microsoft.com/library/ps...mapi2_1944.htm

    There are links on that page to most of the rest, I didn't use the sample code but the parameter defs were very helpful

    provided you know C

    And if you don't know C and you want to get into API programming then it's time to learn, go and by "C in Plain english" not a big or an expensive book and it's easy to read though.
    Paul Dwyer
    Network Engineer
    Aussie In Tokyo

    Using Powerbasic 6 & VB6 SP4 (Please also add your VB Version to your signature!)

  7. #7

    Thread Starter
    Hyperactive Member vbzero's Avatar
    Join Date
    Aug 2000
    Location
    Vienna
    Posts
    347

    Exclamation

    Thank you for help. I know C allready.

    thx, vbzero

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width