135, 593 - Pentesting MSRPC
Last updated
Last updated
Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE) Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)
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!
Protokol Microsoft Remote Procedure Call (MSRPC), model klijent-server koji omogućava programu da zatraži uslugu od programa koji se nalazi na drugom računaru bez razumevanja specifičnosti mreže, prvobitno je izveden iz softvera otvorenog koda, a kasnije je razvijen i zaštićen autorskim pravima od strane Microsoft-a.
RPC endpoint mapper može se pristupiti putem TCP i UDP porta 135, SMB na TCP 139 i 445 (sa null ili autentifikovanom sesijom), i kao web servis na TCP portu 593.
Iniciran od strane klijentske aplikacije, MSRPC proces uključuje pozivanje lokalne stub procedure koja zatim interaguje sa klijentskom runtime bibliotekom kako bi pripremila i prenela zahtev serveru. Ovo uključuje konvertovanje parametara u standardni format Network Data Representation. Izbor transportnog protokola određuje runtime biblioteka ako je server udaljen, osiguravajući da se RPC isporučuje kroz mrežni stek.
Izloženost RPC usluga preko TCP, UDP, HTTP i SMB može se odrediti upitom RPC locator servisa i pojedinačnih krajnjih tačaka. Alati kao što je rpcdump olakšavaju identifikaciju jedinstvenih RPC usluga, označenih IFID vrednostima, otkrivajući detalje usluga i komunikacione veze:
Pristup RPC locator servisu je omogućen putem specifičnih protokola: ncacn_ip_tcp i ncadg_ip_udp za pristup preko porta 135, ncacn_np za SMB veze, i ncacn_http za web-baziranu RPC komunikaciju. Sledeće komande ilustruju korišćenje Metasploit modula za audite i interakciju sa MSRPC servisima, prvenstveno fokusirajući se na port 135:
All options except tcp_dcerpc_auditor
are specifically designed for targeting MSRPC on port 135.
IFID: 12345778-1234-abcd-ef00-0123456789ab
Named Pipe: \pipe\lsarpc
Description: LSA interfejs, korišćen za enumeraciju korisnika.
IFID: 3919286a-b10c-11d0-9ba8-00c04fd92ef5
Named Pipe: \pipe\lsarpc
Description: LSA interfejs za usluge direktorijuma (DS), korišćen za enumeraciju domena i odnosa poverenja.
IFID: 12345778-1234-abcd-ef00-0123456789ac
Named Pipe: \pipe\samr
Description: LSA SAMR interfejs, korišćen za pristup javnim elementima SAM baze podataka (npr. korisnička imena) i brute-force lozinkama korisnika bez obzira na politiku zaključavanja naloga.
IFID: 1ff70682-0a51-30e8-076d-740be8cee98b
Named Pipe: \pipe\atsvc
Description: Planer zadataka, korišćen za daljinsko izvršavanje komandi.
IFID: 338cd001-2244-31f1-aaaa-900038001003
Named Pipe: \pipe\winreg
Description: Usluga daljinskog registra, korišćena za pristup i modifikaciju sistemskog registra.
IFID: 367abb81-9844-35f1-ad32-98f038001003
Named Pipe: \pipe\svcctl
Description: Menadžer kontrole usluga i server usluga, korišćen za daljinsko pokretanje i zaustavljanje usluga i izvršavanje komandi.
IFID: 4b324fc8-1670-01d3-1278-5a47bf6ee188
Named Pipe: \pipe\srvsvc
Description: Menadžer kontrole usluga i server usluga, korišćen za daljinsko pokretanje i zaustavljanje usluga i izvršavanje komandi.
IFID: 4d9f4ab8-7d1c-11cf-861e-0020af6e7c57
Named Pipe: \pipe\epmapper
Description: DCOM interfejs, korišćen za brute-force lozinki i prikupljanje informacija putem WM.
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).
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
The rpcdump.exe from rpctools can interact with this port.
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!
Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE) Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)