Exec 命令

exec 命令会使用指定的起始 URL(在 /starting_url/base_scan/scan_template 中)创建新扫描,并运行和保存此扫描。此外,还可以使用它来生成和保存扫描的报告。

要运行 exec 命令,请按如下所述在命令提示符中键入 execexe,后跟所要求的命令选项。

注: 如果没有指定命令,缺省情况下将运行 exec 命令。

参数

exec 命令中可以包含以下参数。

参数

说明

/starting_url | /surl | /su <full_path>

为扫描设置起始 URL。如果起始 URL 是在扫描模板或基本扫描中定义的,那么无需在此定义。

/credentials | /cred | /cr <username:password>

指定自动登录并设置用户名和密码。这将覆盖在 SCANT 文件(如使用)中配置的任何登录。

/base_scan | /base | /b <full_path>

指定源扫描(必须包含完整路径),将在新扫描中使用其配置。

/dest_scan | /dest | /d <full_path>

指定保存新扫描的目标(必须包含完整路径)。如果没有指定路径,扫描将保存到 Temp 文件夹,AppScanCMD 会通知您其准确位置和文件名。

/scan_template | /stemplate | /st <full_path>

指定扫描模板文件。

/old_host | /ohost | /oh <full_path>

/new_host | /nhost | /nh <full_path>

这两个参数使您可以在基本扫描中,通过“搜索和替换”将一个主机替换为另一个主机。

/login_file | /lfile | /lf <full_path>

导入保存的登录序列。

/multi_step_file | /mstepfile | /mf <full_path>

导入多步骤操作文件。

/manual_explore_file | /mexplorefile | /mef <full_path>

从手动探索文件导入(EXD、HAR、DAST.CONFIG 或 CONFIG 格式)。
注: 从 AppScan Standard V9.0.1 开始,EXD 文件包含响应数据。要导入此数据,请添加标志 /ir。如果添加此标志,那么不会导入响应数据,而将改为运行“探索”阶段(将发送已保存的请求)以收集响应,从而对其进行分析来用于测试。

/policy_file | /pfile | /pf <full_path>

导入测试策略文件。

/additional_domains | /adomains | /ad <domain>

定义要在扫描中包含的、除起始 URL 之外的域。如果有多个其他域,请用分号将它们分隔,或添加多个参数实例。

/report_file | /rf <full_path>

为生成的报告指定目标和名称(必须包含完整路径)。

此字段是可选的。如果未设置,那么不会生成任何报告。

请注意,如果 /rt 定义为 rc_ase,那么不需要报告文件,因为输出会发布到 AppScan Enterprise。

/report_template | /rtemplate| /rtm <CliDefault | GuiDefault | Summary | DetailedReport | Developer | QA | SiteInventory>

指定报告中将包含的信息的类型(请参阅安全报告

缺省模板(如果未指定):CliDefault。这与“报告”对话框中的“缺省”模板相同。要使用模板,则指定 GuiDefault

/report_type | /rt <xml|pdf|rtf|txt|html|rc_ase>

指定报告格式。缺省值为 XML。

rc_ase 指 AppScan Enterprise 报告,并且会使用现有设置将输出发布到 AppScan Enterprise(要查看这些设置,单击文件 > 导出 > 发布到 AppScan Enterprise > 连接设置)。

/ase_application_name | /aan <AppScan Enterprise application name>

指定报告将发布到的 AppScan Enterprise 应用程序。仅使用 /report_type rc_ase

/min_severity | /ms

<low|medium|high|informational>

指定要在报告(仅非 XML 报告)中包含的最低结果严重性。

缺省值为“low”。

/test_type|/tt <All | Application | Infrastructure | ThirdParty>

指定要在报告中包含哪些类型的测试。缺省值为“All”。

标志

exec 命令中可以包含以下标志。包含这些标志等同于将它们从 False 设置为 True。

标志

说明

/continue | /c

继续扫描。

/explore_only | /eo

仅运行“探索”阶段。

/include_responses | /ir

导入含响应数据的“手动探索”数据(EXD 文件)时,包含这些响应(与 /mef 一起使用)。
注: 从 AppScan Standard V9.0.1 开始,EXD 文件包含响应数据。如果添加该标 志,并且此文件包含响应数据,那么将在进行测试分析时使用此数据。如果此文件包含响应数据,那么将运行“探索”阶段(将发送已保存的请求)以收集响应,从而对其进行分析来用于测试。

/incremental | /inc

对指定的基本扫描运行递增扫描,仅扫描应用程序的新增部分。

/incremental_retest | /incretest

对指定的基本扫描运行递增扫描,扫描应用程序的新增部分以及以前发现过问题的应用程序部分。

/merge_manual_explore_requests | /mmer

将“探索”阶段的“冗余调整”设置应用于“手动探索”数据以帮助避免重复的请求(与 /mef 一起使用)。

/multi-step | /mstep

仅测试多步骤操作。

/open_proxy | /oprxy| /opr /listening_port|/lport|/lp <port number> /save_only|/saveo|/so

打开 AppScan 记录代理。缺省情况下,将使用在“工具 > 选项 > 记录代理”选项卡中设置的端口。

要设置其他端口,请使用 /listening_port <port number>

要在不运行扫描的情况下另存为 SCAN 文件,请使用 /save_only|/saveo|/so

SCAN 文件是包含多个组件文件的 ZIP 文件,其中包括另存为单个 Manual_Explore_#.exd 文件(其中“#”是序号)的“手动探索”序列。EXD 文件可导入到另一个扫描中。

/scan_log | /sl

在扫描时显示扫描日志。

/test_only | /to

仅运行“测试”阶段。

/verbose | /v

在输出中包含进度行。

示例

以下是一些完整命令的示例。

示例 1

此命令将使用“常规扫描”模板,从指定的起始 URL 开始扫描。
appscancmd e /su https://demo.testfire.net.scan

示例 2

此命令将使用“常规扫描”模板,仅启动“探索”阶段(从指定的起始 URL 开始)。

appscancmd e /su https://demo.testfire.net.scan /eo

示例 3

此扫描包含手动探索、多步骤操作、记录的登录和测试策略。
appscancmd e
/st D:\demo.testfire.net.scant
/d D:\demo.testfire.net.scan
/mef D:\ManualExplore.exd
/mf D:\MyMultistepOperation.seq
/lf D:\LoginSequence.login
/pf D:\MyTestPolicy.policy 

示例 4:其他域

可在一个 -additional_domains 参数中定义两个或多个其他域,以逗号分隔,或在单独的参数中进行定义。
appscancmd e
/st D:\demo.testfire.net.scant
/d D:\demo.testfire.net.scan
/mef D:\ManualExplore.exd
/ad demo.testfire.net1,demo.testfire.net2,demo.testfire.net3
/sl
OR
appscancmd e
/st D:\demo.testfire.net.scant
/d D:\demo.testfire.net.scan
/mef D:\ManualExplore.exd
/ad demo.testfire.net1
/ad demo.testfire.net2
/ad demo.testfire.net3
/sl

示例 5:更改主机和端口

扫描模板或基本扫描的主机和端口都可以更改。
appscancmd e
/st D:\demo.testfire.net.scant
/d D:\demo.testfire.net.scan
/mef D:\ManualExplore.exd
/oh https://demo.testfire.net:80
/nh https://demo.testfire.net2:8090

示例 6:递增扫描

这些命令对现有 demo.testfire.net.scan 运行递增扫描。有两种类型的递增扫描,有关详细信息,请参阅递增扫描
  • 仅扫描应用程序的新增部分:
    appscancmd e
    /b D:\demo.testfire.net.scan
    /d D:\demo.testfire.net.inc.scan
    /inc
  • 扫描应用程序的新增部分以及以前发现过问题的应用程序部分:
    appscancmd e
    /b D:\demo.testfire.net.scan
    /d D:\demo.testfire.net.incretest.scan
    /incretest