亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ntlm_auth.c

?? 代理服務器 squid-2.6.STABLE16
?? C
字號:
/* * (C) 2000 Francesco Chemolli <kinkie@kame.usr.dsi.unimi.it> * Distributed freely under the terms of the GNU General Public License, * version 2. See the file COPYING for licensing details * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details.  * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * */#include "config.h"#include "ntlmauth.h"#include "ntlm.h"#include "util.h"#include "smbval/smblib-common.h"#include "smbval/rfcnb-error.h"#include <signal.h>#include <unistd.h>/* these are part of rfcnb-priv.h and smblib-priv.h */extern int SMB_Get_Error_Msg(int msg, char *msgbuf, int len);extern int SMB_Get_Last_Error();extern int SMB_Get_Last_SMB_Err();extern int RFCNB_Get_Last_Error();#include <errno.h>#define BUFFER_SIZE 10240#if HAVE_STDLIB_H#include <stdlib.h>#endif#if HAVE_GETOPT_H#include <getopt.h>#endif#ifdef HAVE_STRING_H#include <string.h>#endif#ifdef HAVE_CTYPE_H#include <ctype.h>#endif#ifdef HAVE_UNISTD_H#include <unistd.h>#endif#ifdef DEBUGchar error_messages_buffer[BUFFER_SIZE];#endifchar load_balance = 0, protocol_pedantic = 0;#ifdef NTLM_FAIL_OPENchar last_ditch_enabled = 0;#endifdc *controllers = NULL;int numcontrollers = 0;dc *current_dc;char smb_error_buffer[1000];/* signal handler to be invoked when the authentication operation * times out */static char got_timeout = 0;static voidtimeout_during_auth(int signum){    dc_disconnect();}/* makes a null-terminated string upper-case. Changes CONTENTS! */static voiduc(char *string){    char *p = string, c;    while ((c = *p)) {	*p = xtoupper(c);	p++;    }}/* makes a null-terminated string lower-case. Changes CONTENTS! */static voidlc(char *string){    char *p = string, c;    while ((c = *p)) {	*p = xtolower(c);	p++;    }}voidsend_bh_or_ld(char *bhmessage, ntlm_authenticate * failedauth, int authlen){#ifdef NTLM_FAIL_OPEN    char *creds = NULL;    if (last_ditch_enabled) {	creds = fetch_credentials(failedauth, authlen);	if (creds) {	    lc(creds);	    SEND2("LD %s", creds);	} else {	    SEND("NA last-ditch on, but no credentials");	}    } else {#endif	SEND2("BH %s", bhmessage);#ifdef NTLM_FAIL_OPEN    }#endif}/* * options: * -b try load-balancing the domain-controllers * -f fail-over to another DC if DC connection fails. *    DEPRECATED and VERBOSELY IGNORED. This is on by default now. * -l last-ditch-mode * domain\controller ... */char *my_program_name = NULL;voidusage(){    fprintf(stderr,	"%s usage:\n%s [-b] [-f] [-d] [-l] domain\\controller [domain\\controller ...]\n"	"-b enables load-balancing among controllers\n"	"-f enables failover among controllers (DEPRECATED and always active)\n"	"-l changes behavior on domain controller failyures to last-ditch.\n"	"-d enables debugging statements if DEBUG was defined at build-time.\n\n"	"You MUST specify at least one Domain Controller.\n"	"You can use either \\ or / as separator between the domain name \n"	"and the controller name\n",	my_program_name, my_program_name);}char debug_enabled=0;voidprocess_options(int argc, char *argv[]){    int opt, j, had_error = 0;    dc *new_dc = NULL, *last_dc = NULL;    while (-1 != (opt = getopt(argc, argv, "bfld"))) {	switch (opt) {	case 'b':	    load_balance = 1;	    break;	case 'f':	    fprintf(stderr,		"WARNING. The -f flag is DEPRECATED and always active.\n");	    break;#ifdef NTLM_FAIL_OPEN	case 'l':	    last_ditch_enabled = 1;	    break;#endif	case 'd':		debug_enabled=1;		break;	default:	    fprintf(stderr, "unknown option: -%c. Exiting\n", opt);	    usage();	    had_error = 1;	}    }    if (had_error)	exit(1);    /* Okay, now begin filling controllers up */    /* we can avoid memcpy-ing, and just reuse argv[] */    for (j = optind; j < argc; j++) {	char *d, *c;	/* d will not be freed in case of non-error. Since we don't reconfigure,	 * it's going to live as long as the process anyways */	d = malloc(strlen(argv[j]) + 1);	strcpy(d, argv[j]);	debug("Adding domain-controller %s\n", d);	if (NULL == (c = strchr(d, '\\')) && NULL == (c = strchr(d, '/'))) {	    fprintf(stderr, "Couldn't grok domain-controller %s\n", d);	    free(d);	    continue;	}	/* more than one delimiter is not allowed */	if (NULL != strchr(c + 1, '\\') || NULL != strchr(c + 1, '/')) {	    fprintf(stderr, "Broken domain-controller %s\n", d);	    free(d);	    continue;	}	*c++ = '\0';	new_dc = (dc *) malloc(sizeof(dc));	if (!new_dc) {	    fprintf(stderr, "Malloc error while parsing DC options\n");	    free(d);	    continue;	}	/* capitalize */	uc(c);	uc(d);	numcontrollers++;	new_dc->domain = d;	new_dc->controller = c;	new_dc->dead = 0;	if (controllers == NULL) {	/* first controller */	    controllers = new_dc;	    last_dc = new_dc;	} else {	    last_dc->next = new_dc;	/* can't be null */	    last_dc = new_dc;	}    }    if (numcontrollers == 0) {	fprintf(stderr, "You must specify at least one domain-controller!\n");	usage();	exit(1);    }    last_dc->next = controllers;	/* close the queue, now it's circular */}/* tries connecting to the domain controllers in the "controllers" ring, * with failover if the adequate option is specified. */const char *obtain_challenge(){    int j = 0;    const char *ch = NULL;    for (j = 0; j < numcontrollers; j++) {	debug("obtain_challenge: selecting %s\\%s (attempt #%d)\n",	    current_dc->domain, current_dc->controller, j + 1);	if (current_dc->dead != 0) {	    if (time(NULL) - current_dc->dead >= DEAD_DC_RETRY_INTERVAL) {		/* mark helper as retry-worthy if it's so. */		debug("Reviving DC\n");		current_dc->dead = 0;	    } else {		/* skip it */		debug("Skipping it\n");		continue;	    }	}	/* else branch. Here we KNOW that the DC is fine */	debug("attempting challenge retrieval\n");	ch = make_challenge(current_dc->domain, current_dc->controller);	debug("make_challenge retuned %p\n", ch);	if (ch) {	    debug("Got it\n");	    return ch;		/* All went OK, returning */	}	/* Huston, we've got a problem. Take this DC out of the loop */	debug("Marking DC as DEAD\n");	current_dc->dead = time(NULL);	/* Try with the next */	debug("moving on to next controller\n");	current_dc = current_dc->next;    }    /* all DCs failed. */    return NULL;}voidmanage_request(){    ntlmhdr *fast_header;    char buf[BUFFER_SIZE];    const char *ch;    char *ch2, *decoded, *cred;    int plen;    if (fgets(buf, BUFFER_SIZE, stdin) == NULL) {	fprintf(stderr, "fgets() failed! dying..... errno=%d (%s)\n", errno,	    strerror(errno));	exit(1);		/* BIIG buffer */    }    debug("managing request\n");    ch2 = memchr(buf, '\n', BUFFER_SIZE);	/* safer against overrun than strchr */    if (ch2) {	*ch2 = '\0';		/* terminate the string at newline. */	ch = ch2;    }    debug("ntlm authenticator. Got '%s' from Squid\n", buf);    if (memcmp(buf, "KK ", 3) == 0) {	/* authenticate-request */	/* figure out what we got */	decoded = base64_decode(buf + 3);	/* Note: we don't need to manage memory at this point, since	 *  base64_decode returns a pointer to static storage.	 */	if (!decoded) {		/* decoding failure, return error */	    SEND("NA Packet format error, couldn't base64-decode");	    return;	}	/* fast-track-decode request type. */	fast_header = (struct _ntlmhdr *) decoded;	/* sanity-check: it IS a NTLMSSP packet, isn't it? */	if (memcmp(fast_header->signature, "NTLMSSP", 8) != 0) {	    SEND("NA Broken authentication packet");	    return;	}	switch WSWAP(fast_header->type) {	case NTLM_NEGOTIATE:	    SEND("NA Invalid negotiation request received");	    return;	    /* notreached */	case NTLM_CHALLENGE:	    SEND		("NA Got a challenge. We refuse to have our authority disputed");	    return;	    /* notreached */	case NTLM_AUTHENTICATE:	    /* check against the DC */	    plen = strlen(buf) * 3 / 4;		/* we only need it here. Optimization */	    signal(SIGALRM, timeout_during_auth);	    alarm(30);	    cred = ntlm_check_auth((ntlm_authenticate *) decoded, plen);	    alarm(0);	    signal(SIGALRM, SIG_DFL);	    if (got_timeout != 0) {		fprintf(stderr, "ntlm-auth[%ld]: Timeout during authentication.\n", (long)getpid());		SEND("BH Timeout during authentication");		got_timeout = 0;		return;	    }	    if (cred == NULL) {		int smblib_err, smb_errorclass, smb_errorcode, nb_error;		if (ntlm_errno == NTLM_LOGON_ERROR) {	/* hackish */			SEND("NA Logon Failure");			return;		}		/* there was an error. We have two errno's to look at.		 * libntlmssp's erno is insufficient, we'll have to look at		 * the actual SMB library error codes, to acually figure		 * out what's happening. The thing has braindamaged interfacess..*/		smblib_err = SMB_Get_Last_Error();		smb_errorclass = SMBlib_Error_Class(SMB_Get_Last_SMB_Err());		smb_errorcode = SMBlib_Error_Code(SMB_Get_Last_SMB_Err());		nb_error = RFCNB_Get_Last_Error();		debug("No creds. SMBlib error %d, SMB error class %d, SMB error code %d, NB error %d\n",		    smblib_err, smb_errorclass, smb_errorcode, nb_error);		/* Should I use smblib_err? Actually it seems I can do as well		 * without it.. */		if (nb_error != 0) {	/* netbios-level error */		    send_bh_or_ld("NetBios error!",			(ntlm_authenticate *) decoded, plen);		    fprintf(stderr, "NetBios error code %d (%s)\n", nb_error,			RFCNB_Error_Strings[abs(nb_error)]);		    return;		}		switch (smb_errorclass) {		case SMBC_SUCCESS:		    debug("Huh? Got a SMB success code but could check auth..");		    SEND("NA Authentication failed");		    /*		     * send_bh_or_ld("SMB success, but no creds. Internal error?",		     * (ntlm_authenticate *) decoded, plen);		     */		    return;		case SMBC_ERRDOS:		    /*this is the most important one for errors */		    debug("DOS error\n");		    switch (smb_errorcode) {			/* two categories matter to us: those which could be			 * server errors, and those which are auth errors */		    case SMBD_noaccess:	/* 5 */			SEND("NA Access denied");			return;		    case SMBD_badformat:			SEND("NA bad format in authentication packet");			return;		    case SMBD_badaccess:			SEND("NA Bad access request");			return;		    case SMBD_baddata:			SEND("NA Bad Data");			return;		    default:			send_bh_or_ld("DOS Error",			    (ntlm_authenticate *) decoded, plen);			return;		    }		case SMBC_ERRSRV:	/* server errors */		    debug("Server error");		    switch (smb_errorcode) {			/* mostly same as above */		    case SMBV_badpw:			SEND("NA Bad password");			return;		    case SMBV_access:			SEND("NA Server access error");			return;		    default:			send_bh_or_ld("Server Error",			    (ntlm_authenticate *) decoded, plen);			return;		    }		case SMBC_ERRHRD:	/* hardware errors don't really matter */		    send_bh_or_ld("Domain Controller Hardware error",			(ntlm_authenticate *) decoded, plen);		    return;		case SMBC_ERRCMD:		    send_bh_or_ld("Domain Controller Command Error",			(ntlm_authenticate *) decoded, plen);		    return;		}	    }	    lc(cred);		/* let's lowercase them for our convenience */	    SEND2("AF %s", cred);	    return;	default:	    SEND("BH unknown authentication packet type");	    return;	}	return;    }    if (memcmp(buf, "YR", 2) == 0) {	/* refresh-request */	dc_disconnect();	ch = obtain_challenge();	/* Robert says we can afford to wait forever. I'll trust him on this	 * one */	while (ch == NULL) {	    sleep(30);	    ch = obtain_challenge();	}	SEND2("TT %s", ch);	return;    }    SEND("BH Helper detected protocol error");    return;/********* END ********/}intmain(int argc, char *argv[]){    debug("ntlm_auth build " __DATE__ ", " __TIME__ " starting up...\n");#ifdef DEBUG    debug("changing dir to /tmp\n");    chdir("/tmp");#endif    my_program_name = argv[0];    process_options(argc, argv);    debug("options processed OK\n");    /* initialize FDescs */    setbuf(stdout, NULL);    setbuf(stderr, NULL);    /* select the first domain controller we're going to use */    current_dc = controllers;    if (load_balance != 0 && numcontrollers > 1) {	int n;	pid_t pid = getpid();	n = pid % numcontrollers;	debug("load balancing. Selected controller #%d\n", n);	while (n > 0) {	    current_dc = current_dc->next;	    n--;	}    }    while (1) {	manage_request();    }    return 0;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品一区二区三区高清aⅴ | 久久久久久久久久久久久久久99| 亚洲国产成人tv| 欧美日韩精品福利| 免费人成黄页网站在线一区二区| 欧美一区二区精品在线| 久久99精品久久久久久久久久久久| 日韩精品专区在线影院重磅| 经典三级视频一区| 国产精品免费视频一区| 91老司机福利 在线| 亚洲成人中文在线| 欧美刺激脚交jootjob| 成人午夜激情在线| 亚洲第一二三四区| 久久精品夜色噜噜亚洲aⅴ| 成人手机电影网| 亚洲一区二区不卡免费| 欧美人狂配大交3d怪物一区| 九九九精品视频| 国产精品久久久久久久久久免费看 | 天堂影院一区二区| 久久亚洲免费视频| 91在线播放网址| 午夜国产精品一区| 国产欧美日韩中文久久| 91黄色免费网站| 国产一区二区免费在线| 亚洲视频一区二区在线| 日韩一区二区高清| 97精品国产露脸对白| 美女视频黄a大片欧美| 国产精品电影一区二区| 日韩午夜激情视频| 色女孩综合影院| 韩国一区二区在线观看| 亚洲国产日韩a在线播放性色| 久久久久久**毛片大全| 欧美视频中文字幕| 成人网男人的天堂| 蜜桃一区二区三区在线观看| 国产精品的网站| 久久蜜桃香蕉精品一区二区三区| 欧亚洲嫩模精品一区三区| 国产一区二区伦理| 日韩成人av影视| 一区二区在线观看不卡| 国产日韩欧美电影| 日韩精品一区二区三区视频播放| 在线精品视频免费播放| 成人综合在线网站| 国产精品综合久久| 蜜桃精品视频在线观看| 亚洲国产综合在线| 中文字幕中文字幕中文字幕亚洲无线| 精品免费日韩av| 6080国产精品一区二区| 在线观看中文字幕不卡| 波多野结衣一区二区三区| 理论电影国产精品| 人人狠狠综合久久亚洲| 亚洲午夜久久久| 一二三区精品视频| 一区二区三区色| 亚洲精品高清在线观看| 国产精品成人一区二区三区夜夜夜 | 欧美一级一区二区| 5566中文字幕一区二区电影| 在线观看国产一区二区| 色综合天天综合网天天狠天天| 成人免费不卡视频| 不卡的av网站| 成人福利电影精品一区二区在线观看| 国产在线一区二区综合免费视频| 免费xxxx性欧美18vr| 日本不卡123| 免费成人av资源网| 美女在线视频一区| 国产中文一区二区三区| 国产成人久久精品77777最新版本| 国内精品写真在线观看| 国产剧情一区二区| 成人网在线免费视频| av在线不卡电影| 日本精品视频一区二区| 欧美在线观看一区二区| 欧美视频在线不卡| 日韩一区二区三区电影在线观看 | 色综合久久久网| 欧美日韩和欧美的一区二区| 欧美精品电影在线播放| 777欧美精品| 精品少妇一区二区三区日产乱码 | 精品国产精品网麻豆系列| 久久久久久久国产精品影院| 国产日产精品一区| 亚洲免费在线电影| 亚洲电影你懂得| 久久er精品视频| 成人美女视频在线观看18| 91在线视频网址| 777久久久精品| 欧美激情一区在线观看| 亚洲一区在线观看网站| 日韩在线播放一区二区| 国产乱妇无码大片在线观看| 成人网在线免费视频| 欧美日韩在线精品一区二区三区激情| 欧美一级夜夜爽| 国产精品久久午夜夜伦鲁鲁| 亚洲va中文字幕| 国内成人精品2018免费看| 色网站国产精品| 精品国产免费一区二区三区四区 | 韩国精品久久久| 色噜噜夜夜夜综合网| 精品国产污污免费网站入口 | 国产午夜精品理论片a级大结局 | heyzo一本久久综合| 欧美精品自拍偷拍动漫精品| 国产亚洲婷婷免费| 亚洲va韩国va欧美va精品| 国产精品一二三在| 欧美精品在线视频| 国产精品三级电影| 日韩国产一二三区| 99精品黄色片免费大全| 欧美xxxxxxxxx| 亚洲成人精品影院| av成人免费在线| 久久视频一区二区| 亚洲成人久久影院| 色综合天天性综合| 国产午夜精品久久久久久久| 日本成人超碰在线观看| 91女人视频在线观看| 久久精品视频免费观看| 日韩成人免费看| 欧美三级韩国三级日本三斤| 中文字幕成人网| 国产一区在线精品| 日韩免费高清av| 日韩av不卡在线观看| 在线免费精品视频| 亚洲色图在线看| 成人av网站免费观看| 久久综合国产精品| 麻豆一区二区在线| 51精品久久久久久久蜜臀| 一区二区三区不卡在线观看 | 成人国产亚洲欧美成人综合网 | 国产**成人网毛片九色| 欧美大片一区二区| 麻豆91在线观看| 91精品综合久久久久久| 无码av免费一区二区三区试看| 色婷婷综合久久久中文一区二区| 中文字幕 久热精品 视频在线| 国产真实乱偷精品视频免| 精品国产伦一区二区三区观看方式 | 日韩欧美视频在线| 日本伊人色综合网| 欧美老女人第四色| 日日摸夜夜添夜夜添精品视频| 欧美色欧美亚洲另类二区| 亚洲黄色在线视频| 在线观看91视频| 亚洲成人自拍偷拍| 欧美一级欧美一级在线播放| 日韩高清在线一区| 精品国产乱码久久久久久夜甘婷婷 | 国产精品综合视频| 国产精品亲子伦对白| av欧美精品.com| 亚洲一区在线电影| 欧美一区二区视频网站| 日本欧美一区二区在线观看| 日韩欧美123| 国产电影一区二区三区| 国产精品网友自拍| 91福利视频久久久久| 天天综合日日夜夜精品| 欧美大肚乱孕交hd孕妇| 国产一区二区网址| 国产精品久久久久aaaa樱花| 99精品久久免费看蜜臀剧情介绍| 一区二区三区四区在线播放| 欧美色图片你懂的| 日本亚洲最大的色成网站www| 欧美r级在线观看| 97se亚洲国产综合自在线不卡| 一区二区三区中文在线| 欧美一区二区视频在线观看2022| 国产一区二区美女诱惑| 亚洲精品国产无天堂网2021 | 日本精品裸体写真集在线观看| 亚洲成av人片一区二区| 久久亚洲精精品中文字幕早川悠里| 国产69精品久久久久777| 依依成人综合视频|