Register Login 
 
 

Please use the links on the top right of the page to register and log onto SmartAccessCentral in order to post in the forums.

epa factory complete banner.gif

You are not authorized to post a reply.
Author
  Messages Sort:
linneahr

New Member
New Member
User Online: User is Offline
Posted:25/04/2006 11:50 PM
I wish to create a package that scans for a registry key and wish to use the Citrix watermark cabinet package to do this. I can see in package.xml that there are commented out sections that would appear to let you do this but I am unaware of how to uncomment this section and recompile into a cabinet. Any help with how to do this or how to create a new scan package would be great.
SteveMcG

SmartAccessCentral Moderator
SmartAccessCentral Moderator
User Online: User is Offline
Posted:01/05/2006 8:39 PM

Hi,

If you download the EPA SDK from www.citrix.com/cdn, one of the examples in the help file has code that you could use to achieve your desired result.

There are also some other samples in the SDK which will help you become more familiar with the product.

Steve

linneahr

New Member
New Member
User Online: User is Offline
Posted:02/05/2006 7:34 PM

Steve,

I have downloaded the EPA SDK and am trying to work through the examples to get a working registry scan. Currently my registry EPA scan records a correct answer regardless. I have limited knowledge of coding and believe the error maybe in my package.xml. This is the code I have so far:

package.xml:

<package xmlns="http://www.citrix.com/MSAM/EndpointAnalysis/Package/1.0">

<externalname>1001_name</externalname>

<description>1001_description</description>

<uri>http://www.DSHS.com/EndpointAnalysisPackages/Office4.cab</uri>

<version>1.0</version>

<strings>Office4.resx</strings>

<outputs>

<output>

<externalname>1002_name</externalname>

<description>1002_description</description>

<internalname>result</internalname>

<type>boolean</type>

<values>

<value>False</value>

<value>True</value>

</values>

<default>False</default>

</output>

</outputs>

<parameters>

<parameter>

<externalname>1004_name</externalname>

<description>1004_description</description>

<internalname>ReqKey</internalname>

<type>string</type>

<values />

</parameter>

</parameters>

<dispatcher>

<codemodule>

<content>DispatcherScript.vbs</content>

<entrypoint>

<name>RequestScan</name>

<prerequisite>

<externalname>1003_name</externalname>

<description>1003_description</description>

<internalname>OS</internalname>

<value>Windows 98</value>

<value>Windows ME</value>

<value>Windows NT4</value>

<value>Windows XP</value>

<value>Windows 2000</value>

<value>Windows 2003</value>

</prerequisite>

<parameter>ReqKey</parameter>

</entrypoint>

</codemodule>

</dispatcher>

<downloadables>

<codemodule>

<content>ClientScript.vbs</content>

<entrypoint>

<name>ClientEntryPoint</name>

</entrypoint>

</codemodule>

</downloadables>

</package>

 

office4 .resx:

<?xml version="1.0" encoding="utf-8"?>

<root>

<!--

Microsoft ResX Schema

Version 1.3

The primary goals of this format is to allow a simple XML format

that is mostly human readable. The generation and parsing of the

various data types are done through the TypeConverter classes

associated with the data types.

Example:

... ado.net/XML headers & schema ...

<resheader name="resmimetype">text/microsoft-resx</resheader>

<resheader name="version">1.3</resheader>

<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>

<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>

<data name="Name1">this is my long string</data>

<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>

<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">

[base64 mime encoded serialized .NET Framework object]

</data>

<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">

[base64 mime encoded string representing a byte array form of the .NET Framework object]

</data>

There are any number of "resheader" rows that contain simple

name/value pairs.

Each data row contains a name, and value. The row also contains a

type or mimetype. Type corresponds to a .NET class that support

text/value conversion through the TypeConverter architecture.

Classes that don't support this are serialized and stored with the

mimetype set.

The mimetype is used forserialized objects, and tells the

ResXResourceReader how to depersist the object. This is currently not

extensible. For a given mimetype the value must be set accordingly:

Note - application/x-microsoft.net.object.binary.base64 is the format

that the ResXResourceWriter will generate, however the reader can

read any of the formats listed below.

mimetype: application/x-microsoft.net.object.binary.base64

value : The object must be serialized with

: System.Serialization.Formatters.Binary.BinaryFormatter

: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.soap.base64

value : The object must be serialized with

: System.Runtime.Serialization.Formatters.Soap.SoapFormatter

: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.bytearray.base64

value : The object must be serialized into a byte array

: using a System.ComponentModel.TypeConverter

: and then encoded with base64 encoding.

-->

<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">

<xsd:element name="root" msdata:IsDataSet="true">

<xsd:complexType>

<xsd:choice maxOccurs="unbounded">

<xsd:element name="data">

<xsd:complexType>

<xsd:sequence>

<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />

<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />

</xsd:sequence>

<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />

<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />

<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />

</xsd:complexType>

</xsd:element>

<xsd:element name="resheader">

<xsd:complexType>

<xsd:sequence>

<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />

</xsd:sequence>

<xsd:attribute name="name" type="xsd:string" use="required" />

</xsd:complexType>

</xsd:element>

</xsd:choice>

</xsd:complexType>

</xsd:element>

</xsd:schema>

<resheader name="resmimetype">

<value>text/microsoft-resx</value>

</resheader>

<resheader name="version">

<value>1.3</value>

</resheader>

<resheader name="reader">

<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>

</resheader>

<resheader name="writer">

<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>

</resheader>

<data name="_ctx_package_uri">

<value>http://www.DSHS.com/EndpointAnalysisPackages/Office4.cab</value>

</data>

<data name="_ctx_package_version">

<value>1.0</value>

</data>

<data name="_ctx_language">

<value>en-US</value>

</data>

<data name="1001_name">

<value>Office4</value>

</data>

<data name="1001_description">

<value>Description of Office4</value>

</data>

<data name="1002_name">

<value>Allow Access</value>

</data>

<data name="1002_description">

<value>Reports the result of the scan: whether to allow client access to the server farm.</value>

</data>

<data name="1003_name">

<value>Operating System</value>

</data>

<data name="1003_description">

<value>The operating system of the client machine</value>

</data>

<data name="1004_name">

<value>ReqKey</value>

</data>

<data name="1004_description">

<value>The name of the windows registry key (e.g. HKEY_Local_Machine\Software\Microsoft</value>

</data>

</root>

clientscript.vbs:

Function ClientEntryPoint(varArray)

'Any parameters passed to this function will appear as string elements of varArray

on error resume next

Dim strKey, myvalue

strKey = varArray(0)

mvvalue = "Undefined"

myvalue = cstr(CreateObject("WScript.Shell").RegRead(strKey))

ClientEntryPoint = myvalue

End Function

dispatcher.vbs:

const Version = "1.0" 'NB Must match version number in Package properties

const OutputName ="ClientValue"

dim URI, ExpParam

URI = "http://www.DSHS.com/EndpointAnalysisPackages/Office4.cab" 'This must match the URI string in Package properties

ExpParam = URI & "/" & Version & "/downloadable/ClientScript.vbs"

Function RequestScan(env, params)

'This is the defined entry point for the whole thing

Dim final, ReqKey

final = env.IsFinal()

If Not final Then

'Get the value of parameters defined for the scan

Key = params.Value("key")

ReqKey = params.Value("reqkey")

'Call required client function(s) as defined in ClientScript.vbs

Call Enquiry (env, "ClientEntryPoint", Key, OutputName)

'Set final after calling all required entry points

env.SetFinal

Else

Dim opvalue

ReqKey = params.Value("reqkey")

'Get the string output set by the client

opvalue = env.Value(OutputName)

'Set the return value

env.Value ("value") = opvalue

If trim(opvalue) = trim(ReqKey) then

env.Value ("result") = "True"

Else

env.Value ("result") = "False"

End if

End If

End Function

Private Sub Enquiry(env, strEntrypoint, strArg, strOutput)

Dim exp

Set exp = env.CreateExpression(ExpParam, strEntrypoint)

exp.SetName(strOutput)

If strArg <> "" Then

exp.AddArgument(strArg)

End If

env.SetNamedEnquiry (exp)

End Sub

 

Any help would be much appreciated. Thanks.

bergner

New Member
New Member
User Online: User is Offline
Posted:11/05/2006 12:20 AM

Hi,

i have the same problem. Does anybody have a working Registry Scan ?

regards Marc

bergner

New Member
New Member
User Online: User is Offline
Posted:11/05/2006 12:20 AM

Hi,

i have the same problem. Does anybody have a working Registry Scan ?

regards Marc

Joslyn

SmartAccessCentral Moderator
SmartAccessCentral Moderator
User Online: User is Offline
Posted:11/05/2006 10:20 AM

Guys,

A commercial scan is available at http://www.epafactory.com/index.asp?function=DISPLAYPRODUCT&productid=36

This is a compiled scan with the usual security features in the EPAFactory scans plus it allows you to check for binary values.

I have also knocked up a script based scan for you to look at that reads reg keys.  Please don't use this in production as the script scans are very very insecure.  This also does not have any error checking in it but allows you to see a working example.

Any questions let me know,

Tim


Attachment: ScriptRegistryScan.cab


Tim Joslyn

Tim@smartaccesscentral.com

www.SmartAccessCentral.com
You are not authorized to post a reply.


ActiveForums 3.0
  Home|Forums|Editorials|EPA Packages|Snippets
Copyright (c) 2009 SmartAccessCentral Terms Of Use Privacy Statement