Quantcast
Channel: editing default configuration
Viewing all articles
Browse latest Browse all 6

Re: editing default configuration

$
0
0

If all you care about is the web administration username, edit the following code in httpd.c:

  if ((authorization != NULL) && (strncasecmp(authorization, "Basic ", 6) == 0)) { if (base64_decoded_len(strlen(authorization + 6)) <= sizeof(buf)) { len = base64_decode(authorization + 6, buf, strlen(authorization) - 6); buf[len] = 0; if ((pass = strchr(buf, ':')) != NULL) { *pass++ = 0; if (((u = nvram_get("http_username")) == NULL) || (*u == 0)) u = "root"; if ((strcmp(buf, "root") == 0) || (strcmp(buf, u) == 0)) { if (((p = nvram_get("http_passwd")) == NULL) || (*p == 0)) p = "admin"; if (strcmp(pass, p) == 0) { return AUTH_OK; } } } } return AUTH_BAD; } 

The conditional:

 if ((strcmp(buf, "root") == 0) || (strcmp(buf, u) == 0)) { 

is what checks the username. You could set this to just "if (1==1)" to ignore the username altogether, or you can change root to something else, etc.

This has not been tested. Your mileage may vary.


Viewing all articles
Browse latest Browse all 6

Latest Images

Trending Articles





Latest Images