Friday, May 8, 2009

远程破解QQ密码的各种方法

远程破解QQ密码的各种方法

“远程破解”与“本地破解”正好相反,是指QQ盗号者通过网络盗窃远端QQ
用户的密码。这种QQ破解有很多方法,如在线密码破解、登录窗口破解、邮箱破
解、消息诈骗以及形形色色的QQ木马病毒等。下面就让我们一同来看看这些QQ密
码的远程破解是怎么实现的。
1、在线密码破解
大家知道QQ可以利用代理服务器登录,这是一种保护措施。它不仅可以隐藏用户
的真实IP地址,以避免遭受网络攻击,还可以加快登录速度,保证登录的稳定性

在线密码破解和本地密码破解采用的技术方法类似,都是穷举法,只不过前
者完全脱离了本地用户使用的QQ。它通过对登录代理服务器进行扫描,只要想盗
的QQ号码在线,就可利用在线盗号工具实现远程TCP/IP的追捕,从而神不知鬼不
觉地盗取QQ密码!
在线破解改变了本地破解那种被动的破解方式,只要是在线的QQ号码都可以
破解,适用范围较广。但是由于它仍然采用穷举法技术,所以在枚举密钥位数长
度以及类型时,校验时间很长,破解效率不高。同样,这种方法还受到电脑速度
、网速等诸多因素的影响,因此比前面的本地破解更麻烦。
目前功能比较强大的一款QQ密码在线破解软件叫QQExplorer(最新版本,本
人收藏)。它的破解操作分四步:第一步,在QQ起始号码和结束号码中填上想要
盗取的QQ号码(此号码必须在线);第二步,在“添加或删除HTTP代理服务器”
中输入代理服务器的IP地址和端口号码(如果你嫌自己寻找QQ代理服务器麻烦,
可以使用一些现代的QQ代理公布软件);第三步,点击“添加&测试”按钮,软
件先自动检测此服务器是否正常,确定后将它加入代理服务器列表(此软件可填
入多个代理服务器的地址,并且能够自动筛选不可用或者速度慢的服务器);第
四步,点击“开始”按钮,开始在线密码破解……
2、登录窗口破解
伪造QQ登录窗口的盗号方法非常简单,这是一种比较另类的木马破解方法(
后面对木马破解有专门讲述)。先用盗号软件生成一个伪装的QQ主程序,它运行
后会出现跟腾讯QQ一模一样的登录窗口,只要用户在这个伪登录窗口中登录,输
入的QQ号及密码就会被记录下来,并通过电子邮件发送到盗号者指定的油箱中,
在此以一款叫“狐Q”(本人有最新版软件)的软件为例,首次运行它时,它会
把自身复制到QQ目录中,并把原来的QQ.exe文件改名为QQ.com(这样的更改不会
影响QQ的正常运行)。设置完毕后,“狐Q”的原程序就会消失,伪装成QQ等待
“猎物”上钩……在其软件设置中,有一项设置可以决定真假QQ交替运行的次数
,可以减少用户在使用QQ时产生的怀疑。比如说将“生效次数”设定为3,那么
用户第一次运行的是真QQ了,也就是说在第三次运行时,用户的QQ号便被盗了!
在QQ密码发送的过程中,如果发送失败,它还会把QQ号和密码记下来,等待下一
次发送。
即时监视QQ登录窗口的盗号方法利用Windows窗口函数、句柄功能实现QQ号
和密码的后台截取。此类软件几乎可以捕获Windows下所有标准密码框中的密码
,如QQ、Outlook、屏幕保护程序、各种电子邮件客户端、各种游戏账号和上网
账号等。捕获后,它也会将密码实时发送到盗号者指定的邮箱中。其代表性的盗
号软件是“密码使者”,它几乎可以捕获Windows 9x/2000/XP下所有登录窗口中
的密码,并且还能够盗取在网页中登录的各种密码。盗号在使用这款软件时,只
须填上用于接收别人QQ密码的邮箱地址及保护密码,并把生成的盗号器文件传过
去哄骗别人运行,然后就可以坐等密码上门!此软件与传统的键盘记录器不同,
它在电脑每次开机时隐藏自启动,不管密码是用键盘输入的,还是复制、粘贴的
,都能够有效地实时拦截!其注册版本居然还带有自动升级的功能,破坏力十分
巨大。
3、邮箱破解
利用邮箱盗取QQ密码也是一种比较常用的方法。我们都知道,腾讯公司在对
用户的QQ号码进行验证时需要用户填写电子邮箱。对于申请了“密码保护”功能
的用户,在腾讯主页上找回遗忘的密码时,密码会被发送到用户注册时的邮箱中
。所以,只要盗号者破解了对方的电子邮箱,就有机会得到其QQ密码!通常我们
在对方QQ注册时填写的邮箱。至于如何破解电子邮箱,具体的操作方法有多种,
由于它有点超出文本的范畴,所以大家可以自己上网查询相关资料,在此就不赘
述了。
4、消息诈骗
孔子曰:上士杀人用笔端,中士杀人用语言,下士杀人用石盘。远程盗取QQ
密码还有一种大家最常见也是最简单最有效的方法,那就是利用不少人爱贪小便
宜的弱点,进行人为的欺骗!
标题:腾讯关于xxxxx获奖通知
“QQ幸运儿:恭喜!!!您已经成为QQ在线网友齐抽奖的中奖用户。您将获
赠精美T恤1件,并有机会得到NOKIA 7110手机1部。腾讯公司(tencent.com)注:
奖品是以邮寄方式寄出,请您认真填写以下资料。如果填写错误,将被作为自动
放弃获奖机会处理。> > QQ号码:> 密码:> 姓名:> E-mail地址:> 身份证号
码:> 通讯地址:> 联系电话:> 邮编:”
比如我们的QQ经常会收到如下的陌生人消息。
如果你真的如实填写这些资料并傻傻的发送回去,不一会儿QQ密码就被盗了

还有类似这样的消息:“亲爱的***号QQ用户,恭喜你你已经成为腾讯的幸
运号码,腾讯公司送你QQ靓号:12345,密码:54321。请尽快登陆并修改密码,
感谢您对腾讯公司的支持!”不少人一看,以为白捡的便宜来了 ,登录一试还
是真的,于是就大大咧咧地笑纳了。但是,很多人为了方便,不管什么东西都爱
使用相同的密码,所以当这个QQ号的密码被你改为与自己QQ号相同的密码时,自
己QQ号的连同这个赠送的QQ号都得玩完!这是因为,赠送的QQ号已被盗号者申请
过密码保护,当你更改密码后他就利用腾讯的密码保护功能把它收了回去,同时
也收走你的QQ密码。如果你的QQ没有申请过密码保护,此刻就只能和它永别了。
5、更多的木马破解
“古希腊大军围攻特洛伊城,久攻不破,遂造一大木马藏匿将士于其中,大
部队假装撤退而弃木马。城中得知敌退,将木马作战利品拖入城内。午夜时分,
匿于木马中的将士开启城门四处纵火,城外伏兵涌入,里应外合,焚屠特洛伊城
。”这是古希腊神话《木马屠城记》的故事,其中那只木马被黑客程序借用其名
,表“一经潜入,后患无穷”之意。一个完整的木马程序由服务器端和控制端组
成。所谓“中了木马”,是指用户的电脑中被安装了木马的服务器端,而拥有控
制端的盗号者就通过网络远程控制该电脑,从而轻而易举地盗得该缒灾械腝Q密
码。
针对QQ的木马程序多不胜数,其中专门盗取QQ密码的也有一大堆,它们被偷
偷地安装在用户的电脑中,随电脑启动而自动运行,如果用户使用QQ,那么其账
号和密码就会被这些木马记录下来,并发送到木马安装者的邮箱中。前面已经介
绍了两款通过登录窗口盗号的QQ木马,下面再介绍两款典型的。
第一款:极品QQ盗号2005”
这是“极品QQ盗号”木马的最新版本。它的使用方法跟前面介绍的“密码使
者”差不多,先再“设置”栏中填入接收QQ密码的邮箱地址和发送邮件的标题,
然后把生成的盗号器偷偷地安装到别人的电脑里……这个木马声称可以避过主流
的杀毒软件,盗取QQ最新版本的密码,即QQ2004和QQ2004奥运特别版的密码。
第二款:QQ间谍3.0 ”
使用此木马软件时,点击工具条上的“服务端”,按照提示生成服务端程序
,然后把它偷偷地传到别人的电脑中,当受害者不小心运行了它,木马就被种上
了。这个木马不仅可以盗号,还能悄悄地在后台记录受害者的QQ聊天信息,并下
载可执行文件实现远程升级和远程执行脚本程序。另外再注册之后,它还可以直
接远程监控对方电脑上的QQ聊天记录。
利用木马软件盗取QQ密码,显然比用前面介绍的那些破解方法更有效率!不
仅节省时间,而且成功率也高。但是,如何把木马程序的服务器端安装在用户的
电脑中,这是一个费心思的事儿。另外,很多功能强大的木马程序都是需要花钱
注册,才能使用其全部功能。因此,对于那些水平参差不齐的盗号者而言,要想
玩转木马程序,还得费点劲。

