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

Meg are mixing url parameters (temp fix) #73

Open
intrd opened this issue Sep 3, 2020 · 1 comment
Open

Meg are mixing url parameters (temp fix) #73

intrd opened this issue Sep 3, 2020 · 1 comment

Comments

@intrd
Copy link

intrd commented Sep 3, 2020

$ cat test2 
https://target.com/xxx.php?u=aaa
$ cat emptypath.txt 

$ meg -d 0 -v -L -c 50 -H 'User-Agent: Mozilla/5.0 XXXX' emptypath.txt test2 ./meg3
meg3/target.com/903b3f4440f21d48329f135f0182f1da76886bfa https://target.com?u=aaa/xxx.php (200 OK)

https://target.com/xxx.php?u=aaa become https://target.com?u=aaa/xxx.php

Thank you!

@intrd
Copy link
Author

intrd commented Sep 11, 2020

Temp fix..

@ main.go

	// send requests for each path for every host
	for _, path := range paths {
		for _, host := range hosts {

			// the host portion may contain a path prefix,
			// so we should strip that off and add it to
			// the beginning of the path.
			u, err := url.Parse(host)
			if err != nil {
				fmt.Fprintf(os.Stderr, "failed to parse host: %s\n", err)
				continue
			}

			//prefixedPath := u.Path

			u.Path = ""

			// stripping off a path means we need to
			// rebuild the host portion too
			//host = u.String()

			requests <- request{
				method:         c.method,
				host:           host,
				path:           u.Path+path,
				headers:        c.headers,
				followLocation: c.followLocation,
				body:           c.body,
				timeout:        time.Duration(c.timeout * 1000000),
			}
		}
	}

@intrd intrd changed the title URL path parameters bug? Meg are mixing parameters (temp fix) Sep 11, 2020
@intrd intrd changed the title Meg are mixing parameters (temp fix) Meg are mixing url parameters (temp fix) Sep 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant