Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Make it WORK!! I DARE U!

Options
  • 18-06-2003 12:34pm
    #1
    Registered Users Posts: 998 ✭✭✭


    Ok the script below enables you to view the hardware on your machine when tun through a local webserver setup on the same machine.
    I want to be able to put this on another webserver and enable people who view my site to see there hardware on there machine, sort of like a security joke... I havent been able to figure out how to do this, so I ask you people and fine minds to show me the way!:D if you can.:ninja:

    <%@Language=&quot;VBScript"%>
    <%
    dim objWMIService, colItems, objitem

    Set objWMIService = GetObject( "winmgmts://./root/cimv2" )
    Set colItems = objWMIService.ExecQuery( "Select * from Win32_ComputerSystem", , 48 )
    For Each objItem in colItems
    strComputer = objItem.Name
    Next

    Set objWMIService = GetObject( "winmgmts://" & strComputer & "/root/cimv2" )
    ' Display error number and description if applicable
    If Err Then
    strerMsg = vbCrLf & "Error # " & Err.Number & "<br>"& _
    Err.Description & "<br>" & "<br>"
    End if

    Set colItems = objWMIService.ExecQuery( "Select * from Win32_Processor", , 48 )
    ' Display error number and description if applicable
    'If Err Then ShowError
    ' Prepare display of results
    For Each objItem in colItems
    strMsg = strMsg & "Processor(s) " & _
    " Name: " _
    & trim( objItem.Name ) & "<br>" _
    & " Manufacturer: " _
    & objItem.Manufacturer & "<br>" _
    & " Description: " _
    & objItem.Description & "<br>" _
    & " Current Clock Speed: " _
    & objItem.CurrentClockSpeed & " MHz"
    Next
    Set colItems = objWMIService.ExecQuery( "Select * from Win32_LogicalMemoryConfiguration", , 48 )
    For Each objItem in colItems
    strMsg = strMsg & "Memory" & "<br>" _
    & " Total Physical Memory: " _
    & Int( ( objItem.TotalPhysicalMemory + 1023 ) / 1024 ) _
    & " MB" & "<br>" & "<br>"
    Next
    Set colItems = objWMIService.ExecQuery( "Select * from Win32_DiskDrive", , 48 )
    For Each objItem in colItems
    strMsg = strMsg & "Harddisk(s)" _
    & " Manufacturer: " _
    & objItem.Manufacturer & "<br>" _
    & " Model: " _
    & objItem.Model & "<br>" _
    & " Size: " _
    & Int( ( objItem.Size + 536870912 ) / 1073741824 ) _
    & " GB" & "<br>" & "<br>"
    Next
    Set colItems = objWMIService.ExecQuery( "Select * from Win32_VideoController", , 48 )
    For Each objItem in colItems
    strMsg = strMsg & "Video" _
    & " Name: " _
    & objItem.Name & "<br>" _
    & " Description: " _
    & objItem.Description & "<br>"_
    & " Video Processor: " _
    & objItem.VideoProcessor & "<br>" _
    & " Adapter RAM: " _
    & Int( ( objItem.AdapterRAM + 524288 ) / 1048576 ) _
    & " MB" & "<br>" _
    & " Video Mode Description: " _
    & objItem.VideoModeDescription & "<br>"& "<br>"
    Next

    %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>New Page 1</title>
    </head>

    <body>
    <table border="0" cellpadding="0" cellspacing="0">
    <tr><td>Hardware Summary for <%=strcomputer%>:<br><br></td></tr>
    <% If Err then %>
    <tr><td><%=strerMsg%></td></tr>
    <% else %>
    <tr><td><%=strmsg%></td></tr>
    <% end if%>
    </table>

    </body>

    </html>


Comments

  • Registered Users Posts: 14,148 ✭✭✭✭Lemming


    NGAAHHHHHH!!!

    /meh recoils in horror

    VBscript! Repent Repent!! Heretic! :D :ninja:


  • Closed Accounts Posts: 9,314 ✭✭✭Talliesin


    Originally posted by zekiel
    I want to be able to put this on another webserver and enable people who view my site to see there hardware on there machine, sort of like a security joke... I havent been able to figure out how to do this, so I ask you people and fine minds to show me the way!:D
    IIRC the WMI service isn't creatable with a script running under security (like scripts running local in a browser are unless the settings are ridiculously low).


  • Registered Users Posts: 998 ✭✭✭zekiel


    Ok if its not possible with this script, then is it possible with any other technology?:rolleyes:


  • Registered Users Posts: 491 ✭✭flav0rflav


    Only the technology that takes advantage of lapses in security on browsers, or social engineering, or dodgey email attachments etc.

    The browser environment goes to significant lengths to not allow this type of activity.


  • Registered Users Posts: 998 ✭✭✭zekiel


    ok on the basis that this script wont run via the webserver. is it possible that you could set it so that the script could be run client side via an installable feature. For instance if the client chooses to run this script, a popup comes up requesting that the user installs a small file to enable this.. + add a security garuantee to this so that the user doesnt get scared and run off..
    Now this is going to run on an intranet with a couple of hundred machines so file size isnt a huge hassell.. :D


  • Advertisement
  • Registered Users Posts: 1,268 ✭✭✭hostyle


    You need a signed ActiveX control. If its not signed you'll need the clients to lower their browser security settings to rock bottom. Should be doable in VB.


  • Registered Users Posts: 998 ✭✭✭zekiel


    Thanks.
    The security features shouldnt be a prob.
    So off to work I go!:D


Advertisement