Forums  Register  Login  My Profile  Inbox  Address Book  My Subscription  My Forums 

Member List  Search  FAQ  Ticket List  Log Out

 

Need to get PC Serial Number

 
Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [Networking & Security] >> GFI LANguard >> Need to get PC Serial Number Page: [1] 2   next >   >>
Login
Message << Older Topic   Newer Topic >>
Need to get PC Serial Number - 17.Dec.2004 7:30:00 AM   
NML

 

Posts: 53
Joined: 23.Apr.2004
From: Florida
Status: offline
Is it possible to have LanGuard extract the Serial Number from the PC's bios via a script? I found a vb script that works in windows but not Languard.

Is there a way to convert this to work under Languard?

On Error Resume Next
CompName = inputbox("Enter name or IP address of local or remote computer", _
"BIOSinfo -
Post #: 1
RE: Need to get PC Serial Number - 17.Dec.2004 9:55:00 AM   
Sorin Coroian

 

Posts: 954
Joined: 9.Feb.2003
Status: offline
This script should work:

Function Main
Dim objLocator As Object
Dim objWMIService As Object
Dim objBIOS As Object
Dim ip, compname As String

cr = Chr(13) + Chr(10)
Set objLocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMIService = objLocator.ConnectServer ( GetParameter("ComputerIP"), "root\cimv2", GetParameter("User"), GetParameter("Password") )
If objWMIService is Nothing Then
echo ("Unable to create WMI Object")
Else
Set colBIOS = objWMIService.ExecQuery ("SELECT * FROM Win32_BIOS")
For Each objBIOS In colBIOS
echo("Bios informations for scanned computer:" & cr)
echo("Manufacturer: " & objBIOS.Manufacturer & cr)
echo("Serial number: " & objBIOS.SerialNumber & cr)
echo("BIOS Version: " & objBIOS.SMBIOSBIOSVersion)
Next
End If

(in reply to NML)
Post #: 2
RE: Need to get PC Serial Number - 17.Dec.2004 10:00:00 AM   
NML

 

Posts: 53
Joined: 23.Apr.2004
From: Florida
Status: offline
Thank you for the quick response.

(in reply to NML)
Post #: 3
RE: Need to get PC Serial Number - 17.Dec.2004 10:10:00 AM   
Sorin Coroian

 

Posts: 954
Joined: 9.Feb.2003
Status: offline
I forgot the last line:
End Function

The echo information will be displayed in scanner activity window lile this:
Checking miscellaneous vulnerabilities...
Bios informations for scanned computer:
Manufacturer: Award Software, Inc.
Serial number: SYS-1234567890
BIOS Version: ASUS P2B-F ACPI BIOS Revision 1011

(in reply to NML)
Post #: 4
RE: Need to get PC Serial Number - 17.Dec.2004 11:25:00 AM   
NML

 

Posts: 53
Joined: 23.Apr.2004
From: Florida
Status: offline
I am not sure if I am doing something wrong but when I run the script via the LNSS Script editor it works fine but when I run the script via LNSS it does not echo any data.

Thanks, for any help.

(in reply to NML)
Post #: 5
RE: Need to get PC Serial Number - 17.Dec.2004 12:43:00 PM   
Sorin Coroian

 

Posts: 954
Joined: 9.Feb.2003
Status: offline
Yes, it seems that does not work with Currently Logged-On User. Try with Alternative Credentials using administrative credentials.

(in reply to NML)
Post #: 6
RE: Need to get PC Serial Number - 17.Dec.2004 1:32:00 PM   
rex

 

Posts: 232
Joined: 28.Oct.2003
From: Santa Cruz, CA
Status: offline
Very cool vbs... You should probably integrate this permanently into the Languard scanner. It would also be nice to put this into the registry info instead of an echo for better reporting, but I'm not sure how to do this...

Rex

(in reply to NML)
Post #: 7
RE: Need to get PC Serial Number - 17.Dec.2004 2:09:00 PM   
Sorin Coroian

 

Posts: 954
Joined: 9.Feb.2003
Status: offline
In version 6 was just added for next build an option with which a script can set the description of vulnerabilities, eventually as a new node. So, the info could be displayed in a information vulnerability, which remain in report.
Probably the new beta build will be available next week.

Sorin

(in reply to NML)
Post #: 8
RE: Need to get PC Serial Number - 20.Dec.2004 1:05:00 PM   
rex

 

Posts: 232
Joined: 28.Oct.2003
From: Santa Cruz, CA
Status: offline
Sorin,

It looks like it didn't get implemented yet for beta 6 for this week yet, any chance it will in the furture?

Thanks,
Rex

(in reply to NML)
Post #: 9
RE: Need to get PC Serial Number - 20.Dec.2004 4:31:00 PM   
Sorin Coroian

 

Posts: 954
Joined: 9.Feb.2003
Status: offline
The script below will create a new node within its vulnerability. There are two new instructions: SetDescription, which change the default description text, and AddListItem, which will create a node and sub-items in that node.
The script works only under Alternative credentials. The result in Scan Results window and filters will be like this:

Bios information for scanned computer
BIOS info:
Manufacturer: Award Software International, Inc.
Serial Number:
BIOS Version: 6.00 PG

Function Main
Dim SocketObject As Object
Dim objLocator As Object
Dim objWMIService As Object
Dim objBIOS As Object
Dim ip, compip, compname, user, passwd As String

result = false
cr = Chr(13) + Chr(10)
compip = GetParameter("ComputerIP")
user = GetParameter("User")
passwd = GetParameter("Password")
'Socket.SetTimeout 1000,1000
ip = Socket.DnsLookup(Socket.ReverseDnsLookup("127.0.0.1"))
If ip = compip Then
user = "" 'currently logged on user mode for localhost
passwd = ""
End If
Set objLocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMIService = objLocator.ConnectServer (compip, "root\cimv2", user , passwd )
If objWMIService is Nothing Then
echo ("Unable to create WMI Object")
Else
Set colBIOS = objWMIService.ExecQuery ("SELECT * FROM Win32_BIOS")
For Each objBIOS In colBIOS
echo("Bios information for scanned computer:" & cr)
echo("Manufacturer: " & objBIOS.Manufacturer & cr)
echo("Serial number: " & objBIOS.SerialNumber & cr)
echo("BIOS Version: " & objBIOS.SMBIOSBIOSVersion)
SetDescription("Bios information for scanned computer")
AddListItem("","BIOS info:")
AddListItem("BIOS info:","Manufacturer: " & objBIOS.Manufacturer)
AddListItem("BIOS info:","Serial Number: " & objBIOS.SerialNumber)
AddListItem("BIOS info:","BIOS Version: " & objBIOS.SMBIOSBIOSVersion)
Next
result = true
End If
main = result
End Function

Sorin

(in reply to NML)
Post #: 10
RE: Need to get PC Serial Number - 20.Dec.2004 4:37:00 PM   
Sorin Coroian

 

Posts: 954
Joined: 9.Feb.2003
Status: offline
This script should work with build uploaded, 20041217.

(in reply to NML)
Post #: 11
RE: Need to get PC Serial Number - 17.Jan.2005 10:59:00 PM   
Guest
I cannot get this Script to work.

I have build 20040910 could that be the problem?

I took out:
SetDescription("Bios information for scanned computer")
AddListItem("","BIOS info:")
AddListItem("BIOS info:","Manufacturer: " & objBIOS.Manufacturer)
AddListItem("BIOS info:","Serial Number: " & objBIOS.SerialNumber)
AddListItem("BIOS info:","BIOS Version: " & objBIOS.SMBIOSBIOSVersion)

as I always got a Error message in the debugger. But it only seems to work on a few workstations and not on all!??

It is really strange. please someone any idea??

(in reply to NML)
  Post #: 12
RE: Need to get PC Serial Number - 18.Jan.2005 6:24:00 AM   
Sorin Coroian

 

Posts: 954
Joined: 9.Feb.2003
Status: offline
The script above with containing AddListItem is in fact for version 6, and 20041217 is a version 6 build number. I posted the script regarding the question above it.
For version 5 sections with SetDescription and AddListItems should be commented. However to have the script working on the remote machines you should use only Alternative Credentials (admin credentials) and wmi should be enabled on those machines

(in reply to NML)
Post #: 13
RE: Need to get PC Serial Number - 19.Jan.2005 8:50:00 PM   
Guest
Hi Sorin

just another question befor I leave you in peace for this week.

Anyway to my question. Like I said I removed the AddListItem, is there any possibility to get it into the Scan Report or into the Scan Result as looking the it up in the Scan Activity Window is really aggreavating.

Thanks for your advice

unscencored

(in reply to NML)
  Post #: 14
RE: Need to get PC Serial Number - 20.Jan.2005 8:22:00 AM   
Sorin Coroian

 

Posts: 954
Joined: 9.Feb.2003
Status: offline
With version 5 functionality is not possible. For version 5, I think, could be used custom dbs (from scripts) or custom reports where data is inserted, but it looks a bit complicated.
If you want to have data returned from scripts in LNSS report try version 6. As in the script posted (the same script in version 6 beta forum : http://forums.gfi.com/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=14;t=000032) with SetDescription and AddListItem it is possible to save custom data from scripts in Vulnerabilities descriptions. The script info is saved in a new table, alertdetails, and will be part of the generated reports.

Don't leave me in peace, shoot :-)
I will try to respond to all questions (if my knowledge and time will permit etc.)

Sorin

(in reply to NML)
Post #: 15
Page:   [1] 2   next >   >>
All Forums >> [Networking & Security] >> GFI LANguard >> Need to get PC Serial Number Page: [1] 2   next >   >>
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