-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Make Core Files Great Again 🇺🇸🇩🇰 #839
Conversation
eef18e0
to
d646046
Compare
LOL, Travis doesn't generate core files... |
LMAO @ Travis.
|
Sigh, it's not actually possible to get core-dumps on Travis CI.
|
This is blocked by travis-ci/travis-ci#7135 |
d6161aa
to
ddae726
Compare
There's really, really no way to get core dumps to work appropriately inside Linux Containers, unless there is a writable-from-the-container-user-outside-the-container directory which is mapped into the container. |
214bb9d
to
0fd7924
Compare
1b6086a
to
19b02e4
Compare
272b080
to
7f67e34
Compare
19b7132
to
f3968af
Compare
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.
This change is pretty huge and hard to review. This is made worse by the fact that it contains a bunch of (seemingly?) unrelated changes (e.g. dockerfile, flat).
I trust you enough that I don't really care if you put this in dev, but I haven't actually reviewed it in detail. From a surface point of view, this looks really cool though, though there is a lot of the logic I don't have the knowledge to understand in detail.
Please let me know if you actually wanted a thorough review, in which case I can come back to this.
pwnlib/elf/corefile.py
Outdated
|
||
if not (self.start <= start <= stop <= self.stop): | ||
import pdb | ||
pdb.set_trace() |
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.
I am guessing that this is a leftover from debugging?
pwnlib/elf/elf.py
Outdated
@@ -956,9 +966,13 @@ def read(self, address, count): | |||
memory.chop(stop, None) | |||
|
|||
if memory.begin() != start: | |||
import pdb | |||
pdb.set_trace() |
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.
Same for these
9dc22ec
to
296d784
Compare
There were some bits and pieces that were unrelated which made it in because I was doing development locally for some challenges. Should be cleaner now. |
a5ceaac
to
ff4ce97
Compare
>>> if os.path.exists('core'): os.unlink('core') | ||
|
||
Let's build an example binary which should eat ``R0=0xdeadbeef`` | ||
and ``PC=0xcafebabe``. |
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.
eat?
return super(Corefile, self).__getattribute__(attribute) | ||
|
||
class Core(Corefile): | ||
"""Alias for :class:`.Corefile`""" |
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.
It seems ugly to have a diffent class for this. Would it be possible to make it actua alias and hack the docs somehow?
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.
This is the only way to have the class documented
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.
Much easier to review. I might have missed something, especially in the logic in CorefileFinder
.
Is it possible to have tests for that part of the code? The logic seems sufficiently convoluted that I'm sure some bugs are hiding in there.
Re: Testing It is tested indirectly via two mechanisms in the doctests for |
This sounds good to make. SHIP IT. |
4dccc05
to
5623ba8
Compare
Adds a large amount of functionality around Corefiles, to support smarter exploitation Adds a ".corefile" property to both local and remote (ssh) processes. See the documentation for the corefile module for extensive examples and tests. Additionally, context.delete_corefiles and context.rename_corefiles have been added, to control the behavior of the ".corefile" property.
5623ba8
to
0980528
Compare
CI failure is unrelated, i think it's due to Binutils versions, merging |
Well, the commit certainly did! Specifically #1164 😄 |
* Add options for compact hexdump * Minor cleanup * Update pwndbg/commands/hexdump.py * Update pwndbg/commands/hexdump.py Co-authored-by: git <[email protected]> Co-authored-by: Disconnect3d <[email protected]>
Adds a large amount of functionality around Corefiles, to support smarter exploitation
Adds a ".corefile" property to both local and remote (ssh) processes. See the
documentation for the corefile module for extensive examples and tests.
Additionally, context.delete_corefiles and context.rename_corefiles have been added,
to control the behavior of the ".corefile" property.