|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Announcements
Want a new Job?
Chapters
Services
Feature Zones
|
Target Audience
Concepts Covered
IntroductionFirst of all, let me say that the use of this program can violate any terms of service or usage policies that are in place at your organization. Please seek permission prior to use, and use this program for testing/proof-of-concept only. BackgroundThis program was written to demonstrate that even in a Windows domain where Internet Explorer settings are locked down with a GPO, even a basic user ('users' group) can override the GPO setting that forces the use of a proxy server. This can be useful if you are on a public computer that uses a proxy server to filter URLs. This program cannot bypass filtering that uses WCCP or the like to redirect Web traffic at the gateway. Using the CodeThis code is really very simple. All that is required, is that you change a registry setting in the using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.Win32;
namespace proxyViolater
{
public partial class Form1 : Form
{
bool alert = false;
public Form1()
{
InitializeComponent();
checkProxy();
alert = true;
}
//check the state of the proxy settings
//
//
private void checkProxy()
{
//check the registry for the 'ProxyEnable' value
RegistryKey proxy = Registry.CurrentUser.OpenSubKey(
"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", true);
//the possible values are 1 - enabled, or 0 - disabled
int enabled = int.Parse(proxy.GetValue("ProxyEnable").ToString());
//update the GUI
if (enabled == 1)
{
lblStatus.ForeColor = Color.Red;
lblStatus.Text = "Enabled";
}
else
{
lblStatus.ForeColor = Color.Green;
lblStatus.Text = "Disabled";
}
}
//Enable the proxy server
//
//
private void btnEnable_Click(object sender, EventArgs e)
{
//connect to the registry and enable the proxy
RegistryKey cUser = Registry.CurrentUser.OpenSubKey(
"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", true);
cUser.SetValue("ProxyEnable", 1);
checkProxy();
}
//Disable the proxy server
//
//
private void btnDisable_Click(object sender, EventArgs e)
{
//connect to the registry and disable the proxy
RegistryKey cUser = Registry.CurrentUser.OpenSubKey(
"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", true);
cUser.SetValue("ProxyEnable", 0);
checkProxy();
}
//Monitor the label that is update on proxy change
//
//
private void lblStatus_TextChanged(object sender, EventArgs e)
{
//alert the user to restart the browser after every proxy change event.
if (alert)
{
MessageBox.Show("Please restart all open browsers for
proxy change to take effect.");
}
}
//Check for proxy changes every 5 seconds
//
//
private void timer1_Tick(object sender, EventArgs e)
{
//check to see if the GPO refresh interval has changed the setting back
checkProxy();
}
}
}
Points of InterestIt seems like a pretty big hole to me. Let me know if any of you can think of a workaround that would block this behavior using integrated Windows or Active Directory methods. History
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||