package
1.0.2
Repository: https://github.com/siemens/goscans.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# Functions

AppendUnique adds elements to an existing slice which are not contained yet.
DeadlineReached checks whether a given deadline has been reached.
Equals checks if two slices of strings contain the same elements and also the same amount of those, but with no regard to their order []string{"a","a","c"} == []string{"c","a","c"} >>> false []string{"z","z","x"} == []string{"x","z","z"} >>> true.
Execute command without returning output.
ExtractHostPort extracts host and port from a given URL.
ExtractHtmlTitle parses HTML content and extracts the HTML title.
Filter filters slice for elements where the given function returns true.
FormattedHeader iterates HTTP response headers, sorts them and joins them to a newline separated string.
GetSubjectAlternativeNames Connects to SSL endpoint and extracts subject name and subject alternative names from the SSL certificate.
Returns the sha1 of a byte sequence.
HttpsIndicated indicates whether the wrong HTTP protocol (HTTP over HTTPS) might have been used.
InsecureTlsConfigFactory returns an *INSECURE* SSL connection configuration allowing any supported SSL protocol, and skipping SSL verification routines.
IsElevated checks whether the current process is running with admin privileges on Linux.
IsValidAddress determines whether a given string is a valid IPv4, IPv6 or hostname, but NOT a network range.
IsValidExecutable checks whether a given path can be executed.
IsValidFile checks whether a given path is existing and a file.
IsValidFolder checks whether a given path is existing and a folder.
IsValidHostname determines whether a given hostname is a plausible one.
IsValidIp determines whether a given string is a valid IPv4/IPv6 address.
IsValidIpRange determines whether a given string is a valid network range.
IsValidIpV4 determines whether a given string is a valid IPv4 address.
IsValidIpV6 determines whether a given string is a valid IPv6 address.
Map applies a manipulation function to each element of a slice.
NewHttpFingerprint creates a new HTTP fingerprint definition.
NewRequester returns a reusable and thread safe HTTP requester, which can automatically take care of reusing or resetting the underlying HTTP client/transport.
No description provided by the author
NewTestLogger returns a new standard golang logger compliant with the Logger interface.
No description provided by the author
ReadBody detects the response's content encoding and returns accordingly decoded response body bytes.
RemoveFromSlice removes a given element (and potential duplicates) from a slice and returns a new slice.
ResolvesToHostname checks whether a given IP reverse resolves to the expected hostname.
ResolvesToIp resolves a given DNS name and checks whether the result matches the expected IP address.
Reverse orders slice in reverse order.
SameEndpoint detects whether a given URL is pointing to the given IP and port.
SameScope detects whether a given URL has the same endpoint (host + port) as the given reference URL.
SanitizeFilename takes a desired file name and converts characters not allowed by the filesystem.
Shuffle randomizes slice of strings.
Takes the stacktrace from stack and formats it in a nicely indented way (starting with newline): Stacktrace: | goroutine 2775398 [running]: | go-scans/utils.(*Requester).Get(0xc001511810, 0xc001e39740, 0x2a, 0xc0001b2460, 0x20, 0x0, 0xe, 0xc0003063a0, 0xc, 0x0, ...) | C:/workplace/go/src/go-scans/scans/http.go:228 +0x2ac | go-scans/scans/webcrawler.(*Scanner).execute(0xc0006a89a0, 0x0) | C:/workplace/go/src/go-scans/scans/webcrawler/webcrawler.go:334 +0x5c3 | go-scans/scans/webcrawler.(*Scanner).Run(0xc0006a89a0, 0xd18c2e28000, 0x0) | C:/workplace/go/src/go-scans/scans/webcrawler/webcrawler.go:230 +0x1ca | go-scans/agent/core.DoWebcrawler(0xc000272240, 0xb51e8, 0xc0001b2460, 0x20, 0x50, 0xc00317b270, 0x5, 0x5, 0xc001e5bb9c, 0x4, ...) | C:/workplace/go/src/go-scans/agent/core/core_webcrawler.go:101 +0x8ec | created by go-scans/agent/core.scanTaskLauncher | C:/workplace/go/src/go-scans/agent/core/core.go:323 +0xb28.
StrContained checks whether a given (exact) value is contained within one or multiple given slices.
SubstrContained checks whether a given substring can be found within the strings within the given slices.
TitleFirstLetter makes the fist letter (and only the first letter) of the string uppercase.
TrimToLower converts slice elements to lower case and trim whitespaces.
UniqueStrings gets rid of duplicate entries in the slice.
UrlToRelative can be fed with a relative, absolute or garbage path and will try to convert it into a relative one An absolute path will be converted into a relative one.
No description provided by the author

# Constants

Create new client (discarding cookies) and transport (not keeping connections).
Create new client (discarding cookies), reuse transport (keeping connections).
Reuse client (maintaining cookies), reuse transport (keeping connections).
Scan ran through without significant issues.
Deadline (scan timeout) reached.
Scan crashed or vanished (e.g.
Connection/Socket error, target might not be online anymore.
Proxy error might be suspicious, if a proxy is configured (web enum/crawler).
Scan is in progress.
Target might be on blacklist and not scanned.
Default value of sql attribute on create, if not defined otherwise.

# Variables

ClientFactory is a basic client factory that can be passed to the requester.
InsecureTransportFactory is a basic transport factory that can be passed to the requester.

# Structs

HttpFingerprint holds defining attributes of an HTTP response.
Requester allows to comfortably initialize an HTTP requester that can be reused for multiple request and does automatically take care of resetting the HTTP client or transport if desired.
TaggedLogger is a small wrapper for the Logger interface, that allows to add an additional tag before every message.
TestLogger wraps the default golang logger and extends it with the functions required to implement the Logger interface.

# Interfaces

Logger defines a minimum logger interface.