Monday, April 27, 2009

修改 connection string during install process

public bool modifyConnectionString(string ServerName, string DBName, string AdminName, string AdminPwd, string targetSite)
{

string connectionString = string.Empty;

if (AdminName != string.Empty && AdminPwd != string.Empty)
connectionString = String.Format("Data Source={0};initial catalog={1};id={2};password={3}", ServerName, DBName, AdminName, AdminPwd);
else
connectionString = String.Format("Integrated Security=true;Data Source={0};initial catalog={1}", ServerName, DBName);
try
{
// Get the configuration object for a Web application
// running on the local server.
System.Configuration.Configuration config = WebConfigurationManager.OpenWebConfiguration("/" + targetSite)
as System.Configuration.Configuration;

// Get the appSettings.
ConnectionStringSettings settings = new ConnectionStringSettings();
settings.Name = "connectionString1";
settings.ConnectionString = connectionString;
MessageBox.Show(connectionString);
config.ConnectionStrings.ConnectionStrings.Clear();
config.ConnectionStrings.ConnectionStrings.Add(settings);
config.Save();
return true;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
return false;
}

}

run Sql generate from sql 2005

need:
Microsoft.sqlServer.ConnectionInfo
Microsoft.SqlServer.Smo
Microsoft.SqlServer.SmoEnum

c#
using Microsoft.SqlServer.Management.Common;
using Microsoft.SqlServer.Management.Smo;

private void ExecuteSqlfile(string sqlstring)
{
if (ConnectDatabase())
{
try
{
Server server = new Server(new ServerConnection(sqlConn));
server.ConnectionContext.ExecuteNonQuery(sqlstring);

}
finally
{
Command.Connection.Close();
}
}
}

install/uninstall windows service and start it.

install.bat file (%1 --parameter 1, e.g. install.bat c:\Program Files\)
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -i
cd %1
InstallUtil.exe winservice.exe
NET START "your win services display name"
Pause

uninstall.bat file
cd %1
InstallUtil.exe -u winservice.exe
Pause

c# to run the install.bat file
ProgramFilesx86() run the system program file folder path (e.g. "c:\Program File")
using System.Diagnostics;
System.Diagnostics.Process.Start("\"" + ProgramFilesx86() + "\\path\\install.bat\"", parameter1);

使用VS2005部署带有数据库的Web站点

1. 在“新建项目”对话框的左侧树状图中选择“Other Project Types”->“Setup and Deployment”节点,在右侧选择“Web Setup Project”。

2. 在Solution Explorer中在Solution上点右键,选择“Add”->“Existing Web Site”,将存放编译好的Web网站的文件夹加入Solution中。

如果添加使用aspnet_compiler编译好的网站,有可能会出现下面的提示框,点击“是”就行。


3. 再添加一个新的“Class Library”,名称“CreateDB”,用以创建数据库的操作。


删除默认生成的“class1.cs”,在这个项目上点右键,选择“Add”->“New Item”,在弹出的对话框中选择“Installer Class”,点击OK。

在类中添加如下代码:
private void ExecuteSql(string connectionString, string databaseName, string sql)
{
SqlConnection sqlConnection = new SqlConnection(connectionString);
SqlCommand sqlCommand = new SqlCommand(sql, sqlConnection);
try
{
sqlCommand.Connection.Open();
sqlCommand.Connection.ChangeDatabase(databaseName);
sqlCommand.ExecuteNonQuery();
}
catch (Exception exception)
{
throw exception;
}
finally
{
sqlCommand.Connection.Close();
}
}

public override void Install(System.Collections.IDictionary stateSaver)
{
string server = this.Context.Parameters["server"];
string database = this.Context.Parameters["dbname"];
string user = this.Context.Parameters["user"];
string password = this.Context.Parameters["pwd"];
string targetDir = this.Context.Parameters["targetdir"];

try
{
string connectionString = String.Format("data source={0};user id={1};password={2};persist security info=false;packet size=4096",
server, user, password);

//create db
ExecuteSql(connectionString, "master", "CREATE DATABASE " + database);

//set user
string setUserString = "sp_addlogin 'PrinteryERP', 'PrinteryERP', 'PrinteryERP'";
string setAccessString = "sp_grantdbaccess 'PrinteryERP'";
string setRole = "sp_addrolemember 'db_owner', 'PrinteryERP'";

//create new user login
try
{
ExecuteSql(connectionString, "master", setUserString);
}
catch { }

//set default database
try
{
ExecuteSql(connectionString, "PrinteryERP", setAccessString);
}
catch { }

//set read role
try
{
ExecuteSql(connectionString, "PrinteryERP", setRole);
}
catch { }

//create table,store produce......
Process osqlProcess = new Process();
osqlProcess.StartInfo.FileName = targetDir + "osql.exe";
osqlProcess.StartInfo.Arguments = String.Format(" -U {0} -P {1} -S {2} -d {3} -i {4}createdb.sql",
user, password, server, database, targetDir);
osqlProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
osqlProcess.Start();
osqlProcess.WaitForExit();
osqlProcess.Close();

//add data
osqlProcess.StartInfo.Arguments = String.Format(" -U {0} -P {1} -S {2} -d {3} -i {4}insertdata.sql",
user, password, server, database, targetDir);
osqlProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
osqlProcess.Start();
osqlProcess.WaitForExit();
osqlProcess.Close();
}
catch (Exception exception)
{
throw exception;
}

try
{
string configFile = targetDir + "/Web.config";
if (!File.Exists(configFile))
{
throw new InstallException("没有找到配置文件。");
}

XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(configFile);

GC.Collect();
File.Delete(configFile);
GC.Collect();

foreach (XmlNode xmlNode in xmlDoc["configuration"]["connectionStrings"].ChildNodes)
{
if (xmlNode.Name == "add")
{
if (xmlNode.Attributes["name"].Value == "DBConnection")
{
xmlNode.Attributes["connectionString"].Value = String.Format("Data Source={0};Initial Catalog={1};Persist Security Info=True;User ID=PrinteryERP;Password=PrinteryERP",
server, database);
}
if (xmlNode.Attributes["name"].Value == "UserManageServicesConnection")
{
xmlNode.Attributes["connectionString"].Value = String.Format("Data Source={0};Initial Catalog={1};Persist Security Info=True;User ID=PrinteryERP;Password=PrinteryERP",
server, database);
}
}
}
xmlDoc.Save(configFile);
}
catch (Exception exception)
{
throw exception;
}
}
4. 在“Web Setup Project”项目上点右键,选择“Add”->“Project Output”,选择Project“CreateDB”,选择“Primary Output”,点击OK。重复上述动作,将选择刚才添加的Web Site,选择“Content Files”,点击OK。


5. 在“Web Setup Project”项目上点右键,选择“Add”->“File”,将创建数据库表、存储过程和视图的脚本createdb.sql加入。重复,将向 数据表中添加基础数据的脚本insertdata.sql加入。重复,将程序osql.exe加入。
6. 在“Web Setup Project”项目上点右键,选择“Add”->“Merge Module”,在弹出的对话框中选择“VC_User_CRT71_RTL_X86_---.msm”,点击OK。添加这个VC运行库是因为在一台干净 的机器上测试的时候发现osql.exe这个程序需要这个库。
7. 在“Web Setup Project”项目上点右键,选择“Properties”,在弹出的对话框中可以设置一些安装程序的属性。点击按钮“Prerequisites”, 在弹出的对话框中选中“.NET Framework 2.0”和“Windows Installer 3.1”,选中“Download prerequisites from the same location as my application”。这样就可以把这些组件和应用程序打包在一起,安装的时候自动检测并安装了。如果需要部署的计算机如果没有打过最新的补丁的话, 是没有“Windows Installer 3.1”的,如果没有这个组件,“.NET Framework 2.0”是不能安装的。

8.在“Web Setup Project”项目上点右键,选择“View”->“Custom Actions”,在出现的树状图的节点“Install”上点右键,选择“Add Custom Actions”。在弹出的对话框中“Look in”中选择“Web Application Folders”,在下面选择“Primary output from CreateDB (Active)”,点击OK。


9. 在“Web Setup Project”项目上点右键,选择“View”->“User Interface”,在出现的树状图节点“Install”的子节点“Start”上点击右键,选择“Add Dialog”,在弹出的对话框中选择“TextBoxes(A)”。

在新添加的节点“TextBoxes (A)”上点击右键,选择“Properites Window”,依次设置Edit*Property属性为“CUSTOMTEXTA1”,“CUSTOMTEXTA2”,“CUSTOMTEXTA3” 和“CUSTOMTEXTA4”。

10. 在刚刚建立的“Primary output from CreateDB (Active)”节点上点右键,选择“Properties Window”,设置“CustomActionData”属性为“/dbname=[CUSTOMTEXTA1] /server=[CUSTOMTEXTA2] /user=[CUSTOMTEXTA3] /pwd=[CUSTOMTEXTA4] /targetdir="[TARGETDIR]\"”。

接下来对整个解决方案进行编译,会在输出目录下生成两个文件夹和两个文件。
两个文件夹中分别包含了.NET Framework 2.0和Windows Installer3.1的安装包。另外的两个文件分别是(项目名称).msi和setup.exe。如果要进行安装,请执行setup.exe。

Bootstrap Manifest Generator - How To Setup Custom Pre-Requisites (VS 2005 Web setup project)

Bootstrap Manifest Generator - How To Setup Custom Pre-Requisites (VS 2005 Web setup project)

From: http://jcrawfor74.wordpress.com/2008/02/27/bootstrap-manifest-generator-how-to-custom-pre-requisites/

Recently I was attempting to create a deployment package that has customised pre-requisites i.e I wanted my installer to detect if AJAX Extensions 1.0 was installed and if not ask the user to install it.

I found this link talking about how to do it..

http://www.codeplex.com/MSAjax10SetupPrereq

Which lead me to download the Bootstapper Manifest generator from http://www.codeplex.com/bmg

http://www.davidguyer.us/BMG/publish.htm

I was a bit lost with what to do so hopefully this will save you the pain I went though.

(Note: the BMG is really buggy. Most of the system checks don’t work, and once you add a file system check and save your project you can no longer open your bootstrap project. But given it is free it’s better than attempting to write the XML by hand)

As an example to create a pre-requisite for AJAX follow these steps:
  1. Run the BMG tool.
  2. Create a new Package Manifest. Give it a name, AJAX
  3. Add a file, choose the AJAX Extension installer .msi.
  4. Give it a name, this will be the name that appears in your installer so make it something nice like “Microsoft ASP .Net 2.0 AJAX Extensions 1.0″
  5. Build it.
Now if it builds have a look at the location that it is written to, it is a visual studio directory, so I thought to myself it must integrate with VS2005.
So open your Setup Project in visual studio, (in my case, a Web Setup Project). Right Click — Properties on the solution. There in the bottom right is the pre-requisite button.
Click on it and you should now see AJAX as an option.
Traps for young players
1. Copy paste
Inside the BGM copy and paste does not appear to work. The trick, is right click in the field and choose paste.
2. Download from web Option
If you want to download from the web enter the url for the .exe. I setup my own publically available spot to allow downloading these pre-requesites (rather than relying on the microsoft download site), as they migth change things. So I have a known static location to go download the AJAX Extensions msi.
3. System Checks
You should include a check to see whether AJAX is already installed.
In your manifest click on the file you added, and go to the “System Checks” tab. I found that most of the system checks did not work properly.
I found the one that did work was a file check, so I added a file check for System.Web.Extensions.dll in the default location
  • Add a File check. Set the file name to System.Web.Extensions.dll, turn off the search, and enter the default path to the ASP Net folder.
  • Switch to the “Install Conditions” tab and add a line that says:
    • Type - By Pass If
    • Property - AJAX (or the name you gave your system check
    • Comparison - Exists

Cheers and goodluck

Sunday, November 16, 2008

接口(Interface)的作用

接口(Interface)的作用

继承"基类"跟继承"接口"都能实现某些相同的功能,但有些接口能够完成的功能是只用基类无法实现的

1.接口用于描述一组类的公共方法/公共属性. 它不实现任何的方法或属性,只是告诉继承它的类
《至少》要实现哪些功能,继承它的类可以增加自己的方法.

2.使用接口可以使继承它的类: 命名统一/规范,易于维护.比如: 两个类 "狗"和"猫",如果它
们都继承了接口"动物",其中动物里面有个方法Behavior(),那么狗和猫必须得实现Behavior()方法,
并且都命名为Behavior这样就不会出现命名太杂乱的现象.如果命名不是Behavior(),接口会约束
即不按接口约束命名编译不会通过.

3.提供永远的接口。 当类增加时,现有接口方法能够满足继承类中的大多数方法,没必要
重新给新类设计一组方法,也节省了代码,提高了开发效率.
举个代码示例:

//公共接口: "动物"
public Interface IAnimal
{
int EyeNumber;
private void Behavior(); //行为方法,描述各种动物的特性
}

//类: 狗
public Dog : IAnimal
{
string ActiveTime = "白天";
private void Behavior()
{ {
Console.Write("我晚上睡觉,白天活动");
}
}

//类: 猫
public Cat: IAnimal
{
string ActiveTime = "夜晚";
private void Behavior()
{ {
Console.Write("我白天睡觉,晚上活动");
}
}


//简单的应用:
public static Main()
{
Dog myDog = new Dog();
myDog.Behavior(); //输出: "我晚上睡觉,白天活动"
Cat myCat = new Cat();
myCat.Behavior(); //输出: "我白天睡觉,晚上活动"
}
以上调用不同的类的相同名方法,会输出不同的东东,也就是说每个类里面的同名方法完成的
功能可以是完全不同的.

更进一步,不是用上面Main方法这样一个一个调用类的方法,用多态性实现其调用.
看一下下面这个方法:
public Behavior(IAnimal myIanimal)
{
myIanimal.Behavior();
}

其参数是<<接口类型>>,任何继承它的类都可以调用此方法,此方法能根据类的不同调用不同的类
中的方法. 也即能够自己根据不同的类,完成不同的类的功能.
多态性代码示例:
Dog myDog = new Dog();
Cat myCat = new Cat();
Behavior(myDog); //Behavior接受“狗”类实例
Behavior(myCat); //Behavior接受“狗”类实例

这样Behavior方法写一次就能完成所有继承它的类中的相同名方法的不同功能. 非常方便,

同样,由于“动物软件”功能需求,需要再增加一个"龟"类:
//类: 龟
public Tortoise: IAnimal
{
string ActiveTime = "很难说";
private void Behavior()
{ {
Console.Write("我可以不活动,一睡就睡五千年!");
}
}
那么也可以调用上面多态方法,所以说接口使方法具有较好扩展性.
如果继承它的类很多的话,有多少好处是可想而知的!

另外, 也有抽象类能够实现但接口不能实现的情况:

1. 在抽象类中可以加代码逻辑,但接口不能.

2. 如果要在接口中增加一个方法, 所有实现它的类都强制重载一遍此方法, 如果重载类很多时, 会增大工作量.

总之, 一般在仅实现单继承用途时, 尽量用抽象类, 功能也更强些!