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

BOF in doproxyconnect function #15

Closed
H4niz opened this issue Oct 4, 2019 · 1 comment
Closed

BOF in doproxyconnect function #15

H4niz opened this issue Oct 4, 2019 · 1 comment

Comments

@H4niz
Copy link

H4niz commented Oct 4, 2019

I found a bof in doproxyconnect() function:

void doproxyconnect(int socket)
{
	int x;
	char buf[128];

	/* write CONNECT string to proxy */
	sprintf((char *)&buf, "CONNECT %s HTTP/1.0\n\n", connect_str);
	...
}

We should use snprintf() instead of sprintf().

More:

0x555555558912 <client_accept+594> call doproxyconnect <0x555555558370>
rdi: 0x6

In file: /home/h4niz/Downloads/redir-master/redir.c
868 if (connect_str)
► 869 doproxyconnect(sd);

pwndbg> ni
*** stack smashing detected ***: terminated

@troglobit
Copy link
Owner

Great, would you like to do a pull request?

@H4niz H4niz closed this as completed Oct 7, 2019
@H4niz H4niz reopened this Oct 7, 2019
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

2 participants