Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Scaning the network

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,1354
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Scaning the network
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Scaning the network - 9/13/2004 4:28:39 AM   
  omegabeta

 

Posts: 3
Score: 0
Joined: 9/13/2004
From:
Status: offline
I want to scan my network and send the result into a .txt file using VBscript. The file must looks as following:

Computer_Name Group IP adress MAC adress
comp1 group1 xx.xx.xx.xx xx.xx.xx.xx
comp2 group1 xx.xx.xx.xx xx.xx.xx.xx
comp3 group2 xx.xx.xx.xx xx.xx.xx.xx
comp4 group2 xx.xx.xx.xx xx.xx.xx.xx


Can someone help me ?
 
 
Post #: 1
 
 Re: Scaning the network - 9/13/2004 7:45:19 AM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
What do you have so far?

(in reply to omegabeta)
 
 
Post #: 2
 
 Re: Scaning the network - 9/19/2004 6:55:54 PM   
  omegabeta

 

Posts: 3
Score: 0
Joined: 9/13/2004
From:
Status: offline
I want to scan my LAN to have a updated image -in a list- of computers that works at the moment.

(in reply to omegabeta)
 
 
Post #: 3
 
 Re: Scaning the network - 9/19/2004 11:58:55 PM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
What I meant was what code have you written so far?

(in reply to omegabeta)
 
 
Post #: 4
 
 Re: Scaning the network - 9/23/2004 9:33:27 PM   
  yoma

 

Posts: 3
Score: 0
Joined: 9/23/2004
From:
Status: offline
i am looking for something like this but also tells me who is logged on
oh and does anyone know about exploits for logging people off on windows remotely

(in reply to omegabeta)
 
 
Post #: 5
 
 Re: Scaning the network - 9/23/2004 9:57:21 PM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
Exploits, no, can it be done, yes as long as you have rights, admin I believe, to the remote PC.

(in reply to omegabeta)
 
 
Post #: 6
 
 Re: Scaning the network - 9/24/2004 1:15:15 AM   
  yoma

 

Posts: 3
Score: 0
Joined: 9/23/2004
From:
Status: offline
no it can be done
go to download.com and download angry ip scanner this can tell you the user name
but what i want is to have a script that only scans a cirtain set of hosts as scanning all the ip adresses in my collage is going to take a few hours

(in reply to omegabeta)
 
 
Post #: 7
 
 Re: Scaning the network - 9/27/2004 5:09:42 AM   
  omegabeta

 

Posts: 3
Score: 0
Joined: 9/13/2004
From:
Status: offline
Hi,
->In a .bat file I did:
nbtstat -a x.x.x.x | FIND "<00> UNIQUE" >ip.txt
nbtstat -a x.x.x.x | FIND "IpAddress" >> ip.txt
nbtstat -a x.x.x.x | FIND "MAC Address" >>ip.txt
nbtstat -a x.x.x.x | FIND "<00> GROUP" >>ip.txt
I works( for a single address)
->In VBscript I did:
Set objShell = CreateObject("Wscript.Shell")
name = "nbtstat -a x.x.x.x | FIND '<00> UNIQUE' >d:\script\ip.txt "
ip = "nbtstat -a x.x.x.x | FIND 'IpAddress' >>d:\script\ip.txt"
mac = "nbtstat -a x.x.x.x | FIND 'MAC Address' >>d:\script\ip.txt"
group= "nbtstat -a x.x.x.x | FIND '<00> GROUP' >>d:\script\ip.txt"
Call objShell.Run(name,6)
Call objShell.Run(ip,6)
Call objShell.Run(mac,6)
Call objShell.Run(group,6)
I get no errors but the file is not created.

Can someone give me an advice ?

(in reply to omegabeta)
 
 
Post #: 8
 
 Re: Scaning the network - 9/27/2004 7:59:58 AM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
Here is an example using WshShell.Exec, I have been able to get this to partially work, it returns the IP and Mac addresses but not the <00> stuff. I will need to check on that later but this should give you a start.

quote:
Dim strFileName : strFileName = "computer.txt"
Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject")
Dim WshShell : Set WshShell = createobject("wscript.shell")

Dim oFile
Dim png
Dim strComputer
Dim strPing
Dim strReply

Set oFile = Fso.OpenTextFile(strFileName, ForReading)

If Not Fso.FileExists(strFileName) then
strRet = Msgbox("The file, " & strFileName & " is not available" & vbCr _
& "The file must be located in the same folder as the script." & vbCR _
& "Please check for the file <<" & strFileName & ">> in the folder" & vbCR _
& "<<" & Fso.GetParentFolderName(Wscript.ScriptFullName) & ">>")
Wscript.Quit
End if
Do Until oFile.AtEndOfStream
strComputer = oFile.Readline

set png = WshShell.exec("nbtstat -a " & strComputer)
do until png.status = 1 : wscript.sleep 10 : loop

strPing = png.stdout.readall
msgbox StrPing
temp = ubound(split(strPing,vbcrlf))+1
MyArray = Split(strPing,vbcrlf)
i = 0
Do until i = Temp
Select Case True
Case InStr(MyArray(i), "IpAddress") > 0
Msgbox MyArray(i)
Case InStr(MyArray(i), "<00> UNIQUE") > 0
Msgbox MyArray(i)
Case InStr(MyArray(i), "<00> GROUP") > 0
Msgbox MyArray(i)
Case InStr(MyArray(i), "MAC Address") > 0
Msgbox MyArray(i)
End Select

i = i + 1
Loop
Loop

(in reply to omegabeta)
 
 
Post #: 9
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Scaning the network Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts