?
Solved

500 Points  web page computername capture

Posted on 2009-04-21
2
Medium Priority
?
353 Views
Last Modified: 2013-11-18
Hi, I'm trying to create a script that will capture a users computername username or other system info when the user logs in.  Users that log in are staff members with editing access to our website.  We would like to keep track of who is logging in, and if a users credentials are compromised, we'll have the IP address (already being tracked), computername and username of the culprit.  It should autmatically capture this on page load.

Anyway, i'm trying to accomplish this with a simple javascript or activeX.  i've come up with something like this which doesnt return any values.

Also, it would probably work better as a post to a database than an email submission since IE gives a warning when sending an email from the page.  It is currently sending the email, but only after several warnings... so that's not really gonna work.  I dont mind them accepting the active X install.

why am i not getting any values back and how can i post this to a db or text file or something other than an email.


<script language="javascript">
function getcredential() {
    var wshnetwork=new ActiveXObject("wscript.network");
    //write to some (hidden) form field 
    with (document.formname) {
        usernamefieldname.value=wshnetwork.username;
        computernamefieldname.value=wshnetwork.computername;
        userdomainfieldname.value=wshnetwork.userdomain;
    }
    wshnetwork=null;
    document.formname.submit();
}
window.onload=getcredential;
</script>
</head>
 
<body>
<div>
Please consent to the execution of a "unsafe" ActiveX.<br />
</div>
<form name="formname" action="mailto:info@rgvit.com" method="post">
<input type="hidden" name="usernamefieldname"   />
<input type="hidden" name="computernamefieldname" />
<input type="hidden" name="userdomainfieldname"  />
<INPUT TYPE="submit" VALUE='send'>
</form>
</body>

Open in new window

0
Comment
Question by:rgvit
2 Comments
 
LVL 31

Accepted Solution

by:
Wayne Barron earned 1500 total points
ID: 24199599
0
 
LVL 1

Author Comment

by:rgvit
ID: 24199707
Ive seen some references to using wscript.network which is what i'm using in the code i posted.  The problem is that I dont seem to be getting any values back when i do that.  I also want to store those values or even email them, provided that the email function doesnt go through the whole "Are you SURE you want to send an email... ARE YOU VERY SURE...  ARE YOU ABSOLUTELY POSITIVE... ALLOW!"
warnings that come up when you try to use the form submit to email.

in fact that script was supposed to work without <INPUT TYPE="submit" VALUE='send'>
which i added while tinkering with it.

Thanks... can someone provide me with the code i need ?
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article you will learn how to create a free basic website on Bitbucket, a git service provider. Polymer creates dynamic HTML components, which allow more flexibility than static HTML. This tutorial uses Ubuntu Linux but can also be done on W…
Before we dive into the marketing strategies involved with creating an effective homepage, it’s crucial that EE members know what a homepage is. In essence, a homepage is the introductory, or default page, of a website that typically highlights the …
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
Loops Section Overview
Suggested Courses
Course of the Month9 days, 19 hours left to enroll

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question