I think I may be running into the same problem as Dibyajyoti- AppScan
hangs when I call Scan().
Currently, I'm putting together an extension that automates the
following steps:
1. Create a new scan from a scan template
2. Call an external script to generate an EXD file
3. Import that EXD file into the current scan
4. Continue a full scan
5. Automatically handle any error conditions, i.e. server goes down
temporarily
6. Save the scan and report via email when a scan finishes or cannot
automatically recover
The problem that I'm having is between steps 3 and 4, where I
initially tried something like the following:
using (StreamReader sr = new StreamReader("SomeFileName.exd"))
{
_appScan.Scan.RequestRecorder.ImportRecordedRequests(sr.BaseStream);
_appScan.Scan.RequestRecorder.Analyse();
}
ScanOperationResult scanResult = _appScan.Scan.Scan(true, true);
This didn't work because the call to Analyse() appears to be
asynchronous, and if you try to call Scan() before Analyse() finishes
analyzing the recorded requests, it will throw an error.
So I did something very similar, except instead of calling Scan()
directly after Analyse(), I registered an event handler that would
call Scan() when the scan state returned to idle after the call to
Analyse(). In this case, the call to Scan() appears to work (Scan
State => Exploring), but it never makes any progress, and you can't
stop/pause the scan except by forcefully ending the appscan process
(Complains that "AppScan is busy and cannot close").
Any ideas why this all might be happening? What I really wish I could
do is something like the following:
public void ScanButton_Click()
{
//Generate EXD File
//Import EXD File, call Analyse()
while((result = _appScan.Scan.Scan(true, true)) !=
ScanOperationResult.Succeeded)
{
//Handle any abnormal scan results
}
//Do scan post-processing
}
But I can't see a way to make it work this way.
Anyone have any thoughts or ideas? I very much appreciate it :)
On a somewhat-related note:
One other thing that confuses me is that under certain circumstances
Analyse() appears to start a scan automatically after it's done. For
example, in PyScan with a default template:
>>> appScan.Scan.RequestRecorder.Start() # Scan State => RecordingRequests
>>> appScan.Scan.RequestRecorder.Analyse() # Scan State => Exploring => Idle => ScanExpert
And stays in the ScanExpert state until otherwise instructed. Why does
Analyse() automatically start the ScanExpert? Am I not understanding
what the Analyse() method does, or does it implicitly begin a scan
after it's done Analyzing?
Thanks Again!
--Ian
> On Wed, May 14, 2008 at 7:37 AM, Dibyajyoti Ghosh <
dibyajyotigh...@gmail.com>