Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making IsAuthenticated field public #35

Merged
merged 1 commit into from
Jan 25, 2024
Merged
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
8 changes: 4 additions & 4 deletions cmd/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func scan(cmd *cobra.Command, args []string) error {
fmt.Fprintf(os.Stderr, "Session Layer: %s\n", discoveryResult.SessionLayer)
fmt.Fprintf(os.Stderr, "Presentation Layer: %s\n", discoveryResult.PresentationLayer)
fmt.Fprintf(os.Stderr, "Application Layer: %s\n", discoveryResult.ApplicationLayer)
fmt.Fprintf(os.Stderr, "Authenticated: %v\n", discoveryResult.isAuthenticated)
fmt.Fprintf(os.Stderr, "Authenticated: %v\n", discoveryResult.IsAuthenticated)
fmt.Fprintf(os.Stderr, "Properties: %s\n", discoveryResult.properties)

// Store discovery results in a map
Expand All @@ -102,7 +102,7 @@ func scan(cmd *cobra.Command, args []string) error {
"presentationlayer": discoveryResult.PresentationLayer,
"applicationlayer": discoveryResult.ApplicationLayer,
"service": discoveryResult.ApplicationLayer,
"authenticated": discoveryResult.isAuthenticated,
"authenticated": discoveryResult.IsAuthenticated,
"properties": discoveryResult.properties,
}

Expand All @@ -122,7 +122,7 @@ func scan(cmd *cobra.Command, args []string) error {
fmt.Fprintf(os.Stderr, "Session Layer: %s\n", discoveryResult.SessionLayer)
fmt.Fprintf(os.Stderr, "Presentation Layer: %s\n", discoveryResult.PresentationLayer)
fmt.Fprintf(os.Stderr, "Application Layer: %s\n", discoveryResult.ApplicationLayer)
fmt.Fprintf(os.Stderr, "Authenticated: %v\n", discoveryResult.isAuthenticated)
fmt.Fprintf(os.Stderr, "Authenticated: %v\n", discoveryResult.IsAuthenticated)
fmt.Fprintf(os.Stderr, "Properties: %s\n", discoveryResult.properties)
// Store discovery results in a map
resultMap := map[string]interface{}{
Expand All @@ -133,7 +133,7 @@ func scan(cmd *cobra.Command, args []string) error {
"presentationlayer": discoveryResult.PresentationLayer,
"applicationlayer": discoveryResult.ApplicationLayer,
"service": discoveryResult.ApplicationLayer,
"authenticated": discoveryResult.isAuthenticated,
"authenticated": discoveryResult.IsAuthenticated,
"properties": discoveryResult.properties,
}

Expand Down
6 changes: 3 additions & 3 deletions cmd/servicediscovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type DiscoveryResult struct {
SessionLayer string
PresentationLayer string
ApplicationLayer string
isAuthenticated bool
IsAuthenticated bool
properties map[string]interface{}
}

Expand Down Expand Up @@ -118,7 +118,7 @@ func ScanTargets(host string, port int) (result DiscoveryResult, err error) {
for applicationDiscoveryResult = range applicationLayerChan {
if applicationDiscoveryResult.GetIsDetected() {
result.ApplicationLayer = fmt.Sprintf("%v", applicationDiscoveryResult.Protocol())
result.isAuthenticated = applicationDiscoveryResult.GetIsAuthRequired()
result.IsAuthenticated = applicationDiscoveryResult.GetIsAuthRequired()
result.properties = applicationDiscoveryResult.GetProperties()
break // Stop checking application layer protocol
}
Expand Down Expand Up @@ -154,7 +154,7 @@ func ScanTargets(host string, port int) (result DiscoveryResult, err error) {
for applicationDiscoveryResult = range applicationLayerChan {
if applicationDiscoveryResult.GetIsDetected() {
result.ApplicationLayer = fmt.Sprintf("%v", applicationDiscoveryResult.Protocol())
result.isAuthenticated = applicationDiscoveryResult.GetIsAuthRequired()
result.IsAuthenticated = applicationDiscoveryResult.GetIsAuthRequired()
result.properties = applicationDiscoveryResult.GetProperties()
break
}
Expand Down
Loading