SlideShare a Scribd company logo
PART 2 : ORACLE EVENTS
HUNTING
HATEM MAHMOUD
HTTPS://MAHMOUDHATEM.WORDPRESS.COM
HIGH FIVE POUG
Geeking out with the WeedMan
2
HOW TO BUILD AN ORACLE
EVENT MAPPING FILE
… IN 10 MIN !!
3
BUILDING AN EVENT MAPPING FILES
https://github.com/hatem-mahmoud/scripts/blob/master/oracle_function_to_event_mapping19c.txt
4
WHY ?
5
EXTRACTING CHECKED EVENTS
https://github.com/hatem-mahmoud/scripts/blob/master/oracle_function_to_event_mapping19c.txt
Quickly extract checked events in a specific core oracle function using a simple mapping file :
6
EVENT SNIFFING
https://mahmoudhatem.wordpress.com/2018/10/29/oracle-trace-events-hunting-events-annotations-events-sniffing/
Extracting “all” checked events in specific execution path : After executing select * from dual for example:
*Using Intel Pin tool debugtrace.so to trace program exécution flow
7
ANNOTATING FLAME-GRAPH
https://mahmoudhatem.wordpress.com/2019/03/06/oracle-19c-event-mapping-files/
8
DISCOVERING UNDOCUMENTED-UNDOCUMENETED EVENTS
https://mahmoudhatem.wordpress.com/2018/10/18/oracle-trace-events-hunting-undocumented-events-filling-the-gaps/
9
AND BECAUSE IT’S FUN !!!!
10
WARMING UP BEFORE THE HINTING
START :
EXTRACTING FUNCTION PARAMETER
FROM A SILLY LITTLE C PROGRAM
11
HOW FUNCTION PARAMETERS ARE PASSED : X86-64 CALLING
CONVENTIONS
https://en.wikipedia.org/wiki/X86_calling_conventions
System V AMD64 ABI (Is followed on Solaris, Linux, FreeBSD, macOS)
• “The first six integer or pointer arguments are passed in registers RDI, RSI, RDX, RCX, R8, R9
(R10 is used as a static chain pointer in case of nested functions[19]:21), while XMM0, XMM1, XMM2,
XMM3, XMM4, XMM5, XMM6 and XMM7 are used for certain floating point arguments.[19]:22 As in the
Microsoft x64 calling convention, additional arguments are passed on the stack.”
12
HOW FUNCTION PARAMETERS ARE PASSED : X86-64 CALLING
CONVENTIONS
https://mahmoudhatem.wordpress.com/2016/10/10/reverse-engineering-what-we-need-to-know-as-a-dba/
int add_value(int a,int b ,int c,int d,int e,int f,int g);
int main()
{
printf ("%dn", add_value(1,2,3,4,5,6,7));
return 0;
};
13
HOW FUNCTION PARAMETERS ARE PASSED : X86-64 CALLING
CONVENTIONS
https://mahmoudhatem.wordpress.com/2016/10/10/reverse-engineering-what-we-need-to-know-as-a-dba/
14
TIME TO LOOK AT THE BIG O : EVENT HUNTING
ORACLE IT'S AFTER ALL ONLY A HUGE C
PROGRAM WITH ABOUT 25 MILLION LINE OF
CODE .. THAT’S IT !
https://news.ycombinator.com/item?id=18442941
15
NUMERIC EVENTS (KS*/DBKD*)
Oracle kernel function
First argument as stored in Register RDI
Function used to check for enabled events
16
EVENTS++/UTS (DBG*)
Third argument
Forth argument
EventId to Event/componenent names ?
Function used to check for enabled events
17
EVENTS++/UTS (DBG*)
https://mahmoudhatem.wordpress.com/2018/10/05/write-consistency-and-dml-restart/
Start with a known case
18
EVENTS++/UTS (DBG*)
• Tracing process execution using Intel Pin tools debugtrace.so
 dbgdpStoreEventIdByName  dbgfcsIlcsGetDefByName return the Event Id
• Enable DML UTS trace event
19
EVENTS++/UTS (DBG*)
20
EVENT NAME TO EVENT_ID MAPPING FILE
https://github.com/hatem-mahmoud/scripts/blob/master/dbgdChkEventIntV_event_list_extended19c.txt
21
KERNEL FUNCTION TO EVENT NAME MAPPING FILE
https://github.com/hatem-mahmoud/scripts/blob/master/oracle_function_to_event_mapping19c.txt
22
THANK YOU FOR YOUR
ATTENTION
https://mahmoudhatem.wordpress.com
@Hatem__Mahmoud
https://linkedin.com/in/mahmoudhatemoracle

More Related Content

PPTX
The power of linux advanced tracer [POUG18]
PPTX
Memory access tracing [poug17]
PPTX
Understanding DPDK algorithmics
PPTX
Understanding eBPF in a Hurry!
PDF
LAS16-403: GDB Linux Kernel Awareness
PDF
netLec5.pdf
PDF
How to use KASAN to debug memory corruption in OpenStack environment- (2)
PDF
Linux device driver
The power of linux advanced tracer [POUG18]
Memory access tracing [poug17]
Understanding DPDK algorithmics
Understanding eBPF in a Hurry!
LAS16-403: GDB Linux Kernel Awareness
netLec5.pdf
How to use KASAN to debug memory corruption in OpenStack environment- (2)
Linux device driver

What's hot (20)

PDF
DPDK In Depth
PDF
Physical Memory Models.pdf
PDF
Network Programming: Data Plane Development Kit (DPDK)
PPTX
Staring into the eBPF Abyss
PDF
Geep networking stack-linuxkernel
PPTX
OpenvSwitch Deep Dive
PDF
Open vSwitch Introduction
PDF
Kernel Recipes 2017: Using Linux perf at Netflix
PDF
Container Performance Analysis
PDF
BPF - in-kernel virtual machine
PDF
Performance Analysis Tools for Linux Kernel
PDF
I/O仮想化最前線〜ネットワークI/Oを中心に〜
PPTX
eBPF Workshop
PDF
BPF / XDP 8월 세미나 KossLab
PDF
UM2019 Extended BPF: A New Type of Software
PPTX
Linux Network Stack
ODP
Dpdk performance
PDF
Memory management in Linux kernel
PDF
Kernel Recipes 2019 - XDP closer integration with network stack
PDF
DPDK & Layer 4 Packet Processing
DPDK In Depth
Physical Memory Models.pdf
Network Programming: Data Plane Development Kit (DPDK)
Staring into the eBPF Abyss
Geep networking stack-linuxkernel
OpenvSwitch Deep Dive
Open vSwitch Introduction
Kernel Recipes 2017: Using Linux perf at Netflix
Container Performance Analysis
BPF - in-kernel virtual machine
Performance Analysis Tools for Linux Kernel
I/O仮想化最前線〜ネットワークI/Oを中心に〜
eBPF Workshop
BPF / XDP 8월 세미나 KossLab
UM2019 Extended BPF: A New Type of Software
Linux Network Stack
Dpdk performance
Memory management in Linux kernel
Kernel Recipes 2019 - XDP closer integration with network stack
DPDK & Layer 4 Packet Processing
Ad

Similar to Oracle events hunting [POUG19] (20)

PDF
Cloud-native Java EE-volution
PPTX
Serverless + Machine Learning – Bringing the best of two worlds together
PDF
Feldo: Function Event Listing and Dynamic Observing for Detecting and Prevent...
PDF
The Next Leap in JavaScript Performance
PDF
Stream Processing with Apache Kafka and .NET
PDF
Rakuten Ichiba development Automation show case - Bamboo, Docker -
PPTX
DECK36 - Log everything! and Realtime Datastream Analytics with Storm
PDF
StackStrom: If-This-Than-That for Devops Automation
PDF
Technical Report Vawtrak v2
PDF
How to measure everything - a million metrics per second with minimal develop...
PDF
Meder Kydyraliev - Mining Mach Services within OS X Sandbox
PDF
Running MongoDB Enterprise on Kubernetes
PDF
Finding target for hacking on internet is now easier
PDF
Using linuxKit to build custom rancherOS systems
PDF
Analyzing the Performance of Mobile Web
PDF
Event-driven automation, DevOps way ~IoT時代の自動化、そのリアリティとは?~
PDF
Streaming Analytics for Financial Enterprises
PDF
Automated reduction of attack surface using call graph enumeration
PPTX
Top-5-production-devconMunich-2023.pptx
PDF
3-Way Scripts as a Practical Platform for Secure Distributed Code in Clouds
Cloud-native Java EE-volution
Serverless + Machine Learning – Bringing the best of two worlds together
Feldo: Function Event Listing and Dynamic Observing for Detecting and Prevent...
The Next Leap in JavaScript Performance
Stream Processing with Apache Kafka and .NET
Rakuten Ichiba development Automation show case - Bamboo, Docker -
DECK36 - Log everything! and Realtime Datastream Analytics with Storm
StackStrom: If-This-Than-That for Devops Automation
Technical Report Vawtrak v2
How to measure everything - a million metrics per second with minimal develop...
Meder Kydyraliev - Mining Mach Services within OS X Sandbox
Running MongoDB Enterprise on Kubernetes
Finding target for hacking on internet is now easier
Using linuxKit to build custom rancherOS systems
Analyzing the Performance of Mobile Web
Event-driven automation, DevOps way ~IoT時代の自動化、そのリアリティとは?~
Streaming Analytics for Financial Enterprises
Automated reduction of attack surface using call graph enumeration
Top-5-production-devconMunich-2023.pptx
3-Way Scripts as a Practical Platform for Secure Distributed Code in Clouds
Ad

Recently uploaded (20)

PPT
The Effect of Human Resource Management Practice on Organizational Performanc...
PPTX
PHIL.-ASTRONOMY-AND-NAVIGATION of ..pptx
PPTX
An Unlikely Response 08 10 2025.pptx
PPTX
BIOLOGY TISSUE PPT CLASS 9 PROJECT PUBLIC
PDF
natwest.pdf company description and business model
PPTX
Hydrogel Based delivery Cancer Treatment
PPTX
Effective_Handling_Information_Presentation.pptx
PPTX
Emphasizing It's Not The End 08 06 2025.pptx
PDF
Tunisia's Founding Father(s) Pitch-Deck 2022.pdf
PPTX
Project and change Managment: short video sequences for IBA
PPTX
Human Mind & its character Characteristics
PDF
COLEAD A2F approach and Theory of Change
PDF
Instagram's Product Secrets Unveiled with this PPT
PPTX
Self management and self evaluation presentation
PPTX
Relationship Management Presentation In Banking.pptx
PPTX
The Effect of Human Resource Management Practice on Organizational Performanc...
PPTX
INTERNATIONAL LABOUR ORAGNISATION PPT ON SOCIAL SCIENCE
PPTX
Impressionism_PostImpressionism_Presentation.pptx
DOCX
"Project Management: Ultimate Guide to Tools, Techniques, and Strategies (2025)"
PPTX
Sustainable Forest Management ..SFM.pptx
The Effect of Human Resource Management Practice on Organizational Performanc...
PHIL.-ASTRONOMY-AND-NAVIGATION of ..pptx
An Unlikely Response 08 10 2025.pptx
BIOLOGY TISSUE PPT CLASS 9 PROJECT PUBLIC
natwest.pdf company description and business model
Hydrogel Based delivery Cancer Treatment
Effective_Handling_Information_Presentation.pptx
Emphasizing It's Not The End 08 06 2025.pptx
Tunisia's Founding Father(s) Pitch-Deck 2022.pdf
Project and change Managment: short video sequences for IBA
Human Mind & its character Characteristics
COLEAD A2F approach and Theory of Change
Instagram's Product Secrets Unveiled with this PPT
Self management and self evaluation presentation
Relationship Management Presentation In Banking.pptx
The Effect of Human Resource Management Practice on Organizational Performanc...
INTERNATIONAL LABOUR ORAGNISATION PPT ON SOCIAL SCIENCE
Impressionism_PostImpressionism_Presentation.pptx
"Project Management: Ultimate Guide to Tools, Techniques, and Strategies (2025)"
Sustainable Forest Management ..SFM.pptx

Oracle events hunting [POUG19]

Editor's Notes

  • #12: This article describes the calling conventions used when programming x86 architecture microprocessors. In computer software, an application binary interface (ABI) is an interface between two binary program modules; often, one of these modules is a library or operating system facility, and the other is a program that is being run by a user.
  • #13: This article describes the calling conventions used when programming x86 architecture microprocessors.
  • #14: This article describes the calling conventions used when programming x86 architecture microprocessors.
  • #16: We know how to extract the trace events number from the old ksdpec function (kernel service debug internal errors parser post event and check trigger condition using http://orafun.info/ of course 😀  ) thank to Dennis Yurichev see here and here.  We also know how to extract it from dbkdChkEventRdbmsErr (DB kernel debug check event of RDBMS error) thanks to Yong Huang see here.
  • #17: This article describes the calling conventions used when programming x86 architecture microprocessors.
  • #18: This article describes the calling conventions used when programming x86 architecture microprocessors.
  • #19: This article describes the calling conventions used when programming x86 architecture microprocessors.