Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
update
  • Loading branch information
shack2 committed Oct 25, 2018
1 parent fef7bd6 commit 4d0314b
Show file tree
Hide file tree
Showing 10 changed files with 175 additions and 59 deletions.
35 changes: 18 additions & 17 deletions SNETCracker/Main.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

71 changes: 63 additions & 8 deletions SNETCracker/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Management;
using System.Net.Sockets;
using System.Text.RegularExpressions;
using System.Threading;
Expand Down Expand Up @@ -59,6 +60,7 @@ public void initServices() {

LogWarning("加载检查服务配置发生异常!" + e.Message);
}
services.Clear();
for (int i=0;i< servicesName.Length;i++) {
ServiceModel sm = new ServiceModel();
sm.Name = servicesName[i];
Expand Down Expand Up @@ -275,7 +277,8 @@ private void crackerService(string crakerstring,string username,string password)
{
break;
}

Stopwatch sw = new Stopwatch();
sw.Start();
if (serviceName.Equals("RDP"))
{
server=creackRDP(ip, port, username, password, timeOut);
Expand All @@ -291,6 +294,8 @@ private void crackerService(string crakerstring,string username,string password)
server = cs.creack(ip, port, username, password, timeOut);

}
sw.Stop();
server.userTime = sw.ElapsedMilliseconds;

}
catch (IPBreakException ie)
Expand Down Expand Up @@ -352,7 +357,7 @@ private void crackerService(string crakerstring,string username,string password)
list_success_username.Add(ip + serviceName + port + username);
}
Interlocked.Increment(ref successCount);
addItemToListView(successCount, ip, serviceName, port, username, password, server.banner);
addItemToListView(successCount, ip, serviceName, port, username, password, server.banner, server.userTime);
string sinfo = ip + "-----" + serviceName + "----" + username + "----" + password +"----"+ server.banner +"----成功!";
LogInfo(sinfo);
FileTool.AppendLogToFile(Directory.GetCurrentDirectory() + "/cracker_result.log", sinfo);
Expand All @@ -375,7 +380,7 @@ private void crackerService(string crakerstring,string username,string password)
}
}

private void addItemToListView(int successCount,string ip,String serviceName,int port,String username,String password,String banner) {
private void addItemToListView(int successCount,string ip,String serviceName,int port,String username,String password,String banner,long userTime) {

ListViewItem lvi = new ListViewItem(successCount.ToString());
lvi.SubItems.Add(ip);
Expand All @@ -384,6 +389,7 @@ private void addItemToListView(int successCount,string ip,String serviceName,int
lvi.SubItems.Add(username);
lvi.SubItems.Add(password);
lvi.SubItems.Add(banner);
lvi.SubItems.Add(userTime+"");
this.list_lvw.Invoke(new DelegateAddItem(addItem), lvi);
}

Expand Down Expand Up @@ -710,7 +716,7 @@ private void crakerKey()
Array.Copy(forgedBytes, 0, output, 14, forgedBytes.Length);

var rsaManaged2 = new RSAManaged();
rsaManaged2.FromXmlString("<RSAKeyValue><Modulus>thycVKzZzdxBD6Rl8RoS9MEs1rrLY5qDhse+a+ljfpM=</Modulus><Exponent>AQAB</Exponent><P>xJXNbvuhJEpA647ZChJHMQ==</P><Q>7Sb4m1/8WXGGL/2Zw075Aw==</Q><DP>VtattvbkyfkbEHM7oN1OIQ==</DP><DQ>0kQaatCpErjYDBbjTUro9w==</DQ><InverseQ>AVeR8pKZ4H05p7NRb02kNw==</InverseQ><D>ENshFS1Sk51ZYEtFLEXPjzPUmZbbIak0S+dyUK5o/sE=</D></RSAKeyValue>");
rsaManaged2.FromXmlString("<RSAKeyValue><Modulus>thycVKzZzdxBD6Rl8RoS9MEs1rrLY5qDhse+a+ljfpM=</Modulus><Exponent>AQAB</Exponent><P>xJXNbvuhJEpA647ZChJHMQ==</P><Q>7Sb4m1/8WXGGL/2Zw075Aw==</Q><DP>VtattvbkyfkbEHM7oN1OIQ==</DP><DQ>0kQaatCpErjYDBbjTUro9w==</DQ><InieQ>AVeR8pKZ4H05p7NRb02kNw==</InverseQ><D>ENshFS1Sk51ZYEtFLEXPjzPUmZbbIak0S+dyUK5o/sE=</D></RSAKeyValue>");

var decrypted = rsaManaged2.DecryptValue(output);

Expand Down Expand Up @@ -785,8 +791,6 @@ private Server creackRDP(String ip, int port,String username, String password, i

private void btn_cracker_Click(object sender, EventArgs e)
{


this.btn_cracker.Enabled = false;
this.list_success_username.Clear();
this.services_list.Enabled = false;
Expand Down Expand Up @@ -1024,8 +1028,52 @@ private void tsmi_openURL_Click(object sender, EventArgs e)
}
}

private static int version = 20180809;
public static string versionURL = "http://www.shack2.org/soft/SNETCracker/version.txt";
public static String getSid()
{
//获得系统唯一号,系统安装id和mac组合
String sid = Environment.OSVersion + "_";
try
{
var officeSoftware = new ManagementObjectSearcher("SELECT ID, ApplicationId, PartialProductKey, LicenseIsAddon, Description, Name, OfflineInstallationId FROM SoftwareLicensingProduct where PartialProductKey <> null");
var result = officeSoftware.Get();
foreach (var item in result)
{
if (item.GetPropertyValue("name").ToString().StartsWith("Windows"))
{

sid += item.GetPropertyValue("OfflineInstallationId").ToString() + "__";
break;
}
}

}
catch (Exception e)
{
sid += "ex__";
}
try
{

ManagementClass mc = new ManagementClass("Win32_NetworkAdapterConfiguration");
ManagementObjectCollection moc = mc.GetInstances();
foreach (ManagementObject mo in moc)
{
if ((bool)mo["IPEnabled"] == true)
{
sid += mo["MacAddress"].ToString().Replace(":", "-");
break;
}
}
}
catch
{
sid += "ex__" + System.Guid.NewGuid();
}
return sid;
}

private static int version = 20180924;
public static string versionURL = "http://www.shack2.org/soft/getNewVersion?ENNAME=SNETCracker&NO="+ Uri.EscapeDataString(getSid())+ "&VERSION="+ version;
private void tsmi_help_version_Click(object sender, EventArgs e)
{
MessageBox.Show("V1.0 测试版----" + version);
Expand Down Expand Up @@ -1100,5 +1148,12 @@ private void cbox_threadSize_SelectedIndexChanged(object sender, EventArgs e)
{
updateThreadSize();
}

private void tsmi_reloadConfig_Click(object sender, EventArgs e)
{
initServices();
MessageBox.Show("ok");

}
}
}
55 changes: 32 additions & 23 deletions SNETCracker/Model/CrackFTP.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using LumiSoft.Net.FTP.Client;
using Chilkat;
using FluentFTP;
using LumiSoft.Net.FTP.Client;
using System;
using System.Net;
using Tools;
Expand All @@ -10,35 +12,42 @@ class CrackFTP : CrackService
public CrackFTP() {

}

public override Server creack(String ip, int port,String username,String password,int timeOut) {

FTP_Client ftp = null;


FtpClient ftp = new FtpClient();
Server server = new Server();
try
if ("".Equals(password)) {
password = "";
}
try
{
ftp.Host = ip;
ftp.Credentials = new NetworkCredential(username, password);
ftp.Connect();
if (ftp.IsConnected)
{
ftp = new FTP_Client();
ftp.Timeout = timeOut;
ftp.Connect(ip, port, false);
if (ftp.IsConnected)
{
ftp.Authenticate(username, password);
server.isSuccess = ftp.IsAuthenticated;
server.banner = ftp.GreetingText;
}
server.isSuccess = true;
server.banner = ftp.SystemType;
}
catch (Exception e)
{
}
catch (Exception e)
{
if(e.Message.IndexOf("cannot log in") ==-1){
throw e;
}
}
finally
{
if (ftp != null)
{
ftp.Disconnect();
}
finally {
if (ftp != null)
{
ftp.Disconnect();
}
}
}
return server;
}



}
}
3 changes: 2 additions & 1 deletion SNETCracker/Model/CrackMySQL.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ public override Server creack(String ip, int port, String username, String passw
password = "";
}
conn.ConnectionString = "server=" + ip + ";user id=" + username + ";password=" + password + ";pooling=false;ConnectionTimeout=" + timeOut;

conn.Open();

server.isSuccess = ConnectionState.Open.Equals(conn.State);
if (server.isSuccess)
{
Expand Down Expand Up @@ -60,7 +62,6 @@ public override Server creack(String ip, int port, String username, String passw
finally
{
conn.Close();

}
return server;
}
Expand Down
Loading

0 comments on commit 4d0314b

Please sign in to comment.