10.2 Service Opportunity Cheatsheet
Match the application evidence and identity context to its baseline checks.
Start the first checks →Follow the resulting credential, configuration or application lead.
Follow the finding →← Cheatsheet index · Previous: discovery and scanning · Complete procedures · Mechanics | Strategy map | Study methods: Extract opportunities from services
Use this after application identification. Commands are examples for explicitly authorized targets; replace every placeholder.
Enter with the discovery tuple and extend it:
SOURCE -> TARGET | TRANSPORT/PORT | APPLICATION EVIDENCE | COVERAGE LIMIT
| ACCESS CONTEXT | NAMESPACE/OBJECT | ACTION | RESULT | NEXT
10.2.1 Decision loop
CONFIRM APPLICATION
-> TEST LEAST-PRIVILEGED CONTEXT (anonymous/null/known credential)
-> LIST NAMESPACE BEFORE COPYING/QUERYING
-> MEASURE READ / WRITE / ADMIN / EXECUTE RIGHTS SEPARATELY
-> EXTRACT NAMES, FILES, CONFIGURATION, CREDENTIAL CLUES
-> VALIDATE THE CHEAPEST DECISIVE HYPOTHESIS
-> RE-ENUMERATE AFTER NEW IDENTITY, HOST, ROUTE OR ACCESS
| Output | Safe conclusion | Next action |
|---|---|---|
| Authentication accepted | Identity/method works for this protocol | Enumerate authorization; do not assume session/admin rights |
| Read succeeds | This identity can read that object | Inspect locally; map disclosed names/credentials |
| Write succeeds | This identity can alter that object/path | Find consumer, execution identity and trigger before claiming execution |
| Access denied | This object/action denied in this context | Try a legitimately acquired identity or a different allowed object |
| Timeout/silence | Cause unresolved | Check route, transport, version and a protocol-aware probe |
10.2.2 Find accessible files and usable access through FTP FTP
ftp TARGET
# anonymous / email-like password; then: status, pwd, ls -la, binary, get FILE
nmap -sV -p PORT --script ftp-anon,ftp-syst TARGET
curl --list-only ftp://TARGET/
curl -o FILE ftp://TARGET/path/FILE
curl --user USER --upload-file ./probe.txt ftp://TARGET/path/probe.txt
230accepts login;530rejects that login. Upload proves write only. Full FTP procedure.
10.2.3 Validate SSH identity and available access SSH
ssh -v -p PORT USER@TARGET
chmod 600 KEY
ssh -v -i KEY -p PORT USER@TARGET
nmap -p PORT --script ssh-auth-methods --script-args "ssh.user=USER" TARGET
Separate route, host-key, method, credential and shell-policy failures. Spraying/cracking is a later block. Full SSH procedure.
10.2.4 Identify mail-service identities and supported interactions SMTP
nc -nv TARGET PORT
# EHLO example.invalid
# HELP
# VRFY USER
# EXPN postmaster
# QUIT
openssl s_client -connect TARGET:587 -starttls smtp -crlf -quiet
openssl s_client -connect TARGET:465 -crlf -quiet
smtp-user-enum -M VRFY -U users.txt -t TARGET -p PORT
252is inconclusive, not a confirmed user. Compare response codes and final multiline reply. Full SMTP procedure.
10.2.5 Expand the host map through DNS records and zone transfers DNS
dig @TARGET DOMAIN SOA
dig @TARGET DOMAIN NS
dig @TARGET DOMAIN MX
dig @TARGET DOMAIN TXT
dig @TARGET -x IP
dig @TARGET DOMAIN AXFR
dnsrecon -d DOMAIN -n TARGET -t std
dnsrecon -d DOMAIN -n TARGET -D WORDLIST -t brt
dnsenum --dnsserver TARGET DOMAIN
dnsrecon -r SUBNET -n TARGET
nslookup HOST.DOMAIN TARGET
nslookup -type=TXT HOST.DOMAIN TARGET
AXFR refusal disproves only that transfer attempt.
NXDOMAINdiffers fromNOERRORwith no answer. Check wildcard results. Full DNS procedure.
10.2.6 Find accessible exports and validate their permission mappings NFS and Unix RPC
10.2.6.1 rpcinfo -p TARGET
rpcinfo -p TARGET
showmount -e TARGET
nmap -sV -p 111,2049 --script nfs-showmount,nfs-ls,nfs-statfs TARGET
sudo mkdir -p /mnt/nfs-audit
sudo mount -t nfs -o ro,vers=3,nolock TARGET:/EXPORT /mnt/nfs-audit
ls -lan /mnt/nfs-audit
find /mnt/nfs-audit -maxdepth 3 -ls
sudo umount /mnt/nfs-audit
10.2.6.2 Only when a harmless write check is required:
# Only when a harmless write check is required:
sudo mount -t nfs -o rw,vers=3,nolock TARGET:/EXPORT /mnt/nfs-audit
touch /mnt/nfs-audit/probe-file
ls -ln /mnt/nfs-audit/probe-file
rm /mnt/nfs-audit/probe-file
sudo umount /mnt/nfs-audit
NFSv4-only servers may not answer
showmount. Interpret numeric UID/GID,root_squash, write rights and privileged consumption separately. Full Unix file-services procedure.
10.2.6.3 Rsync daemon — list modules, then retrieve selected artifacts
nmap -sV -p 873 --script rsync-list-modules TARGET
rsync rsync://TARGET/
rsync --list-only rsync://TARGET/MODULE/
rsync -av rsync://TARGET/MODULE/path/FILE ./FILE
A module listing proves namespace visibility, not read/write/execute. Retrieve only selected material; never use remote
--deleteduring enumeration. Interpretation and variants.
10.2.6.4 TFTP — retrieve an evidence-backed filename
tftp TARGET
tftp> binary
tftp> get FILE
tftp> quit
TFTP has no directory listing or login step. A timeout does not distinguish a missing name, blocked UDP or transfer-policy failure. Upload only when the objective requires a write check and a cleanup route exists. Interpretation and write boundary.
10.2.7 Find shares, identities and rights through SMB and RPC SMB and MS-RPC
Run/context: SMB/RPC clients run on the testing workstation against the named server, using an explicit anonymous, local or domain identity. Decide: share listing does not establish file read, write or execution. Validate the exact object with the complete SMB procedure; send a recovered secret to credential classification, and record a denied object as denied in this context.
smbclient -N -L //TARGET
smbclient -L //TARGET -U 'DOMAIN/USER'
smbclient //TARGET/SHARE -U 'DOMAIN/USER'
smbclient -L //TARGET -U 'TARGET/USER'
smbclient -L //TARGET -U 'guest%'
# pwd, ls, allinfo FILE, get FILE
rpcclient -U '' -N TARGET
rpcclient -U 'DOMAIN/USER' TARGET
# srvinfo, enumdomains, enumdomusers, enumdomgroups, queryuser RID, netshareenumall
nxc smb TARGET -u USER -p PASSWORD --shares
enum4linux-ng -A TARGET
nmap -p 139,445 --script smb-protocols,smb2-security-mode,smb2-time TARGET
net view \\TARGET /all
Get-ChildItem \\TARGET\SHARE
Get-Content \\TARGET\SHARE\FILE
Null, guest and authenticated sessions can expose different namespaces. Confirm useful results manually. Full SMB/RPC procedure.
10.2.8 Find configuration and process leads through readable SNMP objects SNMP
10.2.8.1 onesixtyone -c COMMUNITY_FILE TARGET
onesixtyone -c COMMUNITY_FILE TARGET
snmpwalk -v2c -c COMMUNITY TARGET 1.3.6.1.2.1
snmpbulkwalk -v2c -c COMMUNITY TARGET 1.3.6.1.2.1
10.2.8.2 users, processes, installed software, TCP listeners
# users, processes, installed software, TCP listeners
snmpwalk -v1 -c COMMUNITY TARGET 1.3.6.1.4.1.77.1.2.25
snmpwalk -v1 -c COMMUNITY TARGET 1.3.6.1.2.1.25.4.2.1.2
snmpwalk -v1 -c COMMUNITY TARGET 1.3.6.1.2.1.25.6.3.1.2
snmpwalk -v1 -c COMMUNITY TARGET 1.3.6.1.2.1.6.13.1.3
snmpwalk -v3 -l authPriv -u USER -a SHA -A AUTH_PASSWORD -x AES -X PRIV_PASSWORD TARGET 1.3.6.1.2.1
No response can be community, version, OID, loss or filtering. A write community is not permission to alter state during enumeration. Full SNMP procedure.
10.2.9 Find domain identities and validate directory access LDAP and Kerberos
ldapsearch -x -LLL -H ldap://DC_IP:389 -s base -b '' defaultNamingContext dnsHostName
ldapsearch -x -LLL -H ldap://DC_HOST:389 -D 'USER@DOMAIN' -W \
-b 'DC=DOMAIN,DC=TLD' '(&(objectCategory=person)(objectClass=user))' \
sAMAccountName userPrincipalName memberOf description servicePrincipalName
getent hosts DC_HOST
nc -nvz DC_IP 88
date -u
RootDSE may work when anonymous directory search does not. Kerberos failures often come from DNS/hostname/SPN/time/route rather than the password. Full LDAP/Kerberos procedure.
10.2.10 Determine which database data and operations your identity can access Databases
10.2.10.1 Inspect MySQL identity, readable data and file-operation rights MySQL / MariaDB
mysql -h TARGET -P PORT -u USER -p
SELECT VERSION(), USER(), CURRENT_USER();
SHOW DATABASES;
SHOW GRANTS;
USE DATABASE;
SHOW TABLES;
SELECT * FROM TABLE LIMIT 20;
SELECT @@secure_file_priv;
10.2.10.2 Inspect SQL Server identity, grants and available operations MSSQL
impacket-mssqlclient 'USER@TARGET'
impacket-mssqlclient 'DOMAIN/USER@TARGET' -windows-auth
SELECT @@VERSION;
SELECT SYSTEM_USER;
SELECT IS_SRVROLEMEMBER('sysadmin');
SELECT name FROM sys.databases;
10.2.10.3 Inspect PostgreSQL identity, data and server-side operation rights PostgreSQL
psql -h TARGET -p PORT -U USER -d postgres
# \conninfo \l \du \dn \dt *.*
SELECT version(), current_user, session_user;
SELECT pg_has_role(current_user, 'pg_execute_server_program', 'member');
DB admin is not OS admin. Server file/program functions act as the DB service identity and require explicit grants. Full database procedure.
10.2.11 Validate the remote services your Windows identity can access Windows remote access
xfreerdp3 /v:TARGET /u:USER /d:DOMAIN /auth-only /cert:ignore
xfreerdp3 /v:TARGET /u:USER /d:DOMAIN /dynamic-resolution /cert:ignore
nmap -p 3389 --script rdp-enum-encryption,rdp-ntlm-info TARGET
evil-winrm -i TARGET -u USER
evil-winrm -i TARGET -u 'DOMAIN\\USER'
evil-winrm -i TARGET -u USER -S -P 5986
$cred = Get-Credential
Enter-PSSession -ComputerName TARGET -Credential $cred
Valid credentials may still lack RDP logon or WinRM endpoint rights. Check the installed FreeRDP/Evil-WinRM help for version-specific spelling. Full Windows remote-access procedure.
10.2.11.1 Host-side RDP decision check — local administrative context
Get-Service TermService
reg query "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections
reg query "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v PortNumber
reg query "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v UserAuthentication
qwinsta
net localgroup "Remote Desktop Users"
$policy = Join-Path $env:TEMP 'rdp-user-rights.inf'
secedit /export /mergedpolicy /areas user_rights /cfg $policy /quiet
Select-String -Path $policy -Pattern '^SeRemoteInteractiveLogonRight','^SeDenyRemoteInteractiveLogonRight'
fDenyTSConnections = 0permits RDP at the local setting; check applied GPO when policy may override it.UserAuthentication = 1requires NLA. The candidate needs an effectiveSeRemoteInteractiveLogonRight, and any applicableSeDenyRemoteInteractiveLogonRightwins. Confirm the configured port from the actual source before testing authentication. Full interpretation and policy-precedence sequence.
10.2.12 New-state triggers
| New finding | Immediate study/practice action |
|---|---|
| Hostname or IP | Confirm scope, resolve both directions, run discovery/service identification |
| Username/domain | Record confidence and source; do not promote ambiguous SMTP output to confirmed |
| Credential/key | Identify local/domain context and likely services; perform one controlled validation |
| Readable file | Preserve metadata and inspect locally for paths, names, keys and configuration |
| Writable path | Identify consumer, execution identity and trigger before testing exploitation |
| Remote session | Verify host/identity/IP, then re-enumerate local privileges, files, listeners and routes |
10.2.13 Map accessible shares and domain leads with your accepted SMB identity SMBMap and authenticated SMB/RPC collection
Use an accepted account and reachable SMB; inspect one share before downloading a selected file.
smbmap -H TARGET -d DOMAIN -u USER -p 'PASSWORD' --no-write-check
smbmap -H TARGET -d DOMAIN -u USER -p 'PASSWORD' -r 'SHARE' --depth 2 --no-write-check
smbmap -H TARGET -d DOMAIN -u USER -p 'PASSWORD' --download 'SHARE\PATH\FILE' --no-write-check
enum4linux-ng -A -w DOMAIN -u USER -p 'PASSWORD' TARGET
A readable config/backup → classify the value and test the matching service. Share-list denial does not rule out a known share path. Full SMB/RPC procedure.
10.2.14 Discover and recognize candidates
Use these discovery checks to find a candidate, then validate the missing conditions. Cues are illustrative; complete synthetic outputs and three-outcome examples are in the linked study entries.
10.2.14.1 Extract opportunities from services
10.2.14.1.1 Find: Use anonymous or authenticated FTP file access
After identifying FTP, test the allowed anonymous context or one known credential and inspect its directory namespace.
curl -v ftp://TARGET/
curl -v --user 'USER:PASSWORD' ftp://TARGET/
Recognize: A listing identifies candidate artifacts; a completed RETR with recognizable bytes establishes read access.
Validate next: Validate the account context, file contents, data-channel reachability and any separate write/consumer conditions.
Use anonymous or authenticated FTP file access.
10.2.14.1.2 Commands and use-case variants
Need: A confirmed reachable application; anonymous context or one identified credential. Anonymous login allowed or a valid FTP identity; data-channel connectivity and object-specific read/write rights
Recognize: FTP usually appears on TCP/21, but trust an FTP banner or protocol response on any port. Goal: determine authentication, listable/readable content and effective write locations.
10.2.14.1.2.1 Baseline: anonymous access
ftp TARGET
At the prompts, try user anonymous and an email-like password. Then:
status
pwd
ls -la
binary
get FILE
quit
If login succeeds but listing/transfer fails, use the client's passive command to toggle data-channel mode and retry once before changing credentials.
Decisive output: code
230accepts the login; directory listings and successfulRETRestablish read access. Inspect downloaded backups, configuration, keys and source locally. Store target artifacts outside this public repository.
10.2.14.1.2.1.1 Variant — authenticated FTP
ftp TARGET
Enter USER and the password when prompted. Enumerate from the authenticated root again; it may expose a different namespace than anonymous access.
10.2.14.1.2.1.2 Variant — known-user password list
Use only for a scoped account with understood lockout/attempt constraints; first test any already recovered credential normally. With Test bounded online password candidates with a reliable failure signal:
hydra -l USER -P /PATH/passwords.txt -t 1 -f -o ftp-found.txt TARGET ftp
For a nonstandard FTP port:
hydra -l USER -P /PATH/passwords.txt -t 1 -f -s PORT -o ftp-found.txt TARGET ftp
One task limits concurrency, not lockout risk. Stop on lockout or repeated transport errors. Confirm an accepted pair with the authenticated FTP client above, then enumerate permissions again. FTP, FTPS and SSH/SFTP require the correct protocol context. Working-note FTP entry.
10.2.14.1.2.1.3 Variant — curl listing, download and bounded write test
curl --list-only ftp://TARGET/
curl -o FILE ftp://TARGET/path/FILE
curl --user USER ftp://TARGET/
curl --user USER -o FILE ftp://TARGET/path/FILE
curl --user USER --upload-file ./probe.txt ftp://TARGET/path/probe.txt
Omit --user for anonymous access. Let curl prompt for an authenticated password instead of placing it in shell history. Upload only a harmless uniquely named probe when write validation is necessary and authorized; remove it through the FTP client after the test.
10.2.14.1.2.1.4 Variant — focused Nmap helpers
nmap -sV -p PORT --script ftp-anon,ftp-syst TARGET
ftp-anon checks anonymous login and may flag writable entries; ftp-syst asks for server/system information. Manually confirm useful access with a protocol client.
Failure cues:
530means that login was rejected, not that FTP has no other usable identity. A listing failure after230may be a data-channel/passive-mode or authorization problem. A successful upload proves write access only; it does not prove that a web server, scheduled task or privileged process consumes that file.
Next action: inspect recovered files; record exact read/write boundaries; validate any new credential once against its likely service; send a writable-consumer hypothesis to the appropriate web, execution or privilege-escalation block.
Verify: Retrieve recognizable bytes or independently verify an uploaded canary; distinguish listing, read and write rights.
If it fails: Login succeeds but transfers hang: diagnose the data path. A writable upload directory alone does not establish command execution.
10.2.14.1.3 Find: Use SSH passwords, keys and forwarding-capable access
Find SSH in service discovery, then trace a candidate password/key back to its recorded user before a bounded authentication attempt.
ssh -v -p PORT USER@TARGET
ssh -v -i KEY -p PORT USER@TARGET
Recognize: Accepted key authentication plus a verified shell identity establishes that specific login, not root or unrestricted forwarding.
Validate next: Check actual account/shell/subsystem and separately inspect forwarding policy if a tunnel is needed.
Use SSH passwords, keys and forwarding-capable access.
10.2.14.1.4 Commands and use-case variants
Need: A confirmed reachable application; anonymous context or one identified credential. Compatible authentication method, correct user, accepted key policy and the requested shell/subsystem permission
Recognize: SSH commonly uses TCP/22. Prerequisite for access: an accepted authentication method plus a permitted account/session context.
10.2.14.1.4.1 Baseline: validate one known identity
ssh -v -p PORT USER@TARGET
Decisive output: the debug trace separates connection, host-key negotiation, offered authentication methods and account acceptance. A shell prompt establishes session access as that identity.
10.2.14.1.4.1.1 Variant — private key
chmod 600 KEY
ssh -v -i KEY -p PORT USER@TARGET
The key must correspond to an authorized public key for that account. Permission denied (publickey) can mean wrong user, wrong key, server policy or account restrictions.
10.2.14.1.4.1.2 Variant — discover methods for a known username
nmap -p PORT --script ssh-auth-methods --script-args "ssh.user=USER" TARGET
This starts an authentication exchange and is logged; Nmap classifies it as intrusive. Use it only when the supported methods change the next decision.
10.2.14.1.4.1.3 Variant — non-interactive key check
ssh -o BatchMode=yes -o ConnectTimeout=5 -i KEY -p PORT USER@TARGET 'id'
Batch mode will not prompt for passwords or key passphrases. It is useful only when the key is already usable non-interactively.
Failure cues: timeout suggests route/filtering/service issues; refusal means no accepting listener in that context; host-key failure occurs before user authentication;
Permission deniedproves that the attempted method/context failed, not that every credential is invalid. A valid account may still have no shell or be restricted by server policy.
Next action: after a shell, verify
whoami, groups, hostname and addresses, then re-enumerate locally. Password spraying and key-passphrase cracking belong to the credential-attack block, not this procedure.
Verify: Run hostname and id in the resulting context; retain whether a shell, SFTP or only forwarding was actually granted.
If it fails: Permission denied may be username, key, passphrase, policy or method mismatch. A successful banner exchange proves none of these.
10.2.14.1.5 Find: Enumerate SMTP identities and accessible mailbox protocols
Identify mail-related listeners, inspect greeting/capabilities and compare permitted user-discovery replies with a known-invalid control.
nc -nv TARGET 25
Then enter the protocol dialogue:
EHLO example.invalid
VRFY USER
VRFY INVALID_CONTROL
QUIT
Recognize: A reproducible reply difference can expose a possible mailbox identity.
Validate next: Check catch-all policy and account context; recipient acceptance does not prove mailbox credentials or OS access.
Enumerate SMTP identities and accessible mailbox protocols.
10.2.14.1.6 Commands and use-case variants
Need: A confirmed reachable application; anonymous context or one identified credential. Reachable SMTP/POP3/IMAP service; enumeration or mailbox access must be enabled for the selected context
Recognize: SMTP commonly uses TCP/25, submission uses 587, and implicit TLS commonly uses 465. Goal: collect banner/capabilities, mail-domain clues and only defensible user evidence.
10.2.14.1.6.1 Baseline: banner and capabilities
nc -nv TARGET PORT
Then enter:
EHLO example.invalid
HELP
VRFY USER
EXPN postmaster
QUIT
Decisive output:
250-capability lines reveal extensions such as STARTTLS or AUTH.250afterVRFYmay support a valid mailbox;550commonly rejects or denies it;252explicitly means the server will not verify and is not proof that the user exists.
10.2.14.1.6.1.1 Variant — STARTTLS or implicit TLS
openssl s_client -connect TARGET:587 -starttls smtp -crlf -quiet
openssl s_client -connect TARGET:465 -crlf -quiet
Run EHLO example.invalid after TLS negotiation. Certificate names and capabilities can yield host/domain clues; authentication still requires a supported identity and mechanism.
10.2.14.1.6.1.2 Variant — focused automated user checks
smtp-user-enum -M VRFY -U users.txt -t TARGET -p PORT
smtp-user-enum -M RCPT -U users.txt -t TARGET -p PORT
RCPT testing requires an SMTP transaction and servers may deliberately normalize responses. Treat automation as candidate generation and manually compare decisive responses.
10.2.14.1.6.1.3 Variant — Windows source position
Test-NetConnection -ComputerName TARGET -Port PORT
This verifies TCP reachability only. Use an available Netcat/Ncat or OpenSSL client for protocol dialogue.
Failure cues: multiline replies begin with
NNN-and finish withNNN; read the final line.503often means the command sequence is wrong. Uniform252or550responses make enumeration inconclusive. A visible AUTH method does not mean anonymous relay or valid credentials.
Next action: add confirmed/candidate names and domains to the private evidence ledger; test new names only in the later credential block. Do not send real mail or run relay checks unless the objective requires it.
10.2.14.1.6.2 POP3 and IMAP handoff
Mail-access services expose mailbox capabilities and, with legitimate credentials, stored messages that may contain workflow or reset links.
openssl s_client -connect TARGET:995 -crlf -quiet # POP3S
openssl s_client -connect TARGET:993 -crlf -quiet # IMAPS
POP3 dialogue:
CAPA
USER USER
PASS PASSWORD
STAT
LIST
QUIT
IMAP dialogue:
a1 CAPABILITY
a2 LOGIN USER PASSWORD
a3 LIST "" "*"
a4 LOGOUT
Test one legitimately acquired credential. Capability output is not authentication; avoid brute-force NSE scripts until lockout/authorization is explicitly understood. Source supplement: reviewed getSH Nmap mail blocks.
Verify: Record response/control differences and separate inferred account existence from successful mailbox authentication.
If it fails: Uniform replies, disabled VRFY or a catch-all make username enumeration inconclusive; investigate other identity sources.
10.2.14.1.7 Find: Expand names through DNS records and zone transfers
Use DNS-server evidence and discovered domain names to query authority and specific records before considering a transfer.
dig @TARGET DOMAIN SOA
dig @TARGET DOMAIN NS
dig @TARGET DOMAIN AXFR
Recognize: An authoritative zone and returned records can expose hostnames, aliases and applications needing separate enumeration.
Validate next: Check each new name's scope/address and verify host/virtual-host behavior.
Expand names through DNS records and zone transfers.
10.2.14.1.8 Commands and use-case variants
Need: A confirmed reachable application; anonymous context or one identified credential. Reachable DNS transport and relevant authoritative zone; AXFR requires an allowed TCP zone transfer
Recognize: DNS uses UDP/53 for most queries and TCP/53 for operations including conventional zone transfers and oversized responses. Prerequisite: a known or inferred domain for meaningful record and name enumeration.
10.2.14.1.8.1 Baseline: query the target DNS server directly
dig @TARGET DOMAIN SOA
dig @TARGET DOMAIN NS
dig @TARGET DOMAIN A
dig @TARGET DOMAIN MX
dig @TARGET DOMAIN TXT
Decisive output:
ANSWERrecords disclose names, addresses, mail exchangers or text. Theaaflag supports an authoritative answer. Recordstatusseparately from the answer count.
10.2.14.1.8.1.1 Variant — reverse lookup and zone transfer
dig @TARGET -x IP
dig @TARGET DOMAIN AXFR
A successful AXFR returns the zone records and closing SOA. Transfer failed, REFUSED or NOTAUTH only disproves an unauthenticated transfer from this source; continue ordinary queries.
10.2.14.1.8.1.2 Variant — name guessing after the domain is known
dnsrecon -d DOMAIN -n TARGET -t std
dnsrecon -d DOMAIN -n TARGET -D WORDLIST -t brt
dnsenum --dnsserver TARGET DOMAIN
Check wildcard behavior before trusting large result sets. Every resolved in-scope name becomes a new discovery/service-enumeration input.
10.2.14.1.8.1.3 Variant — reverse sweep of an explicitly assigned range
dnsrecon -r SUBNET -n TARGET
Use this only when the entire SUBNET is assigned. PTR names are clues; resolve/scan only in-scope results.
10.2.14.1.8.1.4 Variant — host and Windows nslookup
host -t mx DOMAIN TARGET
host -t txt DOMAIN TARGET
nslookup HOST.DOMAIN TARGET
nslookup -type=TXT HOST.DOMAIN TARGET
nslookup -type=MX DOMAIN TARGET
Failure cues:
NXDOMAINmeans that queried name does not exist in that view;NOERRORwith no answer can mean the name exists but lacks that record type. Timeout can be filtering, loss or a silent/unreachable server. A recursive answer does not establish that the server is authoritative.
Next action: add new hostnames/IPs to the scoped queue, correlate naming roles with observed services, and repeat discovery/service identification for those in-scope endpoints.
Verify: Identify responding server, record type, answer and zone authority; transfer refusal disproves only that transfer/context.
If it fails: No answer may mean wrong server, recursion policy, transport or zone. Resolve authoritative context before retrying AXFR.
10.2.14.1.9 Find: Inspect RPC/NFS exports and effective file identity
Follow RPC/NFS discovery with export inspection, then examine actual ownership/mapping on an allowed mount.
rpcinfo -p TARGET
showmount -e TARGET
Recognize: An export lists a filesystem candidate and client policy; it does not establish file access or trusted UID 0.
Validate next: Use the owning procedure to verify NFS version, allowed client, numeric identity mapping, read/write and squash/mount policy.
Inspect RPC/NFS exports and effective file identity.
10.2.14.1.10 Commands and use-case variants
Need: A confirmed reachable application; anonymous context or one identified credential. Reachable RPC/NFS transports, permitted client address and an export whose UID/GID mapping grants relevant access
Recognize: rpcbind commonly appears on TCP/UDP 111 and NFS on TCP/UDP 2049, with additional dynamically assigned RPC ports. Goal: find exports, allowed client ranges and effective UID/GID-based permissions.
10.2.14.1.10.1 Baseline: list RPC services and exports
rpcinfo -p TARGET
showmount -e TARGET
Decisive output:
rpcinfomaps RPC programs to versions/transports/ports.showmount -ereturns exports and apparent allowed clients, but NFSv4-only servers may not expose the mount service andshowmountcompleteness varies by implementation.
10.2.14.1.10.1.1 Variant — Nmap without mounting
nmap -sV -p 111,2049 --script nfs-showmount,nfs-ls,nfs-statfs TARGET
The scripts can list exports, file attributes and access flags. Confirm access manually when a finding matters.
10.2.14.1.10.1.2 Variant — mount read-only first
sudo mkdir -p /mnt/nfs-audit
sudo mount -t nfs -o ro,vers=3,nolock TARGET:/EXPORT /mnt/nfs-audit
find /mnt/nfs-audit -maxdepth 3 -ls
sudo umount /mnt/nfs-audit
If version 3 fails and version 4 is advertised, retry with -o ro,vers=4. NFSv4 may present a pseudo-filesystem whose export path differs from showmount output.
10.2.14.1.10.1.3 Variant — inspect numeric ownership
ls -lan /mnt/nfs-audit
find /mnt/nfs-audit -maxdepth 3 -type f -readable -ls
NFS commonly authorizes Unix identities by numeric UID/GID. A matching local username is irrelevant if its number differs. root_squash usually maps remote UID 0 to an unprivileged identity; no_root_squash is dangerous but still requires a useful writable object and privileged consumption path.
10.2.14.1.10.1.4 Variant — bounded write verification
sudo mount -t nfs -o rw,vers=3,nolock TARGET:/EXPORT /mnt/nfs-audit
touch /mnt/nfs-audit/probe-file
ls -ln /mnt/nfs-audit/probe-file
rm /mnt/nfs-audit/probe-file
sudo umount /mnt/nfs-audit
Use a unique harmless name only when write validation is needed and authorized. Record the resulting numeric owner/group. Success proves write in that directory, not execution or privileged ownership.
Failure cues:
showmountfailure does not rule out NFSv4.access denied by servercan mean export client restrictions or wrong path/version.permission deniedafter mounting is file authorization, not network failure. Do not change local UIDs or write to an export during concept study.
Next action: inspect readable backups, home data, keys and configuration; record numeric ownership and actual write boundaries; send a writable/privileged-consumer hypothesis to the escalation block.
10.2.14.1.10.2 Rsync daemon — list modules before copying
Recognize: an rsync daemon normally listens on TCP/873, although the application can use another port. The daemon namespace uses
HOST::MODULEorrsync://HOST/MODULE; a single colon is SSH/remote-shell syntax and is a different access path.
nmap -sV -p 873 --script rsync-list-modules TARGET
rsync rsync://TARGET/
rsync --list-only rsync://TARGET/MODULE/
Decisive output: a named module and a file listing establish only that the current anonymous or supplied account can enumerate that namespace. Read access is proven by retrieving selected bytes, not by the module name.
10.2.14.1.10.2.1 Variant — retrieve a selected file or a reviewed module
10.2.14.1.10.2.2 One selected artifact
# One selected artifact
rsync -av rsync://TARGET/MODULE/path/FILE ./FILE
10.2.14.1.10.2.3 A reviewed module into a dedicated local evidence directory
# A reviewed module into a dedicated local evidence directory
mkdir -p ./rsync-MODULE
rsync -av --safe-links rsync://TARGET/MODULE/ ./rsync-MODULE/
--safe-links ignores symbolic links that point outside the copied tree. Review module size and content first; do not mirror a large tree by default. If authentication is required, let rsync prompt or use a protected --password-file rather than putting a password on the command line.
Failure cues: no listed modules can mean the daemon hides its module list;
@ERROR: auth failedis an authentication boundary;@ERROR: Unknown moduleis a namespace error; a listed module can still deny individual reads or writes.Next action: inspect selected readable backups, keys, source and configuration locally. Treat a writable module as file placement only until a specific consumer, destination identity and trigger are proven. Do not use
--deleteagainst a remote module during enumeration.
10.2.14.1.10.3 TFTP — known-name retrieval only
Recognize: TFTP normally uses UDP/69 for the initial request and has no directory-listing or login model. It is useful only when configuration, source, boot metadata or another service gives a plausible filename.
tftp TARGET
tftp> binary
tftp> get FILE
tftp> quit
Decisive output: a completed transfer plus recognizable local bytes establishes read access to that exact name. A timeout is ambiguous because the UDP request, server policy, transfer port or filename can fail without a useful error.
10.2.14.1.10.3.1 Variant — bounded write check only when the objective requires it
printf '%s\n' 'TFTP_WRITE_CANARY' > tftp-probe.txt
tftp TARGET
tftp> binary
tftp> put tftp-probe.txt
tftp> quit
Use a unique harmless filename and only when write capability changes the next decision. TFTP normally offers no remote delete operation; do not create a probe unless you already have an authorized cleanup route.
Next action: inspect a retrieved artifact and follow only evidence-backed filenames. A successful upload is not execution; prove the server-side path and consumer separately.
Verify: Verify the export, mapped identity, actual bytes and any created file's server-side ownership.
If it fails: An empty showmount response does not rule out NFSv4. Mount failure may be transport/export/client-policy rather than absence of files.
10.2.14.1.11 Find: Inspect rsync modules and retrieve selected artifacts
After application identification shows an rsync daemon, list visible modules and inspect one selected namespace before copying data.
nmap -sV -p 873 --script rsync-list-modules TARGET
rsync rsync://TARGET/
rsync --list-only rsync://TARGET/MODULE/
Recognize: A visible module and file listing identify an rsync namespace; they do not establish write or execution.
Validate next: Retrieve one selected file and verify its bytes; record anonymous or supplied-account context.
10.2.14.1.12 Find: Retrieve an evidence-backed file over TFTP
Use TFTP only after another artifact or boot/configuration clue supplies a plausible exact filename.
tftp TARGET
tftp> binary
tftp> get FILE
tftp> quit
Recognize: The exact known filename is retrievable; TFTP still exposes no general directory namespace.
Validate next: Verify recognizable bytes and provenance; distinguish read from any separately required write test.
10.2.14.1.13 Find: Enumerate SMB/RPC shares, files and identities
Start from confirmed SMB and explicitly compare anonymous versus a known authenticated context, then open a relevant named share.
smbclient -L //TARGET -N
smbclient -L //TARGET -U 'DOMAIN/USER'
Recognize: A share name supplies a filesystem investigation target; listing it does not prove read, write or service creation.
Validate next: Connect to the named share under the identity that listed it, then ls/get the exact object. Listing a share does not prove read or write. For a write candidate, verify the path operation and identify a separate execution consumer before treating it as access.
Enumerate SMB/RPC shares, files and identities.
10.2.14.1.14 Commands and use-case variants
Need: A confirmed reachable application; anonymous context or one identified credential. Reachable SMB/RPC; anonymous, guest, local or domain context must be explicit; share and filesystem ACLs both matter
Recognize: direct-hosted SMB commonly uses TCP/445; NetBIOS session service commonly uses TCP/139; MS-RPC endpoint mapping commonly uses TCP/135. They are related Windows surfaces but not interchangeable. Goal: distinguish null, guest and authenticated contexts; enumerate shares, files, users, groups, domain/workgroup clues and actual permissions.
10.2.14.1.14.1 Baseline: list shares without credentials
smbclient -N -L //TARGET
Decisive output: a share list proves that this access context can enumerate names. It does not prove access to share contents.
NT_STATUS_ACCESS_DENIEDmeans this context was denied; repeat after obtaining a legitimate credential.
10.2.14.1.14.1.1 Variant — authenticated share listing and connection
smbclient -L //TARGET -U 'DOMAIN/USER'
smbclient //TARGET/SHARE -U 'DOMAIN/USER'
smbclient -L //TARGET -U 'TARGET/USER'
smbclient -L //TARGET -U 'guest%'
The first two forms use a domain identity, the third makes a local target account explicit, and the fourth tests a guest account with an empty password. Let the client prompt for non-empty passwords. Inside the share:
pwd
ls
allinfo FILE
get FILE
mkdir probe-dir
rmdir probe-dir
exit
Use a harmless uniquely named directory only when write permission must be verified. A successful create/remove establishes share-level write access, not code execution.
10.2.14.1.14.1.2 Variant — recursive retrieval
smbclient //TARGET/SHARE -U 'DOMAIN/USER' -c 'recurse ON;prompt OFF;mget *'
Run from a dedicated local evidence directory and review expected volume first. Search downloaded configuration, scripts, backups, keys and unattended-install files locally; never publish recovered data.
10.2.14.1.14.1.3 Variant — RPC null or authenticated session
rpcclient -U '' -N TARGET
rpcclient -U 'DOMAIN/USER' TARGET
Useful interactive queries:
srvinfo
enumdomains
enumdomusers
enumdomgroups
queryuser RID
netshareenumall
quit
Null-session denial is common on modern systems. Authenticated output must be labelled with the identity that produced it.
10.2.14.1.14.1.4 Variant — fast permission summary and consolidated candidates
nxc smb TARGET -u USER -p PASSWORD --shares
enum4linux-ng -A TARGET
NetExec (nxc) is the current command name on recent Kali releases; older material may use crackmapexec. These tools consolidate candidates. Confirm useful shares and files with smbclient or native access.
10.2.14.1.14.1.5 Variant — protocol, signing and time clues
nmap -p 139,445 --script smb-protocols,smb2-security-mode,smb2-time TARGET
Signing and dialect results affect later relay/exploit decisions but are not vulnerabilities by themselves. The older smb-os-discovery script depends on SMBv1 behavior and may not identify modern hosts reliably.
10.2.14.1.14.1.6 Variant — Windows built-ins
net view \\TARGET /all
Get-ChildItem \\TARGET\SHARE
Get-Content \\TARGET\SHARE\FILE
These use the current Windows logon context unless alternate credentials or mappings are established. An existing connection to the same server under another identity can cause credential-conflict errors.
10.2.14.1.14.1.7 SMBMap — map rights, then read one useful file
Use from Kali when SMB is reachable. Choose the same domain/local identity that worked with smbclient. Suppress write probes when inventorying reads; this means a writable label is not being tested here.
10.2.14.1.14.1.8 Known domain account: enumerate share access without creating a probe file
# Known domain account: enumerate share access without creating a probe file
smbmap -H TARGET -d DOMAIN -u USER -p 'PASSWORD' --no-write-check
10.2.14.1.14.1.9 Inspect the selected share to a bounded depth
# Inspect the selected share to a bounded depth
smbmap -H TARGET -d DOMAIN -u USER -p 'PASSWORD' -r 'SHARE' --depth 2 --no-write-check
10.2.14.1.14.1.10 Download the specific file found above
# Download the specific file found above
smbmap -H TARGET -d DOMAIN -u USER -p 'PASSWORD' --download 'SHARE\PATH\FILE' --no-write-check
Read: a listed file must still be readable under this identity. A downloaded config/backup → classify its credential material, then test only the relevant account/service. A denied share → try another listed share or a newly obtained identity; do not infer a host-wide denial.
SMBMap upstream. For broader SMB/RPC collection, use the existing enum4linux-ng baseline; authenticate explicitly when credentials exist:
10.2.14.1.14.1.11 No credentials: anonymous RPC/SMB candidates
# No credentials: anonymous RPC/SMB candidates
enum4linux-ng -A TARGET
10.2.14.1.14.1.12 Known identity: domain objects visible to this account
# Known identity: domain objects visible to this account
enum4linux-ng -A -w DOMAIN -u USER -p 'PASSWORD' TARGET
Next: validate returned users/groups/shares with rpcclient or smbclient. A collector can return partial data despite a successful login.
Failure cues: distinguish connection failure, authentication failure, share enumeration denial and file authorization denial. A share named
IPC$is not a general file share. Guest acceptance may look like success while returning a restricted namespace. A share marked writable still needs a consumer/trigger before it becomes an execution path.
Next action: inspect readable content, record per-share rights, validate names/domain clues, and re-run authenticated enumeration whenever identity changes. Move file-consumer hypotheses to web/execution/escalation and signing/relay hypotheses to the later credential/AD blocks.
10.2.14.1.14.2 NetBIOS names before SMB enumeration
Use when UDP/137 or SMB suggests Windows names but DNS/domain identity is unclear.
# Ask the assigned host for its NetBIOS names
nbtscan TARGET
nmblookup -A TARGET
Read: a machine name and group/domain label are leads. A workgroup label does not prove AD membership. Resolve the returned name and use the SMB/LDAP checks with the accepted identity. No reply can mean filtering or disabled NetBIOS while TCP/445 still works.
Sources: upstream 1.
10.2.14.1.14.3 SMB/RPC RID lookups when a normal user listing is denied
Use when the accepted identity can translate SIDs but cannot list the directory directly. Keep the queried host/domain and a bounded RID range explicit.
nxc smb TARGET -d DOMAIN -u USER -p 'PASSWORD' --rid-brute 4000
Read: classify returned SID types—users, groups and machine accounts are different objects. The upper bound is coverage, not proof that higher RIDs contain nothing. A resolved name is not a password, service authorization or successful logon. Prefer the existing native directory/RPC listing when it is available; do not infer no accounts from a single denied enumeration method.
Sources: upstream 1.
Verify: Prove the specific share/object action; a successful login or administrative indicator does not establish every remote-execution route.
If it fails: Access denied after login usually means authorization/context. Test local/domain qualification and the exact object rather than repeating passwords.
10.2.14.1.15 Find: Extract configuration and process information through SNMP
Take UDP/161 evidence and a justified management credential/community, then request a small known OID branch before a broad walk.
snmpwalk -v2c -c COMMUNITY TARGET 1.3.6.1.2.1.1
Recognize: A real OID response confirms the accepted read context and supplies software/name clues.
Validate next: Determine which useful views/branches are actually readable; process data and write rights are separate.
Extract configuration and process information through SNMP.
10.2.14.1.16 Commands and use-case variants
Need: A confirmed reachable application; anonymous context or one identified credential. An accepted read community or SNMPv3 identity/security level; transport and view permissions
Recognize: SNMP queries commonly use UDP/161. Versions 1 and 2c authenticate with a community string sent without modern transport protection; version 3 can provide user-based authentication and privacy. Goal: turn a valid read context into host, interface, route, process, software, user and listener clues.
10.2.14.1.16.1 Baseline: find a read community, then walk
onesixtyone -c COMMUNITY_FILE TARGET
snmpwalk -v2c -c COMMUNITY TARGET 1.3.6.1.2.1
Use -v1 instead when version 1 is indicated. Start with the standard system tree before a huge full walk.
Decisive output: returned OID/value pairs prove that the selected version/community can read those objects. Hostnames, interfaces, routes, users, processes and locally listening ports become new hypotheses to validate through the appropriate service or post-access path.
10.2.14.1.16.1.1 Variant — efficient v2c bulk walk
snmpbulkwalk -v2c -c COMMUNITY TARGET 1.3.6.1.2.1
Bulk requests reduce round trips but require SNMPv2c or later. If the agent rejects them, fall back to snmpwalk with the verified version.
10.2.14.1.16.1.2 Variant — high-value Windows OIDs
snmpwalk -v1 -c COMMUNITY TARGET 1.3.6.1.4.1.77.1.2.25
snmpwalk -v1 -c COMMUNITY TARGET 1.3.6.1.2.1.25.4.2.1.2
snmpwalk -v1 -c COMMUNITY TARGET 1.3.6.1.2.1.25.6.3.1.2
snmpwalk -v1 -c COMMUNITY TARGET 1.3.6.1.2.1.6.13.1.3
These target user names, running process names, installed software and TCP listener ports. Availability depends on the agent and exposed MIB view.
10.2.14.1.16.1.3 Variant — SNMPv3 authenticated and private walk
snmpwalk -v3 -l authPriv -u USER -a SHA -A AUTH_PASSWORD -x AES -X PRIV_PASSWORD TARGET 1.3.6.1.2.1
The security level, authentication algorithm, privacy algorithm and credentials must match the configured SNMPv3 user. authNoPriv authenticates without encryption; noAuthNoPriv supplies neither and should be used only when that exact configuration is observed.
10.2.14.1.16.1.4 Variant — focused UDP verification
sudo nmap -sU -sV -p 161 --script snmp-info TARGET
snmp-info extracts basic SNMPv3 engine information without proving a usable v1/v2c community.
Failure cues: UDP silence can remain
open|filtered; it does not prove that the community is wrong.Timeout: No Responsecan be version mismatch, wrong community, filtering, loss or an unavailable OID view.No Such Objectmeans the queried OID is absent/not exposed, not that the whole service failed. Do not use a discovered write community to change configuration during enumeration.
Next action: translate output into exact host/service/user hypotheses, scan newly disclosed in-scope addresses/listeners from the proper source position, and keep configuration-changing SNMP actions outside this stage.
Verify: Preserve the OID, accepted security context and returned value; empty branches can reflect view restrictions.
If it fails: Silence can mean UDP filtering, wrong community/version or denied view; change only the condition supported by evidence.
10.2.14.1.17 Find: Use MySQL/MariaDB data and file primitives
Use a known application/database login and inspect identity, grants and file-operation constraints before choosing an OS transition.
SELECT USER(),CURRENT_USER(),VERSION();
SHOW GRANTS;
SHOW VARIABLES LIKE 'secure_file_priv';
Recognize: SELECT permits data investigation; absent FILE/admin rights and the restricted directory constrain file/OS hypotheses.
Validate next: Check exact grants, useful tables, destination OS permissions and an execution consumer before escalating a file operation.
Use MySQL/MariaDB data and file primitives.
10.2.14.1.18 Commands and use-case variants
Need: A confirmed reachable application; anonymous context or one identified credential. Database authentication and exact schema/file privileges; secure_file_priv and server filesystem identity constrain file actions
mysql -h TARGET -P PORT -u USER -p
SELECT VERSION(), USER(), CURRENT_USER();
SHOW DATABASES;
SHOW GRANTS;
USE DATABASE;
SHOW TABLES;
DESCRIBE TABLE;
SELECT * FROM TABLE LIMIT 20;
SELECT @@secure_file_priv;
Interpret:
USER()shows the presented client identity;CURRENT_USER()shows the account used for privilege checking.secure_file_privrestricts server-side import/export: a directory constrains it, an empty value is unrestricted by that variable, andNULLdisables these operations. TheFILEprivilege is still required.
10.2.14.1.19 MySQL variant — validate server-side file read/write prerequisites
SELECT LOAD_FILE('/path/on/database/server');
SELECT 'probe' INTO OUTFILE '/allowed/server/path/probe.txt';
Use only an authorized harmless path. LOAD_FILE returning NULL is ambiguous among missing file, permissions, size, FILE privilege and secure_file_priv. INTO OUTFILE will not overwrite an existing file. A written file becomes execution only if another privileged component consumes it.
Verify: Check current database identity, grants and actual returned data or written file through an independent observation.
If it fails: Permission denied or a restricted file directory changes the available primitive; pivot to data/credential use or a different entry point.
10.2.14.1.20 Find: Use SQL Server rights, impersonation and command facilities
Once SQL Server authentication works, inspect actual login/server role and supported impersonation context.
SELECT SYSTEM_USER, ORIGINAL_LOGIN(), @@VERSION;
SELECT IS_SRVROLEMEMBER('sysadmin');
Recognize: A valid login with sysadmin=0 is data/rights evidence, not permission to enable xp_cmdshell.
Validate next: Enumerate actual database/server grants and useful impersonation; independently verify any OS facility and its identity.
Use SQL Server rights, impersonation and command facilities.
10.2.14.1.21 Commands and use-case variants
Need: A confirmed reachable application; anonymous context or one identified credential. Correct SQL versus Windows authentication; database role and configuration must permit the requested operation
impacket-mssqlclient 'USER@TARGET'
impacket-mssqlclient 'DOMAIN/USER@TARGET' -windows-auth
Let the tool prompt for the password. At the SQL prompt:
SELECT @@VERSION;
SELECT SYSTEM_USER;
SELECT IS_SRVROLEMEMBER('sysadmin');
SELECT name FROM sys.databases;
USE DATABASE;
SELECT TABLE_SCHEMA, TABLE_NAME FROM INFORMATION_SCHEMA.TABLES;
SELECT TOP 20 * FROM SCHEMA.TABLE;
Interpret:
IS_SRVROLEMEMBER('sysadmin')returns1,0orNULL;NULLis not success. Impacket also exposes helpers such asenum_impersonateandxp_cmdshelldepending on version and rights.
10.2.14.1.22 MSSQL variant — command-execution boundary
EXEC xp_cmdshell 'whoami';
xp_cmdshell is disabled by default on new installations. Enabling it generally requires high privilege and changes server configuration; do not enable it merely to enumerate. When available, a sysadmin's child process normally runs as the SQL Server service account; an authorized non-sysadmin may use a configured proxy. Verify returned identity before choosing the next action.
10.2.14.1.22.1 MSSQL linked-server and login-context mapping
Treat a linked server as another authentication and authorization boundary. The local SQL login, its mapped remote login, remote SQL role and RPC/data-access settings can all differ.
SELECT SYSTEM_USER AS current_login,
ORIGINAL_LOGIN() AS original_login,
SUSER_SNAME() AS effective_login,
IS_SRVROLEMEMBER('sysadmin') AS is_sysadmin;
SELECT name, product, provider, data_source, is_linked
FROM sys.servers
WHERE is_linked = 1;
EXEC master.dbo.sp_helplinkedsrvlogin;
Interpret:
sys.serversproves configuration, not remote access.sp_helplinkedsrvloginshows local-to-remote mappings; aNULLlocal login can represent a mapping that applies to all local logins. Preserve the local and remote identities separately.
After selecting one named link, test the smallest remote query supported by its configuration:
EXEC ('SELECT SYSTEM_USER AS remote_login,
ORIGINAL_LOGIN() AS remote_original_login,
IS_SRVROLEMEMBER(''sysadmin'') AS remote_is_sysadmin')
AT [LINKED_SERVER];
If RPC execution is disabled but data access is allowed, use a read-only pass-through query instead:
SELECT *
FROM OPENQUERY([LINKED_SERVER],
'SELECT SYSTEM_USER AS remote_login,
ORIGINAL_LOGIN() AS remote_original_login');
Decide: a returned remote identity enables only the operations granted to that mapped login.
RPC OUT is disabled, login-mapping failures and data-access failures rule out different mechanisms; they do not prove the server is unreachable. Ifenum_impersonateidentifies a specific permitted login, test only that login and always return to the original context:
EXECUTE AS LOGIN = 'LOGIN';
SELECT SYSTEM_USER, ORIGINAL_LOGIN(), SUSER_SNAME(), IS_SRVROLEMEMBER('sysadmin');
REVERT;
Do not enable RPC, create mappings or change server configuration merely to enumerate. A remote SQL query is not OS execution; independently validate any file or command facility and the operating-system identity behind it.
Sources: Microsoft sys.servers, sp_helplinkedsrvlogin, EXECUTE AS, and OPENQUERY.
Verify: Verify SQL identity and any OS effect with hostname/whoami; record service/proxy execution identity.
If it fails: Login success with denied configuration changes is a rights boundary. Do not repeatedly enable an unavailable facility.
10.2.14.1.23 Find: Use PostgreSQL data and privileged program execution
Authenticate to the observed database and inspect current/session identity and role attributes before program/file functions.
SELECT current_user,session_user,version();
SELECT rolname,rolsuper FROM pg_roles WHERE rolname=current_user;
Recognize: An ordinary database role does not automatically have COPY PROGRAM or server-file access.
Validate next: Inspect effective role memberships and exact operation rights, then the database service's OS context.
Use PostgreSQL data and privileged program execution.
10.2.14.1.24 Commands and use-case variants
Need: A confirmed reachable application; anonymous context or one identified credential. Accepted connection/database role; COPY PROGRAM needs the corresponding server privilege and an executable OS context
psql -h TARGET -p PORT -U USER -d postgres
\conninfo
\l
\du
\dn
\dt *.*
SELECT version(), current_user, session_user;
SELECT rolname, rolsuper, rolcreaterole, rolcreatedb
FROM pg_roles;
10.2.14.1.25 PostgreSQL variant — server file/program privilege boundary
SELECT pg_has_role(current_user, 'pg_read_server_files', 'member');
SELECT pg_has_role(current_user, 'pg_write_server_files', 'member');
SELECT pg_has_role(current_user, 'pg_execute_server_program', 'member');
Server-side COPY ... FROM/TO 'file' uses the PostgreSQL server's filesystem and service identity. COPY ... PROGRAM executes on the server and requires superuser or the corresponding predefined role. Client-side \copy reads/writes the client filesystem and is not the same primitive.
Failure cues: connection refusal/timeout is network or listener context; login rejection is authentication/context; an empty database list may be visibility limits; object denial is authorization. Query only bounded rows first. Never assume that reading application credentials or obtaining database admin implies OS execution.
Next action: identify application accounts, hashes/credentials, paths and linked systems; record the precise grant enabling any file or execution primitive; validate recovered credentials in the later credential block and re-enumerate after any identity change.
Verify: Separate returned rows, file operations and command execution; prove the actual operating-system identity for the latter.
If it fails: Role or OS permission failures require another allowed primitive, not a different spelling of the same denied operation.
10.2.14.1.26 Find: Inspect Redis access and persistence boundaries
Identify Redis and use its authentication context to distinguish accepted commands from denied administrative facilities.
redis-cli -h TARGET -p PORT PING
Recognize: The connection is usable but command ACLs can remove persistence/configuration methods.
Validate next: Inspect allowed operations, data visibility and actual persistence/destination/consumer conditions.
Inspect Redis access and persistence boundaries.
10.2.14.1.27 Commands and use-case variants
Need: A confirmed reachable application; anonymous context or one identified credential. Reachability and accepted authentication/ACL commands; persistence writes need CONFIG rights, destination permissions and a consumer
nmap -Pn -sV --script redis-info -p PORT TARGET
redis-cli -h TARGET -p PORT PING
redis-cli -h TARGET -p PORT INFO
redis-cli -h TARGET -p PORT ACL WHOAMI
redis-cli -h TARGET -p PORT ACL LIST
Authenticated when a password is legitimately known:
redis-cli -h TARGET -p PORT --askpass
PONGproves an accessible Redis command surface, not write/file/execution permission. Check ACLs, mode, bind/protected-mode and persistence/module configuration before reasoning about an effect. Do not runCONFIG SET, write keys or load modules during enumeration.
Verify: Verify authentication context, allowed commands and actual key/file effects without assuming old Redis exploit defaults.
If it fails: NOAUTH and NOPERM identify different boundaries. Investigate credentials or permitted data rather than assuming unauthenticated execution.
10.2.14.1.28 Find: Triage Oracle listener and database identity
Use service discovery and an application's connection descriptor to distinguish listener identification from a valid database session.
nmap -Pn -sV -p 1521 TARGET
Recognize: Listener/product evidence and a service name establish a connection candidate, not database credentials or DBA rights.
Validate next: Validate the exact descriptor/account and inspect its permitted database action.
Triage Oracle listener and database identity.
10.2.14.1.29 Commands and use-case variants
Need: A confirmed reachable application; anonymous context or one identified credential. Correct service/SID, reachable database transport and valid database credentials for authenticated work
nmap -Pn -sV --script oracle-tns-version -p 1521 TARGET
nmap -Pn --script oracle-sid-brute -p 1521 TARGET
A discovered SID/service name is a namespace clue, not credentials. Continue with an installed Oracle client only when a legitimate identity is available; preserve listener/version/SID evidence and do not treat a conventional port as Oracle proof. Source supplement: reviewed getSH Nmap Oracle block.
Verify: Distinguish listener identification, database login and a permitted SQL action.
If it fails: An invalid service descriptor is different from an invalid password; resolve it before further credential decisions.
10.2.14.1.30 Find: Validate RDP, WinRM, VNC and Telnet access contexts
Take remote-access listeners from discovery and validate one known identity against the specific endpoint/logon type.
Test-NetConnection TARGET -Port 3389
Test-NetConnection TARGET -Port 5985
Recognize: Transport offers an RDP candidate from this source; it does not establish remote-interactive rights.
Validate next: Check actual protocol, local/domain context, accepted authentication and endpoint/logon authorization.
Validate RDP, WinRM, VNC and Telnet access contexts.
10.2.14.1.31 Commands and use-case variants
Need: A confirmed reachable application; anonymous context or one identified credential. Enabled destination service, matching authentication and protocol-specific logon/session rights
Recognize: RDP commonly uses TCP/3389; WinRM commonly uses 5985/HTTP and 5986/HTTPS. Goal: determine whether one known credential is accepted in the correct local/domain context and whether it is authorized for a usable session.
10.2.14.1.31.1 RDP baseline: authentication-only check
xfreerdp3 /v:TARGET /u:USER /d:DOMAIN /auth-only /cert:ignore
Some distributions expose the binary as xfreerdp. Omit /d:DOMAIN for the intended local-account context; use /u:TARGET\\USER if needed to make that context explicit.
Decisive output: successful authentication-only validation supports that the credential is accepted for RDP/NLA. It does not prove an interactive desktop will be granted under every policy/session condition.
10.2.14.1.31.1.1 Variant — open an RDP desktop
xfreerdp3 /v:TARGET /u:USER /d:DOMAIN /dynamic-resolution /cert:ignore
Let FreeRDP prompt for the password. /cert:ignore suppresses certificate validation and is suitable only in the controlled lab context; it removes server-identity protection.
10.2.14.1.31.1.2 Variant — identify RDP security requirements
nmap -p 3389 --script rdp-enum-encryption,rdp-ntlm-info TARGET
This can disclose supported security layers, NLA and NTLM host/domain clues. It does not validate a credential.
10.2.14.1.31.2 RDP host-side inspection: local administrative context
Use this read-only sequence after obtaining an authorized local administrative session on the destination, or when the exercise explicitly supplies equivalent remote-management access. It answers four different questions: is RDP enabled, is a listener actually present, what security layer/NLA policy applies, and does the candidate identity have an effective remote-interactive logon right? Do not change registry values or policy merely to make a credential work.
10.2.14.1.31.3 Listener, service and configured port
Get-Service TermService
reg query "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections
reg query "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v PortNumber
qwinsta
netstat -ano | findstr LISTENING | findstr ":3389"
Read:
fDenyTSConnections = 0permits RDP at the local setting;1denies new RDP connections.PortNumberis displayed as a registry DWORD, commonly hexadecimal0xD3Dfor 3389. A runningTermServiceplus anRDP-Tcplistener inqwinstaand a listening socket establishes host-side listener state. A missing:3389socket is not decisive ifPortNumberis nondefault. Policy can override the local value, so inspect resultant policy before treating this as effective configuration.
10.2.14.1.31.4 NLA, transport security and policy precedence
reg query "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v UserAuthentication
reg query "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v SecurityLayer
reg query "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v MinEncryptionLevel
reg query "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v fDenyTSConnections
reg query "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v UserAuthentication
reg query "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v SecurityLayer
gpresult /scope computer /v
Read:
UserAuthentication = 1requires Network Level Authentication. ForSecurityLayer,0is native RDP security,1negotiates, and2requires TLS.MinEncryptionLevelfurther constrains client compatibility. A missing policy value means “not configured at this policy path,” not that the feature is absent. Usegpresultto identify the winning computer policy when local and policy-backed values conflict or revert after refresh. These settings explain negotiation failures; they do not grant a user logon rights.
10.2.14.1.31.5 Candidate membership and effective logon rights
net localgroup "Remote Desktop Users"
whoami /groups
From an elevated PowerShell or Command Prompt, export the currently applied user-right assignments and inspect only the RDP entries:
$policy = Join-Path $env:TEMP 'rdp-user-rights.inf'
secedit /export /mergedpolicy /areas user_rights /cfg $policy /quiet
Select-String -Path $policy -Pattern '^SeRemoteInteractiveLogonRight','^SeDenyRemoteInteractiveLogonRight'
Read: the candidate must be covered by
SeRemoteInteractiveLogonRight; membership in local Administrators or Remote Desktop Users commonly supplies that right, but the actual applied policy is decisive.SeDenyRemoteInteractiveLogonRightoverrides the allow right. Exported entries can be names or SIDs, so resolve unfamiliar SIDs before deciding.whoami /groupsproves only the current process token; use it for the candidate only when you are actually running in that candidate's context. A group listing alone does not prove an effective right when domain policy or nested membership changes the result.
10.2.14.1.31.6 Source-relative validation and decision
nmap -Pn -n -p 3389 --reason TARGET
xfreerdp3 /v:TARGET /u:USER /d:DOMAIN /auth-only /cert:ignore
Ready for an interactive attempt: the actual source reaches the configured RDP port; the listener is enabled; the client can meet the NLA/security requirements; the credential is accepted in the intended local/domain context; and the identity has the effective allow right without an applicable deny right. Ruled out in this context: a decisive required condition is absent, such as an effective deny assignment or no listener on the configured port. Inconclusive: access to policy data is denied, group/SID expansion is unresolved, GPO precedence is unclear, or network filtering prevents source-relative validation. Do not turn an inconclusive result into “bad password” or “RDP disabled.”
Security baseline: on a normally secured host, RDP may be disabled when not needed; when enabled, NLA is normally retained, access is limited to intended administrative/remote-user principals, deny assignments override broad membership, and the firewall limits exposure. The state machine records deviations and capabilities; it does not recommend weakening these controls.
10.2.14.1.31.7 WinRM baseline: interactive session
evil-winrm -i TARGET -u USER
evil-winrm -i TARGET -u 'DOMAIN\\USER'
Omitting -p makes the established Ruby client prompt for the password.
Decisive output: an interactive PowerShell prompt establishes WinRM authorization. Immediately verify identity and host context with
whoami,hostnameandGet-NetIPAddress.
10.2.14.1.31.7.1 Variant — WinRM over HTTPS
evil-winrm -i TARGET -u USER -S -P 5986
Check evil-winrm -h because the established Ruby client and newer evil-winrm-py use different long-option spelling. Do not assume a copied command matches the installed implementation.
10.2.14.1.31.7.2 Variant — Windows PowerShell remoting
$cred = Get-Credential
Enter-PSSession -ComputerName TARGET -Credential $cred
PowerShell remoting uses the configured WinRM endpoint. Local trusted-host, Kerberos/name-resolution and endpoint authorization settings can fail independently of password validity.
Failure cues: certificate warnings are different from authentication failure. RDP errors can reflect NLA, account context, expired/locked accounts or missing logon rights. WinRM
401supports authentication/authorization failure;WinRM cannot process the requestcan be name resolution, trusted-host, listener or transport context. Valid SMB credentials do not guarantee RDP or WinRM rights.
Next action: after a session, re-enumerate identity, groups, privileges, files, local services/listeners and routes. Password spraying, pass-the-hash and ticket use belong to later credential/AD blocks.
Host-inspection sources: Microsoft RDP troubleshooting · Microsoft secedit /export · Microsoft account-right constants · Microsoft qwinsta · Microsoft Remote Desktop Services policy
10.2.14.1.31.8 Validate access to an exposed VNC desktop VNC
nmap -Pn -sV --script vnc-info -p PORT TARGET
vncviewer TARGET:PORT
VNC may expose a desktop without Windows logon semantics; the VNC server's authentication and the resulting OS session identity are separate. Use
realvnc-auth-bypassor password testing only for a confirmed compatible product and explicit authorized objective, then verify the desktop identity.
10.2.14.1.31.9 Identify the Telnet service and validate available access Telnet
nmap -Pn -sV -p PORT TARGET
nc -nv TARGET PORT
telnet TARGET PORT
Telnet is plaintext and may expose a banner/login prompt. Validate only legitimately acquired credentials; do not make
telnet-brutea baseline. After login, verify host and identity because appliance/application shells can differ from an OS shell. Source supplement: reviewed getSH Nmap VNC/Telnet blocks.
10.2.14.1.31.10 GNU Inetutils telnetd — conditional authentication-bypass check
Use only after identifying the affected GNU Inetutils telnetd/login chain and its patch status. CVE-2026-24061 concerns how a supplied USER value reaches login; it does not apply to every Telnet server. Distribution backports matter.
# Client supports sending the autologin USER environment value
USER='-f root' telnet -a TARGET PORT
Read: if a shell is obtained, verify hostname and id. A prompt or echoed username is not root access. A different daemon, fixed build, client negotiation mismatch or a rejected USER value → return to service identification. The affected upstream range and distribution fixes must be checked against the advisory rather than inferred from port 23.
Sources: upstream 1.
Verify: Verify destination hostname, represented identity and usable effect in the resulting session.
If it fails: A valid password is not proof of RDP/WinRM rights. Diagnose TLS, transport, account qualification and logon policy separately.
10.2.14.1.32 Find: Discover LDAP naming contexts and authenticated search
Identify the directory endpoint and query RootDSE before a subtree search under a known bind identity.
ldapsearch -x -LLL -H ldap://DC_IP -s base -b '' defaultNamingContext namingContexts
Recognize: RootDSE supplies the search base; it does not grant arbitrary anonymous subtree access.
Validate next: Check bind identity, transport/signing requirements and read visibility on the selected objects.
Discover LDAP naming contexts and authenticated search.
10.2.14.1.33 Commands and use-case variants
Need: A confirmed reachable application; anonymous context or one identified credential. Reachable directory; anonymous query permission or valid bind identity; required signing/TLS and naming context
Recognition: LDAP commonly appears on TCP/389 or TCP/636; Global Catalog on TCP/3268 or 3269; Kerberos on TCP/UDP 88. Applications may listen elsewhere, so follow protocol evidence rather than port labels.
10.2.14.1.33.1 Baseline: discover naming contexts
Prerequisite: LDAP reachability. Coverage: RootDSE only; this can work even when directory searches require authentication. Decisive output:
defaultNamingContextanddnsHostName.
ldapsearch -x -LLL -H ldap://TARGET:389 -s base -b '' \
defaultNamingContext rootDomainNamingContext configurationNamingContext dnsHostName
Convert DC=corp,DC=example into corp.example for DNS/Kerberos work. Preserve the server's exact hostname because Kerberos is name-sensitive.
10.2.14.1.33.1.1 LDAPS and certificate-name inspection
openssl s_client -connect TARGET:636 -servername DC_HOST </dev/null
ldapsearch -x -LLL -H ldaps://DC_HOST:636 -s base -b '' defaultNamingContext dnsHostName
A certificate can disclose domain/DC names. A TLS validation error is a client trust/name issue, not proof that LDAP is unavailable.
10.2.14.1.33.2 Check which directory objects are readable without credentials Anonymous directory search
Prerequisite: known base DN and server permitting anonymous search. Failure cue:
Inappropriate authenticationorInsufficient accesscloses only the anonymous path.
ldapsearch -x -LLL -H ldap://DC_IP:389 -b 'DC=DOMAIN,DC=TLD' \
'(&(objectCategory=person)(objectClass=user))' \
sAMAccountName userPrincipalName memberOf description
ldapsearch -x -LLL -H ldap://DC_IP:389 -b 'DC=DOMAIN,DC=TLD' \
'(objectClass=group)' cn member description
10.2.14.1.33.3 Query directory objects with your accepted identity Authenticated search
Prerequisite: a valid directory identity. Decisive output: objects/attributes unavailable anonymously. Avoid placing a real password in shell history when an interactive prompt is available.
ldapsearch -x -LLL -H ldap://DC_HOST:389 \
-D 'USER@DOMAIN.TLD' -W -b 'DC=DOMAIN,DC=TLD' \
'(&(objectCategory=person)(objectClass=user))' \
sAMAccountName userPrincipalName memberOf description servicePrincipalName userAccountControl
10.2.14.1.33.3.1 Search computers, groups and SPN-bearing accounts separately
ldapsearch -x -LLL -H ldap://DC_HOST:389 -D 'USER@DOMAIN.TLD' -W \
-b 'DC=DOMAIN,DC=TLD' '(objectClass=computer)' \
dNSHostName operatingSystem operatingSystemVersion servicePrincipalName
ldapsearch -x -LLL -H ldap://DC_HOST:389 -D 'USER@DOMAIN.TLD' -W \
-b 'DC=DOMAIN,DC=TLD' '(objectClass=group)' cn member
ldapsearch -x -LLL -H ldap://DC_HOST:389 -D 'USER@DOMAIN.TLD' -W \
-b 'DC=DOMAIN,DC=TLD' '(&(objectCategory=person)(servicePrincipalName=*))' \
sAMAccountName servicePrincipalName memberOf
10.2.14.1.33.4 Kerberos prerequisites before an attack
Kerberos failures are often name/time/route failures rather than credential failures. Establish:
getent hosts DC_HOST
nc -nvz DC_IP 88
date -u
nmap -Pn -sV -p 88,389,445,464,636,3268,3269 DC_IP -oN dc-services.txt
Interpretation: resolve
DOMAINandDC_HOSTconsistently, keep clock skew within Kerberos tolerance, and ensure the KDC is reached through the selected route.KDC_ERR_C_PRINCIPAL_UNKNOWNpoints to identity/domain naming;KRB_AP_ERR_SKEWpoints to time;KDC_ERR_PREAUTH_FAILEDnormally points to authentication material.
10.2.14.1.33.5 Continue with the capability your result enables Handoff
- New users, groups, computers, SPNs or domain names → domain mapping.
- A user confirmed without preauthentication → Kerberos and identity transitions.
- Valid credentials → rerun authenticated LDAP plus SMB/share/remote-access enumeration.
- Certificate templates/AD CS clues → AD CS and object-control abuse.
Verify: Record DC, base DN, bind identity and actual returned attributes; RootDSE alone is not a complete directory dump.
If it fails: Stronger-auth-required may mean TLS/signing policy; invalid credentials or an empty base require different fixes.
10.2.14.1.34 Find: Investigate SIP/IRC identity and configuration clues
Classify the unusual listener, then use its normal greeting/registration behavior and the owning procedure's bounded protocol checks.
nmap -Pn -sV -p PORT TARGET
nc -nv TARGET PORT
Recognize: The real protocol and registration state determine the next client operation; the expected port label is insufficient.
Validate next: Verify application/version, accepted interaction and exact exploit/access conditions.
Investigate SIP/IRC identity and configuration clues.
10.2.14.1.35 Commands and use-case variants
Need: A confirmed reachable application; anonymous context or one identified credential. Application-specific request format; permitted registration/channel/configuration access
These source-site topics contain only first-pass reconnaissance. Treat them as application-identification branches, not default exploitation paths.
10.2.14.1.35.1 Find SIP identity and configuration clues SIP
Commonly UDP/TCP 5060 or TLS 5061; follow protocol evidence.
nmap -Pn -sU -sV --script sip-methods -p 5060 TARGET
nmap -Pn -sT -sV --script sip-methods -p 5060 TARGET
Decisive output: a SIP response and supported methods.
open|filteredwithout application response remains ambiguous. Do not runsip-bruteuntil the exact registrar, known test identities, lockout policy and explicit authorization are established.
10.2.14.1.35.2 Find IRC identity and configuration clues IRC
nmap -Pn -sV --script irc-info -p PORT TARGET
nc -nv TARGET PORT
Minimal registration for an authorized test client:
NICK testnick
USER testuser 0 * :Test User
QUIT
Decisive output: IRC numeric replies, server/network name, version/capabilities or authentication requirement. Do not use
irc-bruteas identification; authenticate only with legitimately acquired credentials.
Verify: Retain protocol responses and distinguish product clues from confirmed vulnerabilities.
If it fails: A generic banner or denied registration leaves access unproven; return to version/configuration matching.
10.2.14.2 Additional conditional surfaces
Open a branch only when its observation and prerequisites match. Discovery-only entries retain their missing-action boundary.
10.2.14.2.1 Inspect a Java RMI registry before selecting an exploit
-
Enter: service detection or an application response identifies Java RMI on a selected port.
-
Discover: enumerate bound names, classes, remote endpoints and codebase annotations without assuming the registry is exploitable:
nmap -sV -p PORT --script rmi-dumpregistry TARGET -
Validate: confirm the selected endpoint is the actual registry/service, its class-loading/serialization behavior, Java/version prerequisites and whether any proposed test is intrusive. The Nmap class-loader probe is categorized intrusive and must not be the baseline:
nmap -p PORT --script rmi-vuln-classloader TARGET -
Execute: no generic RMI/serialization execution procedure is registered. Route a matched component/version/condition to exploit prerequisite matching only after the required behavior is established; see the pending action procedure.
-
Verify: registry names or a vulnerable class-loader result are component evidence, not a session. A complete action must separately verify the executed identity and resulting capability.
-
Outcomes: matching component and vulnerable behavior → candidate for reviewed exploit prerequisite matching procedure; no registry or prerequisite decisively absent → ruled out here; filtered/incomplete registry or ambiguous class loading → inconclusive.
-
Sources: Nmap
rmi-dumpregistryandrmi-vuln-classloader.
Boundary: discovery/validation only; the action procedure is pending.
10.2.14.2.2 Classify a Tomcat Manager interface and accepted role
-
Enter: the application is confirmed as Apache Tomcat and a
/manager/*interface responds. -
Discover: inspect the selected interface and authentication boundary without spraying credentials:
curl -sk -D - "https://TARGET:PORT/manager/html" -o /dev/null curl -sk -D - "https://TARGET:PORT/manager/text/list" -o /dev/null -
Validate: identify the accepted account and manager role:
manager-gui,manager-script,manager-jmxormanager-status. GUI access and text-script access are intentionally separate; a401,403and application404have different meanings. -
Execute: current notes do not yet own a version-scoped deployment, verification and cleanup procedure. Preserve the authenticated management capability and see the pending action procedure. JBoss/Jenkins and other managers remain separate product branches under the pending action procedure.
-
Verify: a manager listing proves the interface/role only. A deployable application, reachable context path and server-side execution identity require separate proof.
-
Outcomes: accepted deployment-capable role → ready for a reviewed product procedure; role/interface denies the required operation → ruled out for that role; proxy rewriting, wrong scheme/path or ambiguous realm → inconclusive.
-
Source: Apache Tomcat Manager App HOW-TO.
Boundary: discovery/validation only; the action procedure is pending.
10.2.14.2.3 Follow an MSSQL linked server as a new SQL identity boundary
- Enter: a working MSSQL login reveals one linked server or login mapping.
- Discover: enumerate
sys.serversandsp_helplinkedsrvlogin, preserving local login, remote server, provider/data source and mapping. - Validate: test one read-only remote identity query through the supported RPC or data-access mechanism. Do not enable RPC, create mappings or change configuration for enumeration.
- Execute: MSSQL linked-server and login-context mapping.
- Verify: record returned
SYSTEM_USER,ORIGINAL_LOGIN()and the remote role result. A remote SQL query is not OS command execution. - Outcomes: mapped remote query succeeds → re-enter database identity for that server/identity; link exists but RPC/data access is decisively unavailable → ruled out for that mechanism; mapping/authentication/provider failure is unresolved → inconclusive/failed-boundary diagnosis.
10.2.14.2.4 Documented commands and conditions
Treat a linked server as another authentication and authorization boundary. The local SQL login, its mapped remote login, remote SQL role and RPC/data-access settings can all differ.
SELECT SYSTEM_USER AS current_login,
ORIGINAL_LOGIN() AS original_login,
SUSER_SNAME() AS effective_login,
IS_SRVROLEMEMBER('sysadmin') AS is_sysadmin;
SELECT name, product, provider, data_source, is_linked
FROM sys.servers
WHERE is_linked = 1;
EXEC master.dbo.sp_helplinkedsrvlogin;
Interpret:
sys.serversproves configuration, not remote access.sp_helplinkedsrvloginshows local-to-remote mappings; aNULLlocal login can represent a mapping that applies to all local logins. Preserve the local and remote identities separately.
After selecting one named link, test the smallest remote query supported by its configuration:
EXEC ('SELECT SYSTEM_USER AS remote_login,
ORIGINAL_LOGIN() AS remote_original_login,
IS_SRVROLEMEMBER(''sysadmin'') AS remote_is_sysadmin')
AT [LINKED_SERVER];
If RPC execution is disabled but data access is allowed, use a read-only pass-through query instead:
SELECT *
FROM OPENQUERY([LINKED_SERVER],
'SELECT SYSTEM_USER AS remote_login,
ORIGINAL_LOGIN() AS remote_original_login');
Decide: a returned remote identity enables only the operations granted to that mapped login.
RPC OUT is disabled, login-mapping failures and data-access failures rule out different mechanisms; they do not prove the server is unreachable. Ifenum_impersonateidentifies a specific permitted login, test only that login and always return to the original context:
EXECUTE AS LOGIN = 'LOGIN';
SELECT SYSTEM_USER, ORIGINAL_LOGIN(), SUSER_SNAME(), IS_SRVROLEMEMBER('sysadmin');
REVERT;
Do not enable RPC, create mappings or change server configuration merely to enumerate. A remote SQL query is not OS execution; independently validate any file or command facility and the operating-system identity behind it.
Sources: Microsoft sys.servers, sp_helplinkedsrvlogin, EXECUTE AS, and OPENQUERY.