pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Smith <gsmith@gregsmith.com>
To: Christophe <xof@thebuild.com>
Cc: Postgres General List <pgsql-general@postgresql.org>
Subject: Re: Obfuscated stored procedures (was Re: Oracle and Postgresql)
Date: Thu, 25 Sep 2008 18:08:37 -0400 (EDT)
Message-ID: <Pine.GSO.4.64.0809251732400.16879@westnet.com> (raw)
In-Reply-To: <8F40543B-779F-4413-BADF-714F7E0FF565@thebuild.com>
References: <41c1fa08-86a0-4023-acaa-d838d5b0abf8@i24g2000prf.googlegroups.com>
	<48BB040E.3040108@earlham.edu>
	<48C5C394.1070602@gmail.com>
	<819df3760809131924o4ec38ebetfde7cd890767b1a9@mail.gmail.com>
	<1A6E6D554222284AB25ABE3229A9276201A1993B@nrtexcus702.int.asurion.com>
	<20080915135847.GF3666@fetter.org>
	<7be3f35d0809150731k575bf7aajc689a4278176b1a8@mail.gmail.com>
	<000001c91748$af9288b0$0eb79a10$@com>
	<Pine.GSO.4.64.0809151818430.26261@westnet.com>
	<20080915202922.1778a062.wmoran@collaborativefusion.com>
	<20080916005025.GE3666@fetter.org>
	<20080915221136.f39a284e.wmoran@collaborativefusion.com>
	<16972.1221531560@sss.pgh.pa.us>
	<C262B817-9165-4EC7-A3E4-D3300A9206DF@bepress.com>
	<8F40543B-779F-4413-BADF-714F7E0FF565@thebuild.com>

On Thu, 25 Sep 2008, Christophe wrote:

> it strikes me that a reasonable approach would be a non-core pluggable 
> language which accepts encrypted strings as functions, decrypts them 
> (using a key compiled into the language module), and passes them on to 
> PL/pgSQL for execution...This would, of course, be easily hacked with 
> someone who can step through the language module with a debugger

If we presume that the module doing the encryption/decryption is itself is 
a common open-source implementation, all I have to do is read in the 
de-obfuscator code byte at a time, stopping every time I have a key length 
worth of bytes to see if they unlock something that looks like plaintext. 
You have to move to at least another layer of relatively serious security 
before you need debugger-level skills to crack it.

People routinely tear through protection like this even on closed-source 
systems that benefit some from security by obscurity, and if you can know 
the method used that usually allows an even easier approach.

--
* Greg Smith gsmith@gregsmith.com http://www.gregsmith.com Baltimore, MD



view thread (31+ messages)  latest in thread

Message-ID: <Pine.GSO.4.64.0809251732400.16879@westnet.com>
Permalink:  ../Pine.GSO.4.64.0809251732400.16879@westnet.com/
Also on:    postgresql.org/message-id/Pine.GSO.4.64.0809251732400.16879@westnet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: gsmith@gregsmith.com, xof@thebuild.com
  Subject: Re: Obfuscated stored procedures (was Re: Oracle and Postgresql)
  In-Reply-To: <Pine.GSO.4.64.0809251732400.16879@westnet.com>
  References: <41c1fa08-86a0-4023-acaa-d838d5b0abf8@i24g2000prf.googlegroups.com> <48BB040E.3040108@earlham.edu> <48C5C394.1070602@gmail.com> <819df3760809131924o4ec38ebetfde7cd890767b1a9@mail.gmail.com> <1A6E6D554222284AB25ABE3229A9276201A1993B@nrtexcus702.int.asurion.com> <20080915135847.GF3666@fetter.org> <7be3f35d0809150731k575bf7aajc689a4278176b1a8@mail.gmail.com> <000001c91748$af9288b0$0eb79a10$@com> <Pine.GSO.4.64.0809151818430.26261@westnet.com> <20080915202922.1778a062.wmoran@collaborativefusion.com> <20080916005025.GE3666@fetter.org> <20080915221136.f39a284e.wmoran@collaborativefusion.com> <16972.1221531560@sss.pgh.pa.us> <C262B817-9165-4EC7-A3E4-D3300A9206DF@bepress.com> <8F40543B-779F-4413-BADF-714F7E0FF565@thebuild.com> <Pine.GSO.4.64.0809251732400.16879@westnet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox