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

send field with empty value #687

Merged
merged 2 commits into from
Dec 6, 2023
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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ katana
*.exe
katana_*/
katana_*/
dist/
dist/

.vscode
.devcontainer
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ require (
github.com/projectdiscovery/fastdialer v0.0.45
github.com/projectdiscovery/goflags v0.1.29
github.com/projectdiscovery/gologger v1.1.11
github.com/projectdiscovery/hmap v0.0.27
github.com/projectdiscovery/hmap v0.0.28
github.com/projectdiscovery/ratelimit v0.0.16
github.com/projectdiscovery/retryablehttp-go v1.0.37
github.com/projectdiscovery/utils v0.0.65
github.com/projectdiscovery/utils v0.0.67
github.com/projectdiscovery/wappalyzergo v0.0.109
github.com/remeh/sizedwaitgroup v1.0.0
github.com/rs/xid v1.5.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ github.com/projectdiscovery/gologger v1.1.11 h1:8vsz9oJlDT9euw6xlj7F7dZ6RWItVIqV
github.com/projectdiscovery/gologger v1.1.11/go.mod h1:UR2bgXl7zraOxYGnUwuO917hifWrwMJ0feKnVqMQkzY=
github.com/projectdiscovery/gostruct v0.0.2 h1:s8gP8ApugGM4go1pA+sVlPDXaWqNP5BBDDSv7VEdG1M=
github.com/projectdiscovery/gostruct v0.0.2/go.mod h1:H86peL4HKwMXcQQtEa6lmC8FuD9XFt6gkNR0B/Mu5PE=
github.com/projectdiscovery/hmap v0.0.27 h1:I4oYpNRmEYSs0CAL6qlxxKL60wn84tMgV2hC2jgB1/A=
github.com/projectdiscovery/hmap v0.0.27/go.mod h1:QOzaiI4PATlCb4bE50CLC6RAJ+wz0RXtlQUrR2vFmAI=
github.com/projectdiscovery/hmap v0.0.28 h1:2FrjMtGi5Xbh07AuidN1s+gAw6KJixZZ/QT5XcC3448=
github.com/projectdiscovery/hmap v0.0.28/go.mod h1:EkSVc8LdqRNDEjzGXwFWIkmQE467mZnVVaKK1kKrbUk=
github.com/projectdiscovery/mapcidr v1.1.15 h1:rYAgxLvMyxPU0JunE/Y3uSK1n/TcNJHK839d6YM0ms4=
github.com/projectdiscovery/mapcidr v1.1.15/go.mod h1:s9erRsoZqWcLGhJW+WT1SnbscqzhHRRnSX916xBw5ZM=
github.com/projectdiscovery/networkpolicy v0.0.6 h1:yDvm0XCrS9HeemRrBS+J+22surzVczM94W5nHiOy/1o=
Expand All @@ -200,8 +200,8 @@ github.com/projectdiscovery/retryabledns v1.0.43 h1:QQPwb1J7NvjAjyXueKS/ZmoAqofD
github.com/projectdiscovery/retryabledns v1.0.43/go.mod h1:ZKe4nKyrmZhoxEOL5DLaqqNP7QN9lqeu15sfBigxmqU=
github.com/projectdiscovery/retryablehttp-go v1.0.37 h1:sdMEj+Rno3lHJGRfx+F8+PPLGluJA1k1gYLhegUjTAo=
github.com/projectdiscovery/retryablehttp-go v1.0.37/go.mod h1:4b+LWch6Vu9aUBRlWqd5mq4ncpkz1vDIyu0dcrf/84w=
github.com/projectdiscovery/utils v0.0.65 h1:QanNhSFhOfkUjniSlsV2Exm3m5MDyTGmpKbJDMcAVhg=
github.com/projectdiscovery/utils v0.0.65/go.mod h1:qs8T5JWLIXZmoc1DbUkihFVTjPtuYgJ3WOmaNQedhwg=
github.com/projectdiscovery/utils v0.0.67 h1:XNUOoWyhk/HdURffFbdBGcxw5xT3YJtayEy8bsgUGXg=
github.com/projectdiscovery/utils v0.0.67/go.mod h1:XB/adTcVtYn9EPMJfvRM+2oHhqYioHSM2WIHvUGtJ18=
github.com/projectdiscovery/wappalyzergo v0.0.109 h1:BERfwTRn1dvB1tbhyc5m67R8VkC9zbVuPsEq4VEm07k=
github.com/projectdiscovery/wappalyzergo v0.0.109/go.mod h1:4Z3DKhi75zIPMuA+qSDDWxZvnhL4qTLmDx4dxNMu7MA=
github.com/quic-go/quic-go v0.37.4 h1:ke8B73yMCWGq9MfrCCAw0Uzdm7GaViC3i39dsIdDlH4=
Expand Down
3 changes: 1 addition & 2 deletions internal/runner/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ func initExampleFormFillConfig() error {
defaultConfig := filepath.Join(homedir, ".config", "katana", "form-config.yaml")

if fileutil.FileExists(defaultConfig) {
readCustomFormConfig(defaultConfig)
return nil
return readCustomFormConfig(defaultConfig)
}
if err := os.MkdirAll(filepath.Dir(defaultConfig), 0775); err != nil {
return err
Expand Down
3 changes: 2 additions & 1 deletion pkg/engine/parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,7 @@ func bodyFormTagParser(resp *navigation.Response) (navigationRequests []*navigat
isMultipartForm := strings.HasPrefix(encType, "multipart/")

queryValuesWriter := urlutil.NewOrderedParams()
queryValuesWriter.IncludeEquals = true
var sb strings.Builder
var multipartWriter *multipart.Writer

Expand All @@ -557,7 +558,7 @@ func bodyFormTagParser(resp *navigation.Response) (navigationRequests []*navigat

dataMap := utils.FormInputFillSuggestions(formInputs)
dataMap.Iterate(func(key, value string) bool {
if key == "" || value == "" {
if key == "" {
return true
}
if isMultipartForm {
Expand Down
Loading