|_smb-vuln-ms10-061: false We have enumerated the users and groups on the domain but not enumerated the domain itself. -l, --log-basename=LOGFILEBASE Basename for log/debug files It can be done with the help of the createdomuser command with the username that you want to create as a parameter. rpcclient $> lookupsids S-1-5-21-1835020781-2383529660-3657267081-1009 New Folder - 6 D 0 Sun Dec 13 06:55:42 2015 Code & Process Injection. deleteform Delete form |_ https://technet.microsoft.com/en-us/library/security/ms06-025.aspx --------- ---- ------- schannel Force RPC pipe connections to be sealed with 'schannel' (NETSEC). This lab shows how it is possible to bypass commandline argument logging when enumerating Windows environments, using Cobalt Strike and its socks proxy (or any other post exploitation tool that supports socks proxying).
SMB Enumeration (Port 139, 445) - OSCP Notes - GitBook After the tunnel is up, you can comment out the first socks entry in proxychains config. getprintprocdir Get print processor directory Works well for listing and downloading files, and listing shares and permissions. INet~Services <1c> -
M To enumerate these shares the attacker can use netshareenum on the rpcclient. (MS)RPC. Adding it to the original post. SYSVOL READ ONLY, Enter WORKGROUP\root's password: dsroledominfo Get Primary Domain Information | \\[ip]\share: The alias is an alternate name that can be used to reference an object or element. | smb-vuln-ms06-025: -d, --debuglevel=DEBUGLEVEL Set debug level [Original] As Ive been working through PWK/OSCP for the last month, one thing Ive noticed is that enumeration of SMB is tricky, and different tools fail / succeed on different hosts. Hashes work. OSCP notes: ACTIVE INFORMATION GATHERING Flashcards | Quizlet Are you sure you want to create this branch? The RPC service works on the RPC protocols that form a low-level inter-process communication between different Applications. {% code-tabs-item title="attacker@kali" %}. rpcclient $> lookupsids S-1-5-21-1835020781-2383529660-3657267081-1004 The following lists commands that you can issue to SAMR, LSARPC, and LSARPC-DS interfaces upon, # You can also use samrdump.py for this purpose, Enumerate trusted domains within an AD forest. OSCP notes: ACTIVE INFORMATION GATHERING. smbmap -u '' -p '' -H $ip # similar to crackmapexec --shares, smbmap -u Administrator -p aad3b435b51404eeaad3b435b51404ee:e101cbd92f05790d1a202bf91274f2e7 -H $ip, smbmap -u Administrator -p aad3b435b51404eeaad3b435b51404ee:e101cbd92f05790d1a202bf91274f2e7 -H $ip -r # list top level dir, smbmap -u Administrator -p aad3b435b51404eeaad3b435b51404ee:e101cbd92f05790d1a202bf91274f2e7 -H $ip -R # list everything recursively, smbmap -u Administrator -p aad3b435b51404eeaad3b435b51404ee:e101cbd92f05790d1a202bf91274f2e7 -H $ip -s wwwroot -R -A '. The tool is written in Perl and is basically . In other words - it's possible to enumerate AD (or create/delete AD users, etc.) To do this first, the attacker needs a SID. In the demonstration, it can be observed that the current user has been allocated 35 privileges. rpcclient -U "" 192.168.1.100 rpcclient $> querydominfo . This lab shows how it is possible to bypass commandline argument logging when enumerating Windows environments, using Cobalt Strike and its socks proxy (or any other post exploitation tool that supports socks proxying). object in the NAME_DOMAIN.LOCAL domain and you will never see this paired value tied to another object in this domain or any other. --------------- ---------------------- debuglevel Set debug level sign Force RPC pipe connections to be signed abortshutdown Abort Shutdown My #1 SMB tip: if the exploit you're using fails despite the target appearing vulnerable, reset the machine and try again. Nice! With the free software project, , there is also a solution that enables the use of. Start by typing "enum" at the prompt and hitting <tab><tab>: rpcclient $> enum enumalsgroups enumdomains enumdrivers enumkey enumprivs enumdata enumdomgroups enumforms enumports enumtrust enumdataex enumdomusers enumjobs enumprinter. The next command that can be used via rpcclient is querydominfo. WORKGROUP <00> - M result was NT_STATUS_NONE_MAPPED -U, --user=USERNAME Set the network username # You will be asked for a password but leave it blank and press enter to continue. In there you may, many different batch, VBScript, and PowerShell, using some discovered credentials. S-1-5-21-1835020781-2383529660-3657267081-500 LEWISFAMILY\Administrator (1) # lines. (MS)RPC - OSCP Playbook remark: IPC Service (Mac OS X) To begin the enumeration, a connection needs to be established. -i, --scope=SCOPE Use this Netbios scope, Authentication options: You signed in with another tab or window. Nmap done: 1 IP address (1 host up) scanned in 5.58 seconds, # Requires root or enough permissions to use tcpdump, # Will listen for the first 7 packets of a null login, # Will sometimes not capture or will print multiple. S-1-5-21-1835020781-2383529660-3657267081-1015 LEWISFAMILY\bin (2) | Type: STYPE_DISKTREE queryaliasmem Query alias membership with a RID:[0x457] Hex 0x457 would = decimal. We can filter on ntlmssp.ntlmv2_response to see NTLMv2 traffic, for example. lsaenumacctrights Enumerate the rights of an SID In the case of queryusergroups, the group will be enumerated. Common share names for windows targets are, You can try to connect to them by using the following command, # null session to connect to a windows share, # authenticated session to connect to a windows share (you will be prompted for a password), "[+] creating a null session is possible for, # no output if command goes through, thus assuming that a session was created, # echo error message (e.g. This is an enumeration cheat sheet that I created while pursuing the OSCP. This can be done by providing the Username and Password followed by the target IP address of the server. SRVSVC Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. List of SMB versions and corresponding Windows versions: SMB1 Windows 2000, XP and Windows 2003. Server Message Block in modern language is also known as Common Internet File System. In this lab, it is assumed that the attacker/operator has gained: code execution on a target system and the beacon is calling back to the team server, to be interrogated by 10.0.0.5 via 10.0.0.2. In the demonstration, it can be observed that the user has stored their credentials in the Description. Host script results: |_ Current user access: READ path: C:\tmp deldriverex Delete a printer driver with files In this communication, the child process can make requests from a parent process. rpcclient -U '%' -N <IP> Web-Enum . When using the enumdomgroup we see that we have different groups with their respective RID and when this RID is used with the queryusergroups it reveals information about that particular holder or RID. It can be used on the rpcclient shell that was generated to enumerate information about the server. Connect to wwwroot share (try blank password), Nmap scans for SMB vulnerabilities (NB: can cause DoS), Enumerate SNMP device (places info in readable format), Enumerate file privileges (see here for discussion of file_priv), Check if current user superuser (on = yes, off = no), Check users privileges over table (pg_shadow). | State: VULNERABLE dfsgetinfo Query DFS share info This command is made from LSA Query Security Object. On most Linuxes, we have tab auto-complete of commands, which extends into rpcclient commands. so lets run rpcclient with no options to see what's available: SegFault:~ cg$ rpcclient. password: rpcclient $> srvinfo SMB - OSCP Playbook This is what happens - attacker (10.0.0.5) uses proxychains with impacket's reg utility to retrieve the hostname of the box at 10.0.0.7 (WS02) via the compromised (CS beacon) box 10.0.0.2 (WS01): The below shows traffic captures that illustrate that the box 10.0.0.2 enumerates 10.0.0.7 using SMB traffic only: Below further proves that the box 10.0.0.2 (WS01 which acted as proxy) did not generate any sysmon logs and the target box 10.0.0.7 (WS02) logged a couple of events, that most likely would not attract much attention from the blue teams: Note how only the SMB traffic between the compromised system and the DC is generated, but no new processes are spawned by the infected dllhost process: {% embed url="https://www.samba.org/samba/docs/current/man-html/rpcclient.1.html" %}, {% embed url="https://github.com/SecureAuthCorp/impacket/tree/master/examples" %}, {% embed url="https://www.cobaltstrike.com/help-socks-proxy-pivoting" %}, {% embed url="https://www.youtube.com/watch?v=l8nkXCOYQC4&index=19&list=WL&t=7s" %}. enumports Enumerate printer ports Enter WORKGROUP\root's password: Can try without a password (or sending a blank password) and still potentially connect. Host is up (0.030s latency). rpcclient $> lookupsids S-1-5-21-1835020781-2383529660-3657267081-501 You can also fire up wireshark and list target shares with smbclient , you can use anonymous listing to explained above and after that find , # smbenum 0.2 - This script will enumerate SMB using every tool in the arsenal, echo -e "\n########## Getting Netbios name ##########", echo -e "\n########## Checking for NULL sessions ##########", output=`bash -c "echo 'srvinfo' | rpcclient $IP -U%"`, echo -e "\n########## Enumerating domains ##########", bash -c "echo 'enumdomains' | rpcclient $IP -U%", echo -e "\n########## Enumerating password and lockout policies ##########", echo -e "\n########## Enumerating users ##########", nmap -Pn -T4 -sS -p139,445 --script=smb-enum-users $IP, bash -c "echo 'enumdomusers' | rpcclient $IP -U%", bash -c "echo 'enumdomusers' | rpcclient $IP -U%" | cut -d[ -f2 | cut -d] -f1 > /tmp/$IP-users.txt, echo -e "\n########## Enumerating Administrators ##########", net rpc group members "Administrators" -I $IP -U%, echo -e "\n########## Enumerating Domain Admins ##########", net rpc group members "Domain Admins" -I $IP -U%, echo -e "\n########## Enumerating groups ##########", nmap -Pn -T4 -sS -p139,445 --script=smb-enum-groups $IP, echo -e "\n########## Enumerating shares ##########", nmap -Pn -T4 -sS -p139,445 --script=smb-enum-shares $IP, echo -e "\n########## Bruteforcing all users with 'password', blank and username as password", hydra -e ns -L /tmp/$IP-users.txt -p password $IP smb -t 1, hydra -t 1 -V -f -l administrator -P /usr/share/wordlists/rockyou.txt $ip smb, nmap -p445 --script smb-brute --script-args userdb=userfilehere,passdb=/usr/share/seclists/Passwords/Common-Credentials/10-million-password-list-top-1000000.txt $ip -vvvv. With --pw-nt-hash, the pwd provided is the NT hash, #Use --no-pass -c 'recurse;ls' to list recursively with smbclient, #List with smbmap, without folder it list everything. share Disk | Comment: Default share This is made from the words get domain password information. When using querygroupmem, it will reveal information about that group member specific to that particular RID. querydispinfo Query display info Forbid the creation and modification of files? Enumerate Domain Users. Enumerating Windows Domains with rpcclient through SocksProxy == Bypassing Command Line Logging This lab shows how it is possible to bypass commandline argument logging when enumerating Windows environments, using Cobalt Strike and its socks proxy (or any other post exploitation tool that supports socks proxying). Windows NT, 2000, and XP (most SMB1) - VULNERABLE: Null Sessions can be created by default <03> - M dfsexist Query DFS support Using rpcclient we can enumerate usernames on those OSs just like a windows OS. 631 - Internet Printing Protocol (IPP) 873 - Pentesting Rsync. S-1-5-21-1835020781-2383529660-3657267081-1009 LEWISFAMILY\tty (2) SQL Injection & XSS Playground. In this article, we were able to enumerate a wide range of information through the SMB and RPC channel inside a domain using the rpcclient tool. If you're having trouble getting the version from the usual methods, you might have to use wireshark or tcpdump to inspect the packets. | Comment: Remote Admin [+] IP: [ip]:445 Name: [ip] The main application area of the protocol has been the, operating system series in particular, whose network services support SMB in a downward-compatible manner - which means that devices with newer editions can easily communicate with devices that have an older Microsoft operating system installed.