1
0
mirror of https://github.com/proxysu/ProxySU.git synced 2024-11-25 22:56:09 +03:00

mKCP添加密钥,加强搞识别能力

This commit is contained in:
ProxySU 2020-06-11 19:37:37 +08:00
parent e614f82913
commit fd6d35a44d
10 changed files with 107 additions and 65 deletions

View File

@ -410,7 +410,7 @@
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<TextBlock Text="程序版本1.7.1" Grid.Column="0" Grid.Row="0"></TextBlock>
<TextBlock Text="程序版本1.7.2" Grid.Column="0" Grid.Row="0"></TextBlock>
</Grid>

View File

@ -311,7 +311,7 @@ namespace ProxySU
}
#endregion
#region
#region
private void RadioButtonNoProxy_Checked(object sender, RoutedEventArgs e)
{
TextBlockProxyHost.IsEnabled = false;
@ -783,6 +783,10 @@ namespace ProxySU
if (serverConfig.Contains("mkcp") == true)
{
serverJson["inbounds"][0]["streamSettings"]["kcpSettings"]["header"]["type"] = ReceiveConfigurationParameters[5];
if (String.IsNullOrEmpty(ReceiveConfigurationParameters[6])==false )
{
serverJson["inbounds"][0]["streamSettings"]["kcpSettings"]["seed"] = ReceiveConfigurationParameters[6];
}
}
//quic模式下设置伪装类型及密钥
if (serverConfig.Contains("quic") == true)
@ -823,13 +827,13 @@ namespace ProxySU
{
client.RunCommand("ufw allow 80");
client.RunCommand("ufw allow 443");
client.RunCommand("yes | ufw reset");
client.RunCommand("yes | ufw reload");
}
else
{
client.RunCommand($"ufw allow {openFireWallPort}/tcp");
client.RunCommand($"ufw allow {openFireWallPort}/udp");
client.RunCommand("yes | ufw reset");
client.RunCommand("yes | ufw reload");
}
}
@ -987,6 +991,10 @@ namespace ProxySU
if (clientConfig.Contains("mkcp")==true)
{
clientJson["outbounds"][0]["streamSettings"]["kcpSettings"]["header"]["type"] = ReceiveConfigurationParameters[5];
if (String.IsNullOrEmpty(ReceiveConfigurationParameters[6]) == false)
{
clientJson["outbounds"][0]["streamSettings"]["kcpSettings"]["seed"] = ReceiveConfigurationParameters[6];
}
}
if (clientConfig.Contains("quic") == true)
{
@ -1703,13 +1711,13 @@ namespace ProxySU
{
client.RunCommand("ufw allow 80");
client.RunCommand("ufw allow 443");
client.RunCommand("yes | ufw reset");
client.RunCommand("yes | ufw reload");
}
else
{
client.RunCommand($"ufw allow {openFireWallPort}/tcp");
client.RunCommand($"ufw allow {openFireWallPort}/udp");
client.RunCommand("yes | ufw reset");
client.RunCommand("yes | ufw reload");
}
}
@ -2321,13 +2329,13 @@ namespace ProxySU
//{
client.RunCommand("ufw allow 80");
client.RunCommand("ufw allow 443");
client.RunCommand("yes | ufw reset");
client.RunCommand("yes | ufw reload");
//}
//else
//{
// client.RunCommand($"ufw allow {openFireWallPort}/tcp");
// client.RunCommand($"ufw allow {openFireWallPort}/udp");
// client.RunCommand("yes | ufw reset");
// client.RunCommand("yes | ufw reload");
//}
}
@ -2885,13 +2893,13 @@ namespace ProxySU
{
client.RunCommand("ufw allow 80");
client.RunCommand("ufw allow 443");
client.RunCommand("yes | ufw reset");
client.RunCommand("yes | ufw reload");
}
else
{
client.RunCommand($"ufw allow {openFireWallPort}/tcp");
client.RunCommand($"ufw allow {openFireWallPort}/udp");
client.RunCommand("yes | ufw reset");
client.RunCommand("yes | ufw reload");
}
}
@ -4229,7 +4237,7 @@ namespace ProxySU
client.RunCommand("ufw allow 80");
client.RunCommand("ufw allow 443");
client.RunCommand("yes | ufw reset");
client.RunCommand("yes | ufw reload");
}
currentStatus = "符合安装要求,V2ray安装中......";

View File

@ -51,5 +51,5 @@ using System.Windows;
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.7.1.0")]
[assembly: AssemblyFileVersion("1.7.1.0")]
[assembly: AssemblyVersion("1.7.2.0")]
[assembly: AssemblyFileVersion("1.7.2.0")]

View File

@ -66,7 +66,7 @@
<TextBlock x:Name="TextBlockPath" Text="路径(Path)" Grid.Column="0" Grid.Row="9" Margin="1"></TextBlock>
<TextBox x:Name="TextBoxPath" IsReadOnly="True" Grid.Column="1" Grid.Row="9" Margin="2"></TextBox>
<TextBlock x:Name="TextBlockPathExplain" Text="说明" Grid.Column="2" Grid.Row="9"></TextBlock>
<TextBlock x:Name="TextBlockQuicKey" Text="QUIC密钥" Grid.Column="0" Grid.Row="10" Margin="1"></TextBlock>
<TextBlock x:Name="TextBlockQuicKey" Text="mKCP/QUIC密钥" Grid.Column="0" Grid.Row="10" Margin="1"></TextBlock>
<TextBox x:Name="TextBoxQuicKey" IsReadOnly="True" Grid.Column="1" Grid.Row="10" Margin="2"></TextBox>
<TextBlock x:Name="TextBlockQuicKeyExplain" Text="说明" Grid.Column="2" Grid.Row="10"></TextBlock>

View File

@ -143,49 +143,55 @@ namespace ProxySU
{
TextBoxTransmission.Text = "kcp";
TextBoxCamouflageType.Text = "none";
TextBoxQuicKey.Text = MainWindow.ReceiveConfigurationParameters[6];
TextBoxTLS.Text = "none";
HidePath();
HideQuicKey();
ShowQuicKey();
}
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "mKCP2SRTP"))
{
TextBoxTransmission.Text = "kcp";
TextBoxCamouflageType.Text = "srtp";
TextBoxQuicKey.Text = MainWindow.ReceiveConfigurationParameters[6];
TextBoxTLS.Text = "none";
HidePath();
HideQuicKey();
ShowQuicKey();
}
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "mKCPuTP"))
{
TextBoxTransmission.Text = "kcp";
TextBoxCamouflageType.Text = "utp";
TextBoxQuicKey.Text = MainWindow.ReceiveConfigurationParameters[6];
TextBoxTLS.Text = "none";
HidePath();
HideQuicKey();
ShowQuicKey();
}
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "mKCP2WechatVideo"))
{
TextBoxTransmission.Text = "kcp";
TextBoxCamouflageType.Text = "wechat-video";
TextBoxQuicKey.Text = MainWindow.ReceiveConfigurationParameters[6];
TextBoxTLS.Text = "none";
HidePath();
HideQuicKey();
ShowQuicKey();
}
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "mKCP2DTLS"))
{
TextBoxTransmission.Text = "kcp";
TextBoxCamouflageType.Text = "dtls";
TextBoxQuicKey.Text = MainWindow.ReceiveConfigurationParameters[6];
TextBoxTLS.Text = "none";
HidePath();
HideQuicKey();
ShowQuicKey();
}
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "mKCP2WireGuard"))
{
TextBoxTransmission.Text = "kcp";
TextBoxCamouflageType.Text = "wireguard";
TextBoxQuicKey.Text = MainWindow.ReceiveConfigurationParameters[6];
TextBoxTLS.Text = "none";
HidePath();
HideQuicKey();
ShowQuicKey();
}
else if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "QuicNone"))
{
@ -383,7 +389,7 @@ namespace ProxySU
sw.WriteLine($"是否使用TLS{TextBoxTLS.Text}");
sw.WriteLine($"host{TextBoxHostAddress.Text}");
sw.WriteLine($"路径(Path){TextBoxPath.Text}");
sw.WriteLine($"QUIC密钥{TextBoxQuicKey.Text}");
sw.WriteLine($"mKCP/QUIC密钥{TextBoxQuicKey.Text}");
}

View File

@ -173,17 +173,17 @@
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<RadioButton x:Name="RadioButtonMkcpNone" Content="mKCP(无伪装)" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="1" Checked="RadioButtonTCP_Checked"></RadioButton>
<RadioButton x:Name="RadioButtonMkcpNone" Content="mKCP(无伪装)" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="1" Checked="RadioButtonQuicNone_Checked"></RadioButton>
<TextBlock Text="数据加密传输以增加流量消耗来加速减少延迟udp协议,无伪装会被识别为udp流量" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="3"></TextBlock>
<RadioButton x:Name="RadioButton2mKCP2SRTP" Content="mKCP+SRTP" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="2" Checked="RadioButtonTCP_Checked"></RadioButton>
<RadioButton x:Name="RadioButton2mKCP2SRTP" Content="mKCP+SRTP" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="2" Checked="RadioButtonQuicNone_Checked"></RadioButton>
<TextBlock Text="同mKCP(无伪装),增加伪装成 SRTP 数据包,会被识别为视频通话数据(如 FaceTime" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="3"></TextBlock>
<RadioButton x:Name="RadioButton2mKCPuTP" Content="mKCP+uTP" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="3" Checked="RadioButtonTCP_Checked"></RadioButton>
<RadioButton x:Name="RadioButton2mKCPuTP" Content="mKCP+uTP" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="3" Checked="RadioButtonQuicNone_Checked"></RadioButton>
<TextBlock Text="同mKCP(无伪装),增加伪装成 uTP 数据包,会被识别为 BT 下载数据" Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="3"></TextBlock>
<RadioButton x:Name="RadioButton2mKCP2WechatVideo" Content="mKCP+WechatVideo" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="4" Checked="RadioButtonTCP_Checked"></RadioButton>
<RadioButton x:Name="RadioButton2mKCP2WechatVideo" Content="mKCP+WechatVideo" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="4" Checked="RadioButtonQuicNone_Checked"></RadioButton>
<TextBlock Text="同mKCP(无伪装),增加伪装成微信视频通话的数据包" Grid.Column="1" Grid.Row="4" Grid.ColumnSpan="3"></TextBlock>
<RadioButton x:Name="RadioButton2mKCP2DTLS" Content="mKCP+DTLS 1.2" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="5" Checked="RadioButtonTCP_Checked"></RadioButton>
<RadioButton x:Name="RadioButton2mKCP2DTLS" Content="mKCP+DTLS 1.2" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="5" Checked="RadioButtonQuicNone_Checked"></RadioButton>
<TextBlock Text="同mKCP(无伪装),增加伪装成 DTLS 1.2 数据包" Grid.Column="1" Grid.Row="5" Grid.ColumnSpan="3"></TextBlock>
<RadioButton x:Name="RadioButton2mKCP2WireGuard" Content="mKCP+WireGuard" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="6" Checked="RadioButtonTCP_Checked"></RadioButton>
<RadioButton x:Name="RadioButton2mKCP2WireGuard" Content="mKCP+WireGuard" GroupName="TemplateGroup" Grid.Column="0" Grid.Row="6" Checked="RadioButtonQuicNone_Checked"></RadioButton>
<TextBlock Text="同mKCP(无伪装),增加伪装成 WireGuard 数据包。(并不是真正的 WireGuard 协议)" TextWrapping="Wrap" Grid.Column="1" Grid.Row="6" Grid.ColumnSpan="3"></TextBlock>
</Grid>
@ -247,23 +247,25 @@
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<TextBlock x:Name="TextBlockServerListenPort" Text="服务端口:" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2"></TextBlock>
<TextBlock x:Name="TextBlockServerListenPort" Text="服务端口:" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="1"></TextBlock>
<TextBox x:Name="TextBoxServerListenPort" Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="3" Margin="3"></TextBox>
<Button x:Name="ButtonServerListenPort" Content="随机选择" Grid.Column="4" Grid.Row="0" Margin="2" Click="ButtonServerListenPort_Click"></Button>
<TextBlock x:Name="TextBlockNewUUID" Text="UUID" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2"></TextBlock>
<TextBlock x:Name="TextBlockNewUUID" Text="UUID" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="1"></TextBlock>
<TextBox x:Name="TextBoxNewUUID" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="3" Margin="3"></TextBox>
<Button x:Name="ButtonNewUUID" Content="更新" Grid.Column="4" Grid.Row="1" Margin="2" Click="ButtonNewUUID_Click"></Button>
<TextBlock Text="使用已有UUID直接粘贴到框中" TextWrapping="Wrap" Grid.Column="5" Grid.Row="1" Grid.ColumnSpan="2" Margin="0"></TextBlock>
<TextBlock x:Name="TextBlockQuicUUID" Text="QUIC密钥" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="2"></TextBlock>
<TextBlock x:Name="TextBlockQuicUUID" Text="mKCP/QUIC密钥" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="1"></TextBlock>
<TextBox x:Name="TextBoxQuicUUID" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="3" Margin="3"></TextBox>
<Button x:Name="ButtonQuicUUID" Content="更新" Grid.Column="4" Grid.Row="2" Margin="2" Click="ButtonQuicUUID_Click"></Button>
<TextBlock x:Name="TextBlockPath" Text="路径:" Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="2"></TextBlock>
<TextBlock Text="启用mKCP密钥可增强抗识别删除留空则禁用,要求版本4.24.2以上" TextWrapping="Wrap" Grid.Column="5" Grid.Row="2" Grid.ColumnSpan="2"></TextBlock>
<TextBlock x:Name="TextBlockPath" Text="路径:" Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="1"></TextBlock>
<TextBox x:Name="TextBoxPath" Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="3" Margin="3"></TextBox>
<Button x:Name="ButtonPath" Content="随机" Grid.Column="4" Grid.Row="3" Margin="2" Click="ButtonPath_Click"></Button>
<TextBlock x:Name="TextBlockDomain" Text="域名:" Grid.Column="0" Grid.Row="4" Grid.ColumnSpan="2"></TextBlock>
<TextBlock x:Name="TextBlockDomain" Text="域名:" Grid.Column="0" Grid.Row="4" Grid.ColumnSpan="1"></TextBlock>
<TextBox x:Name="TextBoxDomain" Style="{StaticResource TitleText}" Tag="不可为空" Grid.Column="1" Grid.Row="4" Grid.ColumnSpan="3" Margin="3"></TextBox>
<Button x:Name="ButtonDomain" Content="检测" Visibility="Collapsed" Grid.Column="4" Grid.Row="4" Margin="2" Click="ButtonDomain_Click"></Button>
<TextBlock x:Name="TextBlockMaskSites" Text="伪装网站:" Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="2"></TextBlock>
<TextBlock x:Name="TextBlockMaskSites" Text="伪装网站:" Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="1"></TextBlock>
<TextBox x:Name="TextBoxMaskSites" Style="{StaticResource TitleText}" Tag="设置此项可增加代理的隐蔽(可为空)" Grid.Column="1" Grid.Row="5" Grid.ColumnSpan="3" Margin="3"></TextBox>

View File

@ -217,6 +217,10 @@ namespace ProxySU
//传递模板类型
MainWindow.ReceiveConfigurationParameters[0] = "mKCPNone";
MainWindow.ReceiveConfigurationParameters[5] = "none";
if (String.IsNullOrEmpty(TextBoxQuicUUID.Text)==false)
{
MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text;
}
}
//mKCP+srtp伪装模式被选中
else if (RadioButton2mKCP2SRTP.IsChecked == true)
@ -224,6 +228,10 @@ namespace ProxySU
//传递模板类型
MainWindow.ReceiveConfigurationParameters[0] = "mKCP2SRTP";
MainWindow.ReceiveConfigurationParameters[5] = "srtp";
if (String.IsNullOrEmpty(TextBoxQuicUUID.Text) == false)
{
MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text;
}
}
//mKCP+utp伪装模式被选中
else if (RadioButton2mKCPuTP.IsChecked == true)
@ -231,6 +239,10 @@ namespace ProxySU
//传递模板类型
MainWindow.ReceiveConfigurationParameters[0] = "mKCPuTP";
MainWindow.ReceiveConfigurationParameters[5] = "utp";
if (String.IsNullOrEmpty(TextBoxQuicUUID.Text) == false)
{
MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text;
}
}
//mKCP+wechat-video伪装模式被选中
else if (RadioButton2mKCP2WechatVideo.IsChecked == true)
@ -238,6 +250,10 @@ namespace ProxySU
//传递模板类型
MainWindow.ReceiveConfigurationParameters[0] = "mKCP2WechatVideo";
MainWindow.ReceiveConfigurationParameters[5] = "wechat-video";
if (String.IsNullOrEmpty(TextBoxQuicUUID.Text) == false)
{
MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text;
}
}
//mKCP+dtls伪装模式被选中
else if (RadioButton2mKCP2DTLS.IsChecked == true)
@ -245,6 +261,10 @@ namespace ProxySU
//传递模板类型
MainWindow.ReceiveConfigurationParameters[0] = "mKCP2DTLS";
MainWindow.ReceiveConfigurationParameters[5] = "dtls";
if (String.IsNullOrEmpty(TextBoxQuicUUID.Text) == false)
{
MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text;
}
}
//mKCP+wireguard伪装模式被选中
else if (RadioButton2mKCP2WireGuard.IsChecked == true)
@ -252,6 +272,10 @@ namespace ProxySU
//传递模板类型
MainWindow.ReceiveConfigurationParameters[0] = "mKCP2WireGuard";
MainWindow.ReceiveConfigurationParameters[5] = "wireguard";
if (String.IsNullOrEmpty(TextBoxQuicUUID.Text) == false)
{
MainWindow.ReceiveConfigurationParameters[6] = TextBoxQuicUUID.Text;
}
}
//QUIC无伪装模式被选中
else if (RadioButtonQuicNone.IsChecked == true)

Binary file not shown.

View File

@ -45,7 +45,8 @@
"congestion": true,
"header": {
"type": null
}
},
"seed": null
}
}
}

View File

@ -1,33 +1,34 @@
{
"inbounds": [
{
"port": null,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": null,
"alterId": 64
}
]
},
"streamSettings": {
"network": "mkcp",
"kcpSettings": {
"uplinkCapacity": 100,
"downlinkCapacity": 100,
"congestion": true,
"header": {
"type": null
}
}
}
}
],
"outbounds": [
{
"protocol": "freedom",
"settings": {}
}
]
"inbounds": [
{
"port": null,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": null,
"alterId": 64
}
]
},
"streamSettings": {
"network": "mkcp",
"kcpSettings": {
"uplinkCapacity": 100,
"downlinkCapacity": 100,
"congestion": true,
"header": {
"type": null
},
"seed": null
}
}
}
],
"outbounds": [
{
"protocol": "freedom",
"settings": {}
}
]
}