Re: sp_oacreate security execute problem

From: Sue Hoegemeier (Sue_H_at_nomail.please)
Date: 11/26/03


Date: Tue, 25 Nov 2003 20:38:05 -0700

Not sure but one guess would be that the OS restriction
imposed is based on running scripts (vb scripts, wsh scripts
etc.).

-Sue

On Mon, 24 Nov 2003 08:12:24 -0800, "Rich Norgaard"
<rich@discussions.microsoft.com> wrote:

>Hello all!
>
> I've been troubleshooting this problem for quite some
>time now with no success. I am experiencing some sort of
>security issue trying to use the sp_oacreate family of
>stored procedures. I am testing this on a managed hosting
>box on which I have an Admin account and sa priviledges,
>but am restricted via security policies on certain system
>configs. I'm pretty sure they've done something funny and
>misconfigured something. Here's the sql code first of all:
>
>DECLARE @pid int, @hr int, @path varchar(500), @src
>varchar(1000), @desc varchar(1000)
>SET @path = 'd:\myscript\test.wsf'
>EXEC @hr = sp_OACreate 'WScript.Shell', @pid OUT
>IF @hr <> 0
>BEGIN
> EXEC sp_OAGetErrorInfo @pid, @src OUT, @desc OUT
> SELECT 'oacreate',hr=convert(varbinary(4),@hr),
>Source=@src, Description=@desc
> RETURN
>END
>EXEC @hr = sp_OAMethod @pid, 'Run', NULL, @path
>IF @hr <> 0
>BEGIN
> EXEC sp_OAGetErrorInfo @pid, @src OUT, @desc OUT
> SELECT 'oamethod',hr=convert(varbinary(4),@hr),
>Source=@src, Description=@desc
> RETURN
>END
>EXEC @hr = sp_OADestroy @pid
>
> It works on two of three servers from this same
>provider, all of which are 'supposed' to be configured
>exactly the same. It also works on all of our local
>servers here. I am for the time being executing this in
>Query Analyzer with sa.
>
> Here's the result:
>
>oamethod 0x80070002 NULL NULL
>
> At first I thought is was restrictions at the DB
>level so I set all related system stored procedures to
>everyone and it still failed.
>
> Next we looked at local security policies and noticed
>that 'Create global objects' and 'Impersonate a user
>after authentication' were not set, so we got our
>provider to set the effective settings to Service, System
>and Administrators. Still no luck.
>
> The error number results on the call to the method
>Run but searches on this revolve around licensing and I
>couldn't find anything specific enough to help.
>
> The script itself is simply an ADO call to the DB
>with a comment so I can see it in Profiler, here's the
>code for my .wsf:
>
><job id="myjob">
><script language="VBScript">
>Set db_conn = Createobject("ADODB.Connection")
>db_conn.Open MY_CONN_STRING
>db_conn.Execute("-- TEST - IT WORKED IF WE SEE THIS")
></script></job>
>
> Any help would be super appreciated; this is
>definitely a tricky one! Thanks and have a super day!
>
>> Rich



Relevant Pages

  • Linksys BEFSR41 - Control via cron job scripts ?
    ... I'm looking for a way to control a Linksys BEFSR41 via scripts that ... I would like to apply different filters & ... security policies at different times of the day. ...
    (comp.security.firewalls)
  • Re: dhcp server and isps dns...
    ... >>I doubt the DNS servers of your provider will be changing IPs often ... >>but they are the same every time (unless the provider is doing something ... The /etc/init.d scripts must be treated as configuration files, ... (if they are present in the package, that is, in the .deb file) ...
    (comp.os.linux.networking)
  • Re: Sql 2005 replication
    ... provider and, beleive or not, managed to connect to mysybaseserver. ... as I somehow defined the rest from ... Mind you, I set it up through the scripts, as it wasn't possible to ... OLE DB provider and T-SQL scripting. ...
    (microsoft.public.sqlserver.replication)
  • Re: Sharing RX medication to save $
    ... saying all controlled scripts will be verified...however I have watched them ... > I cannot imagine a provider cooperating in this type of mini-fraud to ... > save copay any more easily than I can imagine chickens eating coconuts. ... >>> person who is not in need of cash assistance might have a $20 ...
    (sci.med.cardiology)
  • Re: mail() stopped working
    ... >> I had working mail() scripts now for a long time on my site. ... >> My web provider has closed for the day, but on their support pages it ... > in which you are calling the mailfunction will fix your troubles: ...
    (alt.php)