Jump to content
Sign in to follow this  
ct253704

Script editing restrictions

Recommended Posts

ct253704

Hello,

I am trying to find a way to restrict the editing of a specific script without restricting the ability for anyone to run it. I have looked into LoginWrapper and did some forum searching, but can't seem to find anything that does this, or at least not that I was able to figure out. There was a simple password script in the forums that didn't work either.

I have even considered writing a script that runs another script in a more discreet location, but that's not secure to anyone who knows anything. Any help would be appreciated.

I am to believe AutoIT doesn't have native password protection. I would prefer not to use third party programs, but if you know something subtle and small that would do the trick I wouldn't be opposed. The script will contain a password that I would not like to be accessed if possible. 

If this isn't feasible, I will just trash the project. Thanks for your help!

Share this post


Link to post
Share on other sites
water

If you want to restrict editing (of the source code), compile the script and let the users only access the exe to run it.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
abberration

You could go to Comple With Options and compile as CUI and then go to Obfuscator tab and check Run Obfuscaor before compilation. It will give you two files and both are needed to run.


RAID Calculator | Software Installer

The truth has been suppressed since the dawn of time.

Share this post


Link to post
Share on other sites
Jos

.... then go to Obfuscator tab and check Run Obfuscaor before compilation. It will give you two files and both are needed to run.

Which 2 files are needed to run? scriptname.exe should do it.

Jos


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
abberration

Which 2 files are needed to run? scriptname.exe should do it.

Jos

 

I compiled a script called junk.au3 this way and received junk_Obfuscated.au3 and junk.au3.tbl. Did I do something wrong?


RAID Calculator | Software Installer

The truth has been suppressed since the dawn of time.

Share this post


Link to post
Share on other sites
water

To run a compiled script you only need one file: The exe.

The other files are created by other AutoIt tools.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Jos

I compiled a script called junk.au3 this way and received junk_Obfuscated.au3 and junk.au3.tbl. Did I do something wrong?

 

Not done wrong. Obfuscator creates the new Obfuscated junk_obfuscated.au3 source and the TBL file, which are both used by aut2exe to build the compiled junk.exe script.

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
ct253704

thanks for the help. I was able to compile and set security on the .exe file using domain security to only allow users to run. One more thing, if I wanted to allow users to edit the script to modify for their personal use, but only allow that person access to editing, could i set it to prompt for a password on edit, but not on run?

Share this post


Link to post
Share on other sites
JLogan3o13

Is the person you want to delegate access to going to have AutoIt installed? If so, just include the source with the executable, and they can extract it and make changes from the command line:

If StringInStr($cmdlineRaw, "/Extract") Then
    FileInstall(<path to script>, @TempDir & "\ScriptName.au3", 1)
    Exit
EndIf

Running <path to Script> /Extract would copy the original script to the Temp folder, where the person could update and then recompile.


√-1 2^3 ∑ π, and it was delicious!

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites
ct253704

Ha, that is pretty clever! I tested it and that will serve useful for many things. Thank you for that!

However, it doesn't quite solve the problem. If somebody besides the client understands the extract ability they could have access to the source with the personal information. I'm looking for a way to only allow the source to be viewed by the person it was designed for. For instance, I give the compiled script to client A and B with personal information of Client A. Client B uses the extract command and pulls Client A's personal information which is bad. I need both to be able to run it, but only one person to be able to edit it. I am not sure if that is possible. Also, the people I am dealing with aren't all that tech savvy, so asking them to do something like extracting and recompiling a script would most likely get me laughed at :D.

Also, is there a way to prevent the script from running when I use the /extract command? It extract the source to the tempdir but it also runs the script.

Share this post


Link to post
Share on other sites
JLogan3o13

First off, if you would like only certain people to extract the project you will have to decide on criteria for this (password, etc.). Something along this line:

If StringInStr($cmdlineRaw, "/Extract") Then
    $pw = InputBox("Extract Access", "Please enter your PIN", "", "*")
        If $pw = "3.14159265" Then
            FileInstall("C:\Users\JLogan3o13\Desktop\Test.au3", @TempDir & "\Test.au3", 1)
            Exit
        EndIf
EndIf

MsgBox(0, "", "Test")

 As to your second point, if they are not tech savvy, why would you let them alter your code in the first place?

Edited by JLogan3o13

√-1 2^3 ∑ π, and it was delicious!

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites
ct253704

Perfect, Thank you! Exactly what I needed. And you even gave me some pi.

As to your second question, that's a fair point, but certain information they are entering is information I do not know. I quite literally will put in all capital letters exactly what they are to change, tell them only replace words in all caps with the information it is asking without removing any quotation marks or parenthesis. They are intelligent enough to pull that off, I hope..

Thanks for your help with this, I know it seems a bit picky, but this whole project was by request. I am not fond of exposing personal information in this capacity and automating it, but it will make their lives more efficient. Cheers!

Share this post


Link to post
Share on other sites
GrinReaper

Couldn't you set up a form for them to fill out that would be used to "complete" the script?  That way they don't touch the code.


[u]Forum Rules[/u]

Follow the rules or be b*t**slapped into next week.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×