Merge branch 'antoniaklja-master'
Conflicts: report/onionscanreport.go
This commit is contained in:
commit
d83d10bd93
|
@ -1 +1,36 @@
|
||||||
|
# common files
|
||||||
*~
|
*~
|
||||||
|
*.log
|
||||||
|
*.bak
|
||||||
|
*.tmp
|
||||||
|
*.swp
|
||||||
|
*.lock
|
||||||
|
|
||||||
|
|
||||||
|
# Eclipse
|
||||||
|
.classpath
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.metadata
|
||||||
|
.factorypath
|
||||||
|
|
||||||
|
# IDEA IntelliJ
|
||||||
|
*.ipr
|
||||||
|
*.iws
|
||||||
|
*.iml
|
||||||
|
.idea
|
||||||
|
.idea_modules
|
||||||
|
out
|
||||||
|
atlassian-ide-plugin.xml
|
||||||
|
|
||||||
|
# Windows
|
||||||
|
Thumbs.db
|
||||||
|
ehthumbs.db
|
||||||
|
Desktop.ini
|
||||||
|
|
||||||
|
# KDE directory preferences
|
||||||
|
.directory
|
||||||
|
|
||||||
|
# OS X
|
||||||
|
.DS_Store
|
||||||
|
.Trashes
|
|
@ -45,10 +45,16 @@ func (hps *HTTPProtocolScanner) ScanProtocol(hiddenService string, proxyAddress
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initial Attempt at Resolving Server Type
|
// Reading all http headers
|
||||||
log.Printf("Attempting to Derive Server Type from Headers..\n")
|
log.Printf("HTTP response headers: %s\n", report.ServerVersion)
|
||||||
report.ServerVersion = response.Header.Get("Server")
|
responseHeaders := response.Header
|
||||||
log.Printf("\tServer Version: %s\n", report.ServerVersion)
|
for key := range responseHeaders {
|
||||||
|
value := responseHeaders.Get(key)
|
||||||
|
report.AddResponseHeader(key, value)
|
||||||
|
log.Printf("\t%s : %s\n", key, value)
|
||||||
|
}
|
||||||
|
|
||||||
|
report.ServerVersion = responseHeaders.Get("Server")
|
||||||
|
|
||||||
// Apache mod-status Check
|
// Apache mod-status Check
|
||||||
hps.ScanPage(hiddenService, "/server-status", report, scans.ApacheModStatus)
|
hps.ScanPage(hiddenService, "/server-status", report, scans.ApacheModStatus)
|
||||||
|
|
|
@ -4,6 +4,7 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"github.com/s-rah/onionscan/utils"
|
"github.com/s-rah/onionscan/utils"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"fmt"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ExifTag struct {
|
type ExifTag struct {
|
||||||
|
@ -42,6 +43,8 @@ type OnionScanReport struct {
|
||||||
Hashes []string `json:"hashes"`
|
Hashes []string `json:"hashes"`
|
||||||
SSHKey string `json:"sshKey"`
|
SSHKey string `json:"sshKey"`
|
||||||
Snapshot string `json:"snapshot"`
|
Snapshot string `json:"snapshot"`
|
||||||
|
PageTitle string `json:"pageTitle"`
|
||||||
|
ResponseHeaders []string `json:"responseHeaders"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func LoadReportFromFile(filename string) (OnionScanReport, error) {
|
func LoadReportFromFile(filename string) (OnionScanReport, error) {
|
||||||
|
@ -83,6 +86,11 @@ func (osr *OnionScanReport) AddLinkedSite(site string) {
|
||||||
utils.RemoveDuplicates(&osr.LinkedSites)
|
utils.RemoveDuplicates(&osr.LinkedSites)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (osr *OnionScanReport) AddResponseHeader(name string, value string) {
|
||||||
|
header := fmt.Sprintf("%s : %s ", name, value)
|
||||||
|
osr.ResponseHeaders = append(osr.ResponseHeaders, header)
|
||||||
|
}
|
||||||
|
|
||||||
func (osr *OnionScanReport) Serialize() (string, error) {
|
func (osr *OnionScanReport) Serialize() (string, error) {
|
||||||
report, err := json.Marshal(osr)
|
report, err := json.Marshal(osr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -20,6 +20,16 @@ func StandardPageScan(scan Scanner, page string, status int, contents string, re
|
||||||
report.Hashes = append(report.Hashes, hex.EncodeToString(hash[:]))
|
report.Hashes = append(report.Hashes, hex.EncodeToString(hash[:]))
|
||||||
report.Snapshot = contents
|
report.Snapshot = contents
|
||||||
|
|
||||||
|
// Try resolve page title if present
|
||||||
|
isTitlePresent := strings.Contains(contents, "<title>")
|
||||||
|
if isTitlePresent {
|
||||||
|
var startIndex = strings.Index(contents, "<title>")
|
||||||
|
var endIndex = strings.Index(contents, "</title>")
|
||||||
|
var pageTitle = contents[startIndex+len("<title>"):endIndex]
|
||||||
|
log.Printf("\tPage Title: %s\n", pageTitle)
|
||||||
|
report.PageTitle = pageTitle
|
||||||
|
}
|
||||||
|
|
||||||
domains := utils.ExtractDomains(contents)
|
domains := utils.ExtractDomains(contents)
|
||||||
|
|
||||||
for _, domain := range domains {
|
for _, domain := range domains {
|
||||||
|
|
Loading…
Reference in New Issue