Jump to content

0phoi5

Dedicated Members
  • Posts

    702
  • Joined

  • Last visited

  • Days Won

    20

Everything posted by 0phoi5

  1. I'm placing my bets on a VR supported game, Portal/Half-Life 3. I hope, anyway.
  2. I know this guy, Gordan Freeman, that might be able to tell you, but I haven't been able to email him. Keep getting a bounce-back email, something about a system crash about 20 minutes ago.
  3. Ah, thank you Working great using; function WriteToFile(passForm) { var fso = new ActiveXObject("Scripting.FileSystemObject"); var fileLoc = "J:\\~Business Systems Support\\Customer Delivery\\Service Support\\Disaster Recovery\\CSV\\DRdata.csv"; var file = fso.OpenTextFile(fileLoc, 8); file.writeline( Date() + ',' + passForm.Username.value + ',' + passForm.Hostname.value + ',' + passForm.Title.value + ',' + passForm.Resolvers.value + ',' + passForm.Priority.value + ',' + 'Open' ); file.Close(); alert('Ticket saved.'); location.reload(); }
  4. Apologies, I don't follow your logic. This would give me the current date and time as a variable? How would I then use this to tell the script to add a new line in the CSV file?
  5. Thanks guys :) How would one go about amending... function WriteToFile(passForm) { var fso = new ActiveXObject("Scripting.FileSystemObject"); var fileLoc = "\\SOMEPLACE\\SOMEWHERE"; var file = fso.CreateTextFile(fileLoc, true); file.writeline( passForm.Username.value + ',' + passForm.Hostname.value + ',' + passForm.Description.value + ',' + passForm.Resolvers.value ); file.Close(); alert('Ticket saved.'); } ... to save to a new line in the CSV file on each save, rather than overwriting the first line? Thanks.
  6. So far, I have the below (and yes, it's rather messy as work-in-progress). If there's a better way, I'm all ears, as this is unknown territory for me. The idea behind the form is that it will be used as a 'backup' for logging IT tickets, in-case our normal website is down. So it needs to be in a shared folder, not on a hosted website. I am therefore unable to use PHP etc. Needs to be pretty much client-side script, except it will be saved on a shared drive. I wanted to use CSV and HTML because CSV files are nice and easy to pull to other programs, easily shareable across the business, and HTML makes the form nice and user-friendly and pretty. Cheers. <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>TITLE</title> <link rel="stylesheet" href="CSS/style.css"> <!------------------------------------------------- Javascript to save form data to CSV file --------------------------------------------------> <script language="javascript"> function WriteToFile(passForm) { var fso = new ActiveXObject("Scripting.FileSystemObject"); var fileLoc = "\\SOMEPLACE\\SOMEWHERE"; var file = fso.CreateTextFile(fileLoc, true); file.writeline( passForm.Username.value + ',' + passForm.Hostname.value + ',' + passForm.Description.value + ',' + passForm.Resolvers.value ); file.Close(); alert('Ticket saved.'); } </script> </head> <body> <p>TITLE</p> <form> User's Name: <input type="text" name="Username" size="20"> <br /><br /> Hostname: <input type="text" name="Hostname" size="20"> <br /><br /> Description: <input type="text" name="Description" size="20"> <br /><br /> Resolver Group: <select name="Resolvers"> <option value="IT Service Desk"> Team 1 </option> <option value="IT Desktop"> Team 2 </option> <option value="IT Technical Application Support"> Team 3 </option> </select> <br /><br /> <input type="button" value="Save Ticket" onclick="WriteToFile(this.form)"> </form> <hr /> <!------------------------------------------------- Show the contents of the CSV file on the webpage. --------------------------------------------------> <table datasrc='#data'> <thead> <tr><th>Ticket Ref.</th><th>Date</th><th>User</th><th>Issue</th></tr> </thead> <!----------------------------------------------------------------------- The dataflds need to have the same name as the columns in the CSV file ------------------------------------------------------------------------> <tbody> <tr> <td><span datafld='Ticket Ref'> </span></td> <td><span datafld='Date'></span></td> <td><span datafld='User'> </span></td> <td><span datafld='Issue'> </span></td> </tbody> </table> <!------------------------------------------------------------------------------------------------------------------------- The ActiveX control is initialized using the <object> tag. The CLASSID (unique identifier) for the tabular data control is CLSID:333C7BC4-460F-11D0-BC04-0080C7055A83. This needs to stay the same, else this table won't work. --------------------------------------------------------------------------------------------------------------------------> <object ID=data classid="clsid:333C7BC4-460F-11D0-BC04-0080C7055A83"> <param nAme="DataURL" value="CSV/DRdata.csv"> <param nAme="UseHeader" value="true"> </object> </body> </html>
  7. Is there a better way? The issue is, I'm trying to set up a HTML form to save to a CSV file. I also want the same page to load the contents of the CSV file below the form, so it's viewable and amendable in real-time.
  8. Ah, got it working with; \\SERVERNAME\\Folder 1\\Folder 2\\data.csv Apparently, network locations have to have double backslashes. Another quick query. This works great for amending the first line of data.csv over and over, but how would I amend the script to add data to a new line, each time the user clicks submit? Thanks.
  9. Sorry Cooper, I don't understand. I am signed on to Windows as JOEBLOGGS, using Internet Explorer as JOEBLOGGS, and trying to save to \\SERVERNAME\Folder 1\Folder 2\data.csv, which JOEBLOGGS has Modify access to.
  10. Quick question. Why does this not save when var fileLoc is set to a network location, but works fine when I put C:\somewhere? <html> <head> <script language="javascript"> function WriteToFile(passForm) { var fso = new ActiveXObject("Scripting.FileSystemObject"); var fileLoc = "\\SERVERNAME\Folder 1\Folder 2\data.csv"; var file = fso.CreateTextFile(fileLoc, true); file.writeline(passForm.FirstName.value + ',' + passForm.LastName.value); file.Close(); alert('File created successfully at location: ' + fileLoc); } </script> </head> <body> <p>create a csv file with following details -</p> <form> Type your first name: <input type="text" name="FirstName" size="20"> Type your last name: <input type="text" name="LastName" size="20"> <input type="button" value="submit" onclick="WriteToFile(this.form)"> </form> </body> </html> Initial question resolved. Please read below thread for further question/issue. Thanks.
  11. Hi all, How would you go about setting up a stand-alone Raspberry Pi, which would; Be powered by solar, battery, or any other method. At least a few days power, if possible. Have some sort of internet connection available, so one can SSH / NetCat to it. (Dongle?) Be as small and discreet as possible, so it doesn't get stolen. *edit* Think weather monitoring station, but too far away to connect to the same WiFi network as your home PC, and not in range of any free WiFi hotspots.
  12. Hi all, So, without giving anything away that would end up with you behind iron bars with a lover called Frank, what kind of experiences have you had with the Rubber Ducky? In which scenarios have you found it to be invaluable? I ask through curiosity and for inspriation. I'm sure there are a few good stories out there. Thanks
  13. Some sound advice, and that joke made my day. I'll remember that one.
  14. Hi, This is probably a silly question, but I couldn't find the answer anywhere. What is the item, on this image, second from the left? (this is the kit that comes with the USB Rubber Ducky Deluxe)
  15. Thank you. I'll check those details and post again as soon as I am able.
  16. That'd be great, cheers Maybe it is supposed to be how it is, but it seems a bit dodgy that I can use it to grab files I shouldn't be able to get to.
  17. I'm sure, yes. It prompts for the user's password. And if I run as SYSTEM or Admin (me), then . . . XCOPY Z:\Personal.txt C:\ (or wherever) /E /S /C /Y . . . fails, as the local user's Z:\ drive is not accessible.
  18. RUNAS asks for the user's password. http://ss64.com/nt/runas.html *edit* Also... "When a script is run with elevated permissions several aspects of the user environment will change: The current directory, the current TEMP folder and any mapped drives will be disconnected."
  19. Case-in-point; Each user has their own personal drive, their Z:\ drive, which regardless of me being an Admin, I don't have access to. It's their personal space. Say they have a file called 'Personal.txt' on their Z:\ drive. I can send this . . . XCOPY C:\Foo.bat \\%Hostname%\c$ /E /S /C /Y psexec \\%Hostname% -s -c -f cmd.exe /c "Schtasks /create /RU %UserID% /SC ONCE /TN Pull_File_From_Z /TR c:\Foo.bat /ST %Time% . . . and set Foo.bat as . . . XCOPY Z:\Personal.txt C:\ (or wherever) /E /S /C /Y This gives me access to open their C:\ drive and grab Personal.txt. I shouldn't be able to do that.
  20. I am using my Admin account, because PSEXEC doesn't send commands without Admin privledges, but you're misunderstanding the point. Regardless of being an Admin, the Foo.bat runs entirely as the user. Not me, the user. As an Admin, I should only be able to send commands to a PC using my account or as SYSTEM. Not as a user. This script runs Foo.bat ENTIRELY as the user. Without their password.
  21. Not really. I could copy the file to any location I and the user have access to. Doesn't have to be C:\, that was just an example. The security flaw is the second line of code, which runs the file as the user. Not me, the user. Without their password. If you look at all CMD or Powershell commands that Windows have created, they did not intend this to be available. Their scripts ALWAYS ask for the password for the user specified after /RU.
  22. Hi all, So, this script shouldn't work without a password for a user, but it does. Using PSTools and being on the same network as the target PC. Set the %Time% to be in a couple of minutes . . . XCOPY C:\Foo.bat \\%Hostname%\c$ /E /S /C /Y psexec \\%Hostname% -s -c -f cmd.exe /c "Schtasks /create /RU %UserID% /SC ONCE /TN %NameOfTask% /TR c:\Foo.bat /ST %Time% This actually successfully runs Foo.bat on a user's PC, as the %UserID% set in the script, but doesn't actually prompt for their password. It just runs. I've even managed to use this to send a command to copy files, from a folder that only they have access to, to a location I can then pull them from. If I clean up after me (delete schtask and bat file), it looks to the system like they ran the command and not anyone else. Security flaw?
  23. Thank yourself lucky you didn't just try to explain a fix to someone who asked "Which button is the spacebar?" PICNIC comes to mind.
×
×
  • Create New...