135, 593 - Pentesting MSRPC

Support HackTricks

Join HackenProof Discord server to communicate with experienced hackers and bug bounty hunters!

Hacking Insights Engage with content that delves into the thrill and challenges of hacking

Real-Time Hack News Keep up-to-date with fast-paced hacking world through real-time news and insights

Latest Announcements Stay informed with the newest bug bounties launching and crucial platform updates

Join us on Discord and start collaborating with top hackers today!

Basic Information

Microsoft Remote Procedure Call (MSRPC) प्रोटोकॉल, एक क्लाइंट-सरवर मॉडल है जो एक प्रोग्राम को किसी अन्य कंप्यूटर पर स्थित प्रोग्राम से सेवा का अनुरोध करने की अनुमति देता है बिना नेटवर्क की विशिष्टताओं को समझे, यह प्रारंभ में ओपन-सोर्स सॉफ़्टवेयर से निकला था और बाद में Microsoft द्वारा विकसित और कॉपीराइट किया गया।

RPC एंडपॉइंट मैपर को TCP और UDP पोर्ट 135, SMB पर TCP 139 और 445 (एक शून्य या प्रमाणित सत्र के साथ) और TCP पोर्ट 593 पर एक वेब सेवा के रूप में एक्सेस किया जा सकता है।

135/tcp   open     msrpc         Microsoft Windows RPC

MSRPC कैसे काम करता है?

क्लाइंट एप्लिकेशन द्वारा शुरू किया गया, MSRPC प्रक्रिया एक स्थानीय स्टब प्रक्रिया को कॉल करने में शामिल होती है जो फिर क्लाइंट रनटाइम लाइब्रेरी के साथ इंटरैक्ट करती है ताकि सर्वर को अनुरोध तैयार और भेजा जा सके। इसमें पैरामीटर को एक मानक नेटवर्क डेटा प्रतिनिधित्व प्रारूप में परिवर्तित करना शामिल है। यदि सर्वर दूरस्थ है, तो परिवहन प्रोटोकॉल का चयन रनटाइम लाइब्रेरी द्वारा किया जाता है, यह सुनिश्चित करते हुए कि RPC नेटवर्क स्टैक के माध्यम से वितरित किया गया है।

https://0xffsec.com/handbook/images/msrpc.png

प्रदर्शित RPC सेवाओं की पहचान करना

TCP, UDP, HTTP, और SMB के माध्यम से RPC सेवाओं का प्रदर्शन RPC लोकेटर सेवा और व्यक्तिगत एंडपॉइंट्स को क्वेरी करके निर्धारित किया जा सकता है। rpcdump जैसे उपकरण अद्वितीय RPC सेवाओं की पहचान करने में मदद करते हैं, जिन्हें IFID मानों द्वारा दर्शाया जाता है, सेवा विवरण और संचार बाइंडिंग को प्रकट करते हैं:

D:\rpctools> rpcdump [-p port] <IP>
**IFID**: 5a7b91f8-ff00-11d0-a9b2-00c04fb6e6fc version 1.0
Annotation: Messenger Service
UUID: 00000000-0000-0000-0000-000000000000
Binding: ncadg_ip_udp:<IP>[1028]

RPC लोकेटर सेवा तक पहुँच विशेष प्रोटोकॉल के माध्यम से सक्षम है: ncacn_ip_tcp और ncadg_ip_udp पोर्ट 135 के माध्यम से पहुँच के लिए, SMB कनेक्शनों के लिए ncacn_np, और वेब-आधारित RPC संचार के लिए ncacn_http। निम्नलिखित कमांड Metasploit मॉड्यूल के उपयोग को दर्शाते हैं ताकि MSRPC सेवाओं का ऑडिट और इंटरैक्ट किया जा सके, मुख्य रूप से पोर्ट 135 पर ध्यान केंद्रित करते हुए:

use auxiliary/scanner/dcerpc/endpoint_mapper
use auxiliary/scanner/dcerpc/hidden
use auxiliary/scanner/dcerpc/management
use auxiliary/scanner/dcerpc/tcp_dcerpc_auditor
rpcdump.py <IP> -p 135

All options except tcp_dcerpc_auditor are specifically designed for targeting MSRPC on port 135.

Notable RPC interfaces

  • IFID: 12345778-1234-abcd-ef00-0123456789ab

  • Named Pipe: \pipe\lsarpc

  • Description: LSA इंटरफेस, जिसका उपयोग उपयोगकर्ताओं की सूची बनाने के लिए किया जाता है।

  • IFID: 3919286a-b10c-11d0-9ba8-00c04fd92ef5

  • Named Pipe: \pipe\lsarpc

  • Description: LSA डायरेक्टरी सेवाएँ (DS) इंटरफेस, जिसका उपयोग डोमेन और ट्रस्ट संबंधों की सूची बनाने के लिए किया जाता है।

  • IFID: 12345778-1234-abcd-ef00-0123456789ac

  • Named Pipe: \pipe\samr

  • Description: LSA SAMR इंटरफेस, जिसका उपयोग सार्वजनिक SAM डेटाबेस तत्वों (जैसे, उपयोगकर्ता नाम) तक पहुँचने और उपयोगकर्ता पासवर्ड को ब्रूट-फोर्स करने के लिए किया जाता है, चाहे खाता लॉकआउट नीति कुछ भी हो।

  • IFID: 1ff70682-0a51-30e8-076d-740be8cee98b

  • Named Pipe: \pipe\atsvc

  • Description: कार्य शेड्यूलर, जिसका उपयोग दूरस्थ रूप से कमांड निष्पादित करने के लिए किया जाता है।

  • IFID: 338cd001-2244-31f1-aaaa-900038001003

  • Named Pipe: \pipe\winreg

  • Description: रिमोट रजिस्ट्री सेवा, जिसका उपयोग सिस्टम रजिस्ट्री तक पहुँचने और उसे संशोधित करने के लिए किया जाता है।

  • IFID: 367abb81-9844-35f1-ad32-98f038001003

  • Named Pipe: \pipe\svcctl

  • Description: सेवा नियंत्रण प्रबंधक और सर्वर सेवाएँ, जिसका उपयोग दूरस्थ रूप से सेवाओं को प्रारंभ और रोकने और कमांड निष्पादित करने के लिए किया जाता है।

  • IFID: 4b324fc8-1670-01d3-1278-5a47bf6ee188

  • Named Pipe: \pipe\srvsvc

  • Description: सेवा नियंत्रण प्रबंधक और सर्वर सेवाएँ, जिसका उपयोग दूरस्थ रूप से सेवाओं को प्रारंभ और रोकने और कमांड निष्पादित करने के लिए किया जाता है।

  • IFID: 4d9f4ab8-7d1c-11cf-861e-0020af6e7c57

  • Named Pipe: \pipe\epmapper

  • Description: DCOM इंटरफेस, जिसका उपयोग ब्रूट-फोर्स पासवर्ड ग्राइंडिंग और WM के माध्यम से जानकारी एकत्र करने के लिए किया जाता है।

Identifying IP addresses

Using https://github.com/mubix/IOXIDResolver, comes from Airbus research is possible to abuse the ServerAlive2 method inside the IOXIDResolver interface.

This method has been used to get interface information as IPv6 address from the HTB box APT. See here for 0xdf APT writeup, it includes an alternative method using rpcmap.py from Impacket with stringbinding (see above).

Executing a RCE with valid credentials

It is possible to execute remote code on a machine, if the credentials of a valid user are available using dcomexec.py from impacket framework.

Remember to try with the different objects available

  • ShellWindows

  • ShellBrowserWindow

  • MMC20

Port 593

The rpcdump.exe from rpctools can interact with this port.

References

Join HackenProof Discord server to communicate with experienced hackers and bug bounty hunters!

Hacking Insights Engage with content that delves into the thrill and challenges of hacking

Real-Time Hack News Keep up-to-date with fast-paced hacking world through real-time news and insights

Latest Announcements Stay informed with the newest bug bounties launching and crucial platform updates

Join us on Discord and start collaborating with top hackers today!

Support HackTricks

Last updated