Search in exploit-db
searchsploit --color samba | grep 'linux\/' | grep -v '/dos/' |
Search in exploit-db
searchsploit --color samba | grep 'linux\/' | grep -v '/dos/' |
After we gained a foothold on our target (exploitation) we want to upload and download files.
On UDP port 1434 is most likely the MS SQL Browser Service listening.
You can query this service to retrieve version info and the TCP port where MS SQL Server Service is listening.
nmap -P0 -v -sU -sV -p 1434 <ip> --script ms-sql-info |
apt-get install cifs-utils |
mount -t cifs //<ip>/share <mountpount> -o username=NULL,password,uid=<user>,gid=<group> |
smbclient //<ip>/share -I <ip> -N |
Basic Linux Privilege Escalation
Windows Privilege Escalation
View the permission on the application log file with powershell
get-acl "C:\Windows\SYSTEM32\WINEVT\LOGS\application.evtx" | fl Path : Microsoft.PowerShell.Core\FileSystem::C:\Windows\SYSTEM32\WINEVT\LOGS\application.evtx Owner : NT AUTHORITY\LOCAL SERVICE Group : NT AUTHORITY\LOCAL SERVICE Access : NT SERVICE\EventLog Allow FullControl NT AUTHORITY\SYSTEM Allow FullControl BUILTIN\Administrators Allow FullControl Audit : Sddl : O:LSG:LSD:AI(A;ID;FA;;;S-1-5-80-880578595-1860270145-482643319-2788375705-1540778122)(A;ID;FA;;;SY)(A;ID;FA;;; BA) |
<check_type: "Windows" version:"2"> <group_policy: "MS Windows Server"> <file_acl: "ACL_WINEVT_LOGS_application.evtx"> <user: "Administrators"> acl_inheritance: "inherited" acl_apply: "this object only" acl_allow: "full control" </user> <user: "System"> acl_inheritance: "inherited" acl_apply: "this object only" acl_allow: "full control" </user> <user: "EventLog"> acl_inheritance: "inherited" acl_apply: "this object only" acl_allow: "full control" </user> </acl> <custom_item> type: FILE_PERMISSIONS description: "Audit file permissions om %SystemRoot%\SYSTEM32\WINEVT\LOGS\application.evtx" value_type: FILE_ACL value_data: "ACL_WINEVT_LOGS_application.evtx" file: "C:\Windows\SYSTEM32\WINEVT\LOGS\application.evtx" </custom_item> </group_policy> </check_type> |
Running this auditfile with this specific file results into an error because the file has a file lock.
Windows Compliance Checks, version 1.263 Which file contains your security policy : SMB login : stty: 'standard input': Inappropriate ioctl for device SMB password : stty: 'standard input': Inappropriate ioctl for device SMB domain (optional) : "Audit for %SystemRoot%\SYSTEM32\WINEVT\LOGS\application.evtx": [ERROR] FILE_ERROR_FILE_CREATE: the file could not be opened. It could not be found or permissions were insufficient file: C:\Windows\SYSTEM32\WINEVT\LOGS\application.evtx |
We can use the powershell command-let get-acl to perform the audit.
We run the command and filter out the known good values.
get-acl "C:\Windows\SYSTEM32\WINEVT\LOGS\setup.evtx" | select -ExpandProperty access | select IdentityReference, FileSystemRights | Where {$_.IdentityReference -ne "NT SERVICE\EventLog" -and $_.IdentityReference -ne "NT AUTHORITY\S YSTEM" -and $_.IdentityReference -ne "BUILTIN\Administrators" } |
<check_type: "Windows" version:"2"> <group_policy: "MS Windows Server"> <custom_item> type : AUDIT_POWERSHELL description : "Audit file permissions om %SystemRoot%\SYSTEM32\WINEVT\LOGS\application.evtx" value_type : POLICY_TEXT value_data : "" powershell_args : 'get-acl \\"C:\\Windows\\SYSTEM32\\WINEVT\\LOGS\\setup.evtx\\" | select -ExpandProperty access | select IdentityReference, FileSystemRights | Where {$_.IdentityReference -ne \\"NT SERVICE\\EventLog\\" -and $_.IdentityReference -ne \\"NT AUTHORITY\\SYSTEM\\" -and $_.IdentityReference -ne \\"BUILTIN\\Administrators\\" }' check_type : CHECK_EQUAL powershell_option : CAN_BE_NULL </custom_item> </group_policy> </check_type> |
Description The remote host is missing one or more of the following Microsoft updates: KB2871997, KB2973351, KB2975625, KB2982378, KB2984972, KB2984976, KB2984981, KB2973501, or KB3126593. These updates are needed to improve the protection against possible credential theft. - For Windows 7 / 2008 R2 : KB2984972, KB2871997, KB2982378, and KB2973351 are required; also, KB2984976 (if KB2592687 is installed) or KB2984981 (if KB2830477 is installed). - For Windows 8 / 2012 : KB2973501, KB2871997, and KB2973351 are required. - For Windows 8.1 / 2012 R2 : KB2973351 (if Update 1 is installed) or KB2975625 (if Update 1 isn't installed). These updates provide additional protection for the Local Security Authority (LSA), add a restricted administrative mode for Credential Security Support Provider (CredSSP), introduce support for the protected account-restricted domain user category, enforce stricter authentication policies, add additional protection for users' credentials, and add a restricted administrative mode for Remote Desktop Connection and Remote Desktop Protocol. Solution Microsoft has released a set of patches for Windows 7, 2008 R2, 8, 2012, 8.1, and 2012 R2. Output A required registry setting is missing: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest\UseLogonCredential = 0 More information: https://blogs.technet.microsoft.com/kfalde/2014/11/01/kb2871997-and-wdigest-part-1/
Best practice for systems running IIS, part of Hardening IIS:
Description The remote service accepts connections encrypted using SSL 2.0 and/or SSL 3.0. These versions of SSL are affected by several cryptographic flaws. An attacker can exploit these flaws to conduct man-in-the-middle attacks or to decrypt communications between the affected service and clients. NIST has determined that SSL 3.0 is no longer acceptable for secure communications. As of the date of enforcement found in PCI DSS v3.1, any version of SSL will not meet the PCI SSC'S definition of 'strong cryptography'. Solution Consult the application's documentation to disable SSL 2.0 and 3.0. Use TLS 1.1 (with approved cipher suites) or higher instead.
Best practice for systems running IIS, part of Hardening IIS:
Description The remote host supports SSLv2 and therefore may be affected by a vulnerability that allows a cross-protocol Bleichenbacher padding oracle attack known as DROWN (Decrypting RSA with Obsolete and Weakened eNcryption). This vulnerability exists due to a flaw in the Secure Sockets Layer Version 2 (SSLv2) implementation, and it allows captured TLS traffic to be decrypted. A man-in-the-middle attacker can exploit this to decrypt the TLS connection by utilizing previously captured traffic and weak cryptography along with a series of specially crafted connections to an SSLv2 server that uses the same private key. Solution Disable SSLv2 and export grade cryptography cipher suites. Ensure that private keys are not used anywhere with server software that supports SSLv2 connections.
Best practice for systems running IIS, part of Hardening IIS:
Description The remote host allows SSL/TLS connections with one or more Diffie-Hellman moduli less than or equal to 1024 bits. Through cryptanalysis, a third party may be able to find the shared secret in a short amount of time (depending on modulus size and attacker resources). This may allow an attacker to recover the plaintext or potentially violate the integrity of connections. Solution Reconfigure the service to use a unique Diffie-Hellman moduli of 2048 bits or greater.
Description The remote Windows host supports Server Message Block (SMB) Protocol version 1. It is, therefore, affected by an unspecified remote code execution vulnerability that allows an unauthenticated, remote attacker to execute arbitrary code. Note that this vulnerability is one of multiple Equation Group vulnerabilities and exploits disclosed by a group known as the Shadow Brokers. Solution Disable SMBv1 according to the vendor instructions in Microsoft KB2696547. Additionally, block SMB directly by blocking TCP port 445 on all network boundary devices. For SMB over the NetBIOS API, block TCP ports 137 / 139 and UDP ports 137 / 138 on all network boundary devices.
Best practice for systems running IIS, part of Hardening IIS:
Best practice for systems running IIS, part of Hardening IIS:
Best practice for systems running IIS, part of Hardening IIS:
Best practice for systems running IIS, part of Hardening IIS:
Best practice for systems running IIS, part of Hardening IIS:
Best practice for systems running IIS, part of Hardening IIS:
Best practice for systems running IIS, part of Hardening IIS:
Best practice for systems running IIS, part of Hardening IIS:
The remote host supports the use of SSL ciphers that offer medium strength encryption. Nessus regards medium strength as any encryption that uses key lengths at least 56 bits and less than 112 bits, or else that uses the 3DES encryption suite. Note that it is considerably easier to circumvent medium strength encryption if the attacker is on the same physical network.
Best practice for systems running IIS, part of Hardening IIS:
Best practice for systems running IIS, part of Hardening IIS:
Best practice for systems running IIS, part of Hardening IIS:
Interesting article on how to dump memory from the Nessus Deamon and extract the credentials that are defined in the scans/policies.
Monitor the lockout status is crucial in these situations.
Best practices and references used for hardening Sitecore.