Skip to content

Commit fd6d35a

Browse files
committed
mKCP添加密钥,加强搞识别能力
1 parent e614f82 commit fd6d35a

10 files changed

+107
-65
lines changed

ProxySU/MainWindow.xaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@
410410
<RowDefinition></RowDefinition>
411411
<RowDefinition></RowDefinition>
412412
</Grid.RowDefinitions>
413-
<TextBlock Text="程序版本:1.7.1" Grid.Column="0" Grid.Row="0"></TextBlock>
413+
<TextBlock Text="程序版本:1.7.2" Grid.Column="0" Grid.Row="0"></TextBlock>
414414

415415
</Grid>
416416

ProxySU/MainWindow.xaml.cs

+18-10
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ private void ButtonOpenFileDialog_Click(object sender, RoutedEventArgs e)
311311
}
312312
#endregion
313313

314-
#region 界面控件的有效无效控制代码块
314+
#region 主界面控件的有效无效控制代码块
315315
private void RadioButtonNoProxy_Checked(object sender, RoutedEventArgs e)
316316
{
317317
TextBlockProxyHost.IsEnabled = false;
@@ -783,6 +783,10 @@ private void StartSetUpV2ray(ConnectionInfo connectionInfo,TextBlock textBlockNa
783783
if (serverConfig.Contains("mkcp") == true)
784784
{
785785
serverJson["inbounds"][0]["streamSettings"]["kcpSettings"]["header"]["type"] = ReceiveConfigurationParameters[5];
786+
if (String.IsNullOrEmpty(ReceiveConfigurationParameters[6])==false )
787+
{
788+
serverJson["inbounds"][0]["streamSettings"]["kcpSettings"]["seed"] = ReceiveConfigurationParameters[6];
789+
}
786790
}
787791
//quic模式下设置伪装类型及密钥
788792
if (serverConfig.Contains("quic") == true)
@@ -823,13 +827,13 @@ private void StartSetUpV2ray(ConnectionInfo connectionInfo,TextBlock textBlockNa
823827
{
824828
client.RunCommand("ufw allow 80");
825829
client.RunCommand("ufw allow 443");
826-
client.RunCommand("yes | ufw reset");
830+
client.RunCommand("yes | ufw reload");
827831
}
828832
else
829833
{
830834
client.RunCommand($"ufw allow {openFireWallPort}/tcp");
831835
client.RunCommand($"ufw allow {openFireWallPort}/udp");
832-
client.RunCommand("yes | ufw reset");
836+
client.RunCommand("yes | ufw reload");
833837
}
834838
}
835839

@@ -987,6 +991,10 @@ private void StartSetUpV2ray(ConnectionInfo connectionInfo,TextBlock textBlockNa
987991
if (clientConfig.Contains("mkcp")==true)
988992
{
989993
clientJson["outbounds"][0]["streamSettings"]["kcpSettings"]["header"]["type"] = ReceiveConfigurationParameters[5];
994+
if (String.IsNullOrEmpty(ReceiveConfigurationParameters[6]) == false)
995+
{
996+
clientJson["outbounds"][0]["streamSettings"]["kcpSettings"]["seed"] = ReceiveConfigurationParameters[6];
997+
}
990998
}
991999
if (clientConfig.Contains("quic") == true)
9921000
{
@@ -1703,13 +1711,13 @@ private void StartSetUpTrojan(ConnectionInfo connectionInfo, TextBlock textBlock
17031711
{
17041712
client.RunCommand("ufw allow 80");
17051713
client.RunCommand("ufw allow 443");
1706-
client.RunCommand("yes | ufw reset");
1714+
client.RunCommand("yes | ufw reload");
17071715
}
17081716
else
17091717
{
17101718
client.RunCommand($"ufw allow {openFireWallPort}/tcp");
17111719
client.RunCommand($"ufw allow {openFireWallPort}/udp");
1712-
client.RunCommand("yes | ufw reset");
1720+
client.RunCommand("yes | ufw reload");
17131721
}
17141722
}
17151723

@@ -2321,13 +2329,13 @@ private void StartSetUpTrojanGo(ConnectionInfo connectionInfo, TextBlock textBlo
23212329
//{
23222330
client.RunCommand("ufw allow 80");
23232331
client.RunCommand("ufw allow 443");
2324-
client.RunCommand("yes | ufw reset");
2332+
client.RunCommand("yes | ufw reload");
23252333
//}
23262334
//else
23272335
//{
23282336
// client.RunCommand($"ufw allow {openFireWallPort}/tcp");
23292337
// client.RunCommand($"ufw allow {openFireWallPort}/udp");
2330-
// client.RunCommand("yes | ufw reset");
2338+
// client.RunCommand("yes | ufw reload");
23312339
//}
23322340
}
23332341

@@ -2885,13 +2893,13 @@ private void StartSetUpNaive(ConnectionInfo connectionInfo, TextBlock textBlockN
28852893
{
28862894
client.RunCommand("ufw allow 80");
28872895
client.RunCommand("ufw allow 443");
2888-
client.RunCommand("yes | ufw reset");
2896+
client.RunCommand("yes | ufw reload");
28892897
}
28902898
else
28912899
{
28922900
client.RunCommand($"ufw allow {openFireWallPort}/tcp");
28932901
client.RunCommand($"ufw allow {openFireWallPort}/udp");
2894-
client.RunCommand("yes | ufw reset");
2902+
client.RunCommand("yes | ufw reload");
28952903
}
28962904
}
28972905

@@ -4229,7 +4237,7 @@ private void StartSetUp3in1(ConnectionInfo connectionInfo, TextBlock textBlockNa
42294237

42304238
client.RunCommand("ufw allow 80");
42314239
client.RunCommand("ufw allow 443");
4232-
client.RunCommand("yes | ufw reset");
4240+
client.RunCommand("yes | ufw reload");
42334241
}
42344242

42354243
currentStatus = "符合安装要求,V2ray安装中......";

ProxySU/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@
5151
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
5252
// 方法是按如下所示使用“*”: :
5353
// [assembly: AssemblyVersion("1.0.*")]
54-
[assembly: AssemblyVersion("1.7.1.0")]
55-
[assembly: AssemblyFileVersion("1.7.1.0")]
54+
[assembly: AssemblyVersion("1.7.2.0")]
55+
[assembly: AssemblyFileVersion("1.7.2.0")]

ProxySU/ResultClientInformation.xaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
<TextBlock x:Name="TextBlockPath" Text="路径(Path)" Grid.Column="0" Grid.Row="9" Margin="1"></TextBlock>
6767
<TextBox x:Name="TextBoxPath" IsReadOnly="True" Grid.Column="1" Grid.Row="9" Margin="2"></TextBox>
6868
<TextBlock x:Name="TextBlockPathExplain" Text="说明" Grid.Column="2" Grid.Row="9"></TextBlock>
69-
<TextBlock x:Name="TextBlockQuicKey" Text="QUIC密钥" Grid.Column="0" Grid.Row="10" Margin="1"></TextBlock>
69+
<TextBlock x:Name="TextBlockQuicKey" Text="mKCP/QUIC密钥" Grid.Column="0" Grid.Row="10" Margin="1"></TextBlock>
7070
<TextBox x:Name="TextBoxQuicKey" IsReadOnly="True" Grid.Column="1" Grid.Row="10" Margin="2"></TextBox>
7171
<TextBlock x:Name="TextBlockQuicKeyExplain" Text="说明" Grid.Column="2" Grid.Row="10"></TextBlock>
7272

ProxySU/ResultClientInformation.xaml.cs

+13-7
Original file line numberDiff line numberDiff line change
@@ -143,49 +143,55 @@ public ResultClientInformation()
143143
{
144144
TextBoxTransmission.Text = "kcp";
145145
TextBoxCamouflageType.Text = "none";
146+
TextBoxQuicKey.Text = MainWindow.ReceiveConfigurationParameters[6];
146147
TextBoxTLS.Text = "none";
147148
HidePath();
148-
HideQuicKey();
149+
ShowQuicKey();
149150
}
150151
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "mKCP2SRTP"))
151152
{
152153
TextBoxTransmission.Text = "kcp";
153154
TextBoxCamouflageType.Text = "srtp";
155+
TextBoxQuicKey.Text = MainWindow.ReceiveConfigurationParameters[6];
154156
TextBoxTLS.Text = "none";
155157
HidePath();
156-
HideQuicKey();
158+
ShowQuicKey();
157159
}
158160
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "mKCPuTP"))
159161
{
160162
TextBoxTransmission.Text = "kcp";
161163
TextBoxCamouflageType.Text = "utp";
164+
TextBoxQuicKey.Text = MainWindow.ReceiveConfigurationParameters[6];
162165
TextBoxTLS.Text = "none";
163166
HidePath();
164-
HideQuicKey();
167+
ShowQuicKey();
165168
}
166169
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "mKCP2WechatVideo"))
167170
{
168171
TextBoxTransmission.Text = "kcp";
169172
TextBoxCamouflageType.Text = "wechat-video";
173+
TextBoxQuicKey.Text = MainWindow.ReceiveConfigurationParameters[6];
170174
TextBoxTLS.Text = "none";
171175
HidePath();
172-
HideQuicKey();
176+
ShowQuicKey();
173177
}
174178
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "mKCP2DTLS"))
175179
{
176180
TextBoxTransmission.Text = "kcp";
177181
TextBoxCamouflageType.Text = "dtls";
182+
TextBoxQuicKey.Text = MainWindow.ReceiveConfigurationParameters[6];
178183
TextBoxTLS.Text = "none";
179184
HidePath();
180-
HideQuicKey();
185+
ShowQuicKey();
181186
}
182187
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "mKCP2WireGuard"))
183188
{
184189
TextBoxTransmission.Text = "kcp";
185190
TextBoxCamouflageType.Text = "wireguard";
191+
TextBoxQuicKey.Text = MainWindow.ReceiveConfigurationParameters[6];
186192
TextBoxTLS.Text = "none";
187193
HidePath();
188-
HideQuicKey();
194+
ShowQuicKey();
189195
}
190196
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "QuicNone"))
191197
{
@@ -383,7 +389,7 @@ private void GenerateV2rayShareQRcodeAndBase64Url()
383389
sw.WriteLine($"是否使用TLS:{TextBoxTLS.Text}");
384390
sw.WriteLine($"host:{TextBoxHostAddress.Text}");
385391
sw.WriteLine($"路径(Path):{TextBoxPath.Text}");
386-
sw.WriteLine($"QUIC密钥:{TextBoxQuicKey.Text}");
392+
sw.WriteLine($"mKCP/QUIC密钥:{TextBoxQuicKey.Text}");
387393
}
388394

389395

ProxySU/TemplateConfiguration.xaml

+14-12
Original file line numberDiff line numberDiff line change
@@ -173,17 +173,17 @@
173173
<RowDefinition></RowDefinition>
174174
<RowDefinition></RowDefinition>
175175
</Grid.RowDefinitions>
176-
<RadioButton x:Name="RadioButtonMkcpNone" Content="mKCP(无伪装)" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="1" Checked="RadioButtonTCP_Checked"></RadioButton>
176+
<RadioButton x:Name="RadioButtonMkcpNone" Content="mKCP(无伪装)" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="1" Checked="RadioButtonQuicNone_Checked"></RadioButton>
177177
<TextBlock Text="数据加密传输,以增加流量消耗来加速,减少延迟,udp协议,无伪装,会被识别为udp流量" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="3"></TextBlock>
178-
<RadioButton x:Name="RadioButton2mKCP2SRTP" Content="mKCP+SRTP" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="2" Checked="RadioButtonTCP_Checked"></RadioButton>
178+
<RadioButton x:Name="RadioButton2mKCP2SRTP" Content="mKCP+SRTP" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="2" Checked="RadioButtonQuicNone_Checked"></RadioButton>
179179
<TextBlock Text="同mKCP(无伪装),增加伪装成 SRTP 数据包,会被识别为视频通话数据(如 FaceTime)" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="3"></TextBlock>
180-
<RadioButton x:Name="RadioButton2mKCPuTP" Content="mKCP+uTP" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="3" Checked="RadioButtonTCP_Checked"></RadioButton>
180+
<RadioButton x:Name="RadioButton2mKCPuTP" Content="mKCP+uTP" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="3" Checked="RadioButtonQuicNone_Checked"></RadioButton>
181181
<TextBlock Text="同mKCP(无伪装),增加伪装成 uTP 数据包,会被识别为 BT 下载数据" Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="3"></TextBlock>
182-
<RadioButton x:Name="RadioButton2mKCP2WechatVideo" Content="mKCP+WechatVideo" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="4" Checked="RadioButtonTCP_Checked"></RadioButton>
182+
<RadioButton x:Name="RadioButton2mKCP2WechatVideo" Content="mKCP+WechatVideo" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="4" Checked="RadioButtonQuicNone_Checked"></RadioButton>
183183
<TextBlock Text="同mKCP(无伪装),增加伪装成微信视频通话的数据包" Grid.Column="1" Grid.Row="4" Grid.ColumnSpan="3"></TextBlock>
184-
<RadioButton x:Name="RadioButton2mKCP2DTLS" Content="mKCP+DTLS 1.2" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="5" Checked="RadioButtonTCP_Checked"></RadioButton>
184+
<RadioButton x:Name="RadioButton2mKCP2DTLS" Content="mKCP+DTLS 1.2" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="5" Checked="RadioButtonQuicNone_Checked"></RadioButton>
185185
<TextBlock Text="同mKCP(无伪装),增加伪装成 DTLS 1.2 数据包" Grid.Column="1" Grid.Row="5" Grid.ColumnSpan="3"></TextBlock>
186-
<RadioButton x:Name="RadioButton2mKCP2WireGuard" Content="mKCP+WireGuard" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="6" Checked="RadioButtonTCP_Checked"></RadioButton>
186+
<RadioButton x:Name="RadioButton2mKCP2WireGuard" Content="mKCP+WireGuard" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="6" Checked="RadioButtonQuicNone_Checked"></RadioButton>
187187
<TextBlock Text="同mKCP(无伪装),增加伪装成 WireGuard 数据包。(并不是真正的 WireGuard 协议)" TextWrapping="Wrap" Grid.Column="1" Grid.Row="6" Grid.ColumnSpan="3"></TextBlock>
188188

189189
</Grid>
@@ -247,23 +247,25 @@
247247
<RowDefinition></RowDefinition>
248248
<RowDefinition></RowDefinition>
249249
</Grid.RowDefinitions>
250-
<TextBlock x:Name="TextBlockServerListenPort" Text="服务端口:" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2"></TextBlock>
250+
<TextBlock x:Name="TextBlockServerListenPort" Text="服务端口:" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="1"></TextBlock>
251251
<TextBox x:Name="TextBoxServerListenPort" Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="3" Margin="3"></TextBox>
252252
<Button x:Name="ButtonServerListenPort" Content="随机选择" Grid.Column="4" Grid.Row="0" Margin="2" Click="ButtonServerListenPort_Click"></Button>
253-
<TextBlock x:Name="TextBlockNewUUID" Text="UUID:" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2"></TextBlock>
253+
<TextBlock x:Name="TextBlockNewUUID" Text="UUID:" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="1"></TextBlock>
254254
<TextBox x:Name="TextBoxNewUUID" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="3" Margin="3"></TextBox>
255255
<Button x:Name="ButtonNewUUID" Content="更新" Grid.Column="4" Grid.Row="1" Margin="2" Click="ButtonNewUUID_Click"></Button>
256256
<TextBlock Text="使用已有UUID,直接粘贴到框中" TextWrapping="Wrap" Grid.Column="5" Grid.Row="1" Grid.ColumnSpan="2" Margin="0"></TextBlock>
257-
<TextBlock x:Name="TextBlockQuicUUID" Text="QUIC密钥" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="2"></TextBlock>
257+
<TextBlock x:Name="TextBlockQuicUUID" Text="mKCP/QUIC密钥" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="1"></TextBlock>
258258
<TextBox x:Name="TextBoxQuicUUID" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="3" Margin="3"></TextBox>
259259
<Button x:Name="ButtonQuicUUID" Content="更新" Grid.Column="4" Grid.Row="2" Margin="2" Click="ButtonQuicUUID_Click"></Button>
260-
<TextBlock x:Name="TextBlockPath" Text="路径:" Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="2"></TextBlock>
260+
<TextBlock Text="启用mKCP密钥,可增强抗识别,删除留空则禁用,要求版本4.24.2以上" TextWrapping="Wrap" Grid.Column="5" Grid.Row="2" Grid.ColumnSpan="2"></TextBlock>
261+
262+
<TextBlock x:Name="TextBlockPath" Text="路径:" Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="1"></TextBlock>
261263
<TextBox x:Name="TextBoxPath" Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="3" Margin="3"></TextBox>
262264
<Button x:Name="ButtonPath" Content="随机" Grid.Column="4" Grid.Row="3" Margin="2" Click="ButtonPath_Click"></Button>
263-
<TextBlock x:Name="TextBlockDomain" Text="域名:" Grid.Column="0" Grid.Row="4" Grid.ColumnSpan="2"></TextBlock>
265+
<TextBlock x:Name="TextBlockDomain" Text="域名:" Grid.Column="0" Grid.Row="4" Grid.ColumnSpan="1"></TextBlock>
264266
<TextBox x:Name="TextBoxDomain" Style="{StaticResource TitleText}" Tag="不可为空" Grid.Column="1" Grid.Row="4" Grid.ColumnSpan="3" Margin="3"></TextBox>
265267
<Button x:Name="ButtonDomain" Content="检测" Visibility="Collapsed" Grid.Column="4" Grid.Row="4" Margin="2" Click="ButtonDomain_Click"></Button>
266-
<TextBlock x:Name="TextBlockMaskSites" Text="伪装网站:" Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="2"></TextBlock>
268+
<TextBlock x:Name="TextBlockMaskSites" Text="伪装网站:" Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="1"></TextBlock>
267269
<TextBox x:Name="TextBoxMaskSites" Style="{StaticResource TitleText}" Tag="设置此项可增加代理的隐蔽(可为空)" Grid.Column="1" Grid.Row="5" Grid.ColumnSpan="3" Margin="3"></TextBox>
268270

269271

0 commit comments

Comments
 (0)