-
June 18th, 2004, 04:27 AM
#1
echo Y & net user
del *.*
asks are you sure
echo Y|del *.*
echo's Y to the question of the following command
net user God 123456789012345
asks are you sure you want long password
echo Y|net user God 123456789012345
gives an error 'No Valid Response Was Provided'
how can I make a password, greater than 15 characters, into a new account using the 'net' command, without it asking me 'are you sure you want to do the command you just typed?'
-
June 18th, 2004, 09:49 AM
#2
I thought that LanManager only allowed passwords up to 15 characters (one of those ugly legacy things)?
-
June 18th, 2004, 11:03 AM
#3
True enough, MsMitts, however, rather than generating a real hash, Windows 2000 and XP assign the same string constant for all passwords longer than 15 characters for their LM hash. The command, in theory, should work fine.
Entrop, just for giggles, try this: (notice the carrot before the pipe)
net user username password ^| echo Y
Our scars have the power to remind us that our past was real. -- Hannibal Lecter.
Talent is God given. Be humble. Fame is man-given. Be grateful. Conceit is self-given. Be careful. -- John Wooden
-
June 18th, 2004, 11:10 PM
#4
echo Blah 123456789012345^|echo Y
echo Blah 123456789012345 ^|echo Y
It prints the syntax of the command. Same as if I used the wrong syntax.
"The correct syntax of this command is . . . blah blah"
LanMan only does allow <15 but for local user accounts, which is what the script is for, allows up to 127 characters. I want to be able to echo the variable in as a password and allow the script to continue to run without user input; it is part of a larger automated script.
the script pulls the username and password from another program that printf'd it to a file.
Code:
.
.
.
set ="%USER%"
set ="%PASS%"
echo Y|net user "%USER%" "%PASS%" /ADD
net localgroup "%GROUP%" "%USER%" /ADD
.
.
.
I am just getting hung up on this single stupid little part.
The entire script requires no user input, and having a big batch file pop up and ask the user to push 'Y' then return would be an enormous hassle and is not possible.
-
June 19th, 2004, 07:10 AM
#5
you can use:
echo Y >> somefile.txt
net user God 123456789012345 << somefile.txt
I'v used this in auto-format-install floppies to get it to auto-format the disk.
With all the subtlety of an artillery barrage / Follow blindly, for the true path is sketchy at best. .: Bring OS X to x86!:.
Og ingen kan minnast dei linne drag i dronningas andlet den fagre dag Då landet her kvilte i heilag fred og alle hadde kjærleik å elske med.
-
June 19th, 2004, 08:38 AM
#6
echo Y > blah.txt
checked blah.txt, only consists only of Y
net user blah 123456789012345 /ADD<blah.txt
'No Valid Response was provided'
net user blah 123456789012345 /ADD < blah.txt
'No Valid Response was provided'
net user blah 123456789012345 /ADD<<blah.txt
'<<' was unexpected at this time
net user blah 123456789012345 /ADD << blah.txt
'<<' was unexpected at this time
I swear I am going to hunt down and kill whoever perverted the easy world of dos with this m$ $hit. Anyone know a phone number to one of the programmers over there in redmond ? it can be used as a therapy type thing; stress relief
-
June 19th, 2004, 10:48 AM
#7
my only thought would be something like
net user "%USER%" "%PASS%" /YES /ADD
sorry, that might be
net user "%USER%" "%PASS%" /ADD /YES
" And maddest of all, to see life as it is and not as it should be" --Miguel Cervantes
-
June 19th, 2004, 11:05 AM
#8
It prints the syntax of the command. Same as if I used the wrong syntax.
"The correct syntax of this command is . . . blah blah"
Crap. Oh well. It was a long shot.
LanMan only does allow <15 but for local user accounts, which is what the script is for, allows up to 127 characters.
Yep, I was only talking about the password length, not the account length.
I'm going to start digging for a solution because now I'm bothered that it's not working.
--TH13
***EDIT***
OK, I tried two things. The first is I disabled LMHashes in the registry. HKLM\system\currentcontrolset\control\lsa and changed the nolmhash value to 1.
Next I rebooted and went back to the command prompt.
Here is what I see:
C:\WINDOWS\system32>echo Y | net user test 123456789123456789 /add
The password entered is longer than 14 characters. Computers
with Windows prior to Windows 2000 will not be able to use
this account. Do you want to continue this operation? (Y/N) [Y]:
Hmmm, my theory of the message being tied to LMhash being enabled was instantly killed. I went back and set the value to zero again. (then rebooted)
I then decided to pass the "Y" after the command thinking that it would bang it to the OS when the nag message appeared. Now, I simply added the | echo Y to the end of the statement and here is what I got:
C:\WINDOWS\system32>net user test 123456789123456789 /add | echo Y
Y
C:\WINDOWS\system32>
Then I checked to see if the account was really there.
C:\WINDOWS\system32>net user
User accounts for \\HORSE
-------------------------------------------------------------------------------
Administrator test TheHorse13
The command completed successfully.
C:\WINDOWS\system32>[/
Looks like you're in business!!! What do they say about trying the easy things first? w00t!!
PS
In your script, you'll have to add a CRLF so that the "Y" is actually entered and processed.
Our scars have the power to remind us that our past was real. -- Hannibal Lecter.
Talent is God given. Be humble. Fame is man-given. Be grateful. Conceit is self-given. Be careful. -- John Wooden
-
June 20th, 2004, 01:40 AM
#9
That looks good so far thehorse13, but how do an /r /n into a batch file ?
The script works in that it enters Y into the question, but how can I force the script to accept that as the answer, or tell the batch file to hit enter; /r /n doesn't work in dos, and it would be ugly to have to do a start /wait c++prog.exe just to hit enter.
As I said before, having the user hit [enter] is not a possibility.
*the entire script runs through a cmdow window, which is completely invisible to the user*
-
June 20th, 2004, 11:34 AM
#10
AHA!!!
C:\WINDOWS\system32>net user test 123456789123456789 /add /y
The command completed successfully.
C:\WINDOWS\system32>
This is *exactly* what you are looking for.
Our scars have the power to remind us that our past was real. -- Hannibal Lecter.
Talent is God given. Be humble. Fame is man-given. Be grateful. Conceit is self-given. Be careful. -- John Wooden
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|