URL Vulnerability Checker 06-23-2013, 11:04 PM
#1
Hello HC!
I've made an URL Vulnerability Checker in VB.NET feel free to fix my mistakes
Click here to download.
Virustotal result.
Picture of the programme:
![[Image: pj1xb.png]](http://j1306.hizliresim.com/1b/s/pj1xb.png)
Source Code:
I've made an URL Vulnerability Checker in VB.NET feel free to fix my mistakes
![Smile Smile](https://sinister.ly/images/smilies/set/smile.png)
Virustotal result.
Picture of the programme:
![[Image: pj1xb.png]](http://j1306.hizliresim.com/1b/s/pj1xb.png)
Source Code:
Code:
Imports System.Net
Imports System.IO
Imports System.Text
Imports System.Security.Cryptography
Imports System.Text.RegularExpressions
Module Module1
Function Greetings()
Console.WriteLine(" ___________________________________________ ")
Console.WriteLine(" | HackCommunity URL Vulnerability Checker |")
Console.WriteLine(" | |")
Console.WriteLine(" | Coded_by_RootTheSystem |")
Console.WriteLine(" | |")
Console.WriteLine(" | www.hackcommunity.com |")
Console.WriteLine(" |___________________________________________|")
Console.WriteLine("")
Console.WriteLine("")
End Function
Function Tara2(ByVal url As String)
If (sqlInj(url) = 1) Then
Console.WriteLine("Probable Sql Injection Vulnerability Found! => " & url & vbCrLf)
End If
If (XSS(url) = 1) Then
Console.WriteLine("Probable Cross Site Scripting Vulnerability Found! => " & url & vbCrLf)
End If
If (Csrf(url) = 1) Then
Console.WriteLine("Probable Cross Site Request Forcery Vulnerability Found! => " & url & vbCrLf)
End If
If (fileInclude(url) = 1) Then
Console.WriteLine("Probable File Inclusion Vulnerability Found! => " & url & vbCrLf)
End If
Console.WriteLine("Scanning Done!")
End Function
Function GetHref(ByVal host As String)
Dim output = ""
Try
Dim htmldata = istekGonder(host)
Dim x As New Regex("href=(['""])(?!.+://)(?<url>.+?)\1", RegexOptions.IgnoreCase)
Dim mx As MatchCollection = x.Matches(htmldata)
For Each MItem As Match In mx
Dim link = MItem.Value
If Not link = Nothing Then
link = link.Replace("//", "")
link = link.Replace("href='", "")
link = link.Replace("href=""", "")
link = link.Replace("'", "")
link = link.Replace("""", "")
Dim decoded = URLDecode(link)
output &= decoded & vbCrLf
End If
Next
Return output
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Function
Public Function URLDecode(StringToDecode As String) As String
Dim TempAns As String
Dim CurChr As Integer
CurChr = 1
Do Until CurChr - 1 = Len(StringToDecode)
Select Case Mid(StringToDecode, CurChr, 1)
Case "+"
TempAns = TempAns & " "
Case "%"
TempAns = TempAns & Chr(Val("&h" & _
Mid(StringToDecode, CurChr + 1, 2)))
CurChr = CurChr + 2
Case Else
TempAns = TempAns & Mid(StringToDecode, CurChr, 1)
End Select
CurChr = CurChr + 1
Loop
URLDecode = TempAns
End Function
Function istekGonder(ByVal site As String)
Try
Dim webStream As Stream
Dim webResponse = ""
Dim istek As HttpWebRequest
Dim cevap As HttpWebResponse
istek = WebRequest.Create(site)
istek.Method = "GET"
cevap = istek.GetResponse()
webStream = cevap.GetResponseStream
Dim webStreamReader As New StreamReader(webStream)
While webStreamReader.Peek >= 0
webResponse = webStreamReader.ReadToEnd()
End While
Return webResponse
Catch ex As Exception
Return 0
End Try
End Function
Function sqlInj(ByVal url As String)
Try
Dim hash1 = istekGonder(url)
Dim hash2 = istekGonder(url & "'")
If Not hash1 = hash2 Then
Return 1
Else
Return 0
End If
Catch ex As Exception
Console.WriteLine("Scanning Done!")
End Try
End Function
Function fileInclude(ByVal url As String)
Try
Dim response = istekGonder(url & "somefilethatneverexist.php")
If response.ToString.Contains("Warning: include") Then
Return 1
Else
Return 0
End If
Catch ex As Exception
Console.WriteLine("Scanning Done!")
End Try
End Function
Function XSS(ByVal url As String)
Try
Dim response = istekGonder(url & "<hackcom></hackcom>")
If response.ToString.Contains("<hackcom></hackcom>") Then
Return 1
Else
Return 0
End If
Catch ex As Exception
Console.WriteLine("Scanning Done!")
End Try
End Function
Function Csrf(ByVal url As String)
Try
Dim response = istekGonder(url)
If Not response.ToString.Contains("<input type=""hidden""") Then
Return 1
Else
Return 0
End If
Catch ex As Exception
Console.WriteLine("Scanning Done!")
End Try
End Function
Sub Main()
Greetings()
Dim url As String
start:
Console.WriteLine("Enter the URL that will be checked (ex: http://www.site.com/index.php?id=11)")
Console.WriteLine("")
url = Console.ReadLine()
If url.ToString.Substring(0, 7) = "http://" Then
Console.WriteLine("")
Console.WriteLine("URL Scanning...")
Console.WriteLine("----------------------------------------------------------------------")
Tara2(url)
Console.WriteLine("")
GoTo start
Else
Console.WriteLine("It must have http:// front of your URL!!")
Console.WriteLine("")
GoTo start
End If
Console.ReadLine()
End Sub
End Module
Fuck You.