diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..f512958 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,8 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true + +[*.go] +indent_style = tab \ No newline at end of file diff --git a/.gitignore b/.gitignore index db2d698..75f952a 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ html/ aquatone_report.html aquatone_urls.txt aquatone_session.json +debug.log diff --git a/Gopkg.lock b/Gopkg.lock deleted file mode 100644 index 4b890fb..0000000 --- a/Gopkg.lock +++ /dev/null @@ -1,178 +0,0 @@ -# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. - - -[[projects]] - digest = "1:573fa46f8d413d4bc3f7cc5e86b2c43cb21559f4fb0a19d9874d228e28fdc07c" - name = "github.com/PuerkitoBio/goquery" - packages = ["."] - pruneopts = "UT" - revision = "2d2796f41742ece03e8086188fa4db16a3a0b458" - version = "v1.5.0" - -[[projects]] - digest = "1:66b3310cf22cdc96c35ef84ede4f7b9b370971c4025f394c89a2638729653b11" - name = "github.com/andybalholm/cascadia" - packages = ["."] - pruneopts = "UT" - revision = "901648c87902174f774fac311d7f176f8647bdaa" - version = "v1.0.0" - -[[projects]] - branch = "master" - digest = "1:e2a1ff1174d564ed4b75a62757f4a9081ed3b8c99ed17e47eb252b048b4ff018" - name = "github.com/asaskevich/EventBus" - packages = ["."] - pruneopts = "UT" - revision = "d46933a94f05c6657d7b923fcf5ac563ee37ec79" - -[[projects]] - digest = "1:865079840386857c809b72ce300be7580cb50d3d3129ce11bf9aa6ca2bc1934a" - name = "github.com/fatih/color" - packages = ["."] - pruneopts = "UT" - revision = "5b77d2a35fb0ede96d138fc9a99f5c9b6aef11b4" - version = "v1.7.0" - -[[projects]] - digest = "1:582b704bebaa06b48c29b0cec224a6058a09c86883aaddabde889cd1a5f73e1b" - name = "github.com/google/uuid" - packages = ["."] - pruneopts = "UT" - revision = "0cd6bf5da1e1c83f8b45653022c74f71af0538a4" - version = "v1.1.1" - -[[projects]] - branch = "master" - digest = "1:d06a6c979a16ebfb8969f6f188bb6b014d96ed56b8adbf3bf63a07ff5e0e7075" - name = "github.com/lair-framework/go-nmap" - packages = ["."] - pruneopts = "UT" - revision = "3b9bafddefee56a2884c49e2da6894bb1fe6d40c" - -[[projects]] - digest = "1:c658e84ad3916da105a761660dcaeb01e63416c8ec7bc62256a9b411a05fcd67" - name = "github.com/mattn/go-colorable" - packages = ["."] - pruneopts = "UT" - revision = "167de6bfdfba052fa6b2d3664c8f5272e23c9072" - version = "v0.0.9" - -[[projects]] - digest = "1:e150b5fafbd7607e2d638e4e5cf43aa4100124e5593385147b0a74e2733d8b0d" - name = "github.com/mattn/go-isatty" - packages = ["."] - pruneopts = "UT" - revision = "c2a7a6ca930a4cd0bc33a3f298eb71960732a3a7" - version = "v0.0.7" - -[[projects]] - digest = "1:7aefb397a53fc437c90f0fdb3e1419c751c5a3a165ced52325d5d797edf1aca6" - name = "github.com/moul/http2curl" - packages = ["."] - pruneopts = "UT" - revision = "9ac6cf4d929b2fa8fd2d2e6dec5bb0feb4f4911d" - version = "v1.0.0" - -[[projects]] - digest = "1:0d72291ecb10a37e75f0484eb8e700b0cffbd2501f6e63b282028dcc7830d33c" - name = "github.com/mvdan/xurls" - packages = ["."] - pruneopts = "UT" - revision = "e52e821cbfe8fe163ff6f8628ab5869b11fc05af" - version = "v2.0.0" - -[[projects]] - digest = "1:d776f3e95774a8719f2e57fabbbb33103035fe072dcf6f1864f33abd17b753e5" - name = "github.com/parnurzeal/gorequest" - packages = ["."] - pruneopts = "UT" - revision = "a578a48e8d6ca8b01a3b18314c43c6716bb5f5a3" - version = "v0.2.15" - -[[projects]] - digest = "1:cf31692c14422fa27c83a05292eb5cbe0fb2775972e8f1f8446a71549bd8980b" - name = "github.com/pkg/errors" - packages = ["."] - pruneopts = "UT" - revision = "ba968bfe8b2f7e042a574c888954fccecfa385b4" - version = "v0.8.1" - -[[projects]] - digest = "1:0028cb19b2e4c3112225cd871870f2d9cf49b9b4276531f03438a88e94be86fe" - name = "github.com/pmezard/go-difflib" - packages = ["difflib"] - pruneopts = "UT" - revision = "792786c7400a136282c1664665ae0a8db921c6c2" - version = "v1.0.0" - -[[projects]] - branch = "master" - digest = "1:bb90467981c5e812c4d1c78e498a1416b04cb5149dc5fa2200ab758c37488f6f" - name = "github.com/remeh/sizedwaitgroup" - packages = ["."] - pruneopts = "UT" - revision = "5e7302b12ccef91dce9fde2f5bda6d5c7ea5d2eb" - -[[projects]] - branch = "master" - digest = "1:88e27d7a91ad3aafb5184e55268c3cbf976ca8ba8b14259b01f80b05f93f0493" - name = "golang.org/x/net" - packages = [ - "html", - "html/atom", - "idna", - "publicsuffix", - ] - pruneopts = "UT" - revision = "4829fb13d2c62012c17688fa7f629f371014946d" - -[[projects]] - branch = "master" - digest = "1:157e5158a7f29d6633eed502880463aa43de3c36d451c7051591efd12f455ac8" - name = "golang.org/x/sys" - packages = ["unix"] - pruneopts = "UT" - revision = "a129542de9ae0895210abff9c95d67a1f33cb93d" - -[[projects]] - digest = "1:8d8faad6b12a3a4c819a3f9618cb6ee1fa1cfc33253abeeea8b55336721e3405" - name = "golang.org/x/text" - packages = [ - "collate", - "collate/build", - "internal/colltab", - "internal/gen", - "internal/language", - "internal/language/compact", - "internal/tag", - "internal/triegen", - "internal/ucd", - "language", - "secure/bidirule", - "transform", - "unicode/bidi", - "unicode/cldr", - "unicode/norm", - "unicode/rangetable", - ] - pruneopts = "UT" - revision = "342b2e1fbaa52c93f31447ad2c6abc048c63e475" - version = "v0.3.2" - -[solve-meta] - analyzer-name = "dep" - analyzer-version = 1 - input-imports = [ - "github.com/PuerkitoBio/goquery", - "github.com/asaskevich/EventBus", - "github.com/fatih/color", - "github.com/google/uuid", - "github.com/lair-framework/go-nmap", - "github.com/mvdan/xurls", - "github.com/parnurzeal/gorequest", - "github.com/pmezard/go-difflib/difflib", - "github.com/remeh/sizedwaitgroup", - "golang.org/x/net/html", - ] - solver-name = "gps-cdcl" - solver-version = 1 diff --git a/README.md b/README.md index ecc1cdf..e4b5346 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,17 @@ Aquatone is a tool for visual inspection of websites across a large amount of ho 2. Download the [latest release](https://github.com/michenriksen/aquatone/releases/latest) of Aquatone for your operating system. 3. Uncompress the zip file and move the `aquatone` binary to your desired location. You probably want to move it to a location in your `$PATH` for easier use. -### Compiling the source code +### From Source + +You'll need a working installation of Go with go 1.11+ modules support. + +```bash +go get -u github.com/michenriksen/aquatone/... +# if you already have $GOPATH/bin in your $PATH, you won't need this: +aquatone || echo 'export $PATH="$PATH:'"$(go env GOPATH)/bin"'"' >> "$(ls ~/.bashrc || ls ~/.bash_profile)" +aquatone || . "$(ls ~/.bashrc || ~/.bash_profile)" +``` -If you for some reason don't trust the pre-compiled binaries, you can also compile the code yourself. **You are on your own if you want to do this. I do not support compiling problems. Good luck with it!** ## Usage diff --git a/agents/url_screenshotter.go b/agents/url_screenshotter.go index 2d70baa..a24c3f4 100644 --- a/agents/url_screenshotter.go +++ b/agents/url_screenshotter.go @@ -6,11 +6,9 @@ import ( "io/ioutil" "os" "os/exec" - "regexp" - "strconv" - "strings" "time" + "github.com/chromedp/chromedp" "github.com/michenriksen/aquatone/core" ) @@ -33,7 +31,6 @@ func (a *URLScreenshotter) Register(s *core.Session) error { s.EventBus.SubscribeAsync(core.SessionEnd, a.OnSessionEnd, false) a.session = s a.createTempUserDir() - a.locateChrome() return nil } @@ -69,105 +66,48 @@ func (a *URLScreenshotter) createTempUserDir() { a.tempUserDirPath = dir } -func (a *URLScreenshotter) locateChrome() { - if *a.session.Options.ChromePath != "" { - a.chromePath = *a.session.Options.ChromePath - return - } - - paths := []string{ - "/usr/bin/google-chrome", - "/usr/bin/google-chrome-beta", - "/usr/bin/google-chrome-unstable", - "/usr/bin/chromium-browser", - "/usr/bin/chromium", - "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome", - "/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary", - "/Applications/Chromium.app/Contents/MacOS/Chromium", - "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe", - } - - for _, path := range paths { - if _, err := os.Stat(path); os.IsNotExist(err) { - continue - } - a.chromePath = path +func (a URLScreenshotter) getOpts() (options []chromedp.ExecAllocatorOption) { + if *a.session.Options.Proxy != "" { + options = append(options, chromedp.ProxyServer(*a.session.Options.Proxy)) } - if a.chromePath == "" { - a.session.Out.Fatal("Unable to locate a valid installation of Chrome. Install Google Chrome or try specifying a valid location with the -chrome-path option.\n") - os.Exit(1) + if *a.session.Options.ChromePath != "" { + options = append(options, chromedp.ExecPath(*a.session.Options.ChromePath)) } - if strings.Contains(strings.ToLower(a.chromePath), "chrome") { - a.session.Out.Warn("Using unreliable Google Chrome for screenshots. Install Chromium for better results.\n\n") - } else { - out, err := exec.Command(a.chromePath, "--version").Output() - if err != nil { - a.session.Out.Warn("An error occurred while trying to determine version of Chromium.\n\n") - return - } - version := string(out) - re := regexp.MustCompile(`(\d+)\.`) - match := re.FindStringSubmatch(version) - if len(match) <= 0 { - a.session.Out.Warn("Unable to determine version of Chromium. Screenshotting might be unreliable.\n\n") - return - } - majorVersion, _ := strconv.Atoi(match[1]) - if majorVersion < 72 { - a.session.Out.Warn("An older version of Chromium is installed. Screenshotting of HTTPS URLs might be unreliable.\n\n") - } - } + return +} - a.session.Out.Debug("[%s] Located Chrome/Chromium binary at %s\n", a.ID(), a.chromePath) +// execAllocator turns a.getOpts() (the chrome instance allocator options) into a derivative context.Context +func (a URLScreenshotter) execAllocator(parent context.Context) (context.Context, context.CancelFunc) { + return chromedp.NewExecAllocator(parent, a.getOpts()...) } func (a *URLScreenshotter) screenshotPage(page *core.Page) { filePath := fmt.Sprintf("screenshots/%s.png", page.BaseFilename()) - var chromeArguments = []string{ - "--headless", "--disable-gpu", "--hide-scrollbars", "--mute-audio", "--disable-notifications", - "--no-first-run", "--disable-crash-reporter", "--ignore-certificate-errors", "--incognito", - "--disable-infobars", "--disable-sync", "--no-default-browser-check", - "--user-data-dir=" + a.tempUserDirPath, - "--user-agent=" + RandomUserAgent(), - "--window-size=" + *a.session.Options.Resolution, - "--screenshot=" + a.session.GetFilePath(filePath), - } - - if os.Geteuid() == 0 { - chromeArguments = append(chromeArguments, "--no-sandbox") - } - - if *a.session.Options.Proxy != "" { - chromeArguments = append(chromeArguments, "--proxy-server="+*a.session.Options.Proxy) - } - - chromeArguments = append(chromeArguments, page.URL) ctx, cancel := context.WithTimeout(context.Background(), time.Duration(*a.session.Options.ScreenshotTimeout)*time.Millisecond) + ctx, cancel = a.execAllocator(ctx) + ctx, cancel = chromedp.NewContext(ctx) + defer cancel() - cmd := exec.CommandContext(ctx, a.chromePath, chromeArguments...) - if err := cmd.Start(); err != nil { - a.session.Out.Debug("[%s] Error: %v\n", a.ID(), err) + var pic []byte + if err := chromedp.Run(ctx, chromedp.Tasks{ + chromedp.Navigate(page.URL), + chromedp.WaitReady("body", chromedp.ByQuery), + chromedp.Screenshot("body", &pic, chromedp.NodeVisible, chromedp.ByQuery), + }); err != nil { + a.session.Out.Debug("%s Error: %v\n", a.ID, err) a.session.Stats.IncrementScreenshotFailed() a.session.Out.Error("%s: screenshot failed: %s\n", page.URL, err) - a.killChromeProcessIfRunning(cmd) return } - if err := cmd.Wait(); err != nil { + if err := ioutil.WriteFile(filePath, pic, 0700); err != nil { + a.session.Out.Debug("%s Error: %v\n", a.ID(), err) a.session.Stats.IncrementScreenshotFailed() - a.session.Out.Debug("[%s] Error: %v\n", a.ID(), err) - if ctx.Err() == context.DeadlineExceeded { - a.session.Out.Error("%s: screenshot timed out\n", page.URL) - a.killChromeProcessIfRunning(cmd) - return - } - a.session.Out.Error("%s: screenshot failed: %s\n", page.URL, err) - a.killChromeProcessIfRunning(cmd) return } @@ -175,7 +115,6 @@ func (a *URLScreenshotter) screenshotPage(page *core.Page) { a.session.Out.Info("%s: %s\n", page.URL, Green("screenshot successful")) page.ScreenshotPath = filePath page.HasScreenshot = true - a.killChromeProcessIfRunning(cmd) } func (a *URLScreenshotter) killChromeProcessIfRunning(cmd *exec.Cmd) { diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..fef6f83 --- /dev/null +++ b/go.mod @@ -0,0 +1,24 @@ +module github.com/michenriksen/aquatone + +go 1.12 + +require ( + github.com/PuerkitoBio/goquery v1.5.0 + github.com/asaskevich/EventBus v0.0.0-20180315140547-d46933a94f05 + github.com/chromedp/chromedp v0.5.3 + github.com/elazarl/goproxy v0.0.0-20190421051319-9d40249d3c2f // indirect + github.com/elazarl/goproxy/ext v0.0.0-20190421051319-9d40249d3c2f // indirect + github.com/fatih/color v1.7.0 + github.com/google/uuid v1.1.1 + github.com/lair-framework/go-nmap v0.0.0-20181105160706-3b9bafddefee + github.com/mattn/go-colorable v0.0.9 // indirect + github.com/mattn/go-isatty v0.0.7 // indirect + github.com/moul/http2curl v1.0.0 // indirect + github.com/parnurzeal/gorequest v0.2.15 + github.com/pkg/errors v0.8.1 // indirect + github.com/pmezard/go-difflib v1.0.0 + github.com/remeh/sizedwaitgroup v0.0.0-20180822144253-5e7302b12cce + github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a // indirect + golang.org/x/net v0.0.0-20190424112056-4829fb13d2c6 + mvdan.cc/xurls/v2 v2.0.0 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..aa87b78 --- /dev/null +++ b/go.sum @@ -0,0 +1,69 @@ +github.com/PuerkitoBio/goquery v1.5.0 h1:uGvmFXOA73IKluu/F84Xd1tt/z07GYm8X49XKHP7EJk= +github.com/PuerkitoBio/goquery v1.5.0/go.mod h1:qD2PgZ9lccMbQlc7eEOjaeRlFQON7xY8kdmcsrnKqMg= +github.com/andybalholm/cascadia v1.0.0 h1:hOCXnnZ5A+3eVDX8pvgl4kofXv2ELss0bKcqRySc45o= +github.com/andybalholm/cascadia v1.0.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= +github.com/asaskevich/EventBus v0.0.0-20180315140547-d46933a94f05 h1:Shem5lRG4gJyrrg9YMIl7dOQazyWCq0Daz4LjompZ28= +github.com/asaskevich/EventBus v0.0.0-20180315140547-d46933a94f05/go.mod h1:JS7hed4L1fj0hXcyEejnW57/7LCetXggd+vwrRnYeII= +github.com/chromedp/cdproto v0.0.0-20200116234248-4da64dd111ac h1:T7V5BXqnYd55Hj/g5uhDYumg9Fp3rMTS6bykYtTIFX4= +github.com/chromedp/cdproto v0.0.0-20200116234248-4da64dd111ac/go.mod h1:PfAWWKJqjlGFYJEidUM6aVIWPr0EpobeyVWEEmplX7g= +github.com/chromedp/chromedp v0.5.3 h1:F9LafxmYpsQhWQBdCs+6Sret1zzeeFyHS5LkRF//Ffg= +github.com/chromedp/chromedp v0.5.3/go.mod h1:YLdPtndaHQ4rCpSpBG+IPpy9JvX0VD+7aaLxYgYj28w= +github.com/elazarl/goproxy v0.0.0-20190421051319-9d40249d3c2f h1:8GDPb0tCY8LQ+OJ3dbHb5sA6YZWXFORQYZx5sdsTlMs= +github.com/elazarl/goproxy v0.0.0-20190421051319-9d40249d3c2f/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/elazarl/goproxy/ext v0.0.0-20190421051319-9d40249d3c2f h1:AUj1VoZUfhPhOPHULCQQDnGhRelpFWHMLhQVWDsS0v4= +github.com/elazarl/goproxy/ext v0.0.0-20190421051319-9d40249d3c2f/go.mod h1:gNh8nYJoAm43RfaxurUnxr+N1PwuFV3ZMl/efxlIlY8= +github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= +github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= +github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= +github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= +github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= +github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= +github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/knq/sysutil v0.0.0-20191005231841-15668db23d08 h1:V0an7KRw92wmJysvFvtqtKMAPmvS5O0jtB0nYo6t+gs= +github.com/knq/sysutil v0.0.0-20191005231841-15668db23d08/go.mod h1:dFWs1zEqDjFtnBXsd1vPOZaLsESovai349994nHx3e0= +github.com/lair-framework/go-nmap v0.0.0-20181105160706-3b9bafddefee h1:kente5nMU+zzrv+pwYzn1UwIM3jCjNAO8S6j1gueCu0= +github.com/lair-framework/go-nmap v0.0.0-20181105160706-3b9bafddefee/go.mod h1:7Em1Lxm3DFdLvXWUZ6bQ/xIbGlxFy7jl07bziQMZ/kU= +github.com/mailru/easyjson v0.7.0 h1:aizVhC/NAAcKWb+5QsU1iNOZb4Yws5UO2I+aIprQITM= +github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= +github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-isatty v0.0.7 h1:UvyT9uN+3r7yLEYSlJsbQGdsaB/a0DlgWP3pql6iwOc= +github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/moul/http2curl v1.0.0 h1:dRMWoAtb+ePxMlLkrCbAqh4TlPHXvoGUSQ323/9Zahs= +github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= +github.com/parnurzeal/gorequest v0.2.15 h1:oPjDCsF5IkD4gUk6vIgsxYNaSgvAnIh1EJeROn3HdJU= +github.com/parnurzeal/gorequest v0.2.15/go.mod h1:3Kh2QUMJoqw3icWAecsyzkpY7UzRfDhbRdTjtNwNiUE= +github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/remeh/sizedwaitgroup v0.0.0-20180822144253-5e7302b12cce h1:aP+C+YbHZfOQlutA4p4soHi7rVUqHQdWEVMSkHfDTqY= +github.com/remeh/sizedwaitgroup v0.0.0-20180822144253-5e7302b12cce/go.mod h1:3j2R4OIe/SeS6YDhICBy22RWjJC5eNCJ1V+9+NVNYlo= +github.com/rogpeppe/go-charset v0.0.0-20180617210344-2471d30d28b4/go.mod h1:qgYeAmZ5ZIpBWTGllZSQnw97Dj+woV0toclVaRGI8pc= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a h1:pa8hGb/2YqsZKovtsgrwcDH1RZhVbTKCjLp47XpqCDs= +github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190424112056-4829fb13d2c6 h1:FP8hkuE6yUEaJnK7O2eTuejKWwW+Rhfj80dQ2JcKxCU= +golang.org/x/net v0.0.0-20190424112056-4829fb13d2c6/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190426135247-a129542de9ae h1:mQLHiymj/JXKnnjc62tb7nD5pZLs940/sXJu+Xp3DBA= +golang.org/x/sys v0.0.0-20190426135247-a129542de9ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42 h1:vEOn+mP2zCOVzKckCZy6YsCtDblrpj/w7B9nxGNELpg= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +mvdan.cc/xurls/v2 v2.0.0 h1:r1zSOSNS/kqtpmATyMMMvaZ4/djsesbYz5kr0+qMRWc= +mvdan.cc/xurls/v2 v2.0.0/go.mod h1:2/webFPYOXN9jp/lzuj0zuAVlF+9g4KPFJANH1oJhRU= diff --git a/parsers/regex.go b/parsers/regex.go index 9444fbe..5fbd2ee 100644 --- a/parsers/regex.go +++ b/parsers/regex.go @@ -4,7 +4,7 @@ import ( "bufio" "io" - "github.com/mvdan/xurls" + "mvdan.cc/xurls/v2" ) type RegexParser struct{}