Hi dibyajyoti,
The Scan method is indeed the method to use to run a scan from a
Pyscan shell.
You can find some examples of how to use this method (in C#, but the
same logic applies) in the code of the Privilege Escalation Runner
extension (
http://axf.watchfire.com/extensions/
privilegeescalationrunner.aspx). The extensions on
axf.watchfire.com
are generally good places to look for examples on how to do things
with the AppScan SDK.
The Scan method is a synchronous method. For an a-sync run of a scan
(if you want to start a scan and then go on to perform other tasks),
you can use ScanAsync().
Here is the method used to run scans in that extension (you can
download the full source from the link above):
public void StartRun()
{
IAppScan appScan = AppScanFactory.CreateInstance();
Log("Running Scans");
// Run a scan with no login
string noAuthScan = RunSingleScan(null, appScan);
// Run a scan with the additional login files
List<string> otherScans = new List<string>();
foreach (string loginFile in _config.OtherLoginFilesList)
{
string curScanFile = RunSingleScan(loginFile, appScan);
otherScans.Add(curScanFile);
}
// Run the scan with the primary login
string primeScanFileName =
RunSingleScan(_config.PrimaryLoginFileName, appScan);
// Configure the Privilege Escalation settings on the main scan
file
Log("Adding all roles to Privilege Escalation configuration");
IPrivilegeEscalationRole nonAuthRole =
PrivilegeEscalationRoleFactory.CreateInstance();
nonAuthRole.RoleName = "NoAuth";
nonAuthRole.IsNonAuthenticatedUser = true;
nonAuthRole.PathToScanFile = noAuthScan;
nonAuthRole.Comments = "Auto-created";
appScan.Scan.ScanData.Config.PrivilegeEscalationRoles.Add(nonAuthRole);
foreach (string curScanFile in otherScans)
{
FileInfo fi = new FileInfo(curScanFile);
IPrivilegeEscalationRole curRole =
PrivilegeEscalationRoleFactory.CreateInstance();
curRole.RoleName = fi.Name;
curRole.IsNonAuthenticatedUser = false;
curRole.PathToScanFile = curScanFile;
curRole.Comments = "Auto-created";
appScan.Scan.ScanData.Config.PrivilegeEscalationRoles.Add(curRole);
}
// Run the test on the main scan
Log("Running Privilege Escalation Testing");
appScan.Scan.Scan(false, true);
IncreaseProgress();
// Save the scan to the results file
Log("Saving Results Scan");
appScan.Scan.SaveScanData(_config.ResultsScanFile);
IncreaseProgress();
_mainForm.Invoke(_mainForm.runCompleteHandler, null); // update
progress bar
}
Cheers,
Guypo
On May 6, 12:59 pm, "Dibyajyoti Ghosh" <
dibyajyotigh...@gmail.com>
wrote: