UrlscanGetHttpTransactions
Deprecated. No available replacement.
- Type
- javascript
- Pack
- UrlScan
Source
var url = args.url;
var limit = args.limitl;
var defaultWaitTime = Number(args.wait_time_for_polling)
uuid = executeCommand('urlscan-submit-url-command', {'url': url})[0].Contents;
uri = executeCommand('urlscan-get-result-page', {'uuid': uuid})[0].Contents;
var resStatusCode = 404
var waitedTime = 0
while(resStatusCode == 404 && waitedTime < Number(args.timeout)) {
var resStatusCode = executeCommand('urlscan-poll-uri', {'uri': uri})[0].Contents;
if (resStatusCode == 200) {
break;
}
wait(defaultWaitTime);
waitedTime = waitedTime + defaultWaitTime;
}
if(resStatusCode == 200) {
return executeCommand('urlscan-get-http-transaction-list', {'uuid': uuid, 'url': url, 'limit': limit});
} else {
if(waitedTime >= Number(args.timeout)){
return 'Could not get result from UrlScan, please try to increase the timeout.'
} else {
return 'Could not get result from UrlScan, possible rate-limit issues.'
}
}
README
Gets the HTTP transactions made for a given URL using the URLScan integration.
To use this script properly, go to the Advanced section in the task that executes this script, and check the Run without a worker checkbox. The system will use less resources for the polling action.
Script Data
| Name | Description |
|---|---|
| Script Type | javascript |
| Tags | polling, UrlScan |
Dependencies
This script uses the following commands and scripts.
- urlscan-get-http-transaction-list
- urlscan-poll-uri
- urlscan-submit-url-command
Inputs
| Argument Name | Description |
|---|---|
| url | The URL to search the transaction list for. |
| wait_time_for_polling | The wait time between two polling actions (in Seconds) of the URLScan results page. A rate-limit error may occure if the time value is set too low. |
| timeout | The amount of seconds to wait for the scan ID result. |
| limit | The limit of the results in the War Room. The maximum limit allowed is 100. |
Outputs
There are no outputs for this script.