๐Ÿ” gowitness - a golang, web screenshot utility using Chrome Headless


๐Ÿ” gowitness

A golang, web screenshot utility using Chrome Headless.

@leonjza Go Report Card Docker Cloud Build Status


introduction

gowitness is a website screenshot utility written in Golang, that uses Chrome Headless to generate screenshots of web interfaces using the command line, with a handy report viewer to process results. Both Linux and macOS is supported, with Windows support mostly working.

Inspiration for gowitness comes from Eyewitness. If you are looking for something with lots of extra features, be sure to check it out along with these other projects.

documentation

For installation information and other documentation, please refer to the wiki here.

license

gowitness is licensed under a GNU General Public v3 License. Permissions beyond the scope of this license may be available at http://sensepost.com/contact/.

Owner
SensePost
Orange Cyberdefense's Ethical Hacking Team
SensePost
Comments
  • Screenshot failed Chrome process reported an error taking screenshot

    Screenshot failed Chrome process reported an error taking screenshot

    ERRO[2020-05-12 16:43:39] Screenshot failed destination=https-www.google.com.png err="exit status 1" url="https://www.google.com/" ERRO[2020-05-12 16:43:39] Chrome process reported an error taking screenshot error="exit status 1" url="https://www.google.com/"

    it is giving me an error every time I do a screenshot, I have chrome and chromium latest version installed, anyone knows whats wrong?

  • Failed to query url

    Failed to query url

    Describe the bug Trying to screen shot single url

    To Reproduce Steps to reproduce the behavior: 1.Type this in terminel and get the following error gowitness single --url=https://www.facebook.com/ Error gowitness single --url=https://www.facebook.com/ ERRO[2020-04-01 15:32:28] Failed to query url error="[context deadline exceeded (Client.Timeout or context cancellation while reading body)]" url="https://www.facebook.com/" INFO[2020-04-01 15:32:28] Complete run-time=3.1479092s Screenshots If applicable, add screenshots to help explain your problem. image

    Version Information: Ubuntu WSL (Windows)

  • Full Size Screenshots

    Full Size Screenshots

    Hello,

    I try include the "--fullPage" flag for chrome, instead of resolution. But with no success. This is very useful when you have pages with different lengths. Long product lists etc.

    I would be very grateful for any help.

    Best Regards Askan

  • Single URL errors

    Single URL errors

    Describe the bug I am experiencing two errors when trying to run gowitness. One error says something about a "context deadline exceeded", and the other is "failed to save screenshot buffer"

    To Reproduce Steps to reproduce the behavior: On the command line, type:

    1. gowitness single https://tesla.com
    2. gowitness single https://reddit.com

    Expected behavior Screenshots will be taken of the site.

    Screenshots image

    image

    Version Information:

    • OS: Kali GNU/Linux Rolling x86_64
    • gowitness: 2.0.0
  • Docker Image seems to be broken? (assets 404)

    Docker Image seems to be broken? (assets 404)

    # docker run --rm -v $(pwd):/data -p7171:7171 leonjza/gowitness gowitness report serve --address :7171
    10 Sep 2022 07:46:50 WRN this command is deprecated. use 'gowitness server' instead
    10 Sep 2022 07:46:50 WRN exposing this server to other networks is dangerous! see the server command help for more information
    10 Sep 2022 07:46:50 INF db path path=gowitness.sqlite3
    10 Sep 2022 07:46:50 INF screenshot path path=screenshots
    10 Sep 2022 07:46:50 INF server listening address=:7171
    
    • Submit New URL -> https://example.com
    • Access to Details Page.
    • See the following images

    image1 image2

    Invalid : http://10.0.0.69:7171/details/assets/css/tabler.min.css
    Valid: http://10.0.0.69:7171/assets/css/tabler.min.css
    
  • --fullpage / -F returns `panic: runtime error: invalid memory address or nil pointer dereference`

    --fullpage / -F returns `panic: runtime error: invalid memory address or nil pointer dereference`

    Fullpage (via --fullpage or -F creates a panic:

    $ gowitness single -F https://github.com                                                                                                                                                                   
    20 Mar 2021 10:14:58 INF preflight result statuscode=200 title="GitHub: Where the world builds software ยท GitHub" url=https://github.com
    panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0xa4330b]
    
    goroutine 1 [running]:
    github.com/sensepost/gowitness/chrome.(*Chrome).Screenshot.func2(0xe22760, 0xc00048e2d0, 0x0, 0x0)
            /home/dave/go/pkg/mod/github.com/sensepost/[email protected]/chrome/chrome.go:182 +0x8b
    github.com/chromedp/chromedp.ActionFunc.Do(0xc0003249a0, 0xe22760, 0xc00048e2d0, 0x0, 0x0)
            /home/dave/go/pkg/mod/github.com/chromedp/[email protected]/chromedp.go:606 +0x3a
    github.com/chromedp/chromedp.Tasks.Do(0xc000327bf0, 0x3, 0x3, 0xe22760, 0xc00048e2d0, 0x416a78, 0x30)
            /home/dave/go/pkg/mod/github.com/chromedp/[email protected]/chromedp.go:616 +0x72
    github.com/chromedp/chromedp.Tasks.Do(0xc0004a9ba0, 0x1, 0x1, 0xe22760, 0xc00048e2d0, 0xc0000d0000, 0xe22760)
            /home/dave/go/pkg/mod/github.com/chromedp/[email protected]/chromedp.go:616 +0x72
    github.com/chromedp/chromedp.Run(0xe22760, 0xc000327b90, 0xc000143ba0, 0x1, 0x1, 0xe22760, 0xc000327b90)
            /home/dave/go/pkg/mod/github.com/chromedp/[email protected]/chromedp.go:274 +0xdb
    github.com/sensepost/gowitness/chrome.(*Chrome).Screenshot(0xc000242720, 0xc0001ee7e0, 0x0, 0x0, 0x0, 0x0, 0x0)
            /home/dave/go/pkg/mod/github.com/sensepost/[email protected]/chrome/chrome.go:171 +0x5ac
    github.com/sensepost/gowitness/lib.(*Processor).takeScreenshot(0xc0004a9ce0, 0x0, 0x0)
            /home/dave/go/pkg/mod/github.com/sensepost/[email protected]/lib/processor.go:126 +0xdf
    github.com/sensepost/gowitness/lib.(*Processor).Gowitness(0xc0004a9ce0, 0x0, 0x0)
            /home/dave/go/pkg/mod/github.com/sensepost/[email protected]/lib/processor.go:60 +0x1b5
    github.com/sensepost/gowitness/cmd.glob..func9(0x122c560, 0xc00026a5c0, 0x1, 0x2)
            /home/dave/go/pkg/mod/github.com/sensepost/[email protected]/cmd/single.go:53 +0x198
    github.com/spf13/cobra.(*Command).execute(0x122c560, 0xc00026a5a0, 0x2, 0x2, 0x122c560, 0xc00026a5a0)
            /home/dave/go/pkg/mod/github.com/spf13/[email protected]/command.go:856 +0x2c2
    github.com/spf13/cobra.(*Command).ExecuteC(0x122bde0, 0xc000000180, 0x200000003, 0xc000000180)
            /home/dave/go/pkg/mod/github.com/spf13/[email protected]/command.go:960 +0x375
    github.com/spf13/cobra.(*Command).Execute(...)
            /home/dave/go/pkg/mod/github.com/spf13/[email protected]/command.go:897
    github.com/sensepost/gowitness/cmd.Execute()
            /home/dave/go/pkg/mod/github.com/sensepost/[email protected]/cmd/root.go:49 +0x31
    main.main()
            /home/dave/go/pkg/mod/github.com/sensepost/[email protected]/main.go:6 +0x25
    

    Version

    Installed via go get

    $ gowitness version                                                                                                                                                                                        
    gowitness: 2.3.4
    
    git hash: dev
    go version: dev
    
  • Consider integrating Chrome DevTools protocol

    Consider integrating Chrome DevTools protocol

    Love the tool, but I'm running into an edge case that might only be solvable by a big hammer. Might be overkill for this project, but I wanted to propose just in case :-)

    I'm trying to capture screenshots from go tool trace -http. Problem is, these pages can take up to 15 seconds to properly load. I've tried using --timeout 15 --chrome-time-budget 15 --chrome-timeout 15. None of those help - Chrome considered the page loaded, and AFAIK there is no method to simply say "please wait 10 seconds before you take the screenshot, even if the page reports it is loaded before then".

    A google search leads me here, where a user has a similar issue. I looked into the two recommended solutions. Both internally utilize the Chrome DevTools Protocol, which allows you to connect to a headless instance and communicate with it. As would be expected, this allows a lot more power than passing flags, e.g. you wait for DOM events, or screenshot specific page elements , or otherwise engage with the page. The more developed project is https://github.com/puppeteer/puppeteer, which is a Google project for programmatically interacting with headless Chromium.

    There is already a golang project that speaks the DevTools protocol - https://github.com/chromedp/chromedp. However, it seems focused on being a golang version of puppeteer - intended for programmatic usage. For example, here is their screenshot source code. This project is clean and simply focused on getting a screenshot.

    Would you be open to PRs that attempt to utilize chromedp in some circumstances? Not quite sure the proper combination of flags to indicate when it should be used, that would need to be discussed. Perhaps some "wait X seconds after specified DOM event" approach?

    Misc note: The API call for taking a screenshot using DevTools is in the 1.3 release candidate, whereas 1.2 is the current stable. Doubt it's an issue, as clearly puppeteer finds it OK to expose features from the RC protocol version, but thought it was worth mentioning regardless.

  • invalid memory address or nil pointer dereference

    invalid memory address or nil pointer dereference

    gowitness constantly gives the following error after updating to 1.1.0

    panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x14093c6]
    
    goroutine 5183 [running]:
    github.com/sensepost/gowitness/utils.getPageTitle(0xc0001bee70, 0xc000ae4d98, 0x100e448)
    	/Users/leonjza/Documents/git/gowitness/utils/processor.go:124 +0xa6
    github.com/sensepost/gowitness/utils.getPageTitle(0xc0001bee00, 0xc000ae4de0, 0x138c945)
    	/Users/leonjza/Documents/git/gowitness/utils/processor.go:128 +0x7a
    github.com/sensepost/gowitness/utils.getPageTitle(0xc0001bed90, 0x0, 0x0)
    	/Users/leonjza/Documents/git/gowitness/utils/processor.go:128 +0x7a
    github.com/sensepost/gowitness/utils.getPageTitle(0xc0001becb0, 0xc000c0d0a0, 0xc0001becb0)
    	/Users/leonjza/Documents/git/gowitness/utils/processor.go:128 +0x7a
    github.com/sensepost/gowitness/utils.ProcessURL(0xc000121480, 0x1b62de0, 0x1b60bb0, 0x9)
    	/Users/leonjza/Documents/git/gowitness/utils/processor.go:47 +0x51c
    github.com/sensepost/gowitness/cmd.glob..func1.1(0xc00021e500, 0xc000241ac0, 0xc0002446c0, 0xc000121480)
    	/Users/leonjza/Documents/git/gowitness/cmd/file.go:94 +0x8a
    created by github.com/sensepost/gowitness/cmd.glob..func1
    	/Users/leonjza/Documents/git/gowitness/cmd/file.go:90 +0x5ec
    
  • Hanging during file scan

    Hanging during file scan

    Having a lot of issues with GoWitness hanging during scans, timeout param and thread count don't seem to have any effect.

    gowitness file -f <urls> --disable-db --debug --threads 2 --fullpage single -P <dir>

    ...

    * hangs *

    Would it be possible to leverage the timeout param on the context here...

    https://github.com/sensepost/gowitness/blob/master/chrome/chrome.go#L153

    ...as was done during preflight?

    https://github.com/sensepost/gowitness/blob/master/chrome/chrome.go#L64

    Chromium 90.0.4430.212

    Htop confirms plenty of memory/cpu available. Possibly related.

    https://github.com/chromedp/chromedp/issues/37

    Great work btw!

  • Bring back html report generation

    Bring back html report generation

    In previous version of gowitness, outputting an html report was a feature, but it has since been removed.

    It's really handy when the resulting report is something that needs to be shared, and it would be really helpful to have the reporting component have the option to create files which users could just zip up and send around if the option to have multiple folks hit port 7171 on some host isnt availble - like in the instance where there is a vm in a remote environment where gowitness was run, and to have 'an entire team review the results', there is the overhead of cobbling together ssh tunnels or vpns to get people access to this remote asset.

    it's way simpler to just zip up a dir with an html report and screenshots and host it somewhere more accessible, or just drop it into some kind of collaboration tool

    tl;dr - please bring back html report output <3

  • Support for chromium

    Support for chromium

    Is your feature request related to a problem? Please describe. I'm miss some screenshots with chrome headless

    Describe the solution you'd like I would like if chromium is available for screenshotting the sites.

    Describe alternatives you've considered Chromium

    Additional context I hope it will be in actions ASAP.

  • Missing tagged releases on DockerHub since 2.3.6

    Missing tagged releases on DockerHub since 2.3.6

    Describe the bug

    There were some missing tagged releases on DockerHub since 2.3.6.

    Missing tags are 2.4.0, 2.4.1, 2.4.2.

    To Reproduce

    Steps to reproduce the behavior:

    1. Go to DockerHub
    2. Look at the tags

    Expected behavior

    Would be great to have all releases (tags) from GitHub on DockerHub available as well.

    Screenshots

    image

  • Request: Allow perception sort in static export

    Request: Allow perception sort in static export

    Is your feature request related to a problem? Please describe.

    We use the static HTML export function as we host weekly reports on our own web server. This works well, but we have a lot of identical-looking screenshots across different targets and it would be really nice if we could do perception sorting.

    Describe the solution you'd like

    Add a flag that enables perception sort on the static HTML export option. Example:

    gowitness report export -f report.zip -perception-sort

    I believe this may have existed in older versions.

    Describe alternatives you've considered

    N/A

    Additional context Add any other context or screenshots about the feature request here.

    Thank you so much for the time and effort you put into building and maintaining this tool!

  • Added search to the api, and postgres support for DB

    Added search to the api, and postgres support for DB

    I plan on using this at a larger scale, one where it would be good to have an externally accessible database, as well as a search handler being added to the API.

    Took advantage of the existing gorm usage to add a simple flag to point to a postgresql DB (confirmed working with both local and remote servers). As of now takes a fully qualified PSQL DSN. Database type is switched with the "t" flag. SQLite remains the default, changing type to "1" allows using postgresql. Example Command:

    Mostly cloned the existing search handler behind the UI, and just returning the JSON.

  • Ports options for

    Ports options for "file" command

    Hi there,

    Would it be possible to add to the "file" command the same ports options that exist for the "scan" command ? I mean the following ones :

    --ports string --ports-large --ports-medium --ports-small

    That would avoid some extra bash gymnastic to add the custom ports to the URLs file.

    By the way, great tool, thanks !

  • 21 Nov 2022 14:24:03 INF processing complete - But no screenshot were captured

    21 Nov 2022 14:24:03 INF processing complete - But no screenshot were captured

    Hey there,

    I have a list of 500 urls, and I wanted to capture the screenshot so I run this command-

    gowitness.exe file -f .\working_500.txt --threads 20

    But after hitting the enter I am getting the process complete but when I check the screenshots folder none image was found. And also I can see the sql3 file was there.

    What should I do here?

User programmable screen overlay using web technologies
User programmable screen overlay using web technologies

Topframe User programmable screen overlay using web technologies Display information and always-on-top widgets Use HTML/JS/CSS to draw on your screen

Dec 29, 2022
Go bindings to OpenGL Utility Library

GLU This package offers minimal bindings for GLU functions. Usage go get github.com/go-gl-legacy/glu License Copyright 2012 The go-gl Authors. All ri

Aug 18, 2018
๐Ÿ“ธ Clean your image folder using perceptual hashing and BK-trees using Go!
๐Ÿ“ธ Clean your image folder using perceptual hashing and BK-trees using Go!

Image Cleaner ?? ?? โžก ?? This tool can take your image gallery and create a new folder with image-alike-cluster folders. It uses a perceptual image ha

Oct 8, 2022
Radius parsing in golang using gopacket. You can parse from either live traffic or from pcap of your choice.

go-radius Radius parsing in golang using gopacket. You can parse from either live traffic or from pcap of your choice. RADIUS RADIUS is an AAA (authen

Dec 1, 2022
A festive Christmas tree GIF generator implemented using only Golang standard library code
A festive Christmas tree GIF generator implemented using only Golang standard library code

Christmas Tree GIF Generator A festive Christmas tree GIF generator implemented

Feb 4, 2022
HTML Canvas 2D Context API for mobile, desktop and web

canvas HTML Canvas 2D Context API for mobile, desktop and web Context2D API https://www.w3.org/TR/2dcontext/ native code implement https://github.com/

Apr 22, 2022
Ascii-art-web
Ascii-art-web

ASCII-ART-WEB Author: Alika96 How to run Run the following commands: For building an image: docker image build -t ascii-art-web-docker . For showing i

Dec 13, 2021
Go package for computer vision using OpenCV 4 and beyond.
Go package for computer vision using OpenCV 4 and beyond.

GoCV The GoCV package provides Go language bindings for the OpenCV 4 computer vision library. The GoCV package supports the latest releases of Go and

Jan 1, 2023
go-pix is a Go library for generating Pix transactions using Copy and Paste or QR codes. ๐Ÿ’ณ ๐Ÿ’ฐ
go-pix is a Go library for generating Pix transactions using Copy and Paste or QR codes. ๐Ÿ’ณ ๐Ÿ’ฐ

go-pix go-pix is a Go library for generating Pix transactions using Copy and Paste or QR codes.

Sep 12, 2022
Canvas is a Go drawing library based on OpenGL or using software rendering that is very similar to the HTML5 canvas API
Canvas is a Go drawing library based on OpenGL or using software rendering that is very similar to the HTML5 canvas API

Go canvas Canvas is a pure Go library that provides drawing functionality as similar as possible to the HTML5 canvas API. It has nothing to do with HT

Jan 3, 2023
Convert images to computer generated art using delaunay triangulation.
Convert images to computer generated art using delaunay triangulation.

โ–ฒ Triangle is a tool for generating triangulated image using delaunay triangulation. It takes a source image and converts it to an abstract image comp

Dec 29, 2022
Create a cool glass-like pattern using Voronoi cells
Create a cool glass-like pattern using Voronoi cells

voronoi-glass Have you ever looked through a shower door made of intentionally uneven glass? Everything looks distorted, but maybe also beautiful. Now

Jul 21, 2022
Simple image compression using SVD

SVD image compression An implementation image compression using SVD decomposition on Go Built With Go 1.17 Gonum Compression examples Header Image Ori

Mar 30, 2022
A Pong clone made from scratch with Go and C using OpenGL 3.3

Go-Pong A Pong video game clone made with Go lang and OpenGL 3.3 using C. Gameplay Offline Key bindings are 'w' and 's' for the left player and 'up ar

Feb 10, 2022
Cryptseaside generates seaside images using Unix nanoseconds as the seed value.
Cryptseaside generates seaside images using Unix nanoseconds as the seed value.

Cryptseaside Welcome to the Cryptseaside project. Cryptseaside generates seaside images using Unix nanoseconds as the seed value.

Nov 12, 2021
A pair programming service using operational transforms
A pair programming service using operational transforms

Leaps is a service for collaboratively editing your local files over a web UI, using operational transforms to ensure zero-collision synchronization a

Dec 7, 2022
Human-friendly Go module that builds and prints directory trees using ASCII art

Human-friendly Go module that builds and prints directory trees using ASCII art.

Oct 11, 2022
Very simple SVG to PNG converter library using the Inkscape.

svg2png Description Very simple SVG to PNG converter library using the Inkscape.

Jan 11, 2022
OpenStreetMap PBF golang parser

pbf OpenStreetMap PBF golang encoder/decoder A golang based OpenStreetMap PBF encoder/decoder with a handy command line utility, pbf. pbf Command Line

Oct 23, 2022