[General Accessories] YaLzYiFe:
How to set the admin password

There's a bug in the page that allows you to change the password for the "admin" user: it is supposed to allow all passwords that contain at least 8 letters and numbers, both upper and lowercase, and no other characters. Instead it checks to see if the password contains only lowercase letters and numbers, regardless of how many you entered. This means "z" will be considered a valid password, but "ZZZZZZZZ" will not.

If you want to change the admin password (and you do!) you will need to either use only numbers and lowercase letters or fix the bug in real time. I'll explain how to do the later using Firefox.

Step 1: log in to your camera's webpage at http://ip_address:port.

Step 2: open http://ip_address:port/user.htm in a new tab.

Step 3: Press "Ctrl+Shift+K" to open a browser console. A new window will open.

Step 4: At the bottom of this new window, you will see a prompt ">>". After the prompt copy+paste the following:

function set_users()
{

if($("#user3").val() == ''){
alert(_user_x1);
return;
}
if(($("#user1").val() == '')&&($("#user2").val() != '')){
if($("#user2").val()==$("#user3").val())
{
alert(_user_x2);
return;
}
}
if(($("#user2").val() == '')&&($("#user1").val() != '')){
if($("#user1").val()==$("#user3").val())
{
alert(_user_x2);
return;
}
}
if(($("#user2").val() != '')&&($("#user1").val() != '')){
if(($("#user1").val()==$("#user3").val()) || ($("#user2").val() == $("#user3").val()) || ($("#user1").val()==$("#user2").val()))
{
alert(_user_x2);
return;
}
}

var zmnumreg=/^[0-9a-zA-Z]{8,}$/;
if($("#pwd3").val()!=""&&!zmnumreg.test($("#pwd3").val())){
alert(_PwdFormat);
return;
}

var url;
url='set_users.cgi?next_url=rebootme.htm';
url+='&loginuse='+loginuser+'&loginpas='+encodeURIComponent(loginpass);
url+='&user1='+encodeURIComponent($("#user1").val())+'&pwd1='+encodeURIComponent($("#pwd1").val())+'&pri1=1';//+$("#pri1").val();
url+='&user2='+encodeURIComponent($("#user2").val())+'&pwd2='+encodeURIComponent($("#pwd2").val())+'&pri2=2';//+$("#pri2").val();
url+='&user3='+encodeURIComponent($("#user3").val())+'&pwd3='+encodeURIComponent($("#pwd3").val())+'&pri3=255';//+$("#pri3").val();

location=url;
};"OK"

Step 5: Press ENTER, you should see the text "OK" immediately above the prompt.

Step 5: Close the window and change your password as normal.

Here's how this works: there is an error in http://ip_address:port/user.htm, line 56:

var zmnumreg=/^[0-9a-za-z]*$/;

This is a regular expression used to check the password. The "developer" accidentally wrote "a-z" twice, rather than "A-Za-z". This reg.exp. also does not verify the length is large enough. The correct reg.exp. is:

var zmnumreg=/^[0-9A-Za-z]{8,}$/;

Using the above steps you have replaced the "set_users" function in the page with a new one. This function contains the reg.exp. and does the check. The new version fixes the check, so you can enter a password that contains uppercase characters.

---------- Post added at 04:22 PM ---------- Previous post was at 03:39 PM ----------

I've found there's also a partially implemented video settings page at http://ipaddress:port/video.htm

I don't think you can reach it any other way rather than typing the url directly. It seems to be mostly broken, and nothing happens when you submit it, as there is no Javascript to do anything like there is on other pages. I also could not find a cgi interface it might submit data to (to see what happens when you do submit changes). But then I only just tested to see if anything obvious worked (e.g. set_video.cgi). I'm not sure where on the device the cgi part of the webinterface is implemented: I couldn't find a cgi-bin folder, so I cannot enumerate the cgi pages.