-
Notifications
You must be signed in to change notification settings - Fork 21
/
frmAttackVisualizing.frm
857 lines (764 loc) · 29.7 KB
/
frmAttackVisualizing.frm
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
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmAttackVisualizing
Caption = "Attack Visualizing"
ClientHeight = 5895
ClientLeft = 165
ClientTop = 735
ClientWidth = 6270
Icon = "frmAttackVisualizing.frx":0000
KeyPreview = -1 'True
LinkTopic = "Form1"
ScaleHeight = 5895
ScaleWidth = 6270
StartUpPosition = 3 'Windows Default
Begin VB.Frame fraIllustrated
Height = 5055
Left = 240
TabIndex = 4
Top = 600
Width = 5775
Begin VB.TextBox txtNetworkData
Appearance = 0 'Flat
BackColor = &H00C0FFFF&
Height = 2775
Left = 120
Locked = -1 'True
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 3
Text = "frmAttackVisualizing.frx":0CCA
Top = 2160
Width = 5535
End
Begin VB.TextBox txtAttackerData
Appearance = 0 'Flat
BackColor = &H00C0C0FF&
Height = 735
Left = 240
Locked = -1 'True
MultiLine = -1 'True
TabIndex = 1
Text = "frmAttackVisualizing.frx":0D4A
Top = 1320
Width = 2415
End
Begin VB.TextBox txtTargetData
Appearance = 0 'Flat
BackColor = &H00C0FFC0&
Height = 735
Left = 3120
Locked = -1 'True
MultiLine = -1 'True
TabIndex = 2
Text = "frmAttackVisualizing.frx":0D56
Top = 1320
Width = 2415
End
Begin VB.Label lblAttackerComputing
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "!"
ForeColor = &H00FFFFFF&
Height = 255
Left = 1200
TabIndex = 6
Top = 600
Visible = 0 'False
Width = 255
End
Begin VB.Label lblTargetName
Alignment = 2 'Center
BackColor = &H00404040&
BackStyle = 0 'Transparent
Caption = "Target"
ForeColor = &H00FFFFFF&
Height = 255
Left = 4440
MouseIcon = "frmAttackVisualizing.frx":0D58
MousePointer = 99 'Custom
TabIndex = 8
Top = 600
Width = 1095
End
Begin VB.Label lblTargetComputing
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "!"
ForeColor = &H00FFFFFF&
Height = 255
Left = 4320
TabIndex = 5
Top = 600
Visible = 0 'False
Width = 255
End
Begin VB.Label lblNetworkName
Alignment = 2 'Center
BackColor = &H00404040&
BackStyle = 0 'Transparent
Caption = "Network"
ForeColor = &H00FFFFFF&
Height = 255
Left = 2160
MouseIcon = "frmAttackVisualizing.frx":1062
MousePointer = 99 'Custom
TabIndex = 9
Top = 600
Width = 1455
End
Begin VB.Label lblAttackerName
Alignment = 2 'Center
BackColor = &H00404040&
BackStyle = 0 'Transparent
Caption = "Attacker"
ForeColor = &H00FFFFFF&
Height = 255
Left = 240
TabIndex = 7
Top = 600
Width = 1095
End
Begin VB.Shape shpTarget
BackColor = &H00004000&
BackStyle = 1 'Opaque
Height = 735
Left = 4320
Top = 360
Width = 1335
End
Begin VB.Shape shpNetwork
BackColor = &H00404040&
BackStyle = 1 'Opaque
Height = 975
Left = 2040
Shape = 2 'Oval
Top = 240
Width = 1695
End
Begin VB.Shape shpAttacker
BackColor = &H00000040&
BackStyle = 1 'Opaque
Height = 735
Left = 120
Top = 360
Width = 1335
End
Begin VB.Line linNetwork
X1 = 2880
X2 = 2880
Y1 = 1200
Y2 = 2160
End
Begin VB.Line Line2
X1 = 5400
X2 = 5400
Y1 = 1080
Y2 = 1320
End
Begin VB.Line Line1
X1 = 360
X2 = 360
Y1 = 1080
Y2 = 1320
End
Begin VB.Line linArrow4LineC
BorderColor = &H00004000&
BorderWidth = 2
Visible = 0 'False
X1 = 1560
X2 = 1440
Y1 = 960
Y2 = 840
End
Begin VB.Line linArrow4LineB
BorderColor = &H00004000&
BorderWidth = 2
Visible = 0 'False
X1 = 1560
X2 = 1440
Y1 = 720
Y2 = 840
End
Begin VB.Line linArrow4LineA
BorderColor = &H00004000&
BorderWidth = 2
Visible = 0 'False
X1 = 2040
X2 = 1440
Y1 = 840
Y2 = 840
End
Begin VB.Line linArrow3LineB
BorderColor = &H00004000&
BorderWidth = 2
Visible = 0 'False
X1 = 3840
X2 = 3720
Y1 = 720
Y2 = 840
End
Begin VB.Line linArrow3LineC
BorderColor = &H00004000&
BorderWidth = 2
Visible = 0 'False
X1 = 3720
X2 = 3840
Y1 = 840
Y2 = 960
End
Begin VB.Line linArrow3LineA
BorderColor = &H00004000&
BorderWidth = 2
Visible = 0 'False
X1 = 4320
X2 = 3720
Y1 = 840
Y2 = 840
End
Begin VB.Line linArrow2LineC
BorderColor = &H00000040&
BorderWidth = 2
Visible = 0 'False
X1 = 4200
X2 = 4320
Y1 = 720
Y2 = 600
End
Begin VB.Line linArrow2LineB
BorderColor = &H00000040&
BorderWidth = 2
Visible = 0 'False
X1 = 4200
X2 = 4320
Y1 = 480
Y2 = 600
End
Begin VB.Line linArrow1LineC
BorderColor = &H00000040&
BorderWidth = 2
Visible = 0 'False
X1 = 1920
X2 = 2040
Y1 = 720
Y2 = 600
End
Begin VB.Line linArrow1LineB
BorderColor = &H00000040&
BorderWidth = 2
Visible = 0 'False
X1 = 1920
X2 = 2040
Y1 = 480
Y2 = 600
End
Begin VB.Line linArrow1LineA
BorderColor = &H00000040&
BorderWidth = 2
Visible = 0 'False
X1 = 1440
X2 = 2040
Y1 = 600
Y2 = 600
End
Begin VB.Line linArrow2LineA
BorderColor = &H00000040&
BorderWidth = 2
Visible = 0 'False
X1 = 3720
X2 = 4320
Y1 = 600
Y2 = 600
End
End
Begin VB.Frame fraListing
Height = 5055
Left = 240
TabIndex = 10
Top = 600
Visible = 0 'False
Width = 5775
Begin MSComctlLib.ListView lsvListing
Height = 4695
Left = 120
TabIndex = 11
Top = 240
Width = 5535
_ExtentX = 9763
_ExtentY = 8281
View = 3
LabelEdit = 1
MultiSelect = -1 'True
LabelWrap = -1 'True
HideSelection = -1 'True
AllowReorder = -1 'True
FullRowSelect = -1 'True
_Version = 393217
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
NumItems = 6
BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Text = "Date"
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 1
Text = "Time"
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 2
Text = "Source"
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(4) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 3
Text = "Destination"
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(5) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 4
Text = "Data"
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(6) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 5
Text = "Description"
Object.Width = 2540
EndProperty
End
End
Begin MSComctlLib.TabStrip tspVisualizing
Height = 5655
Left = 120
TabIndex = 0
Top = 120
Width = 6015
_ExtentX = 10610
_ExtentY = 9975
TabWidthStyle = 2
_Version = 393216
BeginProperty Tabs {1EFB6598-857C-11D1-B16A-00C0F0283628}
NumTabs = 2
BeginProperty Tab1 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "&Illustrated"
ImageVarType = 2
EndProperty
BeginProperty Tab2 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "&Listing"
ImageVarType = 2
EndProperty
EndProperty
End
Begin VB.Menu mnuFile
Caption = "&File"
Begin VB.Menu mnuFileCloseItem
Caption = "&Close"
End
End
Begin VB.Menu mnuHelp
Caption = "&Help"
Begin VB.Menu mnuHelpAttackVisualizingHelpItem
Caption = "&Attack Visualizing Help"
Shortcut = {F1}
End
End
End
Attribute VB_Name = "frmAttackVisualizing"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
' ************************************************************************************
' * Developement History *
' * *
' * Version 4.0 2004-12-28 *
' * - Optimized the visualizing routines. *
' * - Added the source and destination ports in the listing. *
' * - Added the printing of the pattern during pattern matching. *
' * - Fixed a bug with a listing misorder (pattern matching after vulnerability *
' * found. *
' * - Fixed a source/destination misorder during data receiving. *
' * Version 3.0 2004-11-14 *
' * - Added the resizing possibility of the frame. *
' * Version 3.0 2004-11-04 *
' * - Replaced the keypress events with the default/cancel properties. *
' * Version 3.0 2004-11-01 *
' * - Replaced all useless functions with normal subs. *
' ************************************************************************************
Private Sub Form_Activate()
If Me.WindowState = vbMinimized Then
Me.WindowState = vbNormal
End If
End Sub
Private Sub Form_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
Case 13, 27
Unload Me
End Select
End Sub
Private Sub Form_Load()
Dim strLocalIP As String
strLocalIP = frmMain.wskTCPWinsock.Item(0).LocalIP
txtAttackerData.Text = strLocalIP & " (" & frmMain.wskTCPWinsock.Item(0).LocalHostName & ")"
lblAttackerName.ToolTipText = strLocalIP
txtTargetData.Text = Target
lblTargetName.ToolTipText = Target
If InStrB(1, Target, "192.168.", vbBinaryCompare) Then
lblNetworkName.Caption = "LAN Class C"
lblNetworkName.ToolTipText = "192.168.0.0 - 192.168.255.255"
ElseIf InStrB(1, Target, "172.", vbBinaryCompare) Then
lblNetworkName.Caption = "LAN Class B"
lblNetworkName.ToolTipText = "172.16.0.0 - 172.31.255.255"
ElseIf InStrB(1, Target, "10.", vbBinaryCompare) Then
lblNetworkName.Caption = "LAN Class A"
lblNetworkName.ToolTipText = "10.0.0.0 - 10.255.255.255"
ElseIf InStrB(1, Target, "127.", vbBinaryCompare) Then
lblNetworkName.Caption = "Localhost"
lblNetworkName.ToolTipText = "127.0.0.0 - 127.255.255.255"
Else
lblNetworkName.Caption = "Internet"
lblNetworkName.ToolTipText = "0.0.0.0 - 255.255.255.255"
End If
End Sub
Private Sub Form_Resize()
If Me.WindowState <> vbMinimized Then
'Prevent zu small windows in height
If Me.Height < 6585 Then
Me.Height = 6585
End If
'Prevent zu small windows in width
If Me.Width < 6390 Then
Me.Width = 6390
End If
tspVisualizing.Height = Me.Height - 920
tspVisualizing.Width = Me.Width - 360
fraIllustrated.Width = tspVisualizing.Width - 240
fraIllustrated.Height = tspVisualizing.Height - 600
fraListing.Width = fraIllustrated.Width
fraListing.Height = fraIllustrated.Height
lsvListing.Width = fraListing.Width - 240
lsvListing.Height = fraListing.Height - 360
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set frmAttackVisualizing = Nothing
End Sub
Private Sub lblNetworkName_Click()
Dim WebSiteURL As String
WebSiteURL = "http://www.faqs.org/rfcs/rfc1918.html"
'Load the project web site
WriteLogEntry "Loading the website " & WebSiteURL, 6
Call ShellExecute(Me.hwnd, "Open", WebSiteURL, "", App.Path, 1)
End Sub
Private Sub lblTargetName_Click()
Shell Environ("Comspec") + " /C telnet " & Target & " " & plugin_port, vbNormalFocus
End Sub
Private Sub lsvListing_KeyPress(KeyAscii As Integer)
If KeyAscii = "13" Then
If lsvListing.ListItems.Count Then
Clipboard.Clear
Clipboard.SetText lsvListing.SelectedItem.SubItems(1) & ";" & _
lsvListing.SelectedItem.SubItems(2) & ";" & _
lsvListing.SelectedItem.SubItems(3) & ";" & _
lsvListing.SelectedItem.SubItems(4) & ";" & _
lsvListing.SelectedItem.SubItems(5), vbCFText
End If
Unload Me
End If
End Sub
Private Sub mnuFileCloseItem_Click()
Unload Me
End Sub
Private Sub mnuHelpAttackVisualizingHelpItem_Click()
Call OpenOnlineHelp("attack_visualizing")
End Sub
Private Sub tspVisualizing_Click()
Dim intSelectedItem As Integer
intSelectedItem = tspVisualizing.SelectedItem.Index
If intSelectedItem = 1 Then
fraIllustrated.Visible = True
fraListing.Visible = False
ElseIf intSelectedItem = 2 Then
fraListing.Visible = True
fraIllustrated.Visible = False
End If
End Sub
Private Sub txtAttackerData_KeyPress(KeyAscii As Integer)
'If the user presses enter, the selected field is copied to the clipboard
If KeyAscii = "13" Then
Clipboard.Clear
txtAttackerData.SelStart = 0
txtAttackerData.SelLength = Len(txtAttackerData.Text)
Clipboard.SetText txtAttackerData.SelText, vbCFText
Unload Me
Else
TextBoxSetFocus KeyAscii, "1"
End If
End Sub
Private Sub txtNetworkData_KeyPress(KeyAscii As Integer)
'If the user presses enter, the selected field is copied to the clipboard
If KeyAscii = "13" Then
Clipboard.Clear
txtNetworkData.SelStart = 0
txtNetworkData.SelLength = Len(txtNetworkData.Text)
Clipboard.SetText txtNetworkData.SelText, vbCFText
Unload Me
Else
TextBoxSetFocus KeyAscii, "3"
End If
End Sub
Private Sub txtTargetData_KeyPress(KeyAscii As Integer)
'If the user presses enter, the selected field is copied to the clipboard
If KeyAscii = "13" Then
Clipboard.Clear
txtTargetData.SelStart = 0
txtTargetData.SelLength = Len(txtTargetData.Text)
Clipboard.SetText txtTargetData.SelText, vbCFText
Unload Me
Else
TextBoxSetFocus KeyAscii, "2"
End If
End Sub
Private Sub TextBoxSetFocus(ByRef KeyAscii As Integer, ByRef BoxNumber As Integer)
'1
If KeyAscii = "49" Then
txtAttackerData.SetFocus
'a
ElseIf KeyAscii = "97" Then
txtAttackerData.SetFocus
'2
ElseIf KeyAscii = "50" Then
txtTargetData.SetFocus
't
ElseIf KeyAscii = "116" Then
txtTargetData.SetFocus
'3
ElseIf KeyAscii = "51" Then
txtNetworkData.SetFocus
'n
ElseIf KeyAscii = "110" Then
txtNetworkData.SetFocus
'+
ElseIf KeyAscii = "43" Then
If BoxNumber = 1 Then
txtTargetData.SetFocus
ElseIf BoxNumber = 2 Then
txtNetworkData.SetFocus
ElseIf BoxNumber = 3 Then
txtAttackerData.SetFocus
End If
'-
ElseIf KeyAscii = "45" Then
If BoxNumber = 1 Then
txtNetworkData.SetFocus
ElseIf BoxNumber = 2 Then
txtAttackerData.SetFocus
ElseIf BoxNumber = 3 Then
txtTargetData.SetFocus
End If
End If
End Sub
Public Sub VisualizeOpenConnection()
Dim List As ListItem 'Needed for the listview handling
Dim strSourceIP As String
Dim intSourcePort As Integer
Dim strDestinationIP As String
Dim intDestinationPort As Integer
strSourceIP = frmMain.wskTCPWinsock.Item(0).LocalIP
intSourcePort = frmMain.wskTCPWinsock.Item(0).LocalPort
strDestinationIP = Target
intDestinationPort = frmMain.wskTCPWinsock.Item(0).RemotePort
lblAttackerComputing.Visible = True
lblTargetComputing.Visible = False
linArrow1LineA.Visible = True
linArrow1LineB.Visible = True
linArrow1LineC.Visible = True
linArrow2LineA.Visible = True
linArrow2LineB.Visible = True
linArrow2LineC.Visible = True
lblAttackerComputing.Visible = False
lblTargetComputing.Visible = True
linArrow3LineA.Visible = False
linArrow3LineB.Visible = False
linArrow3LineC.Visible = False
linArrow4LineA.Visible = False
linArrow4LineB.Visible = False
linArrow4LineC.Visible = False
txtAttackerData.Text = strSourceIP & " (" & frmMain.wskTCPWinsock.Item(0).LocalHostName & ")" & vbNewLine & _
"Opening socket ..."
txtTargetData.Text = strDestinationIP & vbNewLine & _
"Receiving connection request ..."
Call WriteDataToListView(GetTodaysDate("/"), GetActualTime(":"), strSourceIP & ":" & intSourcePort, _
strDestinationIP & ":" & intDestinationPort, "", "Opening connection")
End Sub
Public Sub VisualizeCloseConnection()
Dim strSourceIP As String
Dim intSourcePort As Integer
Dim strDestinationIP As String
Dim intDestinationPort As Integer
strSourceIP = frmMain.wskTCPWinsock.Item(0).LocalIP
intSourcePort = frmMain.wskTCPWinsock.Item(0).LocalPort
strDestinationIP = Target
intDestinationPort = frmMain.wskTCPWinsock.Item(0).RemotePort
lblAttackerComputing.Visible = True
lblTargetComputing.Visible = True
linArrow1LineA.Visible = False
linArrow1LineB.Visible = False
linArrow1LineC.Visible = False
linArrow2LineA.Visible = False
linArrow2LineB.Visible = False
linArrow2LineC.Visible = False
linArrow3LineA.Visible = False
linArrow3LineB.Visible = False
linArrow3LineC.Visible = False
linArrow4LineA.Visible = False
linArrow4LineB.Visible = False
linArrow4LineC.Visible = False
lblAttackerComputing.Visible = False
lblTargetComputing.Visible = False
txtAttackerData.Text = strSourceIP & " (" & frmMain.wskTCPWinsock.Item(0).LocalHostName & ")" & vbNewLine & _
"Closing socket ..."
txtTargetData.Text = strDestinationIP & " (" & Target & ")" & vbNewLine & _
"Session terminated. Waiting for next connection."
Call WriteDataToListView(GetTodaysDate("/"), GetActualTime(":"), strSourceIP & ":" & intSourcePort, _
strDestinationIP & ":" & intDestinationPort, vbNullString, "Closing connection")
End Sub
Public Sub VisualizeSendData(ByRef strDataToSend As String)
Dim strSourceIP As String
Dim intSourcePort As Integer
Dim strDestinationIP As String
Dim intDestinationPort As Integer
strSourceIP = frmMain.wskTCPWinsock.Item(0).LocalIP
intSourcePort = frmMain.wskTCPWinsock.Item(0).LocalPort
strDestinationIP = Target
intDestinationPort = frmMain.wskTCPWinsock.Item(0).RemotePort
txtAttackerData.Text = strSourceIP & " (" & frmMain.wskTCPWinsock.Item(0).LocalHostName & ")" & vbNewLine & _
"Sending data ..."
txtNetworkData.Text = GetActualTime(":") & " " & "Attacker (" & strSourceIP & _
") -> Target (" & strDestinationIP & ")" & vbNewLine & vbNewLine & _
strDataToSend
txtTargetData.Text = strDestinationIP & " (" & strDestinationIP & ")" & vbNewLine & _
"Receiving data ..."
Call WriteDataToListView(GetTodaysDate("/"), GetActualTime(":"), strSourceIP & ":" & intSourcePort, _
strDestinationIP & ":" & intDestinationPort, strDataToSend, "Sending data")
End Sub
Public Sub VisualizeSleep(ByRef intSleepTime As Integer)
Dim strSourceIP As String
Dim intSourcePort As Integer
Dim strDestinationIP As String
Dim intDestinationPort As Integer
strSourceIP = frmMain.wskTCPWinsock.Item(0).LocalIP
intSourcePort = frmMain.wskTCPWinsock.Item(0).LocalPort
strDestinationIP = Target
intDestinationPort = frmMain.wskTCPWinsock.Item(0).RemotePort
txtAttackerData.Text = strSourceIP & " (" & frmMain.wskTCPWinsock.Item(0).LocalHostName & ")" & vbNewLine & _
"Waiting " & intSleepTime & " seconds ..."
lblAttackerComputing.Visible = True
lblTargetComputing.Visible = False
Call WriteDataToListView(GetTodaysDate("/"), GetActualTime(":"), strSourceIP & ":" & intSourcePort, _
strDestinationIP & ":" & intDestinationPort, vbNullString, "Sleep for " & intSleepTime & " seconds")
End Sub
Public Sub VisualizePatternExists(ByRef strTriggers As String)
Dim strSourceIP As String
Dim intSourcePort As Integer
Dim strDestinationIP As String
Dim intDestinationPort As Integer
strSourceIP = frmMain.wskTCPWinsock.Item(0).LocalIP
intSourcePort = frmMain.wskTCPWinsock.Item(0).LocalPort
strDestinationIP = Target
intDestinationPort = frmMain.wskTCPWinsock.Item(0).RemotePort
lblAttackerComputing.Visible = True
lblTargetComputing.Visible = False
txtAttackerData.Text = strSourceIP & " (" & frmMain.wskTCPWinsock.Item(0).LocalHostName & ")" & vbNewLine & _
"Checking if the pattern exists ..."
Call WriteDataToListView(GetTodaysDate("/"), GetActualTime(":"), strSourceIP & ":" & intSourcePort, _
strDestinationIP & ":" & intDestinationPort, "" & strTriggers & "", "Check if the pattern exists")
End Sub
Public Sub VisualizeVulnerabilityFound()
Dim strSourceIP As String
Dim intSourcePort As Integer
Dim strDestinationIP As String
Dim intDestinationPort As Integer
strSourceIP = frmMain.wskTCPWinsock.Item(0).LocalIP
intSourcePort = frmMain.wskTCPWinsock.Item(0).LocalPort
strDestinationIP = Target
intDestinationPort = frmMain.wskTCPWinsock.Item(0).RemotePort
lblAttackerComputing.Visible = False
lblTargetComputing.Visible = False
txtAttackerData.Text = strSourceIP & " (" & frmMain.wskTCPWinsock.Item(0).LocalHostName & ")" & vbNewLine & _
"The vulnerability was found. Waiting for input."
Call WriteDataToListView(GetTodaysDate("/"), GetActualTime(":"), strSourceIP & ":" & intSourcePort, _
strDestinationIP & ":" & intDestinationPort, vbNullString, "Vulnerability was found")
End Sub
Public Sub VisualizeVulnerabilityNotFound()
Dim strSourceIP As String
Dim intSourcePort As Integer
Dim strDestinationIP As String
Dim intDestinationPort As Integer
strSourceIP = frmMain.wskTCPWinsock.Item(0).LocalIP
intSourcePort = frmMain.wskTCPWinsock.Item(0).LocalPort
strDestinationIP = Target
intDestinationPort = frmMain.wskTCPWinsock.Item(0).RemotePort
lblAttackerComputing.Visible = False
lblTargetComputing.Visible = False
txtAttackerData.Text = strSourceIP & " (" & frmMain.wskTCPWinsock.Item(0).LocalHostName & ")" & vbNewLine & _
"The vulnerability was not found. Waiting for input."
Call WriteDataToListView(GetTodaysDate("/"), GetActualTime(":"), strSourceIP & ":" & intSourcePort, _
strDestinationIP & ":" & intDestinationPort, vbNullString, "Vulnerability was not found")
End Sub
Public Sub VisualizeDataArrival()
Dim strSourceIP As String
Dim intSourcePort As Integer
Dim strDestinationIP As String
Dim intDestinationPort As Integer
strSourceIP = Target
intSourcePort = frmMain.wskTCPWinsock.Item(0).RemotePort
strDestinationIP = frmMain.wskTCPWinsock.Item(0).LocalIP
intDestinationPort = frmMain.wskTCPWinsock.Item(0).LocalPort
lblAttackerComputing.Visible = False
lblTargetComputing.Visible = False
linArrow1LineA.Visible = False
linArrow1LineB.Visible = False
linArrow1LineC.Visible = False
linArrow2LineA.Visible = False
linArrow2LineB.Visible = False
linArrow2LineC.Visible = False
linArrow3LineA.Visible = True
linArrow3LineB.Visible = True
linArrow3LineC.Visible = True
linArrow4LineA.Visible = True
linArrow4LineB.Visible = True
linArrow4LineC.Visible = True
txtTargetData.Text = strDestinationIP & " (" & strSourceIP & ")" & vbNewLine & _
"Sending data back ..."
txtAttackerData.Text = strSourceIP & " (" & frmMain.wskTCPWinsock.Item(0).LocalHostName & ")" & vbNewLine & _
"Receiving data ..."
txtNetworkData.Text = LastResponseTime & " " & "Target (" & strDestinationIP & ") -> Attacker (" & strSourceIP & ")" & _
vbNewLine & vbNewLine & _
LastResponse
Call WriteDataToListView(GetTodaysDate("/"), GetActualTime(":"), strSourceIP & ":" & intSourcePort, _
strDestinationIP & ":" & intDestinationPort, LastResponse, "Incoming data")
End Sub
Public Sub WriteDataToListView(ByRef strDate As String, _
ByRef strTime As String, _
ByRef strSource As String, _
ByRef strDestination As String, _
ByRef strData As String, _
ByRef strDescription As String)
Dim List As ListItem 'Needed for the listview handling
'Set the frame title
Me.Caption = "Attack Visualizing - " & plugin_name & ": " & strDescription
'Write the log data into the log frame
Set List = lsvListing.ListItems.Add(, , strDate)
List.SubItems(1) = strTime
List.SubItems(2) = strSource
List.SubItems(3) = strDestination
List.SubItems(4) = strData
List.SubItems(5) = strDescription
'Set the right column width
LVColumnWidth lsvListing
End Sub