Skip to content

Commit 8aa6be1

Browse files
author
AdvanceHacker101
committed
Fixed issues with blocking sites
1 parent c9d0c04 commit 8aa6be1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

proxyServer/Form1.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5489,6 +5489,8 @@ public String[] CheckDumpers()
54895489
public bool CheckHost(Request httpRequest)
54905490
{
54915491
string host = httpRequest.headers["Host"];
5492+
bool serviceState = CheckServiceState(BlockServices.Host);
5493+
if (!serviceState) return false;
54925494
bool result = false;
54935495
if (vf.IsFilterEmpty("mitm_hostblock_white")) result = vf.RunAllCompareOr("mitm_hostblock_black", host);
54945496
else result = !vf.RunAllCompareOr("mitm_hostblock_white", host); //revert the value, because we don't want to block whitelisted hosts
@@ -5503,6 +5505,8 @@ public bool CheckHost(Request httpRequest)
55035505

55045506
public bool CheckIP(string ipAddress)
55055507
{
5508+
bool serviceState = CheckServiceState(BlockServices.IP);
5509+
if (!serviceState) return false;
55065510
bool result = false;
55075511
if (vf.IsFilterEmpty("mitm_ipblock_white")) result = vf.RunAllCompareOr("mitm_ipblock_black", ipAddress);
55085512
else result = !vf.RunAllCompareOr("mitm_ipblock_white", ipAddress); //revert the value, because we don't want to block whitelisted hosts
@@ -5517,6 +5521,8 @@ public bool CheckIP(string ipAddress)
55175521

55185522
public bool CheckBody(string bodyText)
55195523
{
5524+
bool serviceState = CheckServiceState(BlockServices.Body);
5525+
if (!serviceState) return false;
55205526
bool result = false;
55215527
if (vf.IsFilterEmpty("mitm_bodyblock_white")) result = vf.RunAllCompareOr("mitm_bodyblock_black", bodyText);
55225528
else result = !vf.RunAllCompareOr("mitm_bodyblock_white", bodyText); //revert the value, because we don't want to block whitelisted hosts
@@ -8612,7 +8618,7 @@ public void CreateTunnel()
86128618
//console.Debug("https, connect request");
86138619
}
86148620

8615-
if ((protocol == Mode.HTTP && http == ProxyServer.Mode.MITM) || (protocol == Mode.HTTPs && https == ProxyServer.Mode.MITM) && ctx.mitmHttp.started) //only block if mitm is set
8621+
if (((protocol == Mode.HTTP && http == ProxyServer.Mode.MITM) || (protocol == Mode.HTTPs && https == ProxyServer.Mode.MITM)) && ctx.mitmHttp.started) //only block if mitm is set
86168622
{
86178623
bool hostResult = ctx.mitmHttp.CheckHost(req);
86188624
if (hostResult)

0 commit comments

Comments
 (0)