Auditing an Oracle database for security issues is very important. PeteFinnigan.com provides all of the information and tools that you will need Click here for details of PeteFinnigan.com Limited's detailed Oracle database security audit service Click here for details of PeteFinnigan.com Limited's Oracle Security Training Courses
Cookie Policy:We only use essential cookies on small sections of this website. For details see here.

Welcome, Guest. Please Login.
Nov 20th, 2017, 1:47am
News: If you would like to register contact the forum admin
Home | Help | Search | Members | Login
   Pete Finnigan's Oracle Security Forum
   Oracle Security
   Oracle Security
(Moderator: Pete Finnigan)
   Unwrapping PL/SQL
« Previous topic | Next topic »
Pages: 1 2  Reply | Notify of replies | Send Topic | Print
   Author  Topic: Unwrapping PL/SQL  (Read 21566 times)
Pete Finnigan
PeteFinnigan.com Administrator
*****




Oracle Security is easier if you design for it

   
View Profile | WWW | Email

Gender: male
Posts: 309
Unwrapping PL/SQL
« on: Aug 8th, 2006, 2:05pm »
Quote | Modify

I have just posted a link to my presentation slides from Blackhat Las Vegas 2006 on my [url http://www.petefinnigan.com/orasec.htm]Oracle security white papers[/url] page. The slides can be found [url http://www.insight.co.uk/files/presentations/BlackHat%20conference.pdf]here[/url]
IP Logged

Pete Finnigan (email:pete@petefinnigan.com)
Oracle Security Web site: http://www.petefinnigan.com
Forum: http://www.petefinnigan.com/forum/yabb/YaBB.cgi
Oracle security blog: http://www.petefinnigan.com/weblog/entries/index.html
isaez
PeteFinnigan.com Junior Member
**



Ivan

   
View Profile |

Gender: male
Posts: 76
Re: Unwrapping PL/SQL
« Reply #1 on: Aug 9th, 2006, 5:22pm »
Quote | Modify

Pete,
 
It's a very interesting document. And very useful too. I think there are many wrapped pl/sql procedures for which people don't have the source anymore. I have a few wrapped pl/sql procedures written many years ago by DBA's. We know what the functionality is of these procedures but we don't have the source anymore! If we want to change them we have to reverse engineer them. I'll try to unwrap these procedures with you unwrap script.
 
regards,
 
Ivan
IP Logged

regards,

Ivan
olivet
PeteFinnigan.com Newbie
*



I love YaBB 1G - SP1!

   
View Profile |

Posts: 2
Re: Unwrapping PL/SQL
« Reply #2 on: Aug 16th, 2006, 5:07pm »
Quote | Modify

Pete,
Can one  unwrap a PL/SQL Package in oracle 10g?
 
 
 
 
Olivet
IP Logged
Pete Finnigan
PeteFinnigan.com Administrator
*****




Oracle Security is easier if you design for it

   
View Profile | WWW | Email

Gender: male
Posts: 309
Re: Unwrapping PL/SQL
« Reply #3 on: Aug 17th, 2006, 9:19am »
Quote | Modify

Hi,
 
the example procedure included with the paper is for 9i and lower and is only a proof of concept. The 10g algorithm is completely different.
 
cheers
 
Pete
IP Logged

Pete Finnigan (email:pete@petefinnigan.com)
Oracle Security Web site: http://www.petefinnigan.com
Forum: http://www.petefinnigan.com/forum/yabb/YaBB.cgi
Oracle security blog: http://www.petefinnigan.com/weblog/entries/index.html
olivet
PeteFinnigan.com Newbie
*



I love YaBB 1G - SP1!

   
View Profile |

Posts: 2
Re: Unwrapping PL/SQL
« Reply #4 on: Aug 17th, 2006, 10:47am »
Quote | Modify

Pete,
I really understand the write up and i know you delibrated much more on the process for Oracle 9i and bellow with respect to DIANA and m code. But I have an issue in house. I have a package that we wrapped in Oracle 10g. What the package does is to send notification to our numerious customers once a trasaction takes place in their account. We need to expand the scope of this package and we are stucked. The source code cannotbe trace again. Wehave the .plb only. We dont want to re invent the wheel as it took some time to get to that position . I really need your advice in this case. what can we do. Can we get the souce code back from .plb or from another means.
Thak you.
 
 
Warmest regards,
Olivet
« Last Edit: Aug 17th, 2006, 10:49am by olivet » IP Logged
graeme
PeteFinnigan.com Newbie
*



hmmm

   
View Profile |

Posts: 2
Re: Unwrapping PL/SQL
« Reply #5 on: Aug 18th, 2006, 1:21am »
Quote | Modify

Pete,
 
I've read your presentation and it's very good. My question is very much from the other side. We have source which we have wrapped in order to protect our IP. Obviously this is not as protected as we had first thought. Angry
 
Is there anything else we should be looking at to minimise the risk of people unwrapping our code and stealing the IP given that the nature of our product means we cannot lock down the database structures (we are using 10g)?
 
Regards,
Graeme
IP Logged
Pete Finnigan
PeteFinnigan.com Administrator
*****




Oracle Security is easier if you design for it

   
View Profile | WWW | Email

Gender: male
Posts: 309
Re: Unwrapping PL/SQL
« Reply #6 on: Aug 18th, 2006, 10:22am »
Quote | Modify

Hi Graeme,
 
The issue is really that the 10g mechanism has also been cracked. There are a number of 10g unwrappers out there. I know of at least 5 different ones. At this point in time they are not in general circulation so its unlikely that someone without connections is going to get one.  
 
The issue is that the wrapped source is stored in SYS.SOURCE$ so even if the files are not shipped to the server somone may be able to get the wrapped source from the database and unwrap it.
 
Unless you can protect the wrapped source from view the intellectual property is vulnerable. In this sense the wrap mechanism does little to help protect source code.  
 
cheers
 
Pete
IP Logged

Pete Finnigan (email:pete@petefinnigan.com)
Oracle Security Web site: http://www.petefinnigan.com
Forum: http://www.petefinnigan.com/forum/yabb/YaBB.cgi
Oracle security blog: http://www.petefinnigan.com/weblog/entries/index.html
gamyers
PeteFinnigan.com Junior Member
**



I love YaBB 1G - SP1!

   
View Profile |

Posts: 80
Re: Unwrapping PL/SQL
« Reply #7 on: Aug 21st, 2006, 6:41am »
Quote | Modify

Maybe it's not something that you've looked into, but how does native compilation compare to wrapping for 'code hiding' purposes ?
Obviously that isn't its primary purpose, but maybe there's another 'layer' that can be applied on top of native compilation to obfuscate the object ?
IP Logged
Pete Finnigan
PeteFinnigan.com Administrator
*****




Oracle Security is easier if you design for it

   
View Profile | WWW | Email

Gender: male
Posts: 309
Re: Unwrapping PL/SQL
« Reply #8 on: Aug 21st, 2006, 5:42pm »
Quote | Modify

Hi Gary,
 
I have looked into Native compilation in detail. I even mentioned it in the slides. The problem would be that the native PL/SQL is simply the mcode for the PL/SQL VM. The Source code and diana levels still exist, i.e the IDL$ tables still have contents and the SYS.SOURCE$ table still contains the wrapped PL/SQL so we would not gain anything from this strategy.
 
cheers
 
Pete
IP Logged

Pete Finnigan (email:pete@petefinnigan.com)
Oracle Security Web site: http://www.petefinnigan.com
Forum: http://www.petefinnigan.com/forum/yabb/YaBB.cgi
Oracle security blog: http://www.petefinnigan.com/weblog/entries/index.html
graeme
PeteFinnigan.com Newbie
*



hmmm

   
View Profile |

Posts: 2
Re: Unwrapping PL/SQL
« Reply #9 on: Aug 23rd, 2006, 12:00am »
Quote | Modify

Hi Pete & Gary,
 
So to me it looks like there is no way to 100% lock down PL/SQL in order to protect IP. The 2 ways mentioned (wrapping and Native compilation)seem to only be a deterrent to prying eyes and could be read by suitably connected malicious hackers.
 
Not that I think the IP we are protecting will attract these hackers, our IP is still worth a considerable amount and differentiates us from the competition. From my simplistic outlook this is a big issue for IP protection within PL/SQL and a gap in the market for a good solution which can guarantee IP protection within PL/SQL.
 
Cheers,
 
Graeme
IP Logged
Pete Finnigan
PeteFinnigan.com Administrator
*****




Oracle Security is easier if you design for it

   
View Profile | WWW | Email

Gender: male
Posts: 309
Re: Unwrapping PL/SQL
« Reply #10 on: Aug 24th, 2006, 10:24pm »
Quote | Modify

Hi Graeme,
 
I agree, its virtually impossible to protect your IP if a DBA has access to the SYS.SOURCE$ table. I also agree that this seems like a gap in the market to provide a tool but even if you tac something on top of PL/SQL i.e. encrypt the source and dynamically extract and run it the problem is you could still get at the source.
 
An obvious solutiojn is to move your code to C, OCI or Pro*C.
 
cheers
 
Pete
IP Logged

Pete Finnigan (email:pete@petefinnigan.com)
Oracle Security Web site: http://www.petefinnigan.com
Forum: http://www.petefinnigan.com/forum/yabb/YaBB.cgi
Oracle security blog: http://www.petefinnigan.com/weblog/entries/index.html
uudecode
PeteFinnigan.com Newbie
*



I love YaBB 1G - SP1!

   
View Profile |

Posts: 1
Re: Unwrapping PL/SQL
« Reply #11 on: Sep 12th, 2006, 8:32am »
Quote | Modify

Hi!
Will you be so kind, to help me with my trouble?
I will try to explain.
We do use Spatial optins with oracle, and after applying the patchset to 9.2.0.8.0 we can't create or rebuild spatial indexes.
We taking a error like this:
 
11:28:48 test 8 RELEASE2>alter index test_g_idx rebuild;
alter index test_g_idx rebuild
*
ERROR at line 1:
ORA-29858: error occurred in the execution of ODCIINDEXALTER routine
ORA-29400: data cartridge error
Xjэ
ORA-13249: internal error in Spatial index: [mdidxrbd]
ORA-13205: internal error  while parsing spatial parameters
ORA-06512: at "MDSYS.SDO_INDEX_METHOD_9I", line 259
ORA-06512: at line 1
 
 
Metalink told us, that this is a bug, and it fixed in 10R2 ;(
 
But at 9.2.0.7.0 we was able to create spatial indexes.
Can you help me to unwrap this package, I wish to look it, and possible to know, why it isn't working.
Thank you!
IP Logged
omarsawalhah
PeteFinnigan.com Newbie
*



I love YaBB 1G - SP1!

   
View Profile |

Posts: 1
Re: Unwrapping PL/SQL
« Reply #12 on: Sep 14th, 2006, 5:34am »
Quote | Modify

hi pete,
amazing, before this doc really I thought Oracle is unbreakable, about the tool you mentioned that this tool works for 10g, am i right or I missed something please clarify
regards
IP Logged
Marcel-Jan
PeteFinnigan.com Junior Member
**






   
View Profile | WWW |

Gender: male
Posts: 83
Re: Unwrapping PL/SQL
« Reply #13 on: Sep 14th, 2006, 10:49am »
Quote | Modify

Read some more papers from Pete's website and you too will know: Oracle really isn't unbreakable.
IP Logged
cramer
PeteFinnigan.com Newbie
*



I love YaBB 1G - SP1!

   
View Profile |

Posts: 1
Re: Unwrapping PL/SQL
« Reply #14 on: Mar 7th, 2007, 3:43pm »
Quote | Modify

Pete,  
 
it really works when unwrapping a PL/SQL "procedure" in 9i,
but how to unwrap a PL/SQL "Package" in 9i ?
 
"Write PL/SQL as packages; DIANA is not stored in the database" what does it mean in  slides ?
Am I missed anything ?
 
IP Logged
Pages: 1 2  Reply | Notify of replies | Send Topic | Print

« Previous topic | Next topic »

Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright 2000-2004 Yet another Bulletin Board