Call: +44 (0)7759 277220 Call

Pete Finnigan's Oracle Security Weblog

This is the weblog for Pete Finnigan. Pete works in the area of Oracle security and he specialises in auditing Oracle databases for security issues. This weblog is aimed squarely at those interested in the security of their Oracle databases.

Oracle Security 12cR2 and Oracle Security Training Dates

I am going to be teaching my two day class "How to perform a security audit of an Oracle database" in Athens, Greece on the 30th and 31st May 2017. This is advertised on Oracle University website and you can register there or contact me and I will put you in touch with the Oracle team on the ground.

I have also just agreed two new dates with Oracle University to teach my one day classes. The first is on the 28th June and is my one day class "Secure and lock down Oracle". This is a great class and we spend a whole day starting with an open default database with two applications, we attack that database and then lock down most aspects of it and finally hack it again at the end of the day to show that we in fact secured the data in it. The second class to be taught on Oracles LVC on the 5th July 2017 is my new one day class "An Appreciation of Oracle Security". This class takes some elements from my other 5 days of Oracle security training plus some new material on subjects such as incident response to an attack in an Oracle database and also forensic analysis of an Oracle database.

I am also teaching my two day class "How to perform a security audit of an Oracle database" in person in Paris on the 13th and 14th of June 2017.

Finally I will be teaching my "How to perform a security audit of an Oracle database" online via the webbed platform on EST timezone (i.e. New York) on the 26th to 27th June and again on PST timezone (i.e. Los Angeles) and finally on London timezone on the 10th to 11th July 2017.

The details for each of these classes are on my public training dates page along with links to my class outlines. To register follow the register links or if in doubt email me and if the class is with us I will take your booking or if with EasyTeam or Oracle University i will be able to direct you to the right people to book your places.

I have spent some of my spare time (not a lot available unfortunately) researching Oracle 12c Release 2 security changes. This research has looked at the big changes announced by Oracle. There is nothing really major like with previous releases but still quite a lot of security related changes. I have also looked at the little details that I have spotted so far that have changed; interestingly as I was not in the Beta some information gleaned from those that were seems to have either been incorrect or has changed. For instance I was told that O7_DICTIONARY_ACCESSIBILITY was removed in but its still there and is in fact only deprecated. Some research has followed removed and deprecated items and some followed the major change of application root containers and other changes in Multitenant in 12cR2 such as the ability now to formally add metadata links and object links. Some things are the same of course; OPS$ is still OPS$; some things are expected such as more new default users and roles. Interestingly when we first tried PFCLScan our database security scanner against a 12cR2 database it worked with no errors and no changes needed (to support 12cR2) but many years of Oracle made me suspect that would be the case; Oracle rarely changes historic interfaces and rarely removes anything critical that would affect applications and tools. We are of course adding new checks to PFCLScan for 12cR2.

In the latest version of PFCLScan we have also just added our first E-Business Suite policy to check some of the Security basics of E-Business Suite. We will also add an Oracle APEX security scan policy soon as well; its in development.

Our company has also just become an Oracle Gold Partner - we have yet to update the logo on our site to Gold but that will be done soon.

I blogged about old course manuals for our training courses a few weeks ago and these were snapped up straight away and despatched across the world. I have now one extra 2015 printed manual for my one day class "Designing Practical Audit Trails" that we returned to me a week or so ago. A printer who prints our manuals for classes it seems sent it to someone else in 2015 just before our class in York and the organisation that it was sent to posted it to me - So this manual is now also available; its pristine condition and I will take £30 GBP + Postage + VAT (if applicable). If anyone is interested then please email me and we will arrange it - obviously first come; first served.

We are also considering to sell the current class materials to people who would like to buy them. They will be higher price than the old ones we sold recently and the 2015 manual mention here. You would get the scripts and tools from the class and paper manuals BUT you would not benefit from actually attending the training and listening to the delivery but we realise that some people may want just the manuals. If you are interested contact me as we will decide whether its worth the effort to set this up based on the interest levels.

We have also now just purchased our first real server as we continue to grow as we have relied on various office level machines and a RAID storage for many years but we have just bit the bullit and bought a real server with multi-CPU, multi hot swappable SFF disks, hot swappable PSU's massive RAM and storage etc. This will fortify our development and testing regimes for PFCLScan and PFCLObfuscate as soon as we get it live. It took two people to lift it into place..:-)

OK, that wraps it up for this post
[No Comments]

Oracle 12cR2 Security - Listener Port

I downloaded Oracle 12cR2 from Oracle when it became available in March and installed a legacy SE2 database and also a single PDB multitenant database and started some investigations to discover and look at the new security features added in Oracle 12cR2 and also more importantly to investigate the subtle changes made to the database that affect Oracle security and also the bigger non-security changes added to Oracle 12cR2 that could have a security angle.

I have made a lot of notes and I will make some blog posts around some of the new security features / changes in 12cR2 as time allows. The last few weeks have been extremely busy due to client work, teaching training classes, product development on PFCLScan and also company year end so blogging has taken a back seat for a few weeks.

I wanted to make this first post on Oracle 12cR2 Security a simple and short one about the fact that when you install 12cR2 and choose to have a sample database the installer now did not choose by default the port 1521 for the listener and instead in my case it chose 1539 - well, at least in my case. This is not massively different from 1521 but it was nice to see that Oracle did not choose 1521 as its default. I checked with netstat and nothing else was using 1521 to force it to use 1539 instead. I did not find any documentation (yet) that states that Oracle use 1539 instead and a search of Google shows one post from 2016 where someone with 12.1 had Oracle change the port to 1539.

So I decided on Friday evening to try this again and installed a new Oracle Linux 7.3 VM and then installed Oracle 12cR2 SE2 database (My company is a Silver partner currently so we are limited to SE and SE2 at this time). I used the same settings as I did in March and chose defaults except to choose SE2 and also to choose non-CDB. Everything ran correctly except the necta failed and I looked at the logs and it claimed that port 1521 was in use - This was not true and I checked with netstat. So i clicked try again and it succeeded so the choice of port 1521 / 1539 could be related to the fact that necta failed and not a better security setting. The install in March did not fail in nectar and 1539 was also used as i noted it but have now deleted the VM so cannot look further into the install logs.

After the installation completed the listener is not running:

No Listener running after 12cR2 install

Then I changed the current_listener to LISTENER and then started the listener BUT no services; this is to be expected as the auto registration works only in 1521. Here is the listener running but no services:

No Listener services after start of listener

The listener is up and running so lets add the local_listener database parameter and then register the services and see what happens:

Add the local_listener

Finally we can now get into the database via the listener:

The listener has services

In summary, its a good thing that Oracle chose a non 1521 port for my listener; whether its intended as a new security feature I am not yet certain as I need to install the database software again as there is no evidence that i can find that this is normal as the installer said necta failed and then allowed me to try again. Irrespective of this you should not run your database on 1521 as its not just a known default but some things work because of 1521; i.e. alter system register; or connect to the listener and not set the current_listener if the listener is running on port 1521.

As an aside the default port of 5500 for the database manager website is still used and the XDB service is also still enabled by default in 12cR2!!

Changing the port will not stop any determined person as a port scanner would find the database listener anyway but its a default and defaults sometimes make it easier for a script kiddie type attacker who doesn't "know"
[No Comments]

New Online Oracle Security PUBLIC Training Dates Including USA Time Zones

We have just agreed three new online classes to be taught in June and July. These are for my two day class How to perform a security audit of an Oracle database. The classes are two day events and will be taught online via the webex platform. For the first time after having requests for public classes in the USA many times Pete Finnigan will teach this two day class on USA time zones so that it is aimed at USA (Canada, Mexico) attendees. One of the planned two day classes is on EST time zone from 8am to 4pm New York time and one on PST time zone 8am to 4pm Los Angeles time zone. The final sitting is UK/EU time zone from 9am to 5pm.

For details of the classes please see the online Oracle Security class page. A list of all the public training dates is also available.

Please send an email to to register your place.
[No Comments] In The Top 60 Oracle Database Blogs

I got a couple of emails over the last couple of weeks from Anuj at FeedSpot to tell me that my blog (This Oracle Security blog) has been listed in the top 60 Oracle Database blogs on the Feedspot website. This means I have been awarded a gold badge to display here on this blog:

According to the list I am currently number 15!!!. Currently comments are still broken in this blog since I upgraded GreyMatter (this blogs engine) to a custom version I am calling version 1.9. The last released version was 1.8.2 and I offered 1.8.3 to the community some years back with a major new feature to allow posts with linked names rather than numbers. I have recently been adding categories and tags to Greymatter and this will be visible here soon but i seem to also have broken comments as well...

Please connect to me via Social Media:

Twitter or Facebook or Linked In. I am always happy to accept new connections and you can reach me for comments there until the blog is fixed.
[No Comments]

Oracle Security Training Manuals For Sale

I had a reason today to go to our company storage for something today and whilst moving other things around to find what I needed I discovered two A4 boxes with printed manuals for some of our recent training classes. We normally print the exact number of books for each days training but for some classes where a last minute student may come or not we get extra copies. These class books are professionally printed here in York and as we continually make changes to the course MS PPT slides we cannot reuse ones that were not given out. Often the changes are not major so these books are still useful to someone and rather than throw them away I am now offering them for sale here to the first people who say that they would like them. Here are some pictures and details and prices; I will cover postage and VAT at the end; sorry the photos are not brilliant I only had an iPhone to hand to take them and I had to reduce the size of the images to make then reasonable to add to the site:

How to Perform a Security Audit Class notes - Two books

Above is a picture of the course notes for the two days class - How to perform a security audit of an Oracle database - These are printed in two A5 books, one for Day 1 and one for Day 2. They contain approximately 500 MS PPT slides printed one per page and back to back. The printing is Black and White. These were printed in 2010 but the class has not changed drastically in structure so most of the content is still valid. I have 3 copies of two books for sale and they are £20 GBP + Postage + VAT.

Secure and Lock Down Oracle

Above is a picture of the one day class course notes for the Securing and Locking Down Oracle class. These course notes are printed in colour and there are approximately 230 MS PPT slides printed two slides per page in an A4 bound book. These manuals were printed in May 2016. I have two copies of this manual and I will accept £40 GBP + Postage + VAT per copy.

Secure coding in PL/SQL

Above are the course notes for my one day class - Secure Coding in PL/SQL - and they are A4 with two slides per page and there are approximately 230 MS PPT slides. The manuals are printed in Black and white and I have two copies and they were printed in mid 2015. I will accept £30 GBP + Postage + VAT for each copy.

Secure and lock down Oracle

Above is a picture of the class manual for the - secure and lock down Oracle - class. This is an A4 bound manual, Black and White and there are again approximately 230 MS PPT slides. These were printed in mid 2015 and I have two copies. I will accept £30 GBP + Postage + VAT for each copy.

Designing Practical Audit Trails in Oracle

Above is a picture of the class manual for the - Designing Practical Audit Trails in the Oracle Database - class. This is an A4 bound manual, Black and White and there are again approximately 230 MS PPT slides. These were printed in mid 2015 and I have two copies. I will accept £30 GBP + Postage + VAT for each copy.

How to perform a security audit of an Oracle database

Above is a picture of the class manual for the - How to perform a security audit of an Oracle database - class. This is an A4 bound manual, Black and White and there are again approximately 610 MS PPT slides. These were printed in mid 2015 and I have two copies. I will accept £50 GBP + Postage + VAT for each copy.

Please email me on if you are interested to purchase one of these course books that we have for sale. Please also let me know your postal address and I will get an accurate postage price from the post office. Also as we are registered for UK VAT then we may need to also add VAT dependant on where you are. Please get in touch if you would like to purchase one of these course manuals but hurry we don't have many and we will not be repeating this.
[No Comments]

How to Perform a Security Audit of an Oracle Database Training in Athens, Greece

I will be teaching my two days class How to Perform a Security Audit of an Oracle Database in Athens, Greece on May 16th and 17th 2017 organised by Oracle University.

This is a great class that helps you understand why the data in your Oracle database can become insecure and why design decisions that you make can make this worse. We discuss the background first and set the scene of where Oracle security fits, what does it mean for you, what is hacking, how can someone compromise your database and what tools and options are available to you.

We then layout the steps needed to perform a security audit, what tools do we need, what systems / databases should we audit and where does the audit "fit" into the whole realm of securing all of the data held in your Oracle databases. The bulk of the class is a walk-through of a complete example security audit. I perform many examples, use and demonstrate many free tools and explain as we go what to do if we find an issue. The class completes with a look at what to do next; how to review all databases in your organisation, how to create a database security policy and how you may go about locking down all databases.

This is a great class held over 2 days in Athens, Greece and you can register your place by following the link in our Public Training dates page. Sorry, GreyMatter breaks Oracle provided links so I cannot post it directly here in the blog..:-(

Keep an eye on our Public Training dates page for more up-coming public Oracle Security classes taught by Pete Finnigan.
[No Comments]

Is SQL Injection A WebSite Problem?

I saw a post on RobLockards Facebook page this week where he said some people have suggested that his SQL Injection talk only shows calling a procedure from SQLCl and not a web page and he suggests that he may make a web page to satisfy those that want to see SQL Injection via a web-page.

I am not sure that you will be able to see Robs post on his Facebook; I am connected to him so I see it but its unclear if its findable without a connection but connect to Rob if you want to see it. The list is what i have said above anyway. Rob also has his site Oracle Wizard.

It is a good point; should SQL Injection in Oracle demos be made in SQLCl or SQL*Plus or from a webpage? - I have been at both ends of this spectrum for many years. I wrote what i think were the some of the first Oracle SQL Injection papers 15 years ago in 2002 for Security Focus (Now Symantec). These are:

SQL Injection and Oracle Part 1
Sql Injection and Oracle Part 2
Detecting SQL Injection in Oracle

These papers were written a long time ago - 14 - 15 years ago in fact but they are still mostly relevant in the principles. The formatting on the Symantec website is not good for some of the content but they are readable.

I also wrote the first big paper by anyone on Oracle Security in 2001 - which is available on the Pentest Website to read still. This is old but some of the thought patterns are still good and I mention SQL Injection against Oracle in that paper as well.

Whats the point of these references; well back in 2001 not many people were doing SQL Injection or most likely had even heard of it. Certainly the Oracle community (DBA, Devs, etc) most likely did not consider the risk of SQL Injection in Oracle databases. The DBMS_ASSERT package did not exist until 2004 but probably not in wide use until 2005/2006. The large slew of PL/SQL injections in built in packages had not started in 2001 / 2002. The alerts program was only just getting going in 2001 and these were the only security patches released on an "as-when" basis. The CPU security patch regime did not start until 2005 (If i remember correctly). The large onslaught of built in packages with Sql injection or PL/SQL injection came in the middle of this period.

If anyone had heard of SQL Injection back in 2001 / 2002 they mostly associated it with websites and MySQL as that was what Rain Forrest Puppy (the person credited with coming up with this technique) talked about in the first posts on SQL Injection I the late 90s. When I first started to think about SQL Injection in Oracle back in 2001 and then wrote the papers for Security Focus I wanted to make one very big point; That is SQL Injection is not a web thing; it is a script engine thing where the input can be manipulated by an outsider or end user beyond what was intended by the writer of the code. i.e. the script engine (SQL, PL/SQL, PHP, Javascript....) executes dynamic code; actually the code may not be intended to be dynamic in nature its just ended up being written in pieces and stuck together with + signs or || signs or concat or whatever the host language likes to use. This is the problem; a piece of code can be modified by injecting additional code instead of data.

At the time in 2001 I wanted to write my papers and make a point to the reader that this is a code problem not a web problem. Hence I used SQL*Plus as the vehicle to deliver the injection examples to the database and to show how SQL Injection works. I wanted people to realise that they still have a problem if some code is vulnerable to injection even if there is no website to access the code from.

I teach about SQL Injection still in my OracleSecurity classes ; in fact I cover SQL Injection in depth in the secure coding in PL/SQL class and also in the secure and lock down Oracle class and its covered also in the Audit trail design class and also the 2 days class on how to perform a security audit of an Oracle database. SQL Injection has not gone away.

Nowadays I do what Rob is talking about; I have two web applications; one is Worpress 2.0 ported to use Oracle as its database and not MySQL and the other is my own web based application written in PHP (actually its written in PL/SQL as the PL/SQL packages I have written generate PHP for me). This application I call BOF - "Back OfFice" and it was described in a blog post called BOF: A Sample Application For Testing Oracle Security about a year ago. I demonstrate quite a lot of hacking against the PHP websites and show SQL injection, injecting PL/SQL into SQL and also DDL injection. In fact I cover all sorts of stuff from adding users, showing code, adding back-doors, changing passwords, removing audit settings and much more. This is always great for the participants, they love it, they get mesmerised, sit on the edges off their seats and get really excited - Its fun to do BUT does it get across the message that this is a scripting language issue (PL/SQL in this case) in the database and not a website issue. In fact in some of my demos I go 5 layers deep; I inject DDL into dynamic PL/SQL that is itself injected into dynamic PL/SQL that is injected into a SQL in a PL/SQL function that was injected into the SQL statement in the PHP layer. Why so many layers well this was necessary to inject DDL into this particular application (Wordpress). Also i injected IDS evasion techniques to get around the security protections in the PHP in Wordpress as well. This is exciting and fun BUT people don't get this complexity to achieve something. Also the statements I inject are pre-designed. If i walked up to this Wordpress application blind (which I actually did when i wrote the samples) then it takes literally thousands of requests to get something that works - you cannot demonstrate that part and some people question - How did you know how to send such a complex attack string? - then i have to explain and the magic wears off a little.

This is why I also demonstrate attacks using SQL*Plus and this fits nicely. I show four levels of attack;

1) Attacking the website logon form and also search form as a non-authenticated user (no logon on the site, no logon on the database)
2) Attacking the website as an authenticated (website authenticated) user by exploiting the wordpress post, page, comment,...etc pages (no database password)
3) Attacking the database via SQL*Plus as a low level user - CREATE SESSION only
4) Attacking the database via SQL*Plus as a powerful user - CREATE SESSION and DBA roles.

This covers both worlds, it shows the excitement of hacking a website and shows how to avoid security layers in the application and also how to do various injections, SQL into SQL, PL/SQL into SQL, PL/SQL into PL/SQL and DDL into PL/SQL into SQL BUT it also shows the problem at the most simplistic layer; i.e. as close to the problem as possible; executing a PL/SQL procedure and exploiting it.

My view, do both but focus on the SQL*Plus examples as its easier to see whats happening and it illustrates that its not a web problem but a code problem.
[No Comments]