Option Explicit On
Imports Fiddler
Imports System.Net
Imports System.IO
Public Class Form1
Dim url As String = Nothing
Public Sub New()
' This call is required by the designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
AddHandler FiddlerApplication.BeforeResponse, AddressOf FiddlerBeforeResponseHandler
AddHandler FiddlerApplication.BeforeRequest, AddressOf FiddlerBeforeRequestHandler
AddHandler Application.ApplicationExit, AddressOf ShutdownFiddlerApp
Dim oFlags As FiddlerCoreStartupFlags = FiddlerCoreStartupFlags.Default
FiddlerApplication.Startup(0, oFlags)
MsgBox("Started proxy on port " & FiddlerApplication.oProxy.ListenPort)
End Sub
Private Sub ShutdownFiddlerApp()
FiddlerApplication.Shutdown()
MsgBox("Unloaded proxy")
Threading.Thread.Sleep(1000)
End Sub
Private Sub FiddlerBeforeRequestHandler(ByVal tSession As Session)
RichTextBox1.BeginInvoke(New AsyncMethodCaller(AddressOf AddText), tSession.fullUrl)
url = tSession.ToString
End Sub
Private Sub FiddlerBeforeResponseHandler(ByVal tSession As Session)
End Sub
Public Sub Verification()
Try
Dim webClient As New System.Net.WebClient
Dim result As String = webClient.DownloadString(url)
Dim client As WebClient = New WebClient()
Dim data As Stream = client.OpenRead(url)
Dim reader As StreamReader = New StreamReader(data)
Dim Page As String = reader.ReadToEnd
ListeMot.AddRange(IO.File.ReadAllLines("C:\Users\Clément\Documents\ListeDeMots.txt"))
Dim found As Boolean = False
For Each s As String In ListeMot
If Page.ToLower.Contains(" " & s.ToLower & " ") Then
MsgBox("Un mot interdit a été détecté :" & s)
End If
Next
Catch
End Try
End Sub
Dim ListeMot As New List(Of String)
Private Sub AddText(sText As String)
RichTextBox1.AppendText(sText & vbCrLf)
Dim Thread As New Threading.Thread(AddressOf Verification)
Thread.Start()
End Sub
Protected Overrides Sub Finalize()
MyBase.Finalize()
End Sub
End Class
Public Delegate Sub AsyncMethodCaller(sText As String) Private Sub FiddlerBeforeRequestHandler(ByVal tSession As Session)
If tSession.oResponse.headers.ExistsAndContains("Content-Type", "html") Then
RichTextBox1.BeginInvoke(New AsyncMethodCaller(AddressOf AddText), tSession.fullUrl)
url = tSession.ToString
End If
End SubOption Explicit On
Imports Fiddler
Imports System.Net
Imports System.IO
Public Class Form1
Dim url As String = Nothing
Public Sub New()
' This call is required by the designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
AddHandler FiddlerApplication.BeforeResponse, AddressOf FiddlerBeforeResponseHandler
AddHandler FiddlerApplication.BeforeRequest, AddressOf FiddlerBeforeRequestHandler
AddHandler Application.ApplicationExit, AddressOf ShutdownFiddlerApp
Dim oFlags As FiddlerCoreStartupFlags = FiddlerCoreStartupFlags.Default
FiddlerApplication.Startup(0, oFlags)
MsgBox("Started proxy on port " & FiddlerApplication.oProxy.ListenPort)
End Sub
Private Sub ShutdownFiddlerApp()
FiddlerApplication.Shutdown()
MsgBox("Unloaded proxy")
Threading.Thread.Sleep(1000)
End Sub
Private Sub FiddlerBeforeRequestHandler(ByVal tSession As Session)
RichTextBox1.BeginInvoke(New AsyncMethodCaller(AddressOf AddText), tSession.fullUrl)
url = tSession.ToString
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Private Sub FiddlerBeforeRequestHandler(ByVal tSession As Session)
If tSession.fullUrl.Contains("html") Then
RichTextBox1.BeginInvoke(New AsyncMethodCaller(AddressOf AddText), tSession.fullUrl)
url = tSession.ToString
End If
End SubOption Explicit On
Imports Fiddler
Imports System.Net
Imports System.IO
Public Class Form1
Dim url As String = Nothing
Public Sub New()
' This call is required by the designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
AddHandler FiddlerApplication.BeforeResponse, AddressOf FiddlerBeforeResponseHandler
AddHandler FiddlerApplication.BeforeRequest, AddressOf FiddlerBeforeRequestHandler
AddHandler Application.ApplicationExit, AddressOf ShutdownFiddlerApp
Dim oFlags As FiddlerCoreStartupFlags = FiddlerCoreStartupFlags.Default
FiddlerApplication.Startup(0, oFlags)
MsgBox("Started proxy on port " & FiddlerApplication.oProxy.ListenPort)
End Sub
Private Sub ShutdownFiddlerApp()
FiddlerApplication.Shutdown()
MsgBox("Unloaded proxy")
Threading.Thread.Sleep(1000)
End Sub
Private Sub FiddlerBeforeRequestHandler(ByVal tSession As Session)
RichTextBox1.BeginInvoke(New AsyncMethodCaller(AddressOf AddText), tSession.fullUrl)
End Sub
Private Sub FiddlerBeforeResponseHandler(ByVal tSession As Session)
End Sub
Public Sub Verification()
Try
ListeMot.AddRange(IO.File.ReadAllLines("C:\Users\Clément\Documents\ListeDeMots.txt"))
Dim found As Boolean = False
For Each s As String In ListeMot
If url.ToLower.Contains("-" & s.ToLower & "-") Or url.ToLower.Contains("." & s.ToLower & ".") Or url.ToLower.Contains("." & s.ToLower & "-") Or url.ToLower.Contains("-" & s.ToLower & ".") Then
MsgBox("Un mot interdit dans l'URL a été détecté :" & s)
End If
Next
Catch
End Try
Try
Dim webClient As New System.Net.WebClient
Dim result As String = webClient.DownloadString(url)
Dim client As WebClient = New WebClient()
Dim data As Stream = client.OpenRead(url)
Dim reader As StreamReader = New StreamReader(data)
Dim Page As String = reader.ReadToEnd
ListeMot.AddRange(IO.File.ReadAllLines("C:\Users\Clément\Documents\ListeDeMots.txt"))
Dim found As Boolean = False
For Each s As String In ListeMot
If Page.ToLower.Contains(" " & s.ToLower & " ") Then
MsgBox("Un mot interdit a été détecté :" & s)
End If
Next
Catch
End Try
End Sub
Dim ListeMot As New List(Of String)
Private Sub AddText(sText As String)
Dim url2 As Uri
url2 = New Uri(sText)
If url2.AbsolutePath.EndsWith(".js") = False And url2.AbsolutePath.EndsWith(".jpg") = False And url2.AbsolutePath.EndsWith(".gif") = False And url2.AbsolutePath.EndsWith(".png") = False And url2.AbsolutePath.EndsWith(".css") = False And url2.AbsolutePath.EndsWith(".ico") = False And url2.AbsolutePath.EndsWith(":443") = False Then
RichTextBox1.AppendText(sText & vbCrLf)
url = sText
Dim Thread As New Threading.Thread(AddressOf Verification)
Thread.Start()
End If
End Sub
Protected Overrides Sub Finalize()
MyBase.Finalize()
End Sub
End Class
Public Delegate Sub AsyncMethodCaller(sText As String)