Skip to content

Commit

Permalink
gofmt
Browse files Browse the repository at this point in the history
  • Loading branch information
s-rah committed Oct 29, 2016
1 parent 79e397d commit 05ea1b6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 27 deletions.
30 changes: 15 additions & 15 deletions deanonymization/common_correlations.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,21 @@ func CommonCorrelations(osreport *report.OnionScanReport, anonreport *report.Ano

// Adding all Crawl Ids to Common Correlations (this is a bit of a hack to make the webui nicer)
for uri, crawlID := range osreport.Crawls {
if strings.HasSuffix(uri, "/") {
cr,err := osc.Database.GetCrawlRecord(crawlID)
if err == nil {
page := cr.Page
for key,val := range page.Headers {
osc.Database.InsertRelationship(osreport.HiddenService, "crawl", "http-header", key+":"+strings.Join(val,";"))
}
osc.Database.InsertRelationship(osreport.HiddenService, "crawl", "page-info", page.Title)
} else {
osc.LogError(err)
}
}

if strings.HasSuffix(uri, "/") {
cr, err := osc.Database.GetCrawlRecord(crawlID)
if err == nil {
page := cr.Page
for key, val := range page.Headers {

osc.Database.InsertRelationship(osreport.HiddenService, "crawl", "http-header", key+":"+strings.Join(val, ";"))
}
osc.Database.InsertRelationship(osreport.HiddenService, "crawl", "page-info", page.Title)
} else {
osc.LogError(err)
}
}

osc.Database.InsertRelationship(osreport.HiddenService, "crawl", "database-id", strconv.Itoa(crawlID))
}

Expand Down
22 changes: 10 additions & 12 deletions webui/webui.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type SummaryField struct {
type Summary struct {
Fields []SummaryField
Total int
Title string
Title string
}

type Content struct {
Expand Down Expand Up @@ -239,10 +239,10 @@ func (wui *WebUI) Index(w http.ResponseWriter, r *http.Request) {
results = append(results, results_identifier...)

for _, rel := range results {
if rel.Type == "page-info" {
content.Summary.Title = rel.Identifier
if rel.Type == "page-info" {
content.Summary.Title = rel.Identifier
}

if rel.From == "onionscan://user-data" {
if rel.Type == "tag" {
content.UserTags = append(content.UserTags, rel.Identifier)
Expand Down Expand Up @@ -337,7 +337,7 @@ func (wui *WebUI) Index(w http.ResponseWriter, r *http.Request) {
}
} else if rel.Type == "database-id" {
uriCount++
}
}
}

// AutoTag our content
Expand All @@ -359,8 +359,6 @@ func (wui *WebUI) Index(w http.ResponseWriter, r *http.Request) {
for _, v := range tables {
content.Summary.Total += len(v.Rows)
}



for k, v := range tables {
log.Printf("Adding Table %s %v", k, v)
Expand Down Expand Up @@ -392,11 +390,11 @@ func (wui *WebUI) Index(w http.ResponseWriter, r *http.Request) {
case "onion":
alt = "Co-Hosted Onion Sites"
case "search-results":
alt = "Search Results"
case "http-header":
alt = "HTTP Headers"
case "page-info":
alt = "Webpage Information"
alt = "Search Results"
case "http-header":
alt = "HTTP Headers"
case "page-info":
alt = "Webpage Information"
}

total := (float32(len(v.Rows)) / float32(content.Summary.Total)) * float32(100)
Expand Down

0 comments on commit 05ea1b6

Please sign in to comment.