Want to Reboot server from ASPX page

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default Want to Reboot server from ASPX page

    I am developing a asp.net web based service application for our product
    I am trying to trigger a reboot of the server based on a user request
    I believe I have all the appropriate code for AdjustingTokens etc an
    all those calls seem to succeed, however, the final call to ExitWindowsE
    is failing with 'Access Denied'

    In my machine.config, I have already set the userName to 'System' as
    seem to require this for some other functionality I implemented. I also trie
    to impersonate a local user account with admin priviledges via my application
    web.config file but that failed as well with the same 'Access Denied' (by th
    way what exactly does 'impersonate' in the web.config do when the machine.config
    file already lets me specify the user as 'SYSTEM'?

    I expect there is some other security thing that I need to twiddle ... any ideas greatl
    appreciated (with as much detail as possible, I am very new to this whole web securit
    stuff)

    Thanks

    Terr

    Terry Guest

  2. Similar Questions and Discussions

    1. ADOBE: PLEASE REBOOT YOUR SERVER
      HAVE YOU TESTED YOUR DOWNLOAD SERVER TODAY?
    2. Accessing an .aspx page from server in a DMZ
      We are currently hosting our own web site; the web site of course resides outside the DMZ. For security reasons, the network crew will not allow us...
    3. Accessing a aspx page using HttpWebRequest from another aspx page on the same webapp
      Did you have any luck on this as I have the same problem. Maybe you can help me out of you solved your problem.
    4. SQL statement working in SQL Server but not in .aspx.cs page
      I have written the following query with a subquery to add a counter to be added to a drop down list, which works in SQL Server, but when I transfer...
    5. Reboot remote server from ASP.NET (VB.NET) using WMI
      Mickey, There is a free class here to help you reboot the system. http://www.mentalis.org/soft/class.qpx?id=7 Ken ---------------- "Mickey...
  3. #2

    Default Re: Want to Reboot server from ASPX page

    Terry, first get the code to run in a normal Windows App, so you know that
    it works.
    After that, it should be a security issue, and impersonation should work,
    but you also have to switch off anonymous access to the virtual directory
    for impersonation to work.
    To ensure that your impersonation is set up correctly, add a test call
    somewhere in a form, returning the current user, and check that it is what
    you expect (not the anonymous, or ASP.NET user, etc). To get the current
    user, call
    System.Security.Principal.WindowsIdentity.GetCurre nt().Name

    "Terry" <anonymous@discussions.microsoft.com> wrote in message
    news:27B39478-93C0-42AE-9ECE-A49E9EC01AE7@microsoft.com...
    > I am developing a asp.net web based service application for our product.
    > I am trying to trigger a reboot of the server based on a user request.
    > I believe I have all the appropriate code for AdjustingTokens etc and
    > all those calls seem to succeed, however, the final call to ExitWindowsEx
    > is failing with 'Access Denied'.
    >
    > In my machine.config, I have already set the userName to 'System' as I
    > seem to require this for some other functionality I implemented. I also
    tried
    > to impersonate a local user account with admin priviledges via my
    applications
    > web.config file but that failed as well with the same 'Access Denied' (by
    the
    > way what exactly does 'impersonate' in the web.config do when the
    machine.config
    > file already lets me specify the user as 'SYSTEM'?)
    >
    > I expect there is some other security thing that I need to twiddle ... any
    ideas greatly
    > appreciated (with as much detail as possible, I am very new to this whole
    web security
    > stuff).
    >
    > Thanks,
    >
    > Terry
    >

    Chris Botha Guest

  4. #3

    Default Re: Want to Reboot server from ASPX page

    OK, I have verified that the shutdown related code is working fine fro
    a regular app

    How do I switch off anonymous access to the virtual directory
    Are you talking about adding a statement like <deny user="?"
    in my web.config file or are you talking about a setting i
    the IIS Service Mgr

    I am using a simple application based 'Forms' authentication
    In this case if I use <identity impersonate="true" /> who woul
    it be impersonating ... or in this case because I am using Form
    authentication would I have to spell all that out like
    <identity impersonate="true" userName="abc" password="def"

    I am still a little puzzled by all this impersonate stuff ... if you d
    impersonation what is the point of setting the user='SYSTEM' i
    the machine.config file

    Thanks

    Terr

    ----- Chris Botha wrote: ----

    Terry, first get the code to run in a normal Windows App, so you know tha
    it works
    After that, it should be a security issue, and impersonation should work
    but you also have to switch off anonymous access to the virtual director
    for impersonation to work
    To ensure that your impersonation is set up correctly, add a test cal
    somewhere in a form, returning the current user, and check that it is wha
    you expect (not the anonymous, or ASP.NET user, etc). To get the curren
    user, cal
    System.Security.Principal.WindowsIdentity.GetCurre nt().Nam

    "Terry" <anonymous@discussions.microsoft.com> wrote in messag
    news:27B39478-93C0-42AE-9ECE-A49E9EC01AE7@microsoft.com..
    > I am developing a asp.net web based service application for our product
    > I am trying to trigger a reboot of the server based on a user request
    > I believe I have all the appropriate code for AdjustingTokens etc an
    > all those calls seem to succeed, however, the final call to ExitWindowsE
    > is failing with 'Access Denied'
    >> In my machine.config, I have already set the userName to 'System' as
    > seem to require this for some other functionality I implemented. I als
    trie
    > to impersonate a local user account with admin priviledges via m
    application
    > web.config file but that failed as well with the same 'Access Denied' (b
    th
    > way what exactly does 'impersonate' in the web.config do when th
    machine.confi
    > file already lets me specify the user as 'SYSTEM'?
    >> I expect there is some other security thing that I need to twiddle ... an
    ideas greatl
    > appreciated (with as much detail as possible, I am very new to this whol
    web securit
    > stuff)
    >> Thanks
    >> Terr
    >
    Terry Guest

  5. #4

    Default Re: Want to Reboot server from ASPX page

    If you are using Forms authentication and have impersonation enabled, you
    are impersonating the anonymous user configured in IIS to be used for
    anonymous requests (IUSER_MACHINENAME by default).

    If you need SYSTEM privileges to do what you need to do, you must not
    impersonate the anonymous user. You could set the processModel to SYSTEM
    (like you said you did before) and that should work, as the processModel
    account is the account the request runs under when you are not
    impersonating.

    However, running under SYSTEM is generally not a good idea for other
    security reasons. It is probably a better idea to create a COM+ component
    that does the required functionality and run that with an identity with the
    correct permissions. Then, you would call that COM+ component from your
    application.

    It is hard for me to imagine why you would want to allow a remote web
    request to reboot the server, but I guess we'll help you do that if that's
    what you want...

    Joe K.

    "Terry" <anonymous@discussions.microsoft.com> wrote in message
    news:97F66F42-C306-4809-84A1-A1E8CCFE9237@microsoft.com...
    > OK, I have verified that the shutdown related code is working fine from
    > a regular app.
    >
    > How do I switch off anonymous access to the virtual directory?
    > Are you talking about adding a statement like <deny user="?">
    > in my web.config file or are you talking about a setting in
    > the IIS Service Mgr.
    >
    > I am using a simple application based 'Forms' authentication.
    > In this case if I use <identity impersonate="true" /> who would
    > it be impersonating ... or in this case because I am using Forms
    > authentication would I have to spell all that out like
    > <identity impersonate="true" userName="abc" password="def">
    >
    > I am still a little puzzled by all this impersonate stuff ... if you do
    > impersonation what is the point of setting the user='SYSTEM' in
    > the machine.config file?
    >
    > Thanks,
    >
    > Terry
    >
    > ----- Chris Botha wrote: -----
    >
    > Terry, first get the code to run in a normal Windows App, so you know
    that
    > it works.
    > After that, it should be a security issue, and impersonation should
    work,
    > but you also have to switch off anonymous access to the virtual
    directory
    > for impersonation to work.
    > To ensure that your impersonation is set up correctly, add a test
    call
    > somewhere in a form, returning the current user, and check that it is
    what
    > you expect (not the anonymous, or ASP.NET user, etc). To get the
    current
    > user, call
    > System.Security.Principal.WindowsIdentity.GetCurre nt().Name
    >
    > "Terry" <anonymous@discussions.microsoft.com> wrote in message
    > news:27B39478-93C0-42AE-9ECE-A49E9EC01AE7@microsoft.com...
    > > I am developing a asp.net web based service application for our
    product.
    > > I am trying to trigger a reboot of the server based on a user
    request.
    > > I believe I have all the appropriate code for AdjustingTokens etc
    and
    > > all those calls seem to succeed, however, the final call to
    ExitWindowsEx
    > > is failing with 'Access Denied'.
    > >> In my machine.config, I have already set the userName to 'System'
    as I
    > > seem to require this for some other functionality I implemented. I
    also
    > tried
    > > to impersonate a local user account with admin priviledges via my
    > applications
    > > web.config file but that failed as well with the same 'Access
    Denied' (by
    > the
    > > way what exactly does 'impersonate' in the web.config do when the
    > machine.config
    > > file already lets me specify the user as 'SYSTEM'?)
    > >> I expect there is some other security thing that I need to twiddle
    .... any
    > ideas greatly
    > > appreciated (with as much detail as possible, I am very new to this
    whole
    > web security
    > > stuff).
    > >> Thanks,
    > >> Terry
    > >

    Joe Kaplan \(MVP - ADSI\) Guest

  6. #5

    Default Re: Want to Reboot server from ASPX page

    Hi Terry,

    Did you figure out a solution for this?
    I want to reboot my server via ASPX also

    Regards



    ---
    Posted using Wimdows.net NntpNews Component -

    Post Made from [url]http://www.DotNetJunkies.com/newsgroups[/url] Our newsgroup engine supports Post Alerts, Ratings, and Searching.
    DotNetJunkies User Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139