Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

New feature : Screenshot delay #244

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ If you for some reason don't trust the pre-compiled binaries, you can also compi
Timeout in miliseconds for port scans (default 100)
-screenshot-timeout int
Timeout in miliseconds for screenshots (default 30000)
-screenshot-delay int
Delay before taking screenshot (default 0 => deactivated)
-session string
Load Aquatone session file and generate HTML report
-silent
Expand Down Expand Up @@ -103,6 +105,16 @@ Aquatone also supports aliases of built-in port lists to make it easier for you:
$ cat hosts.txt | aquatone -ports large


### Screenshot delay

For example delaying capture, could be useful for javascript rendered pages (sleeping a couple of ms).
The system waits the specified number of virtual milliseconds before deeming the page to be ready.

**Example:**

$ cat hosts.txt | aquatone -screenshot-delay 10000


### Usage examples

Aquatone is designed to play nicely with all kinds of tools. Here's some examples:
Expand Down
4 changes: 4 additions & 0 deletions agents/url_screenshotter.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ func (a *URLScreenshotter) screenshotPage(page *core.Page) {
if *a.session.Options.Proxy != "" {
chromeArguments = append(chromeArguments, "--proxy-server="+*a.session.Options.Proxy)
}

if *a.session.Options.ScreenshotDelay > 0 {
chromeArguments = append(chromeArguments, fmt.Sprint("--virtual-time-budget=", *a.session.Options.ScreenshotDelay))
}

chromeArguments = append(chromeArguments, page.URL)

Expand Down
2 changes: 2 additions & 0 deletions core/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ type Options struct {
ScanTimeout *int
HTTPTimeout *int
ScreenshotTimeout *int
ScreenshotDelay *int
Nmap *bool
SaveBody *bool
Silent *bool
Expand All @@ -38,6 +39,7 @@ func ParseOptions() (Options, error) {
ScanTimeout: flag.Int("scan-timeout", 100, "Timeout in miliseconds for port scans"),
HTTPTimeout: flag.Int("http-timeout", 3*1000, "Timeout in miliseconds for HTTP requests"),
ScreenshotTimeout: flag.Int("screenshot-timeout", 30*1000, "Timeout in miliseconds for screenshots"),
ScreenshotDelay: flag.Int("screenshot-delay", 0, "The delay before taking screenshots"),
Nmap: flag.Bool("nmap", false, "Parse input as Nmap/Masscan XML"),
SaveBody: flag.Bool("save-body", true, "Save response bodies to files"),
Silent: flag.Bool("silent", false, "Suppress all output except for errors"),
Expand Down