@@ -44,6 +44,8 @@ public partial class Main : Form
44
44
public string [ ] servicesName = { } ;
45
45
public string [ ] servicesPort = { } ;
46
46
47
+ public long scanPortsSumCount = 0 ;
48
+
47
49
private Dictionary < string , ServiceModel > services = new Dictionary < string , ServiceModel > ( ) ; //服务列表
48
50
private Dictionary < string , HashSet < string > > dics = new Dictionary < string , HashSet < string > > ( ) ; //字典列表
49
51
public ConcurrentBag < string > list_cracker = new ConcurrentBag < string > ( ) ;
@@ -92,7 +94,7 @@ public void LogAppend(Color color, string text)
92
94
}
93
95
this . txt_log . SelectionColor = color ;
94
96
this . txt_log . HideSelection = false ;
95
- this . txt_log . AppendText ( text + " \r \n " ) ;
97
+ this . txt_log . AppendText ( text + Environment . NewLine ) ;
96
98
}
97
99
/// <summary>
98
100
/// 显示错误日志
@@ -161,7 +163,7 @@ private void updateStatus() {
161
163
}
162
164
this . stxt_crackerSuccessCount . Text = successCount + "" ;
163
165
this . stxt_useTime . Text = runTime + "" ;
164
-
166
+ this . tssl_notScanPortsSumCount . Text = this . scanPortsSumCount + "" ;
165
167
}
166
168
catch ( Exception e ) {
167
169
LogWarning ( e . Message ) ;
@@ -221,6 +223,7 @@ public void ScanPort(string ip,string serviceName,int port) {
221
223
tc . Close ( ) ;
222
224
223
225
}
226
+ Interlocked . Decrement ( ref scanPortsSumCount ) ;
224
227
}
225
228
226
229
private void crackerService ( string crakerstring , string username , string password )
@@ -412,16 +415,21 @@ private void cracker()
412
415
stp = new SmartThreadPool ( ) ;
413
416
stp . MaxThreads = maxThread ;
414
417
creackerSumCount = 0 ;
415
- //计算总数
418
+ scanPortsSumCount = 0 ;
419
+
420
+
421
+ //计算端口扫描总数
416
422
if ( isScanport )
417
423
{
418
424
foreach ( string serviceName in this . services_list . CheckedItems )
419
425
{
420
426
string [ ] ports = this . services [ serviceName ] . Port . Split ( ',' ) ;
421
- creackerSumCount += this . list_target . Count * ports . Length ;
427
+ scanPortsSumCount += this . list_target . Count * ports . Length ;
422
428
}
423
429
}
424
-
430
+ //更新状态
431
+ this . Invoke ( new update ( updateStatus ) ) ;
432
+
425
433
foreach ( string serviceName in this . services_list . CheckedItems ) {
426
434
string [ ] ports = this . services [ serviceName ] . Port . Split ( ',' ) ;
427
435
foreach ( string sport in ports )
@@ -455,7 +463,7 @@ private void cracker()
455
463
{
456
464
foreach ( string serviceName in this . services_list . CheckedItems )
457
465
{
458
- creackerSumCount += list_cracker . Count * this . services_list . CheckedItems . Count * this . services [ serviceName ] . ListUserName . Count * this . services [ serviceName ] . ListPassword . Count ;
466
+ creackerSumCount += list_cracker . Count * this . services [ serviceName ] . ListUserName . Count * this . services [ serviceName ] . ListPassword . Count ;
459
467
}
460
468
}
461
469
else
@@ -756,6 +764,7 @@ private Server addRDPClient(String ip,int port,String username,String password,i
756
764
catch ( Exception e )
757
765
{
758
766
FileTool . log ( ip + ":" + port + "-RDP操作异常-" + e . Message ) ;
767
+ LogWarning ( ip + ":" + port + "-RDP操作异常-" + e . Message ) ;
759
768
server . isDisConnected = true ;
760
769
server . isEndMRE . Set ( ) ;
761
770
}
@@ -767,14 +776,16 @@ private Server addRDPClient(String ip,int port,String username,String password,i
767
776
private void ClearRDP ( RdpClient rdp ) {
768
777
try
769
778
{
770
- this . rdp_panle . Controls . Remove ( rdp ) ;
771
779
if ( rdp . IsDisposed == false )
772
780
{
773
781
rdp . Dispose ( ) ;
774
782
}
783
+ this . rdp_panle . Controls . Remove ( rdp ) ;
784
+
775
785
}
776
786
catch ( Exception e ) {
777
787
FileTool . log ( "RDP资源清理异常-" + e . Message ) ;
788
+ LogWarning ( "RDP资源清理异常-" + e . Message ) ;
778
789
}
779
790
}
780
791
@@ -1073,7 +1084,7 @@ public static String getSid()
1073
1084
return sid ;
1074
1085
}
1075
1086
1076
- private static int version = 20181113 ;
1087
+ private static int version = 20181125 ;
1077
1088
public static string versionURL = "http://www.shack2.org/soft/getNewVersion?ENNAME=SNETCracker&NO=" + Uri . EscapeDataString ( getSid ( ) ) + "&VERSION=" + version ;
1078
1089
private void tsmi_help_version_Click ( object sender , EventArgs e )
1079
1090
{
0 commit comments