i am creating an program that scans ip ranges for an specafic file, for example index.htm, index.php, or index.asp
i found some help from examples from this forum, but now my next question:
This code only checks each ip for index.htm, but how do i change it that it checks each ip for index.htm, index.php, and index.asp?
Please help me out..
The form contains textfields fromIp and toIp and an list1 for listing the ips with the servers who has one of the files...
VB Code:
Private Sub cmdStartScan_Click() Dim tmpInt As Integer Dim toIPend As Integer Dim startIP As Integer Dim bigNet As String Dim x As Integer Dim tmpStr As String For x = Len(txtToIP) To 1 Step -1 If Mid$(txtToIP, x, 1) = "." Then toIPend = Mid(txtToIP, x + 1) Exit For End If Next x For x = Len(txtFromIP) To 1 Step -1 If Mid$(txtFromIP, x, 1) = "." Then startIP = Mid(txtFromIP, x + 1) Exit For End If Next x bigNet = Mid$(txtFromIP, 1, x) For x = startIP To toIPend lblOnIP.Caption = (bigNet & x) OpenSocket (bigNet & x) DoEvents Next x For x = 0 To list1.ListCount - 1 tmpStr = Inet1.OpenURL("http://" & list1.List(x) & "index.htm") If InStr(1, tmpStr, "index.htm", vbTextCompare) Then list1.AddItem list1.List(x) End If DoEvents Next x End Sub




Reply With Quote