HTTP proxy: no NTLM left

NTLM authentication of proxy clients was gone but for what was left of
it: the 407 answer offering NTLM before Basic (12, under NOCRYPT, which
nothing else used) and the one for its handshake (13), sent by nothing,
and the prototypes of genchallenge() and mschap(), defined nowhere. The
strings after them in proxy_stringtable move up two: 403 with <pre> is
12, 503 13, 401 of the FTP server 14, 100 Continue 15.

rus.3ps, StringsPlugin's translation, follows: the two strings go, the
403 with <pre> is UTF-8 as the rest, the XML of the running services
has its Content-disposition, and the table of counters the columns of
its rows (Action and #/Description were one).

NT: passwords, MD4 hashes as Windows keeps them, stay. The documents
no longer tell to give proxy -n to turn off NTLM.

Plugin binary compatibility: a plugin indexing proxy_stringtable finds
the strings from 12 on two places earlier, and a .3ps file of its own
with the NTLM strings has two more than 3proxy (StringsPlugin warns).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Vladimir DubrovinandClaude Opus 5.5 committed 2026-10-28 12:02:27 +03:00
1 parent e396da2696
commit add40b1d85
12 files changed
+22 -61

No files matched your search

+7 -23
View File
@@ -88,36 +88,20 @@ char * proxy_stringtable[] = {
"<html><head><title>403 Access Denied</title></head>\r\n"
"<body><h2>403 Access Denied</h2><h3>Access control list denies you to access this resource</body></html>\r\n",
/* 12*/ "HTTP/1.0 407 Proxy Authentication Required\r\n"
#ifndef NOCRYPT
"Proxy-Authenticate: NTLM\r\n"
#endif
"Proxy-Authenticate: Basic realm=\"proxy\"\r\n"
"Connection: close\r\n"
"Content-type: text/html; charset=utf-8\r\n"
"\r\n"
"<html><head><title>407 Proxy Authentication Required</title></head>\r\n"
"<body><h2>407 Proxy Authentication Required</h2><h3>Access to requested resource disallowed by administrator or you need valid username/password to use this resource</h3></body></html>\r\n",
/* 13*/ "HTTP/1.0 407 Proxy Authentication Required\r\n"
"Connection: keep-alive\r\n"
"Content-Length: 0\r\n"
"Proxy-Authenticate: NTLM ",
/* 14*/ "HTTP/1.0 403 Forbidden\r\n"
/* 12*/ "HTTP/1.0 403 Forbidden\r\n"
"Connection: close\r\n"
"Content-type: text/html; charset=utf-8\r\n"
"\r\n"
"<pre>",
/* 15*/ "HTTP/1.0 503 Service Unavailable\r\n"
/* 13*/ "HTTP/1.0 503 Service Unavailable\r\n"
"Connection: close\r\n"
"Content-type: text/html; charset=utf-8\r\n"
"\r\n"
"<html><head><title>503 Service Unavailable</title></head>\r\n"
"<body><h2>503 Service Unavailable</h2><h3>Your request violates configured policy</h3></body></html>\r\n",
/* 16*/ "HTTP/1.0 401 Authentication Required\r\n"
/* 14*/ "HTTP/1.0 401 Authentication Required\r\n"
"WWW-Authenticate: Basic realm=\"FTP Server\"\r\n"
"Connection: close\r\n"
"Content-type: text/html; charset=utf-8\r\n"
@@ -125,7 +109,7 @@ char * proxy_stringtable[] = {
"<html><head><title>401 FTP Server requires authentication</title></head>\r\n"
"<body><h2>401 FTP Server requires authentication</h2><h3>This FTP server rejects anonymous access</h3></body></html>\r\n",
/* 17*/ "HTTP/1.1 100 Continue\r\n"
/* 15*/ "HTTP/1.1 100 Continue\r\n"
"\r\n",
NULL
@@ -532,7 +516,7 @@ static void proxystatus(struct clientparam *param, int hdrsdone, char *ftpbuf, i
}
}
if(r == 10) stidx = 2;
else if(r == 700 || r == 701) stidx = 16;
else if(r == 700 || r == 701) stidx = 14;
else if(r == 100 || (r > 10 && r < 20) || (r > 701 && r <= 705)) stidx = 1;
else if(r >= 20 && r < 30) stidx = 6;
else if(r >= 30 && r < 80) stidx = 5;
@@ -540,7 +524,7 @@ static void proxystatus(struct clientparam *param, int hdrsdone, char *ftpbuf, i
else if(r < 10) stidx = 7;
else if(r == 999) stidx = 4;
else if(r == 519) stidx = 3;
else if(r == 517) stidx = 15;
else if(r == 517) stidx = 13;
else if(r == 780) stidx = 10;
else if(r >= 511 && r <= 516) stidx = 0;
@@ -841,7 +825,7 @@ for(;;){
}
if( i > 11 && !strncasecmp((char *)(buf+inbuf), "Expect: 100", 11)){
keepalive = 1;
send_st(param, 17);
send_st(param, 15);
continue;
}
if(param->transparent && i > 6 && !strncasecmp((char *)buf + inbuf, "Host:", 5)){
-3
View File
@@ -461,9 +461,6 @@ SOCKET ftpcommand(struct clientparam *param, unsigned char * command, unsigned c
int text2unicode(const char * text, char * buf, int buflen);
void unicode2text(const char *unicode, char * buf, int len);
void genchallenge(struct clientparam *param, char * challenge, char *buf);
void mschap(const unsigned char *win_password,
const unsigned char *challenge, unsigned char *response);
void destroyhashtable(struct hashtable *ht);
int inithashtable(struct hashtable *ht, unsigned tablesize, unsigned poolsize, unsigned growlimit);