-
Notifications
You must be signed in to change notification settings - Fork 37
Add Wrapper Package with a Couple of Existing Examples #380
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: main
Are you sure you want to change the base?
Conversation
// Of course it will not work in every case but that is not the point. | ||
func SimpleVersionCheck(conf *config.Config, rePattern string, versionConstraint string) exploit.VersionCheckType { | ||
url := protocol.GenerateURL(conf.Rhost, conf.Rport, conf.SSL, "/") | ||
resp, body, ok := protocol.HTTPGetCache(url) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatting gone wrong here and elsewhere in the file
|
||
// This removes generic version checking boiler plate that works in a great deal of cases. | ||
// Of course it will not work in every case but that is not the point. | ||
func SimpleVersionCheck(conf *config.Config, rePattern string, versionConstraint string, endpoint string) exploit.VersionCheckType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should move this to the same as CheckSemVer
in go-exploit
// to avoid certain import cycle errors. | ||
|
||
// Helper function for use within exploits to reduce the overall amount of boilerplate when setting up a file server to host a dynamically generated file. | ||
func HTTPServeFileInitAndRunWithFile(conf *config.Config, fileName string, routeName string, data[]byte) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idk where to put this but this probably shouldn't be wrappers
Requires #377
The goal is to put helper functions/wrappers in this package to reduce boilerplate and increase consistency. Also helps to prevent import cycle issues.
Usage examples:
Simple Version Check
Open to opinions about whether or not to include additional params such as status code to check for or passing the endpoint as a param.
Dynamic File Serve: