Skip to content
This repository was archived by the owner on Jan 13, 2023. It is now read-only.
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
2 changes: 1 addition & 1 deletion agents/tcp_port_scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net"
"time"

"github.com/michenriksen/aquatone/core"
"github.com/bberastegui/aquatone/core"
)

type TCPPortScanner struct {
Expand Down
2 changes: 1 addition & 1 deletion agents/url_logger.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package agents

import (
"github.com/michenriksen/aquatone/core"
"github.com/bberastegui/aquatone/core"
)

type URLLogger struct {
Expand Down
2 changes: 1 addition & 1 deletion agents/url_publisher.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package agents

import (
"github.com/michenriksen/aquatone/core"
"github.com/bberastegui/aquatone/core"
)

type URLPublisher struct {
Expand Down
2 changes: 1 addition & 1 deletion agents/url_requester.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"os"
"strings"

"github.com/michenriksen/aquatone/core"
"github.com/bberastegui/aquatone/core"
"github.com/parnurzeal/gorequest"
)

Expand Down
2 changes: 1 addition & 1 deletion agents/url_screenshotter.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strings"
"time"

"github.com/michenriksen/aquatone/core"
"github.com/bberastegui/aquatone/core"
)

type URLScreenshotter struct {
Expand Down
2 changes: 1 addition & 1 deletion agents/url_takeover_detector.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"net/url"
"strings"

"github.com/michenriksen/aquatone/core"
"github.com/bberastegui/aquatone/core"
)

type URLTakeoverDetector struct {
Expand Down
2 changes: 1 addition & 1 deletion agents/url_technology_fingerprinter.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strings"

"github.com/PuerkitoBio/goquery"
"github.com/michenriksen/aquatone/core"
"github.com/bberastegui/aquatone/core"
)

type FingerprintRegexp struct {
Expand Down
2 changes: 1 addition & 1 deletion agents/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"
"time"

"github.com/michenriksen/aquatone/core"
"github.com/bberastegui/aquatone/core"

"github.com/fatih/color"
"github.com/parnurzeal/gorequest"
Expand Down
13 changes: 12 additions & 1 deletion core/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"io"
"os"
"strings"
"encoding/json"
)

type Header struct {
Expand Down Expand Up @@ -190,7 +191,8 @@ const (
{{range .}}
<div class="page card mb-3">
<div class="card-body">
<h5 class="card-title">{{.URL}}</h5>
<h5 class="card-title" style="display: inline-block;">{{.URL}}</h5>
<a href="{{.URL}}" target="_blank">↗</a>
<h6 class="card-subtitle text-muted">{{.Status}}</h6>
<p class="card-text">
{{range .Tags}}
Expand Down Expand Up @@ -317,6 +319,15 @@ func (r *Report) Render(dest io.Writer) error {
return nil
}

func (r *Report) RenderJson(dest io.Writer) error {
jsonTmpl, err := json.MarshalIndent(r.Data, "", " ")
if err != nil {
return err
}
dest.Write(jsonTmpl)
return nil
}

func NewReport(data ReportData) *Report {
return &Report{
Data: data,
Expand Down
22 changes: 17 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"strings"
"time"

"github.com/michenriksen/aquatone/agents"
"github.com/michenriksen/aquatone/core"
"github.com/michenriksen/aquatone/parsers"
"github.com/bberastegui/aquatone/agents"
"github.com/bberastegui/aquatone/core"
"github.com/bberastegui/aquatone/parsers"
)

var (
Expand Down Expand Up @@ -173,12 +173,23 @@ func main() {
report := core.NewReport(reportData)
f, err = os.OpenFile(sess.GetFilePath("aquatone_report.html"), os.O_RDWR|os.O_CREATE, 0644)
if err != nil {
sess.Out.Fatal("Error during report generation: %s\n", err)
sess.Out.Fatal("Error during HTML report generation: %s\n", err)
os.Exit(1)
}
err = report.Render(f)
if err != nil {
sess.Out.Fatal("Error during report generation: %s\n", err)
sess.Out.Fatal("Error during HTML report generation: %s\n", err)
os.Exit(1)
}

f, err = os.OpenFile(sess.GetFilePath("aquatone_report.json"), os.O_RDWR|os.O_CREATE, 0644)
if err != nil {
sess.Out.Fatal("Error during JSON report generation: %s\n", err)
os.Exit(1)
}
err = report.RenderJson(f)
if err != nil {
sess.Out.Fatal("Error during JSON report generation: %s\n", err)
os.Exit(1)
}

Expand All @@ -205,4 +216,5 @@ func main() {
sess.Out.Info(" - Failed : %v\n\n", sess.Stats.ScreenshotFailed)

sess.Out.Important("Wrote HTML report to: %s\n\n", sess.GetFilePath("aquatone_report.html"))
sess.Out.Important("Wrote JSON report to: %s\n\n", sess.GetFilePath("aquatone_report.json"))
}
2 changes: 1 addition & 1 deletion parsers/nmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"io"
"io/ioutil"

"github.com/michenriksen/aquatone/core"
"github.com/bberastegui/aquatone/core"

"github.com/lair-framework/go-nmap"
)
Expand Down