PDA

Bekijk de volledige versie : interesting findings?



xmeister
02-12-2007, 00:32
While playing with the box I became curious as to how the web interface was able to perform all system operations and if it was possible to duplicate these steps from the shell. These included operations like creating user ids (especially the password part), shares, drive mappings etc.

So I looked through the various .asp web files to see if I could find any clues.
For example, in /www/English/user_management the create_user_result.asp
and create_new_user.asp pages take care of creating a new user. But it seems they just perform some sort of library call that understands how to read the appropriate web responses.

So in the case of creating a user it calls create_user, and I can assume it reads the required values from user_name and password HTTP response values that are set in the pages.

So I did some searching on these keywords and came up with this:
http://openmss.org/forum/viewtopic.php?f=2&t=596

It appears you can use a command line program called runwebhooks to 'hook' into these operations. So based on an example from the above page link:
echo create_user | runwebhooks user_name=guest password=g
would create a new user.

The 700g includes runwebhooks, but when try to run it I get this:
runwebhooks: error while loading shared libraries: /usr/lib/libsamplenetregistration.so: undefined symbol: register_net_mode

Any thoughts?

X

kfurge
03-12-2007, 02:56
Interesting... I'm going to play around with this a little bit. Thanks for posting your findings.

- K.C.

arakar
03-12-2007, 07:24
Hi!

In /sbin directory, you have:
tmpuseradd
tmpuserdel
tmpuserchgpw

which do all the required functions. The names are a bit strange, as the changes are not temporary at all. The changes are written in /etc/passwd as they should.

Andrej