Skip to content

Instantly share code, notes, and snippets.

@dLobatog
Last active January 1, 2016 06:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dLobatog/8106711 to your computer and use it in GitHub Desktop.
Save dLobatog/8106711 to your computer and use it in GitHub Desktop.
comtrend gigabit 802.11n router movistar
pwdAdmin = 'PASSWORD IN PLAIN TEXT';
pwdSupport = 'support';
pwdUser = 'user';
function btnApply() {
var loc = 'password.cgi?';
with ( document.forms[0] ) {
var idx = userName.selectedIndex;
switch ( idx ) {
case 0:
alert("No username is selected.");
return;
case 1:
if ( pwdOld.value == pwdAdmin )
break;
else {
alert("Old admin password is wrong.");
return;
}
case 2:
if ( pwdOld.value == pwdSupport )
break;
else {
alert("Old support password is wrong.");
return;
}
case 3:
if ( pwdOld.value == pwdUser )
break;
else {
alert("Old user password is wrong.");
return;
}
}
if ( pwdNew.value != pwdCfm.value ) {
alert("The passwords do not match.");
return;
}
var str = new String();
str = pwdNew.value;
if ( str.length > 16 ) {
alert('Password should not be longer than 16 characters.');
return;
}
if ( str.indexOf(' ') != -1 ) {
alert('Password cannot contain a space.');
return;
}
switch ( idx ) {
case 2:
loc += 'sptPassword=' + encodeUrl(pwdNew.value);
break;
case 3:
loc += 'usrPassword=' + encodeUrl(pwdNew.value);
break;
default:
loc += 'adminPassword=' + encodeUrl(pwdNew.value);
break;
}
var code = 'location="' + loc + '"';
eval(code);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment