Package org.mozilla.zest.core.v1
Class ZestScript
- java.lang.Object
-
- org.mozilla.zest.core.v1.ZestElement
-
- org.mozilla.zest.core.v1.ZestStatement
-
- org.mozilla.zest.core.v1.ZestScript
-
- All Implemented Interfaces:
ZestContainer
public class ZestScript extends ZestStatement implements ZestContainer
The Class ZestScript.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classZestScript.TypeThe type of the script: Active - the script will try to actively find vulnerabilities in the request/response passed into it, ie it will perform attacks Passive - the script will try to passively find vulnerabilities in the request/response passed into it, ie it will not make any additional requests StandAlone - the script acts on a target specified in the script (which can be overriden) the script will make requests Targeted - the script acts on a request passed into it - it may make additional requests and may changes to that request before submitting it.
-
Field Summary
Fields Modifier and Type Field Description static StringABOUTA standard 'about' message to be included in all scripts.static StringVERSIONThe Zest version implemented.static StringZEST_URLThe URL for more info.-
Fields inherited from class org.mozilla.zest.core.v1.ZestElement
JSON_ELEMENT_TYPE
-
-
Constructor Summary
Constructors Constructor Description ZestScript()Instantiates a new zest script.ZestScript(String title, String description, String type)Instantiates a new zest script.ZestScript(String title, String description, ZestScript.Type type)Instantiates a new zest script.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int index, ZestStatement stmt)Adds the statement in the specified index in the script.voidadd(ZestStatement stmt)Adds the statement to the end of the script.voidaddAuthentication(ZestAuthentication auth)Adds the authentication.ZestScriptdeepCopy()Deep copy.voidduplicateTo(ZestScript script)Duplicate to.StringgetAbout()Gets the about.List<ZestAuthentication>getAuthentication()Gets the authentication.StringgetAuthor()Gets the author.ZestStatementgetChildBefore(ZestStatement child)Gets the child before.List<ZestStatement>getChildren()Returns all of the containers immediate childrenSet<String>getClientWindowHandles()Returns a set containing all of the window handles defined in this scriptStringgetDescription()Gets the description.StringgetGeneratedBy()Gets the generated by.intgetIndex(ZestStatement child)Gets the index.ZestStatementgetLast()Gets the last.ZestVariablesgetParameters()Gets the parameters.StringgetPrefix()Gets the prefix.ZestStatementgetStatement(int index)Gets the statement.List<ZestStatement>getStatements()Gets the statements.StringgetTitle()Gets the title.StringgetType()Gets the type.Set<String>getVariableNames()Returns all of the variable names defined by this staement and its children.StringgetZestVersion()Gets the zest version.protected voidinit()booleanisPassive()Checks if is passive.voidmove(int index, ZestStatement req)Move.voidremove(ZestStatement req)Removes the.voidremoveAuthentication(ZestAuthentication auth)Removes the authentication.voidremoveStatement(int index)Removes the statement.voidsetAbout(String about)Sets the about.voidsetAuthentication(List<ZestAuthentication> authentication)Sets the authentication.voidsetAuthor(String author)Sets the author.voidsetDescription(String description)Sets the description.voidsetGeneratedBy(String generatedBy)Sets the generated by.voidsetParameters(ZestVariables parameters)Sets the parameters.voidsetPrefix(String newPrefix)Sets the prefix.voidsetPrefix(String oldPrefix, String newPrefix)protected ZestStatementsetPrev(ZestStatement prev)voidsetStatements(List<ZestStatement> statements)Sets the statements.voidsetTitle(String title)Sets the title.voidsetType(String type)Sets the type.voidsetType(ZestScript.Type type)Sets the type.voidsetZestVersion(String zestVersion)Sets the zest version.-
Methods inherited from class org.mozilla.zest.core.v1.ZestStatement
getIndex, getNext, getPrevious, insertAfter, insertBefore, isEnabled, isSameSubclass, remove, setEnabled, setNext
-
Methods inherited from class org.mozilla.zest.core.v1.ZestElement
getElementType, setElementType
-
-
-
-
Field Detail
-
VERSION
public static final String VERSION
The Zest version implemented.- See Also:
- Constant Field Values
-
ZEST_URL
public static final String ZEST_URL
The URL for more info.- See Also:
- Constant Field Values
-
ABOUT
public static final String ABOUT
A standard 'about' message to be included in all scripts.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ZestScript
public ZestScript()
Instantiates a new zest script.
-
ZestScript
public ZestScript(String title, String description, String type)
Instantiates a new zest script.- Parameters:
title- the titledescription- the descriptiontype- the type
-
ZestScript
public ZestScript(String title, String description, ZestScript.Type type)
Instantiates a new zest script.- Parameters:
title- the titledescription- the descriptiontype- the type
-
-
Method Detail
-
setType
public void setType(ZestScript.Type type)
Sets the type.- Parameters:
type- the new type
-
setType
public void setType(String type)
Sets the type.- Parameters:
type- the new type
-
getType
public String getType()
Gets the type.- Returns:
- the type
-
init
protected void init()
- Overrides:
initin classZestStatement
-
deepCopy
public ZestScript deepCopy()
Description copied from class:ZestElementDeep copy.- Specified by:
deepCopyin classZestStatement- Returns:
- the zest element
-
duplicateTo
public void duplicateTo(ZestScript script)
Duplicate to.- Parameters:
script- the script
-
add
public void add(ZestStatement stmt)
Adds the statement to the end of the script.- Parameters:
stmt- the statement to add
-
add
public void add(int index, ZestStatement stmt)Adds the statement in the specified index in the script.- Parameters:
index- the index at which the statement will be addedstmt- the statement to add
-
move
public void move(int index, ZestStatement req)Description copied from interface:ZestContainerMove.- Specified by:
movein interfaceZestContainer- Parameters:
index- the indexreq- the stmt
-
remove
public void remove(ZestStatement req)
Removes the.- Parameters:
req- the req
-
removeStatement
public void removeStatement(int index)
Removes the statement.- Parameters:
index- the index
-
getStatement
public ZestStatement getStatement(int index)
Description copied from interface:ZestContainerGets the statement.- Specified by:
getStatementin interfaceZestContainer- Parameters:
index- the index- Returns:
- the statement
-
getTitle
public String getTitle()
Gets the title.- Returns:
- the title
-
setTitle
public void setTitle(String title)
Sets the title.- Parameters:
title- the new title
-
getDescription
public String getDescription()
Gets the description.- Returns:
- the description
-
setDescription
public void setDescription(String description)
Sets the description.- Parameters:
description- the new description
-
getStatements
public List<ZestStatement> getStatements()
Gets the statements.- Returns:
- the statements
-
getChildren
public List<ZestStatement> getChildren()
Description copied from interface:ZestContainerReturns all of the containers immediate children- Specified by:
getChildrenin interfaceZestContainer- Returns:
- the children
-
setStatements
public void setStatements(List<ZestStatement> statements)
Sets the statements.- Parameters:
statements- the new statements
-
addAuthentication
public void addAuthentication(ZestAuthentication auth)
Adds the authentication.- Parameters:
auth- the auth
-
removeAuthentication
public void removeAuthentication(ZestAuthentication auth)
Removes the authentication.- Parameters:
auth- the auth
-
getAuthentication
public List<ZestAuthentication> getAuthentication()
Gets the authentication.- Returns:
- the authentication
-
setAuthentication
public void setAuthentication(List<ZestAuthentication> authentication)
Sets the authentication.- Parameters:
authentication- the new authentication
-
getPrefix
public String getPrefix()
Gets the prefix.- Returns:
- the prefix
-
setPrefix
public void setPrefix(String newPrefix) throws MalformedURLException
Sets the prefix.- Parameters:
newPrefix- the new prefix- Throws:
MalformedURLException- the malformed url exception
-
setPrefix
public void setPrefix(String oldPrefix, String newPrefix) throws MalformedURLException
- Throws:
MalformedURLException
-
getParameters
public ZestVariables getParameters()
Gets the parameters.- Returns:
- the parameters
-
setParameters
public void setParameters(ZestVariables parameters)
Sets the parameters.- Parameters:
parameters- the new parameters
-
getZestVersion
public String getZestVersion()
Gets the zest version.- Returns:
- the zest version
-
setZestVersion
public void setZestVersion(String zestVersion)
Sets the zest version.- Parameters:
zestVersion- the new zest version
-
getGeneratedBy
public String getGeneratedBy()
Gets the generated by.- Returns:
- the generated by
-
setGeneratedBy
public void setGeneratedBy(String generatedBy)
Sets the generated by.- Parameters:
generatedBy- the new generated by
-
getAbout
public String getAbout()
Gets the about.- Returns:
- the about
-
setAbout
public void setAbout(String about)
Sets the about.- Parameters:
about- the new about
-
getAuthor
public String getAuthor()
Gets the author.- Returns:
- the author
-
setAuthor
public void setAuthor(String author)
Sets the author.- Parameters:
author- the new author
-
getVariableNames
public Set<String> getVariableNames()
Description copied from interface:ZestContainerReturns all of the variable names defined by this staement and its children.- Specified by:
getVariableNamesin interfaceZestContainer- Returns:
- the tokens
-
getClientWindowHandles
public Set<String> getClientWindowHandles()
Returns a set containing all of the window handles defined in this script- Returns:
- the window handles.
-
getIndex
public int getIndex(ZestStatement child)
Description copied from interface:ZestContainerGets the index.- Specified by:
getIndexin interfaceZestContainer- Parameters:
child- the child- Returns:
- the index
-
getLast
public ZestStatement getLast()
Description copied from interface:ZestContainerGets the last.- Specified by:
getLastin interfaceZestContainer- Returns:
- the last
-
getChildBefore
public ZestStatement getChildBefore(ZestStatement child)
Description copied from interface:ZestContainerGets the child before.- Specified by:
getChildBeforein interfaceZestContainer- Parameters:
child- the child- Returns:
- the child before
-
isPassive
public boolean isPassive()
Description copied from class:ZestStatementChecks if is passive.- Specified by:
isPassivein classZestStatement- Returns:
- true, if is passive
-
setPrev
protected ZestStatement setPrev(ZestStatement prev)
- Overrides:
setPrevin classZestStatement
-
-