/// <summary>
/// (C)2005-2006 godzeye 保留所有权利
///
/// 文件名称:PluginClass.cs
/// 文件ID:
/// 文件说明:
/// FTP 协议密码破解插件。
///
/// 测试:
///
/// 当前版本: 1.0
///
/// 作者: godzeye
/// 创建日期: 2006-9-1
/// 最后修改日期: 2006-9-1
///
/// 历史修改记录:
///
/// </summary>
using System;
using System.Collections;
using System.Net;
using System.Net.Sockets;
using System.IO;
using System.Threading;
using System.Runtime.InteropServices;
using GodzEyeLib;
namespace FtpCrack
{
/// <summary>
/// FTP 协议密码破解插件。
/// </summary>
public class PluginClass:GodzEyeLib.IPlugin
{
public PluginClass()
{
}
public event GodzEyeLib.ActionedFromPlugins action_from_plugin;
#region 变量
//用户自定义端口
public int _port=21;
//破解线程数量
public int _threadCount;
//是否显示详细破解信息
public bool _isVerbose;
//是否为无限制破解
public bool _isLimitCrack;
//连接失败尝试次数
public int _faileTryCount;
//用户名字典所在路径
private string _userNameFilePath;
//密码字典路径
private string _passwdFilePath;
//以下参数为用户名、密码所设
public ArrayList _UserName;
public ArrayList _PassWd;
//用于报告插件消息。
public GodzEyeLib.Action _action=new Action();
#endregion
#region IPlugin接口实现
public string PluginVersion
{
get
{
return "1.0.0";
}
}
public string PluginAuthor
{
get
{
return "godzeye";
}
}
public string PluginDescription
{
get
{
return "该插件用于检测ftp的弱口令,它包括一系列稀有的特性,可以更有效地对ftp服务器进行密码破解探测";
}
}
public GodzEyeLib.PluginType PluginScope
{
get
{
return GodzEyeLib.PluginType.PassWord_Crack;
}
}
public string PluginName
{
get
{
return "FtpCrack";
}
}
if(File.Exists(this._userNameFilePath)&&File.Exists(this._passwdFilePath))
{
using (StreamReader sr = new StreamReader(this._userNameFilePath))
{
while (sr.Peek() >= 0)
{
string strTmp=sr.ReadLine();
this._UserName.Add(strTmp);
}
}
using (StreamReader sr = new StreamReader(this._passwdFilePath))
{
while (sr.Peek() >= 0)
{
string strTmp=sr.ReadLine();
this._PassWd.Add(strTmp);
}
}
}
public void ShowConfigDiag()
{
FtpCrack.misc.Form_FtpConfig ftp_config=new FtpCrack.misc.Form_FtpConfig();
ftp_config.ShowDialog();
}
#endregion
#region startAttack
public unsafe void StartAttack(IPAddress addr)
{
//协商socket
GodzEyeLib.CommonFunction.init_socket();
int intCount=1;
int Passwd=1;