<feed xmlns='http://www.w3.org/2005/Atom'>
<title>nsploit/sploit/rev, branch v0.4</title>
<subtitle>Process interaction tool for software exploitation</subtitle>
<link rel='alternate' type='text/html' href='http://normalmode.org/malf/nsploit/'/>
<entry>
<title>r2: Don't return duplicate gadgets in gadget search</title>
<updated>2023-03-24T07:50:55+00:00</updated>
<author>
<name>dusoleil</name>
<email>howcansocksbereal@gmail.com</email>
</author>
<published>2023-03-23T08:07:28+00:00</published>
<link rel='alternate' type='text/html' href='http://normalmode.org/malf/nsploit/commit/?id=61971e65dd280c84e4c4e06e86f0c4ba1aed03aa'/>
<id>61971e65dd280c84e4c4e06e86f0c4ba1aed03aa</id>
<content type='text'>
Signed-off-by: dusoleil &lt;howcansocksbereal@gmail.com&gt;
Reviewed-by: Malfurious &lt;m@lfurio.us&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: dusoleil &lt;howcansocksbereal@gmail.com&gt;
Reviewed-by: Malfurious &lt;m@lfurio.us&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>r2: Get all relocs that have a name</title>
<updated>2023-03-23T12:19:34+00:00</updated>
<author>
<name>dusoleil</name>
<email>howcansocksbereal@gmail.com</email>
</author>
<published>2023-03-23T12:19:34+00:00</published>
<link rel='alternate' type='text/html' href='http://normalmode.org/malf/nsploit/commit/?id=e313b0eb10278ddc3cfdb42baa100fa8f60aba61'/>
<id>e313b0eb10278ddc3cfdb42baa100fa8f60aba61</id>
<content type='text'>
Originally I was deciding whether to get a reloc based on the type.  I'm
not sure what SET_64 vs ADD_64 means, but the SET* types seemed to be
the only symbols we care about.  After running into a binary where a
SET* symbol didn't have a name (and crashed sploit), I have decided to
filter on that instead.

Signed-off-by: dusoleil &lt;howcansocksbereal@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Originally I was deciding whether to get a reloc based on the type.  I'm
not sure what SET_64 vs ADD_64 means, but the SET* types seemed to be
the only symbols we care about.  After running into a binary where a
SET* symbol didn't have a name (and crashed sploit), I have decided to
filter on that instead.

Signed-off-by: dusoleil &lt;howcansocksbereal@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rev: Use json output for get_bin_info()</title>
<updated>2023-03-23T07:45:20+00:00</updated>
<author>
<name>dusoleil</name>
<email>howcansocksbereal@gmail.com</email>
</author>
<published>2023-03-23T07:45:20+00:00</published>
<link rel='alternate' type='text/html' href='http://normalmode.org/malf/nsploit/commit/?id=f388499a625af89e56669a8c76c65da21a7c1b1a'/>
<id>f388499a625af89e56669a8c76c65da21a7c1b1a</id>
<content type='text'>
Grabbing the json and returning that dict directly avoids all of the
processing we were doing before.  I also added in a small, temporary
band-aid for PE files until we add actual support for them.  The 'relro'
key doesn't exist on PE files, so just default it to '' in ELF.

Signed-off-by: dusoleil &lt;howcansocksbereal@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Grabbing the json and returning that dict directly avoids all of the
processing we were doing before.  I also added in a small, temporary
band-aid for PE files until we add actual support for them.  The 'relro'
key doesn't exist on PE files, so just default it to '' in ELF.

Signed-off-by: dusoleil &lt;howcansocksbereal@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>r2: Rewrite get_elf_symbols()</title>
<updated>2023-03-23T07:23:18+00:00</updated>
<author>
<name>dusoleil</name>
<email>howcansocksbereal@gmail.com</email>
</author>
<published>2023-03-23T07:23:18+00:00</published>
<link rel='alternate' type='text/html' href='http://normalmode.org/malf/nsploit/commit/?id=382737c817a172a03b054bcc447437019eabcfb3'/>
<id>382737c817a172a03b054bcc447437019eabcfb3</id>
<content type='text'>
This addresses a couple issues with get_elf_symbols().

First of all, we can greatly simplify our processing of the r2 output by
getting back json instead of trying to do string processing on their
pretty-printed tables.  This resolves a number of issues we were running
into and also makes the code way more maintainable.

Second, we have reevaluated what we actually want to get out of r2.  We
now grab section offsets, all FUNC, OBJ, and NOTYPE symbols, and all
strings.  The strings and section offsets no longer try to escape
special characters and sometimes aren't accessible through normal object
attributes, but now that we have dictionary subscripting, this isn't an
issue.

Lastly, a few subsets of the symbols are separated into their own tables
and added to the main table as subtables.  Sections are located at
sym.sect and offset at 0.  Imported symbols are located at sym.imp and are
offset at sect['.plt'].  Relocations are located at sym.rel and are offset at
sect['.got'].  Strings are located at sym.str and are offset at
sect['.rodata'].

Signed-off-by: dusoleil &lt;howcansocksbereal@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This addresses a couple issues with get_elf_symbols().

First of all, we can greatly simplify our processing of the r2 output by
getting back json instead of trying to do string processing on their
pretty-printed tables.  This resolves a number of issues we were running
into and also makes the code way more maintainable.

Second, we have reevaluated what we actually want to get out of r2.  We
now grab section offsets, all FUNC, OBJ, and NOTYPE symbols, and all
strings.  The strings and section offsets no longer try to escape
special characters and sometimes aren't accessible through normal object
attributes, but now that we have dictionary subscripting, this isn't an
issue.

Lastly, a few subsets of the symbols are separated into their own tables
and added to the main table as subtables.  Sections are located at
sym.sect and offset at 0.  Imported symbols are located at sym.imp and are
offset at sect['.plt'].  Relocations are located at sym.rel and are offset at
sect['.got'].  Strings are located at sym.str and are offset at
sect['.rodata'].

Signed-off-by: dusoleil &lt;howcansocksbereal@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>r2: limit gadget search to exec privilege sections</title>
<updated>2023-03-19T13:26:08+00:00</updated>
<author>
<name>dusoleil</name>
<email>howcansocksbereal@gmail.com</email>
</author>
<published>2023-03-19T13:26:08+00:00</published>
<link rel='alternate' type='text/html' href='http://normalmode.org/malf/nsploit/commit/?id=e4793b798fe84c856c76817814b3867d3ce7b85e'/>
<id>e4793b798fe84c856c76817814b3867d3ce7b85e</id>
<content type='text'>
Signed-off-by: dusoleil &lt;howcansocksbereal@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: dusoleil &lt;howcansocksbereal@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rev: Normalize the reported offset of found gadgets</title>
<updated>2023-03-19T08:19:21+00:00</updated>
<author>
<name>Malfurious</name>
<email>m@lfurio.us</email>
</author>
<published>2023-03-19T01:21:44+00:00</published>
<link rel='alternate' type='text/html' href='http://normalmode.org/malf/nsploit/commit/?id=31ef0e9a7a67ba3c361e72d279ae84b9285fb470'/>
<id>31ef0e9a7a67ba3c361e72d279ae84b9285fb470</id>
<content type='text'>
ROP gadgets returned through search from the r2 API will now always
contain a file-relative offset, even if they come from a non-pic binary
using a fixed baddr.

However, gadgets returned through the ELF API will be mapped according
to the ELF's Symtbl.  This ensures the correct offset is returned
following a library leak, and allows the user to always safely insert an
ELF-returned gadget into that ELF's Symtbl without issue.

Signed-off-by: Malfurious &lt;m@lfurio.us&gt;
Signed-off-by: dusoleil &lt;howcansocksbereal@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ROP gadgets returned through search from the r2 API will now always
contain a file-relative offset, even if they come from a non-pic binary
using a fixed baddr.

However, gadgets returned through the ELF API will be mapped according
to the ELF's Symtbl.  This ensures the correct offset is returned
following a library leak, and allows the user to always safely insert an
ELF-returned gadget into that ELF's Symtbl without issue.

Signed-off-by: Malfurious &lt;m@lfurio.us&gt;
Signed-off-by: dusoleil &lt;howcansocksbereal@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>elf: Add docstrings</title>
<updated>2023-03-16T22:57:11+00:00</updated>
<author>
<name>dusoleil</name>
<email>howcansocksbereal@gmail.com</email>
</author>
<published>2023-03-16T22:57:11+00:00</published>
<link rel='alternate' type='text/html' href='http://normalmode.org/malf/nsploit/commit/?id=42ab380423553720a2a80d03dee68957e6f3b4ff'/>
<id>42ab380423553720a2a80d03dee68957e6f3b4ff</id>
<content type='text'>
Signed-off-by: dusoleil &lt;howcansocksbereal@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: dusoleil &lt;howcansocksbereal@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>elf: Automatically lookup Arch on ELF construction</title>
<updated>2023-03-16T22:55:59+00:00</updated>
<author>
<name>dusoleil</name>
<email>howcansocksbereal@gmail.com</email>
</author>
<published>2023-03-16T22:55:59+00:00</published>
<link rel='alternate' type='text/html' href='http://normalmode.org/malf/nsploit/commit/?id=143f585b0e02ae87e0d383e27c48aa76745db51b'/>
<id>143f585b0e02ae87e0d383e27c48aa76745db51b</id>
<content type='text'>
Signed-off-by: dusoleil &lt;howcansocksbereal@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: dusoleil &lt;howcansocksbereal@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>elf: Add bininfo to ELF under .info and .security</title>
<updated>2023-03-16T22:47:10+00:00</updated>
<author>
<name>dusoleil</name>
<email>howcansocksbereal@gmail.com</email>
</author>
<published>2023-03-16T22:47:10+00:00</published>
<link rel='alternate' type='text/html' href='http://normalmode.org/malf/nsploit/commit/?id=d0aee78d96aade08c8e6180a4b8f067c947cf20a'/>
<id>d0aee78d96aade08c8e6180a4b8f067c947cf20a</id>
<content type='text'>
On ELF construction, call r2.get_bin_info() and keep the results under
the psuedo-namespaces .info and .security.  Also add a pretty-print to
these in a tabulated form.  Also rewrite the ELF pretty-print to just
summarize and not print out the entirety of .sym.  Lastly, fixed a small
bug where ELF could crash on construction if ldd fails (loading a
non-native ELF, for instance).

Signed-off-by: dusoleil &lt;howcansocksbereal@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On ELF construction, call r2.get_bin_info() and keep the results under
the psuedo-namespaces .info and .security.  Also add a pretty-print to
these in a tabulated form.  Also rewrite the ELF pretty-print to just
summarize and not print out the entirety of .sym.  Lastly, fixed a small
bug where ELF could crash on construction if ldd fails (loading a
non-native ELF, for instance).

Signed-off-by: dusoleil &lt;howcansocksbereal@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>r2: Use get_bin_info in get_elf_symbols</title>
<updated>2023-03-16T22:38:57+00:00</updated>
<author>
<name>dusoleil</name>
<email>howcansocksbereal@gmail.com</email>
</author>
<published>2023-03-16T22:38:57+00:00</published>
<link rel='alternate' type='text/html' href='http://normalmode.org/malf/nsploit/commit/?id=0bdf7d37fc2aa3cfc2fa02348f006996fa0bcce8'/>
<id>0bdf7d37fc2aa3cfc2fa02348f006996fa0bcce8</id>
<content type='text'>
Code reuse since we were using r2 iI in get_elf_symbols to get the
baddr.  This can cause get_bin_info to be called (and log that it's
being called) multiple times, so I'm also adding the @cache annotation.

Signed-off-by: dusoleil &lt;howcansocksbereal@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Code reuse since we were using r2 iI in get_elf_symbols to get the
baddr.  This can cause get_bin_info to be called (and log that it's
being called) multiple times, so I'm also adding the @cache annotation.

Signed-off-by: dusoleil &lt;howcansocksbereal@gmail.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
