none
unbreakable script RRS feed

  • Question

  • hello guys 

    is there any way add code to my powershell script the user after run that can break my script with close the powershell windows use ctrl+c i should write script for more security i put that start up and run good but my users can bypass script with close the windows of powershell use ctrl+c 

    thanks all

    Saturday, July 26, 2014 9:08 PM

Answers

All replies

  • Read this first:

    The arms race between program and users


    -- Bill Stewart [Bill_Stewart]

    Saturday, July 26, 2014 10:02 PM
    Moderator
  • Hello thanks a lot for advise CSRSS.EXE and WINLOGON.EXE you say that i first of line my script end process that i find winlogon but not csrss i script run user can not do any thing ? Actually my script ask the users after log on second password i want it if user can not enter truth pass logout but user can use ctrl+c if end process that thing user can enter password and can't use ctrl+c or close window of ps? I do not find any thing for can solv my problem if you have exprince with that please advise me thanks a lot dear stewart
    Saturday, July 26, 2014 11:46 PM
  • Look up and implement Kiosk mode.

    https://www.google.com/#newwindow=1&q=kiosk+mode+windows+7


    ¯\_(ツ)_/¯

    Saturday, July 26, 2014 11:52 PM
  • The point of having you read that blog posting is that you really don't want what you think you want.

    If your goal is to implement a kiosk mode, then that's a different matter. Tell what your goal is, not how you think it needs to be implemented.


    -- Bill Stewart [Bill_Stewart]

    Sunday, July 27, 2014 2:44 AM
    Moderator
  • hello again my goal is when my script run it in user's computer user can not bypass it just enter password

    my script in down there:

     

    $password="microsoft"
    Write-Host "Just For More Security "
    $pass = Read-Host  -Prompt "Enter preshared key:"

    if ( $password  -eq $pass  ) { 


    Write-Host "welcome"

    }

    user can bypass my script i write somthing like that in vb:

    password = "microsoft"
    strComputer = "."
    strExe = "taskkill /F /IM explorer.exe"
    ' Connect to WMI
    set objWMIService = getobject("winmgmts://"_
    & strComputer & "/root/cimv2")

    ' Obtain the Win32_Process class of object.
    Set objProcess = objWMIService.Get("Win32_Process")
    Set objProgram = objProcess.Methods_( _
    "Create").InParameters.SpawnInstance_
    objProgram.CommandLine = strExe

    'Execute the program now at the command line.
    Set strShell = objWMIService.ExecMethod( _
    "Win32_Process", "Create", objProgram)
    Do
    returnvalue = inputbox("Please enter your password","Password")
    Select case returnvalue
    Case Password
    MsgBox "wlc!"

    strComputer = "."
    strExe = "explorer.exe"
    ' Connect to WMI
    set objWMIService = getobject("winmgmts://"_
    & strComputer & "/root/cimv2")

    ' Obtain the Win32_Process class of object.
    Set objProcess = objWMIService.Get("Win32_Process")
    Set objProgram = objProcess.Methods_( _
    "Create").InParameters.SpawnInstance_
    objProgram.CommandLine = strExe

    'Execute the program now at the command line.
    Set strShell = objWMIService.ExecMethod( _
    "Win32_Process", "Create", objProgram)
    Exit Do
    Case Else
    MsgBox "ur pwd is wronge"
    strComputer = "."
    strExe = "shutdown.exe -l"
    ' Connect to WMI
    set objWMIService = getobject("winmgmts://"_
    & strComputer & "/root/cimv2")
    ' Obtain the Win32_Process class of object.
    Set objProcess = objWMIService.Get("Win32_Process")
    Set objProgram = objProcess.Methods_( _
    "Create").InParameters.SpawnInstance_
    objProgram.CommandLine = strExe
    'Execute the program now at the command line.
    Set strShell = objWMIService.ExecMethod( _
    "Win32_Process", "Create", objProgram)
    WScript.echo "Created: " & strExe & " on " & strComputer
    WSCript.Quit
    End select
    Loop

    in vbs can not bypass when try to bypass session closed but powershell can is there exist anyway i can put user's in trap just enter key nothing to do 

    thanks all

    Sunday, July 27, 2014 5:59 AM
  • I recommend moving this to the dead bin.  This user is just playing games.  Look closely at the sript.  It is just a bunch of nonsense pasted together.  There is no script.


    ¯\_(ツ)_/¯

    Sunday, July 27, 2014 11:27 AM
  • To put it in simple terms the script is nonsense and the request is ridiculous.  The system provides a logon and does what the script appears to try to do.  There is no point in the script and, as pointed out above, the script cannot do what the system does.  YOu cannot make a script lock the screen or the session.

    Either the OP is just playing around or the OP is a child trying to play with the computer. The question and the script show that the OP has no knowledge of or experience with scripting.

    If there is any tru need to lock a process into session then the closes a user will get is through running in kiosk mode or through replacing the default shell.  None of this is about scripting.


    ¯\_(ツ)_/¯

    Sunday, July 27, 2014 11:37 AM
  • n vbs can not bypass when try to bypass session closed but powershell can is there exist anyway i can put user's in trap just enter key nothing to do

    Sorry, but this sequence of words does not make any sense.


    -- Bill Stewart [Bill_Stewart]

    Sunday, July 27, 2014 12:00 PM
    Moderator