-
Notifications
You must be signed in to change notification settings - Fork 41
/
MainWindow.xaml
185 lines (185 loc) · 12.7 KB
/
MainWindow.xaml
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
<mah:MetroWindow x:Class="DLLirant.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:mah="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
xmlns:local="clr-namespace:DLLirant"
mc:Ignorable="d"
Title="DLLirant.NET" Height="664" Width="1176" WindowStartupLocation="CenterScreen" Loaded="MetroWindow_Loaded">
<Window.DataContext>
<local:DataContextViewModel />
</Window.DataContext>
<Window.Resources>
<Style x:Key="TabItemText" TargetType="{x:Type TextBlock}">
<Style.Triggers>
<DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSource AncestorType=TabItem}}" Value="True">
<Setter Property="Foreground" Value="DarkGreen"/>
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="FontFamily" Value="Segoe Script" />
</DataTrigger>
<DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSource AncestorType=TabItem}}" Value="False">
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="FontFamily" Value="Segoe UI" />
</DataTrigger>
</Style.Triggers>
</Style>
</Window.Resources>
<mah:MetroWindow.LeftWindowCommands>
<mah:WindowCommands>
<Button Click="ButtonOpenGitHub_Click" ToolTip="Open up the GitHub site">
<iconPacks:PackIconUnicons Width="22" Height="22" Kind="Github" />
</Button>
</mah:WindowCommands>
</mah:MetroWindow.LeftWindowCommands>
<Grid Background="Black">
<Image Source="background.png" Stretch="Fill" Height="{Binding ActualHeight, ElementName=ItemsContainer}" VerticalAlignment="Top" />
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.5*" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TabControl Grid.Column="0" x:Name="MainTabControl" Background="Transparent" SelectionChanged="MainTabControl_SelectionChanged">
<TabItem>
<TabItem.Header>
<TextBlock Style="{StaticResource TabItemText}" Text="DLL SEARCH ORDER HIJACKINGS" FontSize="14" />
</TabItem.Header>
<Grid Background="Transparent">
<ListBox Grid.Column="0" ItemsSource="{Binding LogsGrid1}" HorizontalContentAlignment="Stretch" Background="Transparent" Foreground="White">
<ListBox.Resources>
<Style TargetType="{x:Type ListBoxItem}">
<Setter Property="Background" Value="Transparent" />
</Style>
</ListBox.Resources>
</ListBox>
</Grid>
</TabItem>
<TabItem>
<TabItem.Header>
<TextBlock Style="{StaticResource TabItemText}" Text="NAME NOT FOUND" FontSize="14" />
</TabItem.Header>
<Grid Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="0.06*" />
</Grid.RowDefinitions>
<ListBox x:Name="ListBoxLogsGrid2" Grid.Row="0" ItemsSource="{Binding LogsGrid2}" HorizontalContentAlignment="Stretch" Background="Transparent" Foreground="White">
<ListBox.ContextMenu>
<ContextMenu>
<MenuItem Header="Open Directory" PreviewMouseDown="MenuItemOpenDirectory_PreviewMouseDown"></MenuItem>
</ContextMenu>
</ListBox.ContextMenu>
<ListBox.Resources>
<Style TargetType="{x:Type ListBoxItem}">
<Setter Property="Background" Value="Transparent" />
</Style>
</ListBox.Resources>
</ListBox>
</Grid>
</TabItem>
<TabItem>
<TabItem.Header>
<TextBlock Style="{StaticResource TabItemText}" Text="DLL PROXYING" FontSize="14" />
</TabItem.Header>
<Grid Background="Transparent">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid Grid.Column="0">
<StackPanel>
<TextBlock Margin="5, 20, 5, 0" HorizontalAlignment="Center" Text="Generate a classic proxy DLL:" Foreground="White" FontWeight="Bold" FontStyle="Italic" FontFamily="Consolas" />
<TextBlock Margin="10" Text="Select the targeted DLL:" Foreground="White" FontFamily="Consolas" TextAlignment="Center" />
<Button Margin="5" Width="100" Content="Browse" Click="SelectedTargetedDLL_Button_Click" />
<TextBlock Margin="10" Text="Targeted DLL:" Foreground="White" FontFamily="Consolas" TextAlignment="Center" />
<TextBlock x:Name="TargetedDLL" Margin="10" Text="None" Foreground="White" FontFamily="Consolas" TextAlignment="Center" TextWrapping="Wrap" />
<TextBlock Margin="10" Text="Path to use in the Proxy DLL (by default it will be 'proxy' but you can use full path like 'C:\\Windows\\System32\\foobar.dll'):" Foreground="White" FontFamily="Consolas" TextAlignment="Center" TextWrapping="Wrap" />
<TextBox x:Name="TextBoxPathProxyDLL" Margin="5" ToolTip="Write the path of the proxy DLL" Width="200" />
<Button x:Name="ButtonGenerateClassicDLL" Margin="5" Width="200" Content="Generate" Click="GenerateClassicDLL_Button_Click" IsEnabled="False" />
</StackPanel>
</Grid>
<Grid Grid.Column="1">
<StackPanel>
<TextBlock Margin="5, 20, 5, 0" HorizontalAlignment="Center" Text="Generate an Ordinal based proxy DLL:" Foreground="White" FontWeight="Bold" FontStyle="Italic" FontFamily="Consolas" />
<TextBlock Margin="10" Text="Name of the DLL to generate:" Foreground="White" FontFamily="Consolas" TextAlignment="Center" />
<TextBox x:Name="TextBoxOrdinalDLLName" Margin="5" ToolTip="Write the name of the DLL that you want to generate" Width="200" />
<TextBlock Margin="10" Text="Number of Ordinal to export:" Foreground="White" FontFamily="Consolas" TextAlignment="Center" />
<DockPanel Margin="10" VerticalAlignment="Center" Width="300">
<TextBox Text="{Binding ElementName=sliderValue, Path=Value, UpdateSourceTrigger=PropertyChanged}" DockPanel.Dock="Right" TextAlignment="Right" Width="45" Margin="10,0,0,0" />
<Slider Maximum="10000" TickFrequency="1" IsSnapToTickEnabled="True" Name="sliderValue" />
</DockPanel>
<Button Margin="5" Width="200" Content="Generate" Click="GenerateOrdinalBasedDLL_Button_Click" />
</StackPanel>
</Grid>
</Grid>
</Grid>
</TabItem>
</TabControl>
<Grid x:Name="GridDLLSearchOrderHijackingMenu" Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="0.07*" />
<RowDefinition />
<RowDefinition Height="0.1*" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,5,0,5">
<TextBox x:Name="TextBoxBinaryNameToTest" mah:TextBoxHelper.Watermark="SELECT THE BINARY TO TEST ..." Width="380" Background="Transparent" BorderThickness="1" TextAlignment="Right" PreviewMouseDown="TextBoxBinaryNameToTest_PreviewMouseDown" />
<Button x:Name="ButtonStartFindingDLLSearchOrderHijackings" Background="Transparent" Click="ButtonStartFindingDLLSearchOrderHijackings_Click" Margin="5,0,5,0" BorderThickness="0">
<Button.ContentTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<iconPacks:PackIconUnicons Width="18" Height="18" VerticalAlignment="Center" Kind="Play" />
<TextBlock Margin="5,0,0,0" VerticalAlignment="Center" Text="Start" />
</StackPanel>
</DataTemplate>
</Button.ContentTemplate>
</Button>
</StackPanel>
<ListBox x:Name="ListBoxExcludes" Grid.Row="1" ItemsSource="{Binding ExcludesDLLs}" HorizontalContentAlignment="Right" Background="Transparent" Foreground="White">
<ListBox.ContextMenu>
<ContextMenu>
<MenuItem Header="Delete" PreviewMouseDown="MenuItemDeleteExcludeDLL_PreviewMouseDown"></MenuItem>
</ContextMenu>
</ListBox.ContextMenu>
<ListBox.Resources>
<Style TargetType="{x:Type ListBoxItem}">
<Setter Property="Background" Value="Transparent" />
</Style>
</ListBox.Resources>
</ListBox>
<StackPanel Grid.Row="2" Margin="0,5,0,5" VerticalAlignment="Bottom">
<TextBlock Text="Add a DLL in the exclusion list:" Foreground="White" TextAlignment="Center" FontFamily="Consolas" />
<Grid Margin="0,5,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBox x:Name="TextBoxExcludeAdd" Grid.Column="0" Margin="5,0,5,0" Background="Transparent" />
<Button Grid.Column="1" Content="ADD" Foreground="White" Margin="5,0,5,0" Background="Transparent" Click="ButtonAddExclude_Click" />
</Grid>
</StackPanel>
</Grid>
<Grid x:Name="GridNameNotFoundMenu" Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="0.065*" />
<RowDefinition />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,5,0,5">
<TextBox x:Name="TextBoxProcessNameToMonitor" mah:TextBoxHelper.Watermark="ENTER THE PROCESS NAME TO MONITOR OR LET BLANK FOR ALL ..." Width="380" Background="Transparent" BorderThickness="1" TextAlignment="Right" />
<Button x:Name="ButtonStartMonitoringNameNotFound" Background="Transparent" Click="ButtonStartMonitoringNameNotFound_Click" Margin="5,0,5,0" BorderThickness="0">
<Button.ContentTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<iconPacks:PackIconUnicons Width="18" Height="18" VerticalAlignment="Center" Kind="Play" />
<TextBlock Margin="5,0,0,0" VerticalAlignment="Center" Text="Start" />
</StackPanel>
</DataTemplate>
</Button.ContentTemplate>
</Button>
</StackPanel>
</Grid>
</Grid>
</Grid>
</mah:MetroWindow>