Skip to content

Commit

Permalink
handle false positives in ssrf
Browse files Browse the repository at this point in the history
  • Loading branch information
dmdhrumilmistry committed Aug 26, 2024
1 parent 49eed48 commit f42d384
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/pkg/tgen/basicSsrf.go
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
package tgen

import "github.com/OWASP/OFFAT/src/pkg/parser"
import (
_ "github.com/OWASP/OFFAT/src/pkg/logging"
"github.com/OWASP/OFFAT/src/pkg/parser"
"github.com/rs/zerolog/log"
)

// generates very basic SSRF API tests by injecting provided URL
func BasicSsrfTest(ssrfUrl, baseUrl string, docParams []*parser.DocHttpParams, queryParams map[string]string, headers map[string]string, injectionConfig InjectionConfig) []*ApiTest {
testName := "Basic SSRF Test"
vulnResponseCodes := []int{500}

payloads := []Payload{
{InjText: ssrfUrl, VulnerableResponseCodes: vulnResponseCodes},
{InjText: ssrfUrl},
}

injectionConfig.Payloads = payloads

tests := injectParamIntoApiTest(baseUrl, docParams, queryParams, headers, testName, injectionConfig)
log.Info().Msg("Check SSRF server for calls. Vulnerable endpoint path will be available in query param")

return tests
}

0 comments on commit f42d384

Please sign in to comment.