⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 decode_pop.c

📁 一个网络工具包,可以嗅探email和http等数据包中的密码等信息.注意要先把libnet-1.0.2a.tar.gz和 libnids-1.16.tar.gz装上,不然会因为缺少库函数而无法编译和安
💻 C
字号:
/*  decode_pop.c  Post Office Protocol.    Copyright (c) 2000 Dug Song <dugsong@monkey.org>   $Id: decode_pop.c,v 1.3 2000/11/06 14:08:42 dugsong Exp $*/#include "config.h"#include <sys/types.h>#include <stdio.h>#include <string.h>#include "base64.h"#include "options.h"#include "decode.h"intdecode_poppass(u_char *buf, int len, u_char *obuf, int olen){	char *p;		obuf[0] = '\0';		for (p = strtok(buf, "\r\n"); p != NULL; p = strtok(NULL, "\r\n")) {		if (strncasecmp(p, "user ", 5) == 0 ||		    strncasecmp(p, "pass ", 5) == 0 ||		    strncasecmp(p, "newpass ", 8) == 0) {			strlcat(obuf, p, olen);			strlcat(obuf, "\n", olen);		}	}	if (strip_lines(obuf, Opt_lines) < 3)		return (0);		return (strlen(obuf));}intdecode_pop(u_char *buf, int len, u_char *obuf, int olen){	char *p;	int i, j;		obuf[0] = '\0';		for (p = strtok(buf, "\r\n"); p != NULL; p = strtok(NULL, "\r\n")) {		if (strncasecmp(p, "AUTH PLAIN", 10) == 0 ||		    strncasecmp(p, "AUTH LOGIN", 10) == 0) {			strlcat(obuf, p, olen);			strlcat(obuf, "\n", olen);						/* Decode SASL auth. */			for (i = 0; i < 2 && (p = strtok(NULL, "\r\n")); i++) {				strlcat(obuf, p, olen);				j = base64_pton(p, p, strlen(p));				p[j] = '\0';				strlcat(obuf, " [", olen);				strlcat(obuf, p, olen);				strlcat(obuf, "]\n", olen);			}		}		/* Save regular POP2, POP3 auth info. */		else if (strncasecmp(p, "USER ", 5) == 0 ||			 strncasecmp(p, "PASS ", 5) == 0 ||			 strncasecmp(p, "HELO ", 5) == 0) {			strlcat(obuf, p, olen);			strlcat(obuf, "\n", olen);		}	}	return (strlen(obuf));}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -