Skip to content

Add unsorted_bin_into_stack #77

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

Merged
merged 1 commit into from
Jun 5, 2018
Merged

Add unsorted_bin_into_stack #77

merged 1 commit into from
Jun 5, 2018

Conversation

insuyun
Copy link
Contributor

@insuyun insuyun commented May 8, 2018

It adds another attack that returns nearly-arbitrary pointer.
It is similar to house of lore, but it overwrites unsorted bin and simpler.
I tested it with Ubuntu 16.04.

@m1ghtym0
Copy link
Member

This attack does not work on the latest glibc anymore, because the freed chunk will not end up in the unsorted bin, but in the tcache instead. When reallocated the size of the chunk in the tcache will not be checked again, so the modification is irrelevant (in this step).
Of course the tcache is basically reducing security checks here, but in that case it destroys the particular attack vector.

@zardus We should think about a structure in this repo that differentiates attacks based on the glibc version. Or even hierarchical for different libcs like: libc -> version -> attack

@insuyun
Copy link
Contributor Author

insuyun commented May 15, 2018

True. This is not working in latest glibc.
But it does not prevent from the attack, but it's due to the change of its data structure.
Currently, most of techniques in how2heap are tested in Ubuntu 14.04 or 16.04.
This attack also works in the version, so I think it's fine to add this.

Also, I agree with that it's better to maintain this by glibc versions.
For example, current house of orange is broken due to the glibc patch.
Also, we can do the other attacks related to tcache as you mentioned.

@zardus
Copy link
Member

zardus commented May 16, 2018

I like the idea of splitting things up by libc version (and libc variant), especially with what's coming soon.

@bennofs
Copy link
Contributor

bennofs commented May 26, 2018

You should still be able to make this attack work by filling up the tcache first as after the tcache is full, chunks still go into the unsorted bin. In fact, I think any attack that works without tcache can work with tcache but you may need to do a lot of mallocs/frees in between to fill/clear the tcache.

@insuyun
Copy link
Contributor Author

insuyun commented May 26, 2018

If we have tcache, I think we can use tcache_poisoning instead of this one.

@m1ghtym0
Copy link
Member

m1ghtym0 commented May 27, 2018 via email

@m1ghtym0 m1ghtym0 merged commit 82d7434 into shellphish:master Jun 5, 2018
@insuyun
Copy link
Contributor Author

insuyun commented Jun 5, 2018

Thanks. Maybe we need to maintain based on version for these techniques.

@m1ghtym0
Copy link
Member

m1ghtym0 commented Jun 5, 2018

Thank you!
I'm gonna build smth. this weekend

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants