Results 1 to 4 of 4

Thread: Scanning ports

  1. #1
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926

    Unanswered: Scanning ports

    Is there a way to scan port numbers/user Login somehow in MSAccess? I want to set up an application which scans for ports and ties them somehow to users and enter the data jack numbers and store the information in an MSAccess application. If there isn't a way to do it directly in MSAccess, is there any software which can be tied into MSAccess or does anybody have any suggestions on a good freeware program?
    Last edited by pkstormy; 08-29-06 at 15:43.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Last time I had to incorporate port scanning with Access I used AngryIP from command line. Works pretty slick.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926

    IP Scanning

    Thanks Teddy,

    I just tried out AngryIP - it's pretty slick, easy and sweet (and Freeware!).
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  4. #4
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    I found the project I did that for. I used a shellwait function by Terry Kreft to spawn AngryIP silently from commandline, then suck in the textfile that it generates.

    Here's the shellwait function:

    Code:
    '***************** Code Start ******************
    'This code was originally written by Terry Kreft.
    'It is not to be altered or distributed,
    'except as part of an application.
    'You are free to use it in any application,
    'provided the copyright notice is left unchanged.
    '
    'Code Courtesy of
    'Terry Kreft
    Private Const STARTF_USESHOWWINDOW& = &H1
    Private Const NORMAL_PRIORITY_CLASS = &H20&
    Private Const INFINITE = -1&
    
    Public Type STARTUPINFO
        cb As Long
        lpReserved As String
        lpDesktop As String
        lpTitle As String
        dwX As Long
        dwY As Long
        dwXSize As Long
        dwYSize As Long
        dwXCountChars As Long
        dwYCountChars As Long
        dwFillAttribute As Long
        dwFlags As Long
        wShowWindow As Integer
        cbReserved2 As Integer
        lpReserved2 As Long
        hStdInput As Long
        hStdOutput As Long
        hStdError As Long
    End Type
    
    Public Type PROCESS_INFORMATION
        hProcess As Long
        hThread As Long
        dwProcessID As Long
        dwThreadID As Long
    End Type
    
        
    Public Sub ShellWait(Pathname As String, Optional WindowStyle As Long)
        Dim proc As PROCESS_INFORMATION
        Dim start As STARTUPINFO
        Dim ret As Long
        ' Initialize the STARTUPINFO structure:
        With start
            .cb = Len(start)
            If Not IsMissing(WindowStyle) Then
                .dwFlags = STARTF_USESHOWWINDOW
                .wShowWindow = WindowStyle
            End If
        End With
        ' Start the shelled application:
        ret& = CreateProcessA(0&, Pathname, 0&, 0&, 1&, _
                NORMAL_PRIORITY_CLASS, 0&, 0&, start, proc)
        ' Wait for the shelled application to finish:
        DoEvents
        ret& = WaitForSingleObject(proc.hProcess, INFINITE)
        ret& = CloseHandle(proc.hProcess)
    End Sub
    '***************** Code End ****************
    I would use it like so:

    Code:
    'In my scenario, I needed to scan entire Class C's, which was passed in via the "ClassC" var.  fName is the name of the textfile you want to use.
    cmdStr = path & "\bin\ipscan.exe " & ClassC & ".1 " & ClassC & ".255 -h -f:csv """ & fName & """"
    
    'SetStatus refers to a status tracking utility I posted here a while ago
    SetStatus "Scanning Class C", 40
    
    ShellWait (cmdStr)
    
    SetStatus "Importing Scan File", 80
    
    'Import output from ipscan
    DoCmd.TransferText , "ipscanOut", tblName, fName
    Anywho, the basic idea is spawn AngryIP with the parameters you like. Hang the application until AngryIP is done, then suck the file it created into a staging table to do whatever with.

    *I should add that I kept all ancillory required executables in a \bin directory which was part of my install. I highly recommend doing the same.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •