├── Images ├── readme.md ├── v1 │ └── v1-dashboard.png └── v2 │ ├── 1-Dashboard.png │ ├── 10-ExtractedSecrets.png │ ├── 11-InterestingFiles.png │ ├── 12-DataExposure.png │ ├── 13-RiskExposure.png │ ├── 13-RiskExposure2.png │ ├── 2-Generated-Files.png │ ├── 3-ShareNames-0.png │ ├── 3-ShareNames-1.png │ ├── 3-ShareNames-2.png │ ├── 4-Remediation.png │ ├── 5-Timeline.png │ ├── 6-PeerComparison.png │ ├── 7-FolderGroups.png │ ├── 8-AssetFingerprintingExposure.png │ └── 9-ShareGraph.png ├── LICENSE.md ├── PowerHuntShares.psm1 ├── PowerHuntSharesSampleReport.html ├── Presentations ├── SO-CON_2025_Sutherland_Hunting_SMB_Shares_Final.pdf ├── SO-CON_2025_Sutherland_Hunting_SMB_Shares_Final.pptx └── readme.md ├── README.md ├── Scripts ├── Analyze-HuntSMBShares.ps1 ├── ConfigParsers │ ├── parser-.pgpass.ps1 │ ├── parser-SiteManager.xml.ps1 │ ├── parser-app.config.ps1 │ ├── parser-bootstrap.ini.ps1 │ ├── parser-cisco-config.ps1 │ ├── parser-config.xml.ps1 │ ├── parser-context.xml.ps1 │ ├── parser-db.ini.ps1 │ ├── parser-dbvisxml.ps1 │ ├── parser-example.dtsx.ps1 │ ├── parser-example.rdp.ps1 │ ├── parser-fetchmailrc.ps1 │ ├── parser-gitcredentials.ps1 │ ├── parser-gppfiles.ps1 │ ├── parser-grub.cfg.ps1 │ ├── parser-htpasswd.ps1 │ ├── parser-jboss-cli.xml.ps1 │ ├── parser-krb5.conf.ps1 │ ├── parser-machine.config.ps1 │ ├── parser-my.cnf.ps1 │ ├── parser-netrc.ps1 │ ├── parser-php.ini.ps1 │ ├── parser-pureftpd.passwd.ps1 │ ├── parser-putty.reg.ps1 │ ├── parser-remmina.ps1 │ ├── parser-remminapref.ps1 │ ├── parser-server.xml.ps1 │ ├── parser-settings.ini.ps1 │ ├── parser-shadow.ps1 │ ├── parser-smb.conf.ps1 │ ├── parser-sssd.conf.ps1 │ ├── parser-standalone.xml-ps1.ps1 │ ├── parser-sysprep.inf.ps1 │ ├── parser-tnsnames.ora.ps1 │ ├── parser-tomcat-users.xml.ps1 │ ├── parser-unattend.xml.ps1 │ ├── parser-vnc.ini.ps1 │ ├── parser-web.config.ps1 │ ├── parser-winscp.ini.ps1 │ └── parser-wp-config.php.ps1 ├── Invoke-FingerPrintShare.ps1 ├── JavaScript │ ├── all.min.css │ ├── apexcharts.js │ ├── apexsankey.js │ ├── cytoscape-dagre.js │ ├── cytoscape-euler.js │ ├── cytoscape-klay.js │ ├── cytoscape.min.js │ ├── dagre.min.js │ └── klay.js └── SampleConfigs │ ├── .fetchmailrc │ ├── .git-credentials │ ├── .htpasswd │ ├── .netrc │ ├── .pgpass │ ├── .remmina │ ├── DataSources.xml │ ├── Drives.xml │ ├── Groups.xml │ ├── Printers.xml │ ├── ScheduledTasks.xml │ ├── Services.xml │ ├── SiteManager.xml │ ├── WinSCP.ini │ ├── app.config │ ├── bootstrap.ini │ ├── config.xml │ ├── context.xml │ ├── dbvis.xml │ ├── dbxdrivers.ini │ ├── example.dtsx │ ├── example.rdp │ ├── grub.cfg │ ├── grub.conf │ ├── jboss-cli.xml │ ├── krb5.conf │ ├── machine.config │ ├── my.cnf │ ├── php.ini │ ├── pureftpd.passwd │ ├── putty.reg │ ├── remmina.pref │ ├── running-config │ ├── server.xml │ ├── setting.ini │ ├── shadow │ ├── smb.conf │ ├── sssd.conf │ ├── standalone.xml │ ├── startup-config │ ├── sysprep.inf │ ├── tnsnames.ora │ ├── tomcat-users.xml │ ├── unattend-base64.xml │ ├── unattend-cleartext.xml │ ├── vnc.ini │ ├── web.config │ └── wp-config.php ├── interesting-files-template.csv └── summary-report.png /Images/readme.md: -------------------------------------------------------------------------------- 1 | This folder is for image files. 2 | -------------------------------------------------------------------------------- /Images/v1/v1-dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NetSPI/PowerHuntShares/efa8fc259333915d1ede21d7f56757c5309ef0e9/Images/v1/v1-dashboard.png -------------------------------------------------------------------------------- /Images/v2/1-Dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NetSPI/PowerHuntShares/efa8fc259333915d1ede21d7f56757c5309ef0e9/Images/v2/1-Dashboard.png -------------------------------------------------------------------------------- /Images/v2/10-ExtractedSecrets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NetSPI/PowerHuntShares/efa8fc259333915d1ede21d7f56757c5309ef0e9/Images/v2/10-ExtractedSecrets.png -------------------------------------------------------------------------------- /Images/v2/11-InterestingFiles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NetSPI/PowerHuntShares/efa8fc259333915d1ede21d7f56757c5309ef0e9/Images/v2/11-InterestingFiles.png -------------------------------------------------------------------------------- /Images/v2/12-DataExposure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NetSPI/PowerHuntShares/efa8fc259333915d1ede21d7f56757c5309ef0e9/Images/v2/12-DataExposure.png -------------------------------------------------------------------------------- /Images/v2/13-RiskExposure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NetSPI/PowerHuntShares/efa8fc259333915d1ede21d7f56757c5309ef0e9/Images/v2/13-RiskExposure.png -------------------------------------------------------------------------------- /Images/v2/13-RiskExposure2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NetSPI/PowerHuntShares/efa8fc259333915d1ede21d7f56757c5309ef0e9/Images/v2/13-RiskExposure2.png -------------------------------------------------------------------------------- /Images/v2/2-Generated-Files.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NetSPI/PowerHuntShares/efa8fc259333915d1ede21d7f56757c5309ef0e9/Images/v2/2-Generated-Files.png -------------------------------------------------------------------------------- /Images/v2/3-ShareNames-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NetSPI/PowerHuntShares/efa8fc259333915d1ede21d7f56757c5309ef0e9/Images/v2/3-ShareNames-0.png -------------------------------------------------------------------------------- /Images/v2/3-ShareNames-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NetSPI/PowerHuntShares/efa8fc259333915d1ede21d7f56757c5309ef0e9/Images/v2/3-ShareNames-1.png -------------------------------------------------------------------------------- /Images/v2/3-ShareNames-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NetSPI/PowerHuntShares/efa8fc259333915d1ede21d7f56757c5309ef0e9/Images/v2/3-ShareNames-2.png -------------------------------------------------------------------------------- /Images/v2/4-Remediation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NetSPI/PowerHuntShares/efa8fc259333915d1ede21d7f56757c5309ef0e9/Images/v2/4-Remediation.png -------------------------------------------------------------------------------- /Images/v2/5-Timeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NetSPI/PowerHuntShares/efa8fc259333915d1ede21d7f56757c5309ef0e9/Images/v2/5-Timeline.png -------------------------------------------------------------------------------- /Images/v2/6-PeerComparison.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NetSPI/PowerHuntShares/efa8fc259333915d1ede21d7f56757c5309ef0e9/Images/v2/6-PeerComparison.png -------------------------------------------------------------------------------- /Images/v2/7-FolderGroups.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NetSPI/PowerHuntShares/efa8fc259333915d1ede21d7f56757c5309ef0e9/Images/v2/7-FolderGroups.png -------------------------------------------------------------------------------- /Images/v2/8-AssetFingerprintingExposure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NetSPI/PowerHuntShares/efa8fc259333915d1ede21d7f56757c5309ef0e9/Images/v2/8-AssetFingerprintingExposure.png -------------------------------------------------------------------------------- /Images/v2/9-ShareGraph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NetSPI/PowerHuntShares/efa8fc259333915d1ede21d7f56757c5309ef0e9/Images/v2/9-ShareGraph.png -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | PowerHuntShares is provided under the 3-clause BSD license below. 2 | 3 | ************************************************************* 4 | 5 | Copyright (c) 2024, NetSPI 6 | All rights reserved. 7 | 8 | Redistribution and use in source and binary forms, with or without 9 | modification, are permitted provided that the following conditions are met: 10 | 11 | * Redistributions of source code must retain the above copyright notice, this 12 | list of conditions and the following disclaimer. 13 | 14 | * Redistributions in binary form must reproduce the above copyright notice, 15 | this list of conditions and the following disclaimer in the documentation 16 | and/or other materials provided with the distribution. 17 | 18 | * Neither the name of PowerHuntShares nor the names of its 19 | contributors may be used to endorse or promote products derived from 20 | this software without specific prior written permission. 21 | 22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 23 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 25 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 26 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 28 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 30 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | -------------------------------------------------------------------------------- /PowerHuntSharesSampleReport.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NetSPI/PowerHuntShares/efa8fc259333915d1ede21d7f56757c5309ef0e9/PowerHuntSharesSampleReport.html -------------------------------------------------------------------------------- /Presentations/SO-CON_2025_Sutherland_Hunting_SMB_Shares_Final.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NetSPI/PowerHuntShares/efa8fc259333915d1ede21d7f56757c5309ef0e9/Presentations/SO-CON_2025_Sutherland_Hunting_SMB_Shares_Final.pdf -------------------------------------------------------------------------------- /Presentations/SO-CON_2025_Sutherland_Hunting_SMB_Shares_Final.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NetSPI/PowerHuntShares/efa8fc259333915d1ede21d7f56757c5309ef0e9/Presentations/SO-CON_2025_Sutherland_Hunting_SMB_Shares_Final.pptx -------------------------------------------------------------------------------- /Presentations/readme.md: -------------------------------------------------------------------------------- 1 | This folder contains related presentations. 2 | -------------------------------------------------------------------------------- /Scripts/ConfigParsers/parser-.pgpass.ps1: -------------------------------------------------------------------------------- 1 | # Author: Scott Sutherland, NetSPI (@_nullbind / nullbind) 2 | 3 | function Get-PgPassCredentials { 4 | param ( 5 | [Parameter(Mandatory = $true)] 6 | [string]$FilePath 7 | ) 8 | 9 | # Ensure the file exists 10 | if (-Not (Test-Path $FilePath)) { 11 | Write-Error "File not found: $FilePath" 12 | return 13 | } 14 | 15 | # Read the .pgpass file 16 | $pgpassEntries = Get-Content -Path $FilePath 17 | 18 | # Array to store the extracted credentials 19 | $credentialsList = @() 20 | 21 | # Loop through each line in the .pgpass file 22 | foreach ($entry in $pgpassEntries) { 23 | # Skip comments and empty lines 24 | if ($entry -match '^\s*#' -or $entry -match '^\s*$') { 25 | continue 26 | } 27 | 28 | # Split the line by colon, expecting the format: hostname:port:database:username:password 29 | $fields = $entry -split ':' 30 | 31 | if ($fields.Length -eq 5) { 32 | # Create a custom object for each entry 33 | $credential = [PSCustomObject]@{ 34 | Hostname = $fields[0] 35 | Port = $fields[1] 36 | Database = $fields[2] 37 | Username = $fields[3] 38 | Password = $fields[4] 39 | } 40 | 41 | # Add the credential object to the list 42 | $credentialsList += $credential 43 | } 44 | else { 45 | Write-Warning "Invalid format in entry: $entry" 46 | } 47 | } 48 | 49 | # Output the results as a PowerShell object 50 | return $credentialsList 51 | } 52 | 53 | # Example usage: 54 | $pgpassCredentials = Get-PgPassCredentials -FilePath "c:\temp\configs\.pgpass" 55 | $pgpassCredentials 56 | 57 | <# .pgpass file - used for postgres 58 | 59 | # Format: hostname:port:database:username:password 60 | 61 | # Local database connection 62 | localhost:5432:mydatabase:myuser:mypassword 63 | 64 | # Remote database connection 65 | remote.server.com:5432:anotherdb:anotheruser:anotherpassword 66 | 67 | # Default connection for any database on localhost 68 | localhost:*:*:defaultuser:defaultpassword 69 | 70 | # Wildcard example: Any database and any user connecting to localhost 71 | localhost:*:*:*:supersecretpassword 72 | 73 | 74 | #> -------------------------------------------------------------------------------- /Scripts/ConfigParsers/parser-SiteManager.xml.ps1: -------------------------------------------------------------------------------- 1 | # Author: Scott Sutherland, NetSPI (@_nullbind / nullbind) 2 | 3 | # Function to check if a string is a valid base64-encoded string 4 | function IsBase64String { 5 | param ([string]$string) 6 | if ($string -match '^[a-zA-Z0-9\+/]*={0,2}$' -and ($string.Length % 4 -eq 0)) { 7 | return $true 8 | } 9 | return $false 10 | } 11 | 12 | # Function to process the SiteManager.xml file and extract server information 13 | function Get-SiteManagerServerInfo { 14 | param ( 15 | [string]$xmlFilePath 16 | ) 17 | 18 | # Check if the file exists 19 | if (-not (Test-Path $xmlFilePath)) { 20 | Write-Error "File not found: $xmlFilePath" 21 | return 22 | } 23 | 24 | # Load the XML file 25 | $xml = [xml](Get-Content $xmlFilePath) 26 | 27 | # Iterate through each server entry and extract relevant information 28 | $xml.FileZilla3.Servers.Server | ForEach-Object { 29 | $decodedPassword = "Invalid or not present" 30 | 31 | # Access the Pass element's inner text, ensuring it's properly treated as a string 32 | [string]$base64Pass = $_.Pass.InnerText 33 | # Check if the password is a valid base64 string before decoding 34 | if ($base64Pass) { 35 | try { 36 | # Trim any extra whitespace from the base64 string 37 | $cleanPass = $base64Pass.Trim() 38 | $decodedPassword = [System.Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($cleanPass)) 39 | } catch { 40 | $decodedPassword = "Error decoding password: $_" 41 | } 42 | } 43 | 44 | # Output the server details 45 | [pscustomobject]@{ 46 | Server = $_.Host 47 | Port = $_.Port 48 | Username = $_.User 49 | Password = $decodedPassword 50 | } 51 | } 52 | } 53 | 54 | # Example usage 55 | $xmlFilePath = "c:\temp\configs\SiteManager.xml" 56 | Get-SiteManagerServerInfo -xmlFilePath $xmlFilePath 57 | 58 | 59 | 60 | 61 | <# SiteManager.xml 62 | 63 | 64 | 65 | 66 | 67 | ftp.example.com 68 | 21 69 | 0 70 | 0 71 | username 72 | SGVsbG9QYXNzd29yZA== 73 | 1 74 | 0 75 | MODE_DEFAULT 76 | 0 77 | Auto 78 | 0 79 | My FTP Site 80 | Sample FTP site for demonstration 81 | 82 | 83 | 0 84 | 0 85 | 86 | 87 | 88 | sftp.example.com 89 | 22 90 | 1 91 | 1 92 | sftpuser 93 | SGVsbG9QYXNzd29yZA== 94 | 1 95 | 0 96 | MODE_DEFAULT 97 | 1 98 | Auto 99 | 0 100 | My SFTP Site 101 | Sample SFTP site 102 | 103 | 104 | 0 105 | 0 106 | 107 | 108 | 109 | 110 | 111 | #> -------------------------------------------------------------------------------- /Scripts/ConfigParsers/parser-bootstrap.ini.ps1: -------------------------------------------------------------------------------- 1 | # Author: Scott Sutherland, NetSPI (@_nullbind / nullbind) 2 | 3 | function Get-BootstrapConfig { 4 | param ( 5 | [string]$FilePath 6 | ) 7 | 8 | # Read all lines from the provided file path 9 | $iniContent = Get-Content -Path $FilePath 10 | 11 | # Initialize a hash table to store key-value pairs 12 | $fields = @{ 13 | Username = $null 14 | Password = $null 15 | Public = $null 16 | Private = $null 17 | Key = $null 18 | Secret = $null 19 | } 20 | 21 | # Loop through each line and look for the required fields 22 | foreach ($line in $iniContent) { 23 | if ($line -match 'username\s*=\s*(.*)') { 24 | $fields['Username'] = $matches[1].Trim() 25 | } 26 | if ($line -match 'password\s*=\s*(.*)') { 27 | $fields['Password'] = $matches[1].Trim() 28 | } 29 | if ($line -match 'public\s*=\s*(.*)') { 30 | $fields['Public'] = $matches[1].Trim() 31 | } 32 | if ($line -match 'private\s*=\s*(.*)') { 33 | $fields['Private'] = $matches[1].Trim() 34 | } 35 | if ($line -match 'key\s*=\s*(.*)') { 36 | $fields['Key'] = $matches[1].Trim() 37 | } 38 | if ($line -match 'secret\s*=\s*(.*)') { 39 | $fields['Secret'] = $matches[1].Trim() 40 | } 41 | } 42 | 43 | # Convert the hash table into a custom PowerShell object 44 | $configObject = [PSCustomObject]$fields 45 | 46 | # Output the custom object 47 | return $configObject 48 | } 49 | 50 | # Example call using the example file path 51 | $bootstrapIniPath = "c:\temp\configs\bootstrap.ini" 52 | $config = Get-BootstrapConfig -FilePath $bootstrapIniPath 53 | 54 | # Output the result 55 | $config 56 | 57 | 58 | <# bootstrap.ini 59 | 60 | [GeneralSettings] 61 | username=adminUser 62 | password=P@ssw0rd123 63 | timeout=30 64 | loglevel=info 65 | public=public 66 | private=mysecret 67 | secret=mysecret 68 | key=mykey 69 | 70 | [DatabaseSettings] 71 | db_name=my_database 72 | db_host=localhost 73 | db_port=3306 74 | 75 | [NetworkSettings] 76 | protocol=http 77 | port=8080 78 | 79 | #> 80 | -------------------------------------------------------------------------------- /Scripts/ConfigParsers/parser-config.xml.ps1: -------------------------------------------------------------------------------- 1 | # Author: Scott Sutherland, NetSPI (@_nullbind / nullbind) 2 | 3 | function Get-JenkinsUserCredentials { 4 | param ( 5 | [Parameter(Mandatory = $true)] 6 | [string]$FilePath 7 | ) 8 | 9 | # Ensure the file exists 10 | if (-Not (Test-Path $FilePath)) { 11 | Write-Error "File not found: $FilePath" 12 | return 13 | } 14 | 15 | # Read the XML content as plain text 16 | $xmlText = Get-Content -Path $FilePath -Raw 17 | 18 | # Replace XML version 1.1 with 1.0 19 | $xmlText = $xmlText -replace "version='1.1'", "version='1.0'" 20 | 21 | # Now parse the XML 22 | [xml]$xmlContent = [xml]$xmlText 23 | 24 | # Extract the full name (username) 25 | $fullName = $xmlContent.user.fullName 26 | 27 | # Extract the password hash 28 | $passwordHash = $xmlContent.user.properties.'hudson.security.HudsonPrivateSecurityRealm_-Details'.passwordHash 29 | 30 | # Create and return the result as a PowerShell object 31 | $result = [PSCustomObject]@{ 32 | Username = $fullName 33 | PasswordHash = $passwordHash 34 | } 35 | 36 | return $result 37 | } 38 | 39 | 40 | # Example usage: 41 | $userCredentials = Get-JenkinsUserCredentials -FilePath "c:\temp\configs\config.xml" 42 | $userCredentials 43 | 44 | 45 | <# config.xml - jenkins - hudson.security.HudsonPrivateSecurityRealm - stored in $JENKINS_HOME/users/username/config.xml 46 | 47 | $JENKINS_HOME/users/username/config.xml 48 | 49 | 50 | 51 | John Doe 52 | 53 | 54 | 55 | #jbcrypt:$2a$10$D6wVozrLhk.TIq.jBBKZluIh/EqzpjCUJFT/mWUnyAO4EYmxk5.aK 56 | 57 | 58 | 59 | 60 | #> -------------------------------------------------------------------------------- /Scripts/ConfigParsers/parser-context.xml.ps1: -------------------------------------------------------------------------------- 1 | # Author: Scott Sutherland, NetSPI (@_nullbind / nullbind) 2 | 3 | # Function to extract credentials from a given context.xml file 4 | function Get-CredentialsFromContextXml { 5 | param ( 6 | [string]$contextXmlPath 7 | ) 8 | 9 | # Check if the file exists 10 | if (-Not (Test-Path $contextXmlPath)) { 11 | Write-Host "File not found: $contextXmlPath" 12 | return 13 | } 14 | 15 | # Load the XML file 16 | [xml]$xml = Get-Content $contextXmlPath 17 | 18 | # Extract username and password from the Resource element 19 | $username = $xml.Context.Resource | Where-Object { $_.name -eq 'jdbc/MyDB' } | Select-Object -ExpandProperty username 20 | $password = $xml.Context.Resource | Where-Object { $_.name -eq 'jdbc/MyDB' } | Select-Object -ExpandProperty password 21 | 22 | # Create a PowerShell object to hold the extracted information 23 | $credentials = [PSCustomObject]@{ 24 | Username = $username 25 | Password = $password 26 | } 27 | 28 | # Return the credentials object 29 | return $credentials 30 | } 31 | 32 | # Example usage of the function 33 | $exampleFilePath = "c:\temp\configs\context.xml" 34 | $credentials = Get-CredentialsFromContextXml -contextXmlPath $exampleFilePath 35 | 36 | # Display the credentials 37 | $credentials 38 | 39 | <# context.xml 40 | 41 | 51 | 52 | 53 | #> -------------------------------------------------------------------------------- /Scripts/ConfigParsers/parser-dbvisxml.ps1: -------------------------------------------------------------------------------- 1 | 2 | # Author: Scott Sutherland, NetSPI (@_nullbind / nullbind) 3 | # Intended input: dbvis.xml files 4 | 5 | function Get-PwDbvisxml{ 6 | param ( 7 | [string]$ComputerName = $null, # Optional 8 | [string]$ShareName = $null, # Optional 9 | [string]$UncFilePath = $null, # Optional 10 | [string]$FileName = $null, # Optional 11 | [string]$FilePath # Required 12 | ) 13 | 14 | # Parameters for password decryption 15 | $password = "qinda" # hard-coded key 16 | $iterations = 10 17 | $salt = [byte[]]@(142, 18, 57, 156, 7, 114, 111, 90) 18 | 19 | # Create the key and cipher for PBEWithMD5AndDES 20 | $spec = New-Object System.Security.Cryptography.Rfc2898DeriveBytes($password, $salt, $iterations) 21 | $key = $spec.GetBytes(8) # DES key size is 8 bytes 22 | $des = New-Object System.Security.Cryptography.DESCryptoServiceProvider 23 | $des.Key = $key 24 | $des.IV = $salt[0..7] 25 | $des.Padding = 'PKCS7' 26 | 27 | # Decrypt Function 28 | function Decrypt-Pw ($encryptedText) { 29 | $encryptedBytes = [Convert]::FromBase64String($encryptedText) 30 | $decryptor = $des.CreateDecryptor() 31 | $decryptedBytes = $decryptor.TransformFinalBlock($encryptedBytes, 0, $encryptedBytes.Length) 32 | return [System.Text.Encoding]::UTF8.GetString($decryptedBytes) 33 | } 34 | 35 | # Load and parse dbvis.xml 36 | [xml]$xml = Get-Content -Path $FilePath 37 | 38 | # Extract connection details 39 | $connectionNode = $xml.dbvis.connections.connection 40 | 41 | # Extract required fields 42 | $targetServer = $connectionNode.url -replace 'jdbc:mysql://([^:/]+).*','$1' 43 | $targetPort = $connectionNode.url -replace '.*:(\d+)/.*','$1' 44 | $username = $connectionNode.user 45 | $passwordEnc = $connectionNode.password 46 | $decryptedPassword = Decrypt-Pw -encryptedText $passwordEnc 47 | 48 | # Return result object 49 | return [PSCustomObject]@{ 50 | ComputerName = $ComputerName 51 | ShareName = $ShareName 52 | UncFilePath = $UncFilePath 53 | FileName = $FileName 54 | Section = "NA" 55 | ObjectName = "NA" 56 | TargetURL = "NA" 57 | TargetServer = $targetServer 58 | TargetPort = $targetPort 59 | Database = "NA" 60 | Domain = "NA" 61 | Username = $username 62 | Password = $decryptedPassword 63 | PasswordEnc = $passwordEnc 64 | KeyFilePath = "NA" 65 | } 66 | } 67 | 68 | # Example command 69 | # Get-PwDbvisxml -ComputerName "MyComputer" -ShareName "MyShare" -UncFilePath "\\MyComputer\MyShare\dbvis.xml" -FileName "dbvis.xml" -FilePath "C:\temp\dbvis.xml" 70 | 71 | <# Sample dbvis.xml 72 | 73 | 74 | 75 | 76 | MyDatabaseConnection 77 | jdbc:mysql://localhost:3306/mydatabase 78 | db_user 79 | +mQwYxIFaEjZ/MWJDkm1SCWhHw7xPXWd 80 | com.mysql.jdbc.Driver 81 | 82 | 83 | 84 | 85 | #> 86 | 87 | <# Bonus encryption and decryption functions 88 | 89 | # Parameters 90 | $password = "qinda" 91 | $iterations = 10 92 | $salt = [byte[]]@(142, 18, 57, 156, 7, 114, 111, 90) 93 | 94 | # Create the key and cipher for PBEWithMD5AndDES 95 | $keyBytes = [System.Text.Encoding]::UTF8.GetBytes($password) 96 | $spec = New-Object System.Security.Cryptography.Rfc2898DeriveBytes($password, $salt, $iterations) 97 | $key = $spec.GetBytes(8) # DES key size is 8 bytes 98 | 99 | # Initialize DES encryption with PKCS7 padding 100 | $des = New-Object System.Security.Cryptography.DESCryptoServiceProvider 101 | $des.Key = $key 102 | $des.IV = $salt[0..7] # DES requires an 8-byte IV, derived from salt 103 | $des.Padding = 'PKCS7' # Set padding mode to PKCS7 104 | 105 | # Encrypt Function 106 | function Encrypt-Pw ($plainText) { 107 | $plainBytes = [System.Text.Encoding]::UTF8.GetBytes($plainText) 108 | $encryptor = $des.CreateEncryptor() 109 | $encryptedBytes = $encryptor.TransformFinalBlock($plainBytes, 0, $plainBytes.Length) 110 | return [Convert]::ToBase64String($encryptedBytes) 111 | } 112 | that 113 | # Example usage 114 | $plaintextPassword = "mydbvispasswordinclr" 115 | $encryptedPassword = Encrypt-Pw -plainText $plaintextPassword 116 | Write-Output "Encrypted Password: $encryptedPassword" 117 | 118 | # ----------- 119 | 120 | # Parameters 121 | $password = "qinda" 122 | $iterations = 10 123 | $salt = [byte[]]@(142, 18, 57, 156, 7, 114, 111, 90) 124 | 125 | # Create the key and cipher for PBEWithMD5AndDES 126 | $keyBytes = [System.Text.Encoding]::UTF8.GetBytes($password) 127 | $spec = New-Object System.Security.Cryptography.Rfc2898DeriveBytes($password, $salt, $iterations) 128 | $key = $spec.GetBytes(8) # DES key size is 8 bytes 129 | 130 | # Initialize DES encryption with PKCS7 padding 131 | $des = New-Object System.Security.Cryptography.DESCryptoServiceProvider 132 | $des.Key = $key 133 | $des.IV = $salt[0..7] # DES requires an 8-byte IV, derived from salt 134 | $des.Padding = 'PKCS7' # Set padding mode to PKCS7 135 | 136 | # Decrypt Function 137 | function Decrypt-Pw ($encryptedText) { 138 | $encryptedBytes = [Convert]::FromBase64String($encryptedText) 139 | $decryptor = $des.CreateDecryptor() 140 | $decryptedBytes = $decryptor.TransformFinalBlock($encryptedBytes, 0, $encryptedBytes.Length) 141 | return [System.Text.Encoding]::UTF8.GetString($decryptedBytes) 142 | } 143 | 144 | # Example usage 145 | $decryptedPassword = Decrypt-Pw -encryptedText $encryptedPassword 146 | Write-Output "Decrypted Password: $decryptedPassword" 147 | 148 | #> 149 | -------------------------------------------------------------------------------- /Scripts/ConfigParsers/parser-example.rdp.ps1: -------------------------------------------------------------------------------- 1 | # Author: Scott Sutherland, NetSPI (@_nullbind / nullbind) 2 | 3 | function Get-RdpCredentials { 4 | param ( 5 | [Parameter(Mandatory = $true)] 6 | [string]$FilePath 7 | ) 8 | 9 | # Check if the file exists 10 | if (-not (Test-Path -Path $FilePath)) { 11 | Write-Error "File not found: $FilePath" 12 | return 13 | } 14 | 15 | # Read the RDP file contents 16 | $rdpContent = Get-Content -Path $FilePath 17 | 18 | # Initialize variables to store username and password 19 | $username = "" 20 | $encryptedPassword = "" 21 | $decryptedPassword = "" 22 | 23 | # Parse the RDP file for username and encrypted password fields 24 | foreach ($line in $rdpContent) { 25 | if ($line -match "^username:s:(.+)$") { 26 | $username = $matches[1] 27 | } 28 | if ($line -match "^password 51:b:(.+)$") { 29 | $encryptedPassword = $matches[1] 30 | } 31 | } 32 | 33 | # Attempt to decrypt the password if it exists 34 | if ($encryptedPassword) { 35 | try { 36 | # Convert the encrypted password from Base64 to byte array 37 | $passwordBytes = [Convert]::FromBase64String($encryptedPassword) 38 | 39 | # Use DPAPI to decrypt the password 40 | $decryptedPassword = [System.Text.Encoding]::Unicode.GetString([System.Security.Cryptography.ProtectedData]::Unprotect($passwordBytes, $null, [System.Security.Cryptography.DataProtectionScope]::CurrentUser)) 41 | } catch { 42 | Write-Warning "Unable to decrypt password: $_" 43 | $decryptedPassword = "Unable to decrypt" 44 | } 45 | } else { 46 | $encryptedPassword = "No password found" 47 | $decryptedPassword = "No password found" 48 | } 49 | 50 | # Create a PowerShell object to return the results 51 | $result = [PSCustomObject]@{ 52 | Username = $username 53 | EncryptedPassword = $encryptedPassword 54 | DecryptedPassword = $decryptedPassword 55 | } 56 | 57 | return $result 58 | } 59 | 60 | 61 | # Example usage: 62 | $credentials = Get-RdpCredentials -FilePath "c:\temp\configs\example.rdp" 63 | $credentials 64 | 65 | 66 | <# example.rdp - decryption needs to be done on the target system using dpapi 67 | 68 | screen mode id:i:2 69 | desktopwidth:i:1920 70 | desktopheight:i:1080 71 | session bpp:i:32 72 | winposstr:s:0,3,0,0,800,600 73 | full address:s:yourserver.com 74 | username:s:YourUsername 75 | password 51:b:encrypted_password_value 76 | 77 | 78 | #> -------------------------------------------------------------------------------- /Scripts/ConfigParsers/parser-fetchmailrc.ps1: -------------------------------------------------------------------------------- 1 | # Author: Scott Sutherland, NetSPI (@_nullbind / nullbind) 2 | # Intended input: .fetchmailrc files 3 | 4 | function Get-PwFetchmailrc { 5 | param ( 6 | [string]$FilePath, 7 | [string]$ComputerName = "NA", 8 | [string]$ShareName = "NA", 9 | [string]$UncFilePath = "NA", 10 | [string]$FileName = "NA", 11 | [string]$TargetURL = "NA" 12 | ) 13 | 14 | if (-not (Test-Path -Path $FilePath)) { 15 | Write-Host "File not found: $FilePath" 16 | return 17 | } 18 | 19 | # Read and clean the lines into a modifiable list 20 | $lines = [System.Collections.Generic.List[string]](Get-Content -Path $FilePath | ForEach-Object { 21 | $_.Trim() 22 | } | Where-Object { $_ -notmatch '^#' }) # Remove comments 23 | 24 | # Consolidate multi-line configurations 25 | for ($i = $lines.Count - 1; $i -gt 0; $i--) { 26 | if ($lines[$i] -notmatch '^(defaults|poll|skip)\s+') { 27 | $lines[$i - 1] += " " + $lines[$i] 28 | $lines.RemoveAt($i) 29 | } 30 | } 31 | 32 | # Initialize variables 33 | $defaults = @{} 34 | $credentials = @() 35 | 36 | # Function to parse individual configuration lines 37 | function Parse-FetchmailRCLine { 38 | param ($line) 39 | $cred = @{ 40 | "Username" = @() 41 | "Password" = @() 42 | "TargetServer" = "" 43 | "Section" = "" 44 | "TargetPort" = "" 45 | } 46 | 47 | # Extract users, passwords, server, protocol, and port 48 | $userMatch = [regex]::Match($line, '\s+user(?:name)?\s+"([^"]+)"') 49 | if ($userMatch.Success) { 50 | $cred["Username"] = $userMatch.Groups[1].Value 51 | } 52 | 53 | $passMatch = [regex]::Match($line, '\s+pass(?:word)?\s+"([^"]+)"') 54 | if ($passMatch.Success) { 55 | $cred["Password"] = $passMatch.Groups[1].Value 56 | } 57 | 58 | $cred["TargetServer"] = if ($line -match '^(?:poll|skip)\s+(\S+)') { $matches[1] } else { $cred["TargetServer"] } 59 | $cred["Section"] = if ($line -match '\s+proto(?:col)?\s+(\S+)') { $matches[1] } else { $cred["Section"] } 60 | $cred["TargetPort"] = if ($line -match '\s+(?:port|service)\s+(\S+)') { $matches[1] } else { $cred["TargetPort"] } 61 | 62 | # Return credentials if found 63 | return $cred 64 | } 65 | 66 | # Parse each line for credentials 67 | foreach ($line in $lines) { 68 | # If 'defaults' line, save defaults 69 | if ($line -match '^defaults') { 70 | $defaults = Parse-FetchmailRCLine -line $line 71 | continue 72 | } 73 | 74 | # Parse line, merge with defaults if any 75 | $parsedCred = Parse-FetchmailRCLine -line $line 76 | foreach ($key in $defaults.Keys) { 77 | if (-not $parsedCred[$key] -or ($parsedCred[$key] -is [array] -and $parsedCred[$key].Count -eq 0)) { 78 | $parsedCred[$key] = $defaults[$key] 79 | } 80 | } 81 | 82 | # Add parsed credentials if valid 83 | if ($parsedCred["TargetServer"] -and $parsedCred["Section"] -and $parsedCred["Username"] -and $parsedCred["Password"]) { 84 | $credentials += [pscustomobject]@{ 85 | ComputerName = $ComputerName 86 | ShareName = $ShareName 87 | UncFilePath = $UncFilePath 88 | FileName = $FileName 89 | Section = $parsedCred["Section"] 90 | ObjectName = "NA" 91 | TargetURL = $TargetURL 92 | TargetServer = $parsedCred["TargetServer"] 93 | TargetPort = $parsedCred["TargetPort"] 94 | Database = "NA" 95 | Domain = "NA" 96 | Username = $parsedCred["Username"] 97 | Password = $parsedCred["Password"] 98 | PasswordEnc = "NA" 99 | KeyFilePath = "NA" 100 | } 101 | } 102 | } 103 | 104 | # Output credentials 105 | if ($credentials.Count -eq 0) { 106 | Write-Host "No credentials found in $FilePath" 107 | } else { 108 | $credentials | Format-Table -AutoSize 109 | } 110 | 111 | return $credentials 112 | } 113 | 114 | # Sample Command 115 | # Get-PwFetchmailrc -FilePath "C:\temp\.fetchmailrc" -ComputerName "MyComputer" -ShareName "MyShare" -UncFilePath "\\path\to\.fetchmailrc" -FileName ".fetchmailrc" 116 | 117 | <# Sample .fetchmailrc file 118 | 119 | # Global options 120 | set daemon 300 121 | 122 | # Default options for all servers 123 | defaults 124 | protocol IMAP 125 | port 993 126 | keep 127 | 128 | # Fetch mail from the first server 129 | poll mail.example.com 130 | proto IMAP 131 | user "user1@example.com" pass "password1" 132 | ssl 133 | 134 | # Fetch mail from another server with custom settings 135 | poll mail.anotherexample.com 136 | proto POP3 137 | user "user2@anotherexample.com" pass "password2" 138 | port 995 139 | ssl 140 | 141 | # Another example with a forwarding SMTP setup 142 | poll mail.forwardexample.com via smtp.example.com 143 | proto IMAP 144 | user "forwarduser@forwardexample.com" pass "forwardpassword" 145 | smtphost smtp.example.com 146 | esmtpname "smtpuser@example.com" esmtppassword "smtppassword" 147 | 148 | # Additional account with a different protocol and no SSL 149 | poll plainexample.com 150 | proto POP3 151 | user "plainuser@plainexample.com" pass "plainpassword" 152 | port 110 153 | 154 | 155 | #> 156 | -------------------------------------------------------------------------------- /Scripts/ConfigParsers/parser-gitcredentials.ps1: -------------------------------------------------------------------------------- 1 | # Author: Scott Sutherland, NetSPI (@_nullbind / nullbind) 2 | # Intended input: .git-credentials files 3 | function Get-PwGitCredentials { 4 | param ( 5 | [string]$ComputerName = $null, # Optional 6 | [string]$ShareName = $null, # Optional 7 | [string]$UncFilePath = $null, # Optional 8 | [string]$FileName = $null, # Optional 9 | [string]$FilePath # Required 10 | ) 11 | 12 | # Check if file exists 13 | if (-Not (Test-Path -Path $FilePath)) { 14 | Write-Error "File not found at path: $FilePath" 15 | return 16 | } 17 | 18 | # Array to store parsed credentials 19 | $credentialsList = @() 20 | 21 | # Parse each line in .git-credentials 22 | foreach ($line in Get-Content -Path $FilePath) { 23 | if ($line -match 'https://([^:]+):([^@]+)@(.*)') { 24 | $username = $matches[1] 25 | $passwordEnc = $matches[2] 26 | $targetServer = $matches[3] -replace '/.*', '' # Extract server without path 27 | $targetURL = $matches[3] 28 | 29 | # Create output structure 30 | $credentialsList += [PSCustomObject]@{ 31 | ComputerName = $ComputerName 32 | ShareName = $ShareName 33 | UncFilePath = $UncFilePath 34 | FileName = $FileName 35 | Section = "NA" 36 | ObjectName = "NA" 37 | TargetURL = $targetURL 38 | TargetServer = $targetServer 39 | TargetPort = "NA" # Not in .git-credentials format 40 | Database = "NA" 41 | Domain = "NA" 42 | Username = $username 43 | Password = "NA" # Decrypted password not available 44 | PasswordEnc = $passwordEnc # Original token/password as in file 45 | KeyFilePath = "NA" 46 | } 47 | } 48 | } 49 | 50 | # Return parsed credentials 51 | return $credentialsList 52 | } 53 | 54 | # Example usage 55 | # Get-PwGitCredentials -FilePath "C:\temp\.git-credentials" -ComputerName "MyComputer" -ShareName "MyShare" -UncFilePath "\\MyComputer\MyShare\.git-credentials" -FileName ".git-credentials" 56 | 57 | <# Example config 58 | 59 | https://username1:ghp_token1example@github.com 60 | https://username2:ghp_token2example@bitbucket.org 61 | https://my-gitlab-username:glpat_token3example@gitlab.com 62 | https://username4:ghp_token4example@company-git.example.com 63 | 64 | #> 65 | 66 | -------------------------------------------------------------------------------- /Scripts/ConfigParsers/parser-grub.cfg.ps1: -------------------------------------------------------------------------------- 1 | # Author: Scott Sutherland, NetSPI (@_nullbind / nullbind) 2 | # Intended input: grub.conf, grub.config, grub.cfg 3 | function Get-PwGrubConfig { 4 | param ( 5 | [string]$ComputerName = $null, # Optional 6 | [string]$ShareName = $null, # Optional 7 | [string]$UncFilePath = $null, # Optional 8 | [string]$FileName = $null, # Optional 9 | [string]$FilePath # Required 10 | ) 11 | 12 | # Check if the FilePath exists 13 | if (-not (Test-Path -Path $FilePath)) { 14 | Write-Error "File not found: $FilePath" 15 | return 16 | } 17 | 18 | # Initialize the output structure with default values 19 | $output = [pscustomobject]@{ 20 | ComputerName = $ComputerName 21 | ShareName = $ShareName 22 | UncFilePath = $UncFilePath 23 | FileName = $FileName 24 | Section = "NA" 25 | ObjectName = 'NA' 26 | TargetURL = "NA" 27 | TargetServer = "NA" 28 | TargetPort = "NA" 29 | Database = "NA" 30 | Domain = "NA" 31 | Username = "NA" 32 | Password = "NA" 33 | PasswordEnc = "NA" 34 | KeyFilePath = "NA" 35 | } 36 | 37 | # Read the file contents 38 | $fileContent = Get-Content -Path $FilePath -Raw 39 | 40 | # Extract the superuser username 41 | if ($fileContent -match 'set superusers\s*=\s*"([^"]+)"') { 42 | $output.Username = $matches[1].Trim() 43 | } 44 | 45 | # Use the extracted username in the password regex 46 | if ($output.Username -ne "NA") { 47 | $usernamePattern = [regex]::Escape($output.Username) 48 | $passwordPattern = "password\s+$usernamePattern\s+(\S+)" 49 | if ($fileContent -match $passwordPattern) { 50 | $output.Password = $matches[1].Trim() 51 | } 52 | } 53 | 54 | # Debug output to verify matching sections in file content 55 | if ($output.Username -eq "NA") { 56 | # Write-Host "Username not found. Ensure 'set superusers' syntax is correct." 57 | } else { 58 | # Write-Host "Username extracted successfully: $($output.Username)" 59 | } 60 | 61 | if ($output.Password -eq "NA") { 62 | # Write-Host "Password not found. Ensure 'password ' syntax is correct." 63 | } else { 64 | # Write-Host "Password extracted successfully: $($output.Password)" 65 | } 66 | 67 | # Return the output structure 68 | return $output 69 | } 70 | 71 | # Get-PwGrubConfig -FilePath "C:\temp\grub.cfg" -ComputerName "MyComputer" -ShareName "MyShare" -FileName grub.cfg 72 | 73 | <# grub.cfg 74 | 75 | # Set the default menu entry to boot 76 | set default=0 77 | 78 | # Set the timeout for the GRUB menu 79 | set timeout=5 80 | 81 | # Set the GRUB background image (optional) 82 | if loadfont /boot/grub/fonts/unicode.pf2; then 83 | insmod gfxterm 84 | insmod png 85 | set gfxmode=auto 86 | set background_image="/boot/grub/background.png" 87 | terminal_output gfxterm 88 | fi 89 | 90 | # Define the superuser and plain-text password (for demo purposes only) 91 | set superusers="admin" 92 | password admin myplaintextpassword 93 | 94 | # Load necessary modules for Linux booting 95 | insmod gzio 96 | insmod part_msdos 97 | insmod ext2 98 | 99 | # Specify the path to the main GRUB boot configuration 100 | set root='hd0,msdos1' 101 | search --no-floppy --fs-uuid --set=root 1234-5678 102 | 103 | # Boot menu entries 104 | menuentry 'Ubuntu 22.04 LTS' --class ubuntu --class gnu-linux --class os { 105 | recordfail 106 | load_video 107 | gfxmode $linux_gfx_mode 108 | insmod gzio 109 | insmod part_msdos 110 | insmod ext2 111 | set root='hd0,msdos1' 112 | linux /vmlinuz-5.15.0-30-generic root=UUID=1234-5678 ro quiet splash 113 | initrd /initrd.img-5.15.0-30-generic 114 | } 115 | 116 | # Protected entry for recovery mode (requires superuser password) 117 | menuentry 'Ubuntu 22.04 LTS (Recovery Mode)' --class ubuntu --class gnu-linux --class os --unrestricted { 118 | recordfail 119 | load_video 120 | gfxmode $linux_gfx_mode 121 | insmod gzio 122 | insmod part_msdos 123 | insmod ext2 124 | set root='hd0,msdos1' 125 | linux /vmlinuz-5.15.0-30-generic root=UUID=1234-5678 ro recovery nomodeset 126 | initrd /initrd.img-5.15.0-30-generic 127 | } 128 | 129 | # Additional entry for Windows booting (if dual-booted) 130 | menuentry 'Windows 10' --class windows --class os { 131 | insmod part_msdos 132 | insmod ntfs 133 | set root='hd0,msdos2' 134 | chainloader +1 135 | } 136 | 137 | # Boot to GRUB command line (restricted access, requires superuser password) 138 | menuentry 'GRUB Command Line' --class cmdline --unrestricted { 139 | insmod all_video 140 | terminal_input console 141 | terminal_output console 142 | } 143 | 144 | #> 145 | -------------------------------------------------------------------------------- /Scripts/ConfigParsers/parser-htpasswd.ps1: -------------------------------------------------------------------------------- 1 | # Author: Scott Sutherland, NetSPI (@_nullbind / nullbind) 2 | 3 | function Get-HtpasswdContent { 4 | param ( 5 | [string]$FilePath 6 | ) 7 | 8 | # Check if the file exists 9 | if (-Not (Test-Path $FilePath)) { 10 | Write-Error "File not found at path: $FilePath" 11 | return 12 | } 13 | 14 | # Read the file contents 15 | $lines = Get-Content $FilePath 16 | 17 | # Initialize an array to store user objects 18 | $users = @() 19 | 20 | # Process each line 21 | foreach ($line in $lines) { 22 | # Split each line into username and hashed password 23 | $parts = $line -split ':', 2 24 | if ($parts.Length -eq 2) { 25 | # Create a custom object for each user 26 | $userObj = [pscustomobject]@{ 27 | Username = $parts[0] 28 | PasswordHash = $parts[1] 29 | } 30 | # Add the user object to the array 31 | $users += $userObj 32 | } 33 | } 34 | 35 | # Output the results 36 | return $users 37 | } 38 | 39 | # Example usage 40 | $result = Get-HtpasswdContent -FilePath "c:\temp\configs\.htpasswd" 41 | $result 42 | 43 | <# .htpasswd 44 | 45 | user1:$apr1$5lRQ1y3v$pmOQf9/fNVE5dTtQDBl9D1 46 | user2:$apr1$Jd9UE91p$J/H8G9HSvj5l8LKQ2qfd3. 47 | admin:$apr1$GZJoqjNF$wl8IjDhZC84z5Bb4wHOv50 48 | 49 | 50 | #> -------------------------------------------------------------------------------- /Scripts/ConfigParsers/parser-jboss-cli.xml.ps1: -------------------------------------------------------------------------------- 1 | # Author: Scott Sutherland, NetSPI (@_nullbind / nullbind) 2 | 3 | # Define the function to extract username and password from a jboss-cli.xml file and return an object 4 | function Get-JbossCredentials { 5 | param ( 6 | [string]$FilePath 7 | ) 8 | 9 | # Check if the file exists 10 | if (-not (Test-Path -Path $FilePath)) { 11 | Write-Error "File not found: $FilePath" 12 | return $null 13 | } 14 | 15 | # Load the XML file 16 | [xml]$jbossCliXml = Get-Content -Path $FilePath 17 | 18 | # Extract the username and password 19 | $username = $jbossCliXml."jboss-cli".authentication.username 20 | $password = $jbossCliXml."jboss-cli".authentication.password 21 | 22 | # Return a PowerShell object with the username and password 23 | return [pscustomobject]@{ 24 | Username = $username 25 | Password = $password 26 | } 27 | } 28 | 29 | # Example usage 30 | $xmlFilePath = "c:\temp\configs\jboss-cli.xml" 31 | $credentials = Get-JbossCredentials -FilePath $xmlFilePath 32 | 33 | # Output the returned object (optional for testing) 34 | $credentials 35 | 36 | <# jboss-cli.xml 37 | 38 | 39 | 40 | 41 | 127.0.0.1 42 | 9990 43 | 44 | 45 | 46 | 47 | admin 48 | password 49 | 50 | 51 | 52 | 53 | false 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | true 69 | 500 70 | 71 | 72 | 73 | #> 74 | -------------------------------------------------------------------------------- /Scripts/ConfigParsers/parser-krb5.conf.ps1: -------------------------------------------------------------------------------- 1 | # Author: Scott Sutherland, NetSPI (@_nullbind / nullbind) 2 | 3 | function Get-ConfigCredentials { 4 | [CmdletBinding()] 5 | param ( 6 | [Parameter(Mandatory = $true)] 7 | [string]$FilePath 8 | ) 9 | 10 | # Initialize a hashtable to store extracted values 11 | $configData = @{ 12 | Domain = $null 13 | Server = $null 14 | Username = $null 15 | Password = $null 16 | } 17 | 18 | # Check if the file exists 19 | if (-Not (Test-Path -Path $FilePath)) { 20 | Write-Error "File not found: $FilePath" 21 | return 22 | } 23 | 24 | # Read the configuration file 25 | $configFile = Get-Content -Path $FilePath 26 | 27 | # Parse the configuration file line by line 28 | foreach ($line in $configFile) { 29 | # Ignore comment lines and empty lines 30 | if ($line -match '^\s*#' -or $line -match '^\s*$') { 31 | continue 32 | } 33 | 34 | # Extract the domain (e.g., default_realm or ad_domain or similar) 35 | if ($line -match 'default_realm\s*=\s*(.+)') { 36 | $configData.Domain = $matches[1].Trim() 37 | } 38 | 39 | # Extract the server (e.g., kdc or krb5_server or similar) 40 | if ($line -match 'kdc\s*=\s*(.+)') { 41 | $configData.Server = $matches[1].Trim() 42 | } 43 | 44 | # Extract the username (e.g., principal or ldap_default_bind_dn or similar) 45 | if ($line -match 'principal\s*=\s*(.+)') { 46 | $configData.Username = $matches[1].Trim() 47 | } 48 | elseif ($line -match 'ldap_default_bind_dn\s*=\s*(.+)') { 49 | $configData.Username = $matches[1].Trim() 50 | } 51 | 52 | # Extract the password (e.g., password or ldap_default_authtok or similar) 53 | if ($line -match 'password\s*=\s*(.+)') { 54 | $configData.Password = $matches[1].Trim() 55 | } 56 | elseif ($line -match 'ldap_default_authtok\s*=\s*(.+)') { 57 | $configData.Password = $matches[1].Trim() 58 | } 59 | } 60 | 61 | # Output the extracted configuration as a PowerShell object 62 | [PSCustomObject]@{ 63 | Domain = $configData.Domain 64 | Server = $configData.Server 65 | Username = $configData.Username 66 | Password = $configData.Password 67 | } 68 | } 69 | 70 | # Example usage: 71 | $config = Get-ConfigCredentials -FilePath "c:\temp\configs\krb5.conf" 72 | $config | Format-List 73 | 74 | 75 | <# krb5.conf - use for kerberos authention on linux systems 76 | 77 | [libdefaults] 78 | default_realm = EXAMPLE.COM 79 | dns_lookup_realm = false 80 | dns_lookup_kdc = true 81 | rdns = false 82 | ticket_lifetime = 24h 83 | forwardable = yes 84 | 85 | [realms] 86 | EXAMPLE.COM = { 87 | kdc = ad.example.com 88 | admin_server = ad.example.com 89 | default_domain = example.com 90 | } 91 | 92 | [domain_realm] 93 | .example.com = EXAMPLE.COM 94 | example.com = EXAMPLE.COM 95 | 96 | # Insecure: Exposing credentials in krb5.conf for automated ticket retrieval (NOT recommended) 97 | [login] 98 | krb5_get_init_creds_keytab = false 99 | 100 | # Insecure: Plaintext credentials for AD principal 101 | [appdefaults] 102 | kinit = { 103 | principal = admin@EXAMPLE.COM 104 | password = P@ssw0rd123 105 | } 106 | 107 | pam = { 108 | debug = false 109 | ticket_lifetime = 36000 110 | renew_lifetime = 36000 111 | forwardable = true 112 | } 113 | 114 | 115 | #> -------------------------------------------------------------------------------- /Scripts/ConfigParsers/parser-my.cnf.ps1: -------------------------------------------------------------------------------- 1 |  2 | # Author: Scott Sutherland, NetSPI (@_nullbind / nullbind) 3 | 4 | function Get-MySQLCredentials { 5 | param ( 6 | [string]$FilePath 7 | ) 8 | 9 | # Check if the file exists 10 | if (-Not (Test-Path -Path $FilePath)) { 11 | Write-Error "File not found: $FilePath" 12 | return $null 13 | } 14 | 15 | # Read the file content 16 | $fileContent = Get-Content -Path $FilePath 17 | 18 | # Initialize variables to store username and password 19 | $username = $null 20 | $password = $null 21 | 22 | # Parse the file content 23 | foreach ($line in $fileContent) { 24 | if ($line -match '^\s*user\s*=\s*(.+)$') { 25 | $username = $matches[1].Trim() 26 | } 27 | elseif ($line -match '^\s*password\s*=\s*(.+)$') { 28 | $password = $matches[1].Trim() 29 | } 30 | } 31 | 32 | # Check if both username and password are found 33 | if ($username -and $password) { 34 | # Create a custom PowerShell object to return the credentials 35 | $credentials = [PSCustomObject]@{ 36 | Username = $username 37 | Password = $password 38 | } 39 | return $credentials 40 | } else { 41 | Write-Warning "Username or password not found in the file." 42 | return $null 43 | } 44 | } 45 | 46 | # Example usage: 47 | $credentials = Get-MySQLCredentials -FilePath "c:\temp\configs\my.cnf" 48 | $credentials 49 | 50 | 51 | <# my.cnf 52 | 53 | [client] 54 | # Client configuration options 55 | user=yourusername 56 | password=yourpassword 57 | port=3306 58 | socket=/var/run/mysqld/mysqld.sock 59 | 60 | [mysqld] 61 | # MySQL server configuration 62 | user=mysql 63 | pid-file=/var/run/mysqld/mysqld.pid 64 | socket=/var/run/mysqld/mysqld.sock 65 | port=3306 66 | basedir=/usr 67 | datadir=/var/lib/mysql 68 | tmpdir=/tmp 69 | log-error=/var/log/mysql/error.log 70 | bind-address=127.0.0.1 71 | max_connections=100 72 | skip-external-locking 73 | 74 | # Buffer pool size for InnoDB 75 | innodb_buffer_pool_size=256M 76 | 77 | # Other MySQL server settings 78 | max_allowed_packet=16M 79 | query_cache_limit=1M 80 | query_cache_size=16M 81 | log_bin=/var/log/mysql/mysql-bin.log 82 | 83 | [mysql] 84 | # Client-specific settings for the MySQL command-line tool 85 | user=yourusername 86 | password=yourpassword 87 | no-auto-rehash 88 | 89 | #> -------------------------------------------------------------------------------- /Scripts/ConfigParsers/parser-netrc.ps1: -------------------------------------------------------------------------------- 1 | # Author: Scott Sutherland, NetSPI (@_nullbind / nullbind) 2 | # Intended input: .netrc file 3 | function Get-PwNetrc { 4 | param ( 5 | [string]$ComputerName = $null, # Optional 6 | [string]$ShareName = $null, # Optional 7 | [string]$UncFilePath = $null, # Optional 8 | [string]$FileName = $null, # Optional 9 | [string]$FilePath # Required 10 | ) 11 | 12 | # Initialize an array to store parsed entries 13 | $entries = @() 14 | 15 | # Read file contents 16 | $fileContent = Get-Content -Path $FilePath -ErrorAction Stop 17 | 18 | # Initialize variables for each entry 19 | $currentEntry = @{ 20 | ComputerName = $ComputerName 21 | ShareName = $ShareName 22 | UncFilePath = $UncFilePath 23 | FileName = $FileName 24 | Section = "NA" 25 | ObjectName = "NA" 26 | TargetURL = "NA" 27 | TargetServer = "NA" 28 | TargetPort = "NA" 29 | Database = "NA" 30 | Domain = "NA" 31 | Username = "NA" 32 | Password = "NA" 33 | PasswordEnc = "NA" 34 | KeyFilePath = "NA" 35 | } 36 | 37 | # Parse lines from the .netrc file 38 | foreach ($line in $fileContent) { 39 | # Match each .netrc directive with regex 40 | if ($line -match "^machine\s+(\S+)") { 41 | # If an entry already exists, add it to the array 42 | if ($currentEntry.TargetServer -ne "NA") { 43 | $entries += [pscustomobject]$currentEntry 44 | } 45 | # Start a new entry 46 | $currentEntry.TargetServer = $matches[1] 47 | $currentEntry.Username = "NA" 48 | $currentEntry.Password = "NA" 49 | } 50 | elseif ($line -match "^login\s+(\S+)") { 51 | $currentEntry.Username = $matches[1] 52 | } 53 | elseif ($line -match "^password\s+(\S+)") { 54 | $currentEntry.Password = $matches[1] 55 | } 56 | } 57 | 58 | # Add the last entry if present 59 | if ($currentEntry.TargetServer -ne "NA") { 60 | $entries += [pscustomobject]$currentEntry 61 | } 62 | 63 | # Output the result 64 | return $entries 65 | } 66 | 67 | # Sample command 68 | # Get-PwNetrc -ComputerName "MyComputer" -ShareName "MyShare" -UncFilePath "\\MyComputer\MyShare\netrc" -FileName ".netrc" -FilePath "C:\temp\.netrc" 69 | 70 | <# .netrc sample file 71 | 72 | # Sample .netrc file 73 | 74 | # Configuration for accessing example.com 75 | machine example.com 76 | login exampleuser 77 | password examplepass 78 | 79 | # Configuration for accessing another-site.com 80 | machine another-site.com 81 | login anotheruser 82 | password anotherpass 83 | 84 | # Configuration for accessing an FTP server at ftp.myserver.com 85 | machine ftp.myserver.com 86 | login ftpuser 87 | password ftppass 88 | 89 | # Configuration with an account for systems that require it 90 | machine account-required.com 91 | login myuser 92 | password mypassword 93 | account myaccount 94 | 95 | # Wildcard for default login when no specific machine is specified 96 | default 97 | login defaultuser 98 | password defaultpass 99 | 100 | #> 101 | -------------------------------------------------------------------------------- /Scripts/ConfigParsers/parser-php.ini.ps1: -------------------------------------------------------------------------------- 1 | # Author: Scott Sutherland, NetSPI (@_nullbind / nullbind) 2 | 3 | function Get-PhpIniCredentials { 4 | [CmdletBinding()] 5 | param ( 6 | [Parameter(Mandatory = $true)] 7 | [string]$FilePath 8 | ) 9 | 10 | # Initialize a hashtable to store extracted values 11 | $configData = @{ 12 | Username = $null 13 | Password = $null 14 | } 15 | 16 | # Check if the file exists 17 | if (-Not (Test-Path -Path $FilePath)) { 18 | Write-Error "File not found: $FilePath" 19 | return 20 | } 21 | 22 | # Read the configuration file 23 | $configFile = Get-Content -Path $FilePath 24 | 25 | # Parse the configuration file line by line 26 | foreach ($line in $configFile) { 27 | # Ignore comment lines and empty lines 28 | if ($line -match '^\s*;' -or $line -match '^\s*$') { 29 | continue 30 | } 31 | 32 | # Extract the username (e.g., mysql.default_user) 33 | if ($line -match '^\s*mysql\.default_user\s*=\s*"(.+)"') { 34 | $configData.Username = $matches[1].Trim() 35 | } 36 | 37 | # Extract the password (e.g., mysql.default_password) 38 | if ($line -match '^\s*mysql\.default_password\s*=\s*"(.+)"') { 39 | $configData.Password = $matches[1].Trim() 40 | } 41 | } 42 | 43 | # Output the extracted configuration as a PowerShell object 44 | [PSCustomObject]@{ 45 | Username = $configData.Username 46 | Password = $configData.Password 47 | } 48 | } 49 | 50 | # Example usage: 51 | $credentials = Get-PhpIniCredentials -FilePath "c:\temp\configs\php.ini" 52 | $credentials | Format-List 53 | 54 | 55 | <# php.ini - storing mysql credentials 56 | 57 | 58 | [PHP] 59 | ; Basic PHP settings 60 | 61 | ; Maximum size of POST data allowed 62 | post_max_size = 8M 63 | 64 | ; Maximum allowed size for uploaded files 65 | upload_max_filesize = 2M 66 | 67 | ; INSECURE: Storing database credentials in php.ini (not recommended) 68 | ; This exposes credentials to anyone with access to php.ini or via phpinfo() if not secured. 69 | 70 | mysql.default_user = "dbuser" 71 | mysql.default_password = "P@ssw0rd123" 72 | mysql.default_host = "localhost" 73 | mysql.default_database = "example_db" 74 | 75 | ; Log errors to a file 76 | log_errors = On 77 | error_log = /var/log/php_errors.log 78 | 79 | ; Ensure that this option is Off to avoid disclosing sensitive configuration details 80 | expose_php = Off 81 | 82 | ; Ensure that phpinfo() is secured or disabled to prevent exposure of configuration data 83 | disable_functions = phpinfo 84 | 85 | 86 | #> -------------------------------------------------------------------------------- /Scripts/ConfigParsers/parser-pureftpd.passwd.ps1: -------------------------------------------------------------------------------- 1 | # Author: Scott Sutherland, NetSPI (@_nullbind / nullbind) 2 | 3 | function Get-PureFtpCredentials { 4 | param ( 5 | [Parameter(Mandatory = $true)] 6 | [string]$FilePath 7 | ) 8 | 9 | # Check if the file exists 10 | if (-Not (Test-Path $FilePath)) { 11 | Write-Error "The file at path $FilePath does not exist." 12 | return 13 | } 14 | 15 | # Initialize an array to store user credentials 16 | $credentials = @() 17 | 18 | # Read the file line by line 19 | Get-Content $FilePath | ForEach-Object { 20 | # Skip empty lines 21 | if ($_ -match '^\s*$') { return } 22 | 23 | # Split the line into components using ':' as delimiter 24 | $fields = $_ -split ':' 25 | 26 | # Check if we have at least the username and password fields 27 | if ($fields.Length -ge 2) { 28 | $username = $fields[0] 29 | $passwordHash = $fields[1] 30 | 31 | # Create a custom object for each user 32 | $credentialObject = [PSCustomObject]@{ 33 | Username = $username 34 | PasswordHash = $passwordHash 35 | } 36 | 37 | # Add the object to the credentials array 38 | $credentials += $credentialObject 39 | } else { 40 | Write-Error "The line '$_' does not contain enough fields." 41 | } 42 | } 43 | 44 | # Output the results as a PowerShell object array 45 | return $credentials 46 | } 47 | 48 | 49 | $ftpCredentials = Get-PureFtpCredentials -FilePath "c:\temp\configs\pureftpd.passwd" 50 | $ftpCredentials | Format-Table 51 | 52 | 53 | <# pureftpd.passwd - used by pureftpd, passwords stored as MD5 or SHA-1 hash 54 | 55 | username:$1$X9p2ER8W$M7P5CxX5CHPxuAiB5BBJq/:1001:1001::/home/ftp/username:/bin/false:: 56 | user2:$1$XYz3ERzW$G9P7CxF6CPxxuAiB6BBJq/:1002:1002::/home/ftp/user2:/bin/false:: 57 | 58 | 59 | #> -------------------------------------------------------------------------------- /Scripts/ConfigParsers/parser-putty.reg.ps1: -------------------------------------------------------------------------------- 1 | # Author: Scott Sutherland, NetSPI (@_nullbind / nullbind) 2 | # Putty.reg does not store passwords, but can point to private keys 3 | 4 | function Parse-PuttyRegFile { 5 | param ( 6 | [string]$filePath 7 | ) 8 | 9 | # Check if the file exists 10 | if (-not (Test-Path $filePath)) { 11 | Write-Host "File not found: $filePath" 12 | return 13 | } 14 | 15 | # Read the contents of the .reg file 16 | $regContent = Get-Content -Path $filePath 17 | 18 | # Create a list to store extracted session details 19 | $sessionDetails = @() 20 | 21 | # Variables to hold extracted data for each session 22 | $currentSession = "" 23 | $hostName = "" 24 | $portNumber = "" 25 | $userName = "" 26 | $privateKeyPath = "" 27 | 28 | # Iterate through the lines of the file 29 | foreach ($line in $regContent) { 30 | # Detect session headers (e.g., "[HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\My%20SSH%20Session]") 31 | if ($line -match '^\[HKEY_CURRENT_USER\\Software\\SimonTatham\\PuTTY\\Sessions\\(.+?)\]') { 32 | # If we're processing a new session, save the previous one 33 | if ($currentSession -ne "") { 34 | $sessionDetails += [pscustomobject]@{ 35 | Session = $currentSession 36 | HostName = $hostName 37 | Port = [int]$portNumber 38 | UserName = $userName 39 | PrivateKeyPath = $privateKeyPath 40 | } 41 | } 42 | 43 | # Reset variables for the new session 44 | $currentSession = $matches[1] 45 | $hostName = "" 46 | $portNumber = "" 47 | $userName = "" 48 | $privateKeyPath = "" 49 | } 50 | 51 | # Extract HostName 52 | if ($line -match '"HostName"="(.+?)"') { 53 | $hostName = $matches[1] 54 | } 55 | 56 | # Extract PortNumber (convert hex to decimal) 57 | if ($line -match '"PortNumber"=dword:(\w{8})') { 58 | $portNumber = [convert]::ToInt32($matches[1], 16) 59 | } 60 | 61 | # Extract UserName 62 | if ($line -match '"UserName"="(.+?)"') { 63 | $userName = $matches[1] 64 | } 65 | 66 | # Extract PrivateKeyFile (path to the private key) 67 | if ($line -match '"PublicKeyFile"="(.+?)"') { 68 | $privateKeyPath = $matches[1] 69 | } 70 | } 71 | 72 | # After the loop, add the last session if it exists 73 | if ($currentSession -ne "") { 74 | $sessionDetails += [pscustomobject]@{ 75 | Session = $currentSession 76 | HostName = $hostName 77 | Port = [int]$portNumber 78 | UserName = $userName 79 | PrivateKeyPath = $privateKeyPath 80 | } 81 | } 82 | 83 | # Return the session details 84 | return $sessionDetails 85 | } 86 | 87 | # Example usage: 88 | $puttySessions = Parse-PuttyRegFile -filePath "c:\temp\configs\putty.reg" 89 | 90 | # Display the results 91 | $puttySessions | Format-Table -AutoSize 92 | 93 | 94 | <# putty.reg 95 | 96 | Windows Registry Editor Version 5.00 97 | 98 | [HKEY_CURRENT_USER\Software\SimonTatham\PuTTY] 99 | "TermWidth"=dword:00000050 100 | "TermHeight"=dword:00000018 101 | "WinTitle"="PuTTY" 102 | 103 | [HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\Default%20Settings] 104 | "HostName"="" 105 | "PortNumber"=dword:00000016 106 | "Protocol"="ssh" 107 | "TerminalType"="xterm" 108 | "Font"="Courier New" 109 | "FontHeight"=dword:0000000a 110 | "WinHeight"=dword:00000018 111 | "WinWidth"=dword:00000050 112 | "ConnectionSharing"=dword:00000001 113 | 114 | [HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\My%20SSH%20Session] 115 | "HostName"="192.168.1.100" 116 | "PortNumber"=dword:00000016 117 | "Protocol"="ssh" 118 | "TerminalType"="xterm" 119 | "Font"="Courier New" 120 | "FontHeight"=dword:0000000a 121 | "WinHeight"=dword:00000018 122 | "WinWidth"=dword:00000050 123 | "Compression"=dword:00000001 124 | "ConnectionSharing"=dword:00000001 125 | "PublicKeyFile"="C:\\Users\\YourUsername\\.ssh\\id_rsa.ppk" 126 | "LogFileName"="C:\\putty_logs\\my_session.log" 127 | "LogType"=dword:00000001 128 | "LogFileClash"=dword:00000001 129 | "LogFlush"=dword:00000001 130 | "LogOmitPasswords"=dword:00000001 131 | "LogOmitData"=dword:00000000 132 | "UserName"="myusername" ; Username stored here 133 | 134 | 135 | #> -------------------------------------------------------------------------------- /Scripts/ConfigParsers/parser-remmina.ps1: -------------------------------------------------------------------------------- 1 | 2 | # Author: Scott Sutherland, NetSPI (@_nullbind / nullbind) 3 | # Intended input: .remmina file 4 | function Get-PwRemmina { 5 | param ( 6 | [string]$ComputerName = $null, 7 | [string]$ShareName = $null, 8 | [string]$UncFilePath = $null, 9 | [string]$FileName = $null, 10 | [string]$FilePath # Required 11 | ) 12 | 13 | # Array to hold individual records 14 | $outputArray = @() 15 | 16 | # Check if the file exists 17 | if (-not (Test-Path -Path $FilePath)) { 18 | Write-Host "File not found at path: $FilePath" 19 | return $outputArray 20 | } 21 | 22 | # Read the file content and parse for each protocol setting 23 | $fileContent = Get-Content -Path $FilePath 24 | 25 | # Initialize variables for each record type 26 | $vncSettings = @{ 27 | ComputerName = $ComputerName 28 | ShareName = $ShareName 29 | UncFilePath = $UncFilePath 30 | FileName = $FileName 31 | Section = "NA" 32 | ObjectName = "VNC" 33 | TargetURL = "NA" 34 | TargetServer = "NA" 35 | TargetPort = "NA" 36 | Database = "NA" 37 | Domain = "NA" 38 | Username = "NA" 39 | Password = "NA" 40 | PasswordEnc = "NA" 41 | KeyFilePath = "NA" 42 | } 43 | 44 | $sshSettings = @{ 45 | ComputerName = $ComputerName 46 | ShareName = $ShareName 47 | UncFilePath = $UncFilePath 48 | FileName = $FileName 49 | Section = "NA" 50 | ObjectName = "SSH" 51 | TargetURL = "NA" 52 | TargetServer = "NA" 53 | TargetPort = "NA" 54 | Database = "NA" 55 | Domain = "NA" 56 | Username = "NA" 57 | Password = "NA" 58 | PasswordEnc = "NA" 59 | KeyFilePath = "NA" 60 | } 61 | 62 | # Parse each line and fill in the appropriate settings 63 | foreach ($line in $fileContent) { 64 | if ($line -match "^protocol=(.+)") { 65 | $protocol = $matches[1].Trim() 66 | if ($protocol -eq "VNC") { 67 | $vncSettings["ObjectName"] = "VNC" 68 | } elseif ($protocol -eq "SSH") { 69 | $sshSettings["ObjectName"] = "SSH" 70 | } 71 | } 72 | elseif ($line -match "^server=(.+)") { 73 | $vncSettings["TargetServer"] = $matches[1].Trim() 74 | } elseif ($line -match "^listenport=(\d+)") { 75 | $vncSettings["TargetPort"] = $matches[1].Trim() 76 | } elseif ($line -match "^username=(.+)") { 77 | $vncSettings["Username"] = $matches[1].Trim() 78 | } elseif ($line -match "^password=(.+)") { 79 | $vncSettings["Password"] = $matches[1].Trim() 80 | } 81 | elseif ($line -match "^ssh_server=(.+)") { 82 | $sshSettings["TargetServer"] = $matches[1].Trim() 83 | } elseif ($line -match "^ssh_username=(.+)") { 84 | $sshSettings["Username"] = $matches[1].Trim() 85 | } elseif ($line -match "^ssh_privatekey=(.+)") { 86 | $sshSettings["KeyFilePath"] = $matches[1].Trim() 87 | } 88 | } 89 | 90 | # Add each filled record to the output array 91 | $outputArray += [PSCustomObject]$vncSettings 92 | $outputArray += [PSCustomObject]$sshSettings 93 | 94 | # Return the array of records 95 | return $outputArray 96 | } 97 | 98 | # Example command 99 | # Get-PwRemmina -ComputerName "MyComputer" -ShareName "MyShare" -UncFilePath "\\MyComputer\MyShare\.remmina" -FileName ".remmina" -FilePath "C:\temp\.remmina" 100 | 101 | <# .remmina example config 102 | 103 | [remmina] 104 | name=myvnc 105 | group=RemoteServers ; Group label for organization, such as "RemoteServers" 106 | server=192.168.1.10 107 | protocol=VNC 108 | username=myusername 109 | password=mysecretpassword ; Avoid storing passwords in cleartext; keyring storage is recommended 110 | domain=demo.com 111 | clientname= ; Leave empty to use the default client name 112 | 113 | # Display settings 114 | resolution=AUTO ; Use AUTO for adaptive resolution 115 | keymap=default ; Default keymap for the connection 116 | gkeymap= ; Global keymap if different from the default 117 | colordepth=16 ; Color depth setting 118 | quality=9 ; Set connection quality, 0 to 9 (9 = best quality) 119 | viewmode=1 ; Set view mode: 1 for full screen, 4 for windowed 120 | 121 | # Connection and scaling 122 | listenport=5500 ; Port Remmina listens on for reverse connections 123 | hscale=100 ; Horizontal scale in percent, e.g., 100% = no scaling 124 | vscale=100 ; Vertical scale in percent, e.g., 100% = no scaling 125 | bitmapcaching=false ; Bitmap caching to improve speed at cost of memory 126 | compression=true ; Enable compression to improve speed (especially on slower networks) 127 | showcursor=true ; Show remote cursor in VNC sessions 128 | viewonly=false ; Set true for view-only mode (no interaction) 129 | console=false ; Use this as a console session 130 | disableserverinput=false ; Allow server to receive input events 131 | aspectscale=false ; Maintain aspect ratio while scaling 132 | 133 | # Advanced features 134 | shareprinter=false ; Set to true to share printers 135 | once=false ; Connect only once if true 136 | 137 | # SSH tunneling settings 138 | ssh_enabled=true ; Enable SSH tunneling 139 | ssh_server=192.168.1.20 ; SSH server address for tunneling 140 | ssh_auth=1 ; SSH authentication method (1 = private key, 0 = password) 141 | ssh_username=sshuser ; SSH username for tunneling 142 | ssh_privatekey=/home/user/.ssh/id_rsa ; Path to SSH private key (if using key-based auth) 143 | ssh_charset=UTF-8 ; Character set for SSH if necessary 144 | 145 | # Window settings 146 | scale=false ; Auto scale window to screen resolution 147 | keyboard_grab=false ; Allow keyboard grabbing for shortcuts 148 | window_width=1024 ; Window width in pixels 149 | window_height=808 ; Window height in pixels 150 | window_maximize=false ; Start maximized if true 151 | toolbar_opacity=0 ; Opacity of the toolbar when visible (0 = transparent) 152 | #> 153 | -------------------------------------------------------------------------------- /Scripts/ConfigParsers/parser-remminapref.ps1: -------------------------------------------------------------------------------- 1 | # Author: Scott Sutherland, NetSPI (@_nullbind / nullbind) 2 | # Intended input: remmina.pref file 3 | function Get-PwRemminaPref { 4 | param ( 5 | [string]$ComputerName = $null, 6 | [string]$ShareName = $null, 7 | [string]$UncFilePath = $null, 8 | [string]$FileName = $null, 9 | [string]$FilePath # Required 10 | ) 11 | 12 | # Initialize the output object with default values 13 | $output = [PSCustomObject]@{ 14 | ComputerName = $ComputerName 15 | ShareName = $ShareName 16 | UncFilePath = $UncFilePath 17 | FileName = $FileName 18 | Section = "remmina_pref" 19 | ObjectName = "Remmina Configuration" 20 | TargetURL = "NA" 21 | TargetServer = "NA" 22 | TargetPort = "NA" 23 | Database = "NA" 24 | Domain = "NA" 25 | Username = "NA" 26 | Password = "NA" 27 | PasswordEnc = "NA" 28 | KeyFilePath = "NA" 29 | } 30 | 31 | # Check if the file exists 32 | if (-not (Test-Path -Path $FilePath)) { 33 | Write-Host "File not found at path: $FilePath" 34 | return $output 35 | } 36 | 37 | # Read the file content and parse for the 'secret' field in the remmina_pref section 38 | $fileContent = Get-Content -Path $FilePath 39 | $inRemminaPrefSection = $false 40 | 41 | foreach ($line in $fileContent) { 42 | # Check if we are in the [remmina_pref] section 43 | if ($line -match "^\[remmina_pref\]") { 44 | $inRemminaPrefSection = $true 45 | } 46 | # Exit the section if a new section starts 47 | elseif ($line -match "^\[.*\]") { 48 | $inRemminaPrefSection = $false 49 | } 50 | # Parse 'secret' value in the remmina_pref section 51 | elseif ($inRemminaPrefSection -and $line -match "^secret=(.+)") { 52 | $output.PasswordEnc = $matches[1].Trim() 53 | } 54 | } 55 | 56 | # Output the final object 57 | return $output 58 | } 59 | 60 | # Example command 61 | # Get-PwRemminaPref -ComputerName "MyComputer" -ShareName "MyShare" -UncFilePath "\\MyComputer\MyShare\.remmina" -FileName ".remmina" -FilePath "c:\temp\remmina.pref" 62 | 63 | <# Sample config 64 | 65 | [remmina_pref] 66 | secret=A123kgXlYRiCAdDcbFsE8SAoCGUanspg123= 67 | recent_RDP=myserver.demo.local 68 | save_view_mode=true 69 | invisible_toolbar=false 70 | default_action=0 71 | scale_quality=0 72 | hide_toolbar=false 73 | hide_statusbar=false 74 | small_toolbutton=false 75 | view_file_mode=0 76 | resolutions=640x480,800x600,1024x768,1152x864,1280x960,1400x1050 77 | main_width=600 78 | main_height=400 79 | main_maximize=false 80 | main_sort_column_id=1 81 | main_sort_order=0 82 | sshtunnel_port=4732 83 | applet_quick_ontop=false 84 | applet_hide_count=false 85 | recent_maximum=10 86 | default_mode=0 87 | tab_mode=9 88 | 89 | #> 90 | -------------------------------------------------------------------------------- /Scripts/ConfigParsers/parser-server.xml.ps1: -------------------------------------------------------------------------------- 1 | # Author: Scott Sutherland, NetSPI (@_nullbind / nullbind) 2 | 3 | function Parse-UserPasswordFromXML { 4 | param ( 5 | [string]$filePath 6 | ) 7 | 8 | # Load the XML file 9 | [xml]$xmlContent = Get-Content -Path $filePath 10 | 11 | # Define an array to store the user credentials 12 | $credentials = @() 13 | 14 | # Parse basicRegistry user credentials 15 | $xmlContent.server.basicRegistry.user | ForEach-Object { 16 | $credentials += [pscustomobject]@{ 17 | User = $_.name 18 | Password = $_.password 19 | Source = 'basicRegistry' 20 | } 21 | } 22 | 23 | # Parse variable-based credentials (DB_USER and DB_PASS) 24 | $dbUser = $xmlContent.server.variable | Where-Object { $_.name -eq "DB_USER" } 25 | $dbPass = $xmlContent.server.variable | Where-Object { $_.name -eq "DB_PASS" } 26 | 27 | if ($dbUser -and $dbPass) { 28 | $credentials += [pscustomobject]@{ 29 | User = $dbUser.value 30 | Password = $dbPass.value 31 | Source = 'variable' 32 | } 33 | } 34 | 35 | # Parse containerAuthData credentials 36 | $xmlContent.server.dataSource.containerAuthData | ForEach-Object { 37 | $credentials += [pscustomobject]@{ 38 | User = $_.user 39 | Password = $_.password 40 | Source = 'containerAuthData' 41 | } 42 | } 43 | 44 | # Parse authData credentials 45 | $xmlContent.server.authData | ForEach-Object { 46 | $credentials += [pscustomobject]@{ 47 | User = $_.user 48 | Password = $_.password 49 | Source = 'authData' 50 | } 51 | } 52 | 53 | # Return the collected credentials as an array of objects 54 | return $credentials 55 | } 56 | 57 | # Example usage: 58 | $parsedCredentials = Parse-UserPasswordFromXML -filePath "c:\temp\configs\server.xml" 59 | 60 | # Display the results 61 | $parsedCredentials | Format-Table -AutoSize 62 | 63 | 64 | <# server.xml 65 | 66 | 78 | 79 | 80 | 81 | 82 | componenttest-1.0 83 | restConnector-2.0 84 | jdbc-4.2 85 | mpOpenApi-1.0 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | adminuser 99 | 100 | 101 | reader 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 159 | SET CURRENT SCHEMA = APP 160 | SET CURRENT SQLID = APP 161 | 162 | 163 | 164 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | #> -------------------------------------------------------------------------------- /Scripts/ConfigParsers/parser-settings.ini.ps1: -------------------------------------------------------------------------------- 1 | # Author: Scott Sutherland, NetSPI (@_nullbind / nullbind) 2 | 3 | function Get-IniCredentials { 4 | [CmdletBinding()] 5 | param ( 6 | [Parameter(Mandatory = $true)] 7 | [string]$FilePath 8 | ) 9 | 10 | # Initialize an array to store the credentials 11 | $credentials = @() 12 | 13 | # Check if the file exists 14 | if (-Not (Test-Path -Path $FilePath)) { 15 | Write-Error "File not found: $FilePath" 16 | return 17 | } 18 | 19 | # Read the INI file content 20 | $iniFile = Get-Content -Path $FilePath 21 | 22 | # Initialize variables to track current section and credentials 23 | $currentSection = "" 24 | $username = $null 25 | $password = $null 26 | 27 | # Parse the INI file line by line 28 | foreach ($line in $iniFile) { 29 | # Ignore comment lines and empty lines 30 | if ($line -match '^\s*;' -or $line -match '^\s*$') { 31 | continue 32 | } 33 | 34 | # Detect section headers (e.g., [DatabaseSettings]) 35 | if ($line -match '^\s*\[(.+)\]\s*$') { 36 | # If we have collected username and password, store them before moving to the next section 37 | if ($username -and $password) { 38 | $credentials += [PSCustomObject]@{ 39 | Section = $currentSection 40 | Username = $username 41 | Password = $password 42 | } 43 | } 44 | # Reset username and password for the new section 45 | $username = $null 46 | $password = $null 47 | 48 | # Update current section 49 | $currentSection = $matches[1].Trim() 50 | continue 51 | } 52 | 53 | # Match username and password in the lines 54 | if ($line -match '^\s*username\s*=\s*(.+)$') { 55 | $username = $matches[1].Trim() 56 | } elseif ($line -match '^\s*password\s*=\s*(.+)$') { 57 | $password = $matches[1].Trim() 58 | } elseif ($line -match '^\s*user\s*=\s*(.+)$') { 59 | $username = $matches[1].Trim() 60 | } elseif ($line -match '^\s*pass\s*=\s*(.+)$') { 61 | $password = $matches[1].Trim() 62 | } 63 | } 64 | 65 | # Capture any remaining username/password pair after the last section 66 | if ($username -and $password) { 67 | $credentials += [PSCustomObject]@{ 68 | Section = $currentSection 69 | Username = $username 70 | Password = $password 71 | } 72 | } 73 | 74 | # Output the credentials as PowerShell objects 75 | return $credentials 76 | } 77 | 78 | # Example usage: 79 | $parsedCredentials = Get-IniCredentials -FilePath "c:\temp\configs\setting.ini" 80 | $parsedCredentials | Format-Table -AutoSize 81 | 82 | 83 | 84 | <# setting.ini 85 | 86 | [GeneralSettings] 87 | app_name = MyApp 88 | version = 1.0.0 89 | theme = dark 90 | 91 | [DatabaseSettings] 92 | host = localhost 93 | port = 3306 94 | username = dbuser 95 | password = dbpass 96 | 97 | [CustomSettings] 98 | user = myuser 99 | pass = mypass 100 | 101 | [Logging] 102 | log_level = DEBUG 103 | log_file = /var/log/myapp.log 104 | 105 | #> -------------------------------------------------------------------------------- /Scripts/ConfigParsers/parser-shadow.ps1: -------------------------------------------------------------------------------- 1 | # Author: Scott Sutherland, NetSPI (@_nullbind / nullbind) 2 | 3 | 4 | function Get-ShadowFileCredentials { 5 | [CmdletBinding()] 6 | param ( 7 | [Parameter(Mandatory = $true)] 8 | [string]$FilePath 9 | ) 10 | 11 | # Initialize an array to store extracted user data 12 | $credentials = @() 13 | 14 | # Check if the file exists 15 | if (-Not (Test-Path -Path $FilePath)) { 16 | Write-Error "File not found: $FilePath" 17 | return 18 | } 19 | 20 | # Read the shadow file 21 | $shadowFile = Get-Content -Path $FilePath 22 | 23 | # Parse each line in the shadow file 24 | foreach ($line in $shadowFile) { 25 | # Ignore empty lines or comments (if any) 26 | if ($line -match '^\s*$' -or $line -match '^\s*#') { 27 | continue 28 | } 29 | 30 | # Split the line into fields using colon as a delimiter 31 | $fields = $line -split ':' 32 | 33 | # Extract username and password hash 34 | $username = $fields[0] 35 | $passwordHash = $fields[1] 36 | 37 | # Create an object to store the extracted information 38 | $userObject = [PSCustomObject]@{ 39 | Username = $username 40 | PasswordHash = $passwordHash 41 | } 42 | 43 | # Add the object to the array 44 | $credentials += $userObject 45 | } 46 | 47 | # Output the array of credentials 48 | return $credentials 49 | } 50 | 51 | # Example usage: 52 | $shadowData = Get-ShadowFileCredentials -FilePath "c:\temp\configs\shadow" 53 | $shadowData | Format-Table -AutoSize 54 | 55 | 56 | <# shadow - linux password file 57 | 58 | root:$6$examplehash$E5iNRLtC5/j/kCkRhYlOro.Y9PzE0Gv8jlsfLZUNwlEm7HMBZSO9.mUvefOrKT6BjKSO4obQ.EtCZKhQgmgwV0:19000:0:99999:7::: 59 | user1:$6$examplehash$OwhxlyS5hoxfFE4tmtyOR8Hw1k8PLqokP9FYxYP8QMG3wO0u.0Xvd4g/0Udr6BQZilJk4k7XwlxJ6p0RJ2IL5/:19000:0:99999:7::: 60 | nobody:*:19000:0:99999:7::: 61 | daemon:*:19000:0:99999:7::: 62 | 63 | #> -------------------------------------------------------------------------------- /Scripts/ConfigParsers/parser-smb.conf.ps1: -------------------------------------------------------------------------------- 1 | # Author: Scott Sutherland, NetSPI (@_nullbind / nullbind) 2 | 3 | function Get-SmbConfCredentials { 4 | [CmdletBinding()] 5 | param ( 6 | [Parameter(Mandatory = $true)] 7 | [string]$FilePath 8 | ) 9 | 10 | # Initialize a hashtable to store extracted values 11 | $configData = @{ 12 | Username = $null 13 | Password = $null 14 | } 15 | 16 | # Check if the file exists 17 | if (-Not (Test-Path -Path $FilePath)) { 18 | Write-Error "File not found: $FilePath" 19 | return 20 | } 21 | 22 | # Read the configuration file 23 | $configFile = Get-Content -Path $FilePath 24 | 25 | # Parse the configuration file line by line 26 | foreach ($line in $configFile) { 27 | # Ignore comment lines and empty lines 28 | if ($line -match '^\s*#' -or $line -match '^\s*$') { 29 | continue 30 | } 31 | 32 | # Extract the username 33 | if ($line -match '^\s*username\s*=\s*(.+)') { 34 | $configData.Username = $matches[1].Trim() 35 | } 36 | 37 | # Extract the password 38 | if ($line -match '^\s*password\s*=\s*(.+)') { 39 | $configData.Password = $matches[1].Trim() 40 | } 41 | } 42 | 43 | # Output the extracted configuration as a PowerShell object 44 | [PSCustomObject]@{ 45 | Username = $configData.Username 46 | Password = $configData.Password 47 | } 48 | } 49 | 50 | # Example usage: 51 | $credentials = Get-SmbConfCredentials -FilePath "c:\temp\configs\smb.conf" 52 | $credentials | Format-List 53 | 54 | 55 | <# smb.conf 56 | 57 | [global] 58 | # General server settings 59 | workgroup = EXAMPLE 60 | realm = EXAMPLE.COM 61 | server string = Samba Server Version %v 62 | security = ads 63 | encrypt passwords = yes 64 | kerberos method = secrets and keytab 65 | log file = /var/log/samba/log.%m 66 | max log size = 50 67 | 68 | # Domain and authentication settings 69 | idmap config * : backend = tdb 70 | idmap config EXAMPLE : backend = rid 71 | idmap config EXAMPLE : range = 10000-20000 72 | template shell = /bin/bash 73 | winbind use default domain = yes 74 | winbind offline logon = yes 75 | winbind enum users = yes 76 | winbind enum groups = yes 77 | 78 | # INSECURE: Credentials for binding to Active Directory (avoid plaintext credentials) 79 | # This exposes the AD admin account and password directly in the smb.conf file 80 | username = ad-admin 81 | password = P@ssw0rd123 82 | 83 | # Kerberos keytab file location (more secure than plaintext credentials) 84 | dedicated keytab file = /etc/krb5.keytab 85 | kerberos method = secrets and keytab 86 | 87 | [homes] 88 | comment = Home Directories 89 | browseable = no 90 | writable = yes 91 | 92 | [printers] 93 | comment = All Printers 94 | path = /var/spool/samba 95 | printable = yes 96 | guest ok = no 97 | writable = no 98 | browseable = no 99 | 100 | [shared] 101 | path = /srv/samba/shared 102 | browseable = yes 103 | read only = no 104 | valid users = @staff 105 | #> -------------------------------------------------------------------------------- /Scripts/ConfigParsers/parser-sssd.conf.ps1: -------------------------------------------------------------------------------- 1 | # Author: Scott Sutherland, NetSPI (@_nullbind / nullbind) 2 | 3 | function Get-ConfigCredentials { 4 | [CmdletBinding()] 5 | param ( 6 | [Parameter(Mandatory = $true)] 7 | [string]$FilePath 8 | ) 9 | 10 | # Initialize a hashtable to store extracted values 11 | $configData = @{ 12 | Domain = $null 13 | Server = $null 14 | Username = $null 15 | Password = $null 16 | } 17 | 18 | # Check if the file exists 19 | if (-Not (Test-Path -Path $FilePath)) { 20 | Write-Error "File not found: $FilePath" 21 | return 22 | } 23 | 24 | # Read the configuration file 25 | $configFile = Get-Content -Path $FilePath 26 | 27 | # Parse the configuration file line by line 28 | foreach ($line in $configFile) { 29 | # Ignore comment lines and empty lines 30 | if ($line -match '^\s*#' -or $line -match '^\s*$') { 31 | continue 32 | } 33 | 34 | # Extract the domain (e.g., ad_domain or similar) 35 | if ($line -match 'ad_domain\s*=\s*(.+)') { 36 | $configData.Domain = $matches[1].Trim() 37 | } 38 | 39 | # Extract the server (e.g., krb5_server or similar) 40 | if ($line -match 'krb5_server\s*=\s*(.+)') { 41 | $configData.Server = $matches[1].Trim() 42 | } 43 | 44 | # Extract the username (e.g., ldap_default_bind_dn or similar) 45 | if ($line -match 'ldap_default_bind_dn\s*=\s*(.+)') { 46 | $configData.Username = $matches[1].Trim() 47 | } 48 | 49 | # Extract the password (e.g., ldap_default_authtok or similar) 50 | if ($line -match 'ldap_default_authtok\s*=\s*(.+)') { 51 | $configData.Password = $matches[1].Trim() 52 | } 53 | } 54 | 55 | # Output the extracted configuration as a PowerShell object 56 | [PSCustomObject]@{ 57 | Domain = $configData.Domain 58 | Server = $configData.Server 59 | Username = $configData.Username 60 | Password = $configData.Password 61 | } 62 | } 63 | 64 | # Example usage: 65 | $config = Get-ConfigCredentials -FilePath "c:\temp\configs\sssd.conf" 66 | $config | Format-List 67 | 68 | 69 | <# sssd.conf - used to support kerberos authentication in Linux 70 | 71 | 72 | [sssd] 73 | config_file_version = 2 74 | services = nss, pam, ssh, sudo 75 | domains = example.com 76 | 77 | [nss] 78 | filter_groups = root 79 | filter_users = root 80 | 81 | [pam] 82 | offline_credentials_expiration = 2 83 | offline_failed_login_attempts = 3 84 | offline_failed_login_delay = 5 85 | 86 | [domain/example.com] 87 | # Basic configuration for connecting to Active Directory 88 | id_provider = ad 89 | auth_provider = ad 90 | access_provider = ad 91 | 92 | # Enable Kerberos for authentication 93 | krb5_realm = EXAMPLE.COM 94 | krb5_server = ad.example.com 95 | krb5_kpasswd = ad.example.com 96 | 97 | # Active Directory server information 98 | ad_domain = example.com 99 | ad_server = ad.example.com 100 | ad_hostname = linuxclient.example.com 101 | 102 | # INSECURE PRACTICE: Hardcoding AD username and password in sssd.conf 103 | # These values will expose the username and password in plaintext 104 | ldap_default_bind_dn = cn=admin,cn=users,dc=example,dc=com 105 | ldap_default_authtok = P@ssw0rd123 106 | 107 | # Using the above configuration exposes credentials to anyone who can read this file 108 | 109 | # User and group filtering (optional) 110 | ldap_id_mapping = true 111 | 112 | # Performance optimizations 113 | cache_credentials = true 114 | enumerate = false 115 | use_fully_qualified_names = false 116 | 117 | # Access Control (Optional: limit login to users in AD group 'LinuxAdmins') 118 | access_provider = simple 119 | simple_allow_groups = LinuxAdmins 120 | 121 | # Security settings 122 | min_id = 1000 123 | fallback_homedir = /home/%u 124 | 125 | # Timeout and retry settings for better AD stability 126 | ldap_search_timeout = 10 127 | ldap_connection_expire_timeout = 60 128 | 129 | # Debugging options (uncomment for troubleshooting) 130 | # debug_level = 9 131 | 132 | 133 | #> -------------------------------------------------------------------------------- /Scripts/ConfigParsers/parser-standalone.xml-ps1.ps1: -------------------------------------------------------------------------------- 1 | # Author: Scott Sutherland, NetSPI (@_nullbind / nullbind) 2 | 3 | function Parse-DataSourceConfig { 4 | param ( 5 | [string]$ConfigPath 6 | ) 7 | 8 | # Load the XML config 9 | [xml]$configXml = Get-Content -Path $ConfigPath 10 | 11 | # Define a hashtable to store results 12 | $result = @{} 13 | 14 | # Parse the server and port from the connection URL 15 | $connectionUrl = $configXml.server.subsystem.datasources.datasource."connection-url" 16 | if ($connectionUrl -match "jdbc:mysql://([^:/]+)(?::(\d+))?") { 17 | $result.Server = $matches[1] 18 | $result.Port = if ($matches[2]) { $matches[2] } else { "3306" } # Default MySQL port 19 | } 20 | 21 | # Get the username 22 | $result.Username = $configXml.server.subsystem.datasources.datasource.security."user-name" 23 | 24 | # Get the password 25 | $result.Password = $configXml.server.subsystem.datasources.datasource.security.password 26 | 27 | # Get the keystore password from the vault section 28 | $keystorePassword = $configXml.server.security.vault."vault-option" | Where-Object { $_.name -eq "KEYSTORE_PASSWORD" } 29 | $result.KeystorePassword = $keystorePassword.value 30 | 31 | # Convert hashtable to PowerShell object 32 | $resultObject = [PSCustomObject]$result 33 | 34 | # Output the result object 35 | return $resultObject 36 | } 37 | 38 | # Example usage 39 | $parsedConfig = Parse-DataSourceConfig -ConfigPath "c:\temp\configs\standalone.xml" 40 | $parsedConfig 41 | 42 | 43 | <# standalone.xml used by jboss 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | jdbc:mysql://localhost:3306/mydatabase 57 | mysql 58 | 59 | ${VAULT::vault::mydbuser} 60 | ${VAULT::vault::mydbpassword} 61 | 62 | 63 | 5 64 | 20 65 | 66 | 67 | 68 | true 69 | true 70 | 71 | 72 | 5000 73 | 74 | 75 | false 76 | 77 | 78 | 79 | 80 | 81 | com.mysql.jdbc.jdbc2.optional.MysqlXADataSource 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | #> -------------------------------------------------------------------------------- /Scripts/ConfigParsers/parser-sysprep.inf.ps1: -------------------------------------------------------------------------------- 1 | # Author: Scott Sutherland, NetSPI (@_nullbind / nullbind) 2 | 3 | function Get-SysprepCredentials { 4 | param ( 5 | [Parameter(Mandatory=$true)] 6 | [string]$FilePath 7 | ) 8 | 9 | # Check if file exists 10 | if (-Not (Test-Path $FilePath)) { 11 | Write-Error "File does not exist: $FilePath" 12 | return 13 | } 14 | 15 | # Initialize an empty hashtable to store credentials 16 | $credentials = @{ 17 | AdminPassword = $null 18 | JoinDomain = $null 19 | DomainAdmin = $null 20 | DomainAdminPassword = $null 21 | } 22 | 23 | # Read the sysprep.inf file 24 | $fileContent = Get-Content -Path $FilePath 25 | 26 | # Loop through each line and extract relevant credentials 27 | foreach ($line in $fileContent) { 28 | if ($line -match 'AdminPassword\s*=\s*(.+)') { 29 | $credentials['AdminPassword'] = $matches[1].Trim() 30 | } 31 | 32 | if ($line -match 'JoinDomain\s*=\s*(.+)') { 33 | $credentials['JoinDomain'] = $matches[1].Trim() 34 | } 35 | 36 | if ($line -match 'DomainAdmin\s*=\s*(.+)') { 37 | $credentials['DomainAdmin'] = $matches[1].Trim() 38 | } 39 | 40 | if ($line -match 'DomainAdminPassword\s*=\s*(.+)') { 41 | $credentials['DomainAdminPassword'] = $matches[1].Trim() 42 | } 43 | } 44 | 45 | # Create and return a PowerShell object 46 | $credObject = [pscustomobject]@{ 47 | AdminPassword = $credentials['AdminPassword'] 48 | JoinDomain = $credentials['JoinDomain'] 49 | DomainAdmin = $credentials['DomainAdmin'] 50 | DomainAdminPassword = $credentials['DomainAdminPassword'] 51 | } 52 | 53 | return $credObject 54 | } 55 | 56 | # Example usage: 57 | $result = Get-SysprepCredentials -FilePath "c:\temp\configs\sysprep.inf" 58 | $result 59 | 60 | <# sysprep.inf 61 | 62 | [Unattended] 63 | OemSkipEula=Yes 64 | InstallFilesPath=C:\sysprep\i386 65 | 66 | [GuiUnattended] 67 | AdminPassword=YourAdminPassword 68 | EncryptedAdminPassword=NO 69 | OEMSkipRegional=1 70 | TimeZone=004 71 | OemSkipWelcome=1 72 | 73 | [UserData] 74 | ProductKey=XXXXX-XXXXX-XXXXX-XXXXX-XXXXX 75 | FullName="Your Name" 76 | OrgName="Your Organization" 77 | ComputerName=* 78 | 79 | [Display] 80 | BitsPerPel=32 81 | Xresolution=1024 82 | YResolution=768 83 | Vrefresh=60 84 | 85 | [SetupMgr] 86 | DistFolder=C:\sysprep\i386 87 | DistShare=windist 88 | 89 | [Identification] 90 | JoinDomain=YourDomain 91 | DomainAdmin=YourDomainAdmin 92 | DomainAdminPassword=YourDomainAdminPassword 93 | 94 | [Networking] 95 | InstallDefaultComponents=Yes 96 | 97 | #> -------------------------------------------------------------------------------- /Scripts/ConfigParsers/parser-tnsnames.ora.ps1: -------------------------------------------------------------------------------- 1 | # Author: Scott Sutherland, NetSPI (@_nullbind / nullbind) 2 | 3 | function Extract-OracleCredentials { 4 | param( 5 | [string]$FilePath 6 | ) 7 | 8 | if (-Not (Test-Path -Path $FilePath)) { 9 | Write-Error "File path does not exist: $FilePath" 10 | return 11 | } 12 | 13 | # Initialize an empty array to store the results 14 | $credentialsList = @() 15 | 16 | # Read the file contents 17 | $fileContent = Get-Content -Path $FilePath 18 | 19 | # Initialize variables to store temporary values 20 | $currentDatabase = $null 21 | $currentUser = $null 22 | $currentPassword = $null 23 | 24 | foreach ($line in $fileContent) { 25 | # Trim the line for easier processing 26 | $line = $line.Trim() 27 | 28 | # Match a database name (lines that don't start with a '(' and end with '=') 29 | if ($line -match '^\w+\s*=\s*$') { 30 | if ($currentDatabase -and $currentUser -and $currentPassword) { 31 | # Store the previous credentials 32 | $credentialsList += [pscustomobject]@{ 33 | Database = $currentDatabase 34 | User = $currentUser 35 | Password = $currentPassword 36 | } 37 | } 38 | 39 | # Reset the user and password for the next database entry 40 | $currentDatabase = $line -replace '\s*=\s*$', '' # Remove the equals sign 41 | $currentUser = $null 42 | $currentPassword = $null 43 | } 44 | 45 | # Match the USER line 46 | if ($line -match 'USER\s*=\s*(.+)$') { 47 | $currentUser = $matches[1] 48 | } 49 | 50 | # Match the PASSWORD line 51 | if ($line -match 'PASSWORD\s*=\s*(.+)$') { 52 | $currentPassword = $matches[1] 53 | } 54 | } 55 | 56 | # Capture the last set of credentials 57 | if ($currentDatabase -and $currentUser -and $currentPassword) { 58 | $credentialsList += [pscustomobject]@{ 59 | Database = $currentDatabase 60 | User = $currentUser 61 | Password = $currentPassword 62 | } 63 | } 64 | 65 | # Output the results as a list of objects 66 | return $credentialsList 67 | } 68 | 69 | # Example usage: 70 | $result = Extract-OracleCredentials -FilePath "c:\temp\configs\tnsnames.ora" 71 | $result | Format-Table 72 | 73 | 74 | 75 | <# tnsnames.ora - oracle 76 | 77 | MYDB = 78 | (DESCRIPTION = 79 | (ADDRESS = (PROTOCOL = TCP)(HOST = mydbserver.example.com)(PORT = 1521)) 80 | (CONNECT_DATA = 81 | (SERVICE_NAME = mydbservice) 82 | ) 83 | ) 84 | (USER = myusername) 85 | (PASSWORD = mypassword) 86 | 87 | MYDB_ALIAS = 88 | (DESCRIPTION = 89 | (ADDRESS_LIST = 90 | (ADDRESS = (PROTOCOL = TCP)(HOST = mydbserver.example.com)(PORT = 1521)) 91 | ) 92 | (CONNECT_DATA = 93 | (SERVICE_NAME = mydbservice) 94 | ) 95 | ) 96 | (USER = anotheruser) 97 | (PASSWORD = anotherpassword) 98 | 99 | #> -------------------------------------------------------------------------------- /Scripts/ConfigParsers/parser-tomcat-users.xml.ps1: -------------------------------------------------------------------------------- 1 | # Author: Scott Sutherland, NetSPI (@_nullbind / nullbind) 2 | 3 | function Get-TomcatUsers { 4 | param ( 5 | [Parameter(Mandatory = $true)] 6 | [string]$TomcatConfigFile 7 | ) 8 | 9 | # Load the XML file 10 | [xml]$xml = Get-Content -Path $TomcatConfigFile 11 | 12 | # Create an array to store the results 13 | $usersList = @() 14 | 15 | # Select the user nodes from the XML 16 | $users = $xml.'tomcat-users'.user 17 | 18 | # Loop through each user and extract the name and password attributes 19 | foreach ($user in $users) { 20 | # Create a PowerShell object for each user 21 | $userObject = [PSCustomObject]@{ 22 | Username = $user.name 23 | Password = $user.password 24 | } 25 | 26 | # Add the object to the list 27 | $usersList += $userObject 28 | } 29 | 30 | # Display the list of users as a table 31 | return $usersList 32 | } 33 | 34 | # Example usage 35 | $tomcatConfigFilePath = "c:\temp\configs\tomcat-users.xml" 36 | Get-TomcatUsers -TomcatConfigFile $tomcatConfigFilePath | Format-Table -AutoSize 37 | 38 | 39 | <# tomcat-users.xml 40 | 41 | 42 | 58 | 59 | 64 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | #> -------------------------------------------------------------------------------- /Scripts/ConfigParsers/parser-unattend.xml.ps1: -------------------------------------------------------------------------------- 1 | # Author: Scott Sutherland, NetSPI (@_nullbind / nullbind) 2 | 3 | function Parse-UnattendFile { 4 | param ( 5 | [string]$filePath 6 | ) 7 | 8 | # Load the XML file 9 | [xml]$xmlContent = Get-Content -Path $filePath 10 | 11 | # Create an array to store the parsed credentials 12 | $credentials = @() 13 | 14 | # Define namespaces used in the XML file 15 | $namespace = @{ 16 | "unattend" = "urn:schemas-microsoft-com:unattend" 17 | "wcm" = "http://schemas.microsoft.com/WMIConfig/2002/State" 18 | } 19 | 20 | # Function to decode Base64 if password is encoded 21 | function Decode-PasswordIfNeeded { 22 | param ( 23 | [string]$passwordValue, 24 | [bool]$isPlainText 25 | ) 26 | 27 | if ($isPlainText -eq $false) { 28 | try { 29 | # Decode Base64 password 30 | $decodedPassword = [Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($passwordValue)) 31 | return $decodedPassword 32 | } catch { 33 | Write-Host "Error: Unable to decode Base64 string, returning original value." 34 | return $passwordValue 35 | } 36 | } 37 | else { 38 | return $passwordValue 39 | } 40 | } 41 | 42 | # Parse AutoLogon credentials 43 | $autoLogon = $xmlContent.unattend.settings.component | Where-Object { 44 | $_.name -eq "Microsoft-Windows-Shell-Setup" -and $_.AutoLogon -ne $null 45 | } 46 | if ($autoLogon) { 47 | $username = $autoLogon.AutoLogon.Username 48 | $password = $autoLogon.AutoLogon.Password.Value 49 | $isPlainText = $autoLogon.AutoLogon.Password.PlainText -eq "true" 50 | 51 | # Decode password if necessary 52 | $password = Decode-PasswordIfNeeded -passwordValue $password -isPlainText $isPlainText 53 | 54 | $credentials += [pscustomobject]@{ 55 | User = $username 56 | Password = $password 57 | Source = "AutoLogon" 58 | } 59 | } 60 | 61 | # Parse LocalAccounts credentials 62 | $localAccounts = $xmlContent.unattend.settings.component.UserAccounts.LocalAccounts.LocalAccount | Where-Object { $_ -ne $null } 63 | foreach ($account in $localAccounts) { 64 | $username = $account.Name 65 | $password = $account.Password.Value 66 | $isPlainText = $account.Password.PlainText -eq "true" 67 | 68 | # Decode password if necessary 69 | $password = Decode-PasswordIfNeeded -passwordValue $password -isPlainText $isPlainText 70 | 71 | $credentials += [pscustomobject]@{ 72 | User = $username 73 | Password = $password 74 | Source = "LocalAccount" 75 | } 76 | } 77 | 78 | # Return the collected credentials as an array of objects 79 | return $credentials 80 | } 81 | 82 | # Example usage: 83 | $parsedCredentials = Parse-UnattendFile -filePath "c:\temp\configs\unattend-base64.xml" 84 | 85 | # Display the results 86 | $parsedCredentials | Format-Table -AutoSize 87 | 88 | 89 | 90 | <# unattend.xml 91 | 92 | 93 | 94 | 95 | 96 | * 97 | acme corp. 98 | acme corp. 99 | 100 | false 101 | 102 | 103 | LocalAdmin 104 | true 105 | 10 106 | 107 | UEBzc3dvcmQxMjMh 108 | false</PlainText> 109 | </Password> 110 | </AutoLogon> 111 | </component> 112 | </settings> 113 | 114 | <settings pass="oobeSystem"> 115 | <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"> 116 | <UserAccounts> 117 | <LocalAccounts> 118 | <LocalAccount wcm:action="add"> 119 | <Password> 120 | <Value>UEBzc3dvcmQxMjMh</Value> <!-- This is Base64 for 'P@ssword123!' --> 121 | <PlainText>false</PlainText> 122 | </Password> 123 | <Group>Administrators</Group> 124 | <Description>Provisioning Admin</Description> 125 | <DisplayName>LocalAdmin</DisplayName> 126 | <Name>LocalAdmin</Name> 127 | </LocalAccount> 128 | </LocalAccounts> 129 | </UserAccounts> 130 | <OOBE> 131 | <HideEULAPage>true</HideEULAPage> 132 | <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen> 133 | <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> 134 | <HideOnlineAccountScreens>true</HideOnlineAccountScreens> 135 | <HideLocalAccountScreen>true</HideLocalAccountScreen> 136 | <ProtectYourPC>1</ProtectYourPC> 137 | </OOBE> 138 | </component> 139 | </settings> 140 | </unattend> 141 | 142 | 143 | #> -------------------------------------------------------------------------------- /Scripts/ConfigParsers/parser-vnc.ini.ps1: -------------------------------------------------------------------------------- 1 | # Author: Scott Sutherland, NetSPI (@_nullbind / nullbind) 2 | function Get-VNCPassword { 3 | param ( 4 | [Parameter(Mandatory=$true)] 5 | [string]$VncIniPath 6 | ) 7 | 8 | # Define the fixed DES key used by VNC 9 | $desKey = [byte[]](0x23, 0x52, 0x6A, 0x3B, 0x58, 0x92, 0x67, 0x34) 10 | 11 | # Read the vnc.ini file 12 | if (-Not (Test-Path -Path $VncIniPath)) { 13 | Write-Error "The file path '$VncIniPath' does not exist." 14 | return 15 | } 16 | 17 | $vncIniContent = Get-Content -Path $VncIniPath 18 | 19 | # Extract the encrypted password from the ini file 20 | $encryptedHex = ($vncIniContent | ForEach-Object { 21 | if ($_ -match '^Password=(.+)$') { 22 | return $matches[1] 23 | } 24 | }).Trim() 25 | 26 | if (-not $encryptedHex) { 27 | Write-Output "Password not found in vnc.ini" 28 | return 29 | } 30 | 31 | # Convert the hex string to a byte array 32 | $encryptedBytes = for ($i = 0; $i -lt $encryptedHex.Length; $i += 2) { 33 | [Convert]::ToByte($encryptedHex.Substring($i, 2), 16) 34 | } 35 | 36 | # Create a DES crypto object and set the key and mode 37 | $des = New-Object System.Security.Cryptography.DESCryptoServiceProvider 38 | $des.Key = $desKey # Assign the key as a byte array 39 | $des.Mode = [System.Security.Cryptography.CipherMode]::ECB 40 | $des.Padding = [System.Security.Cryptography.PaddingMode]::None 41 | 42 | # Create a decryptor 43 | $decryptor = $des.CreateDecryptor() 44 | 45 | # Decrypt the encrypted password 46 | $decryptedBytes = $decryptor.TransformFinalBlock($encryptedBytes, 0, $encryptedBytes.Length) 47 | 48 | # Convert the decrypted byte array to a string, trimming null characters 49 | $decryptedPassword = [System.Text.Encoding]::ASCII.GetString($decryptedBytes).Trim("`0") 50 | 51 | # Return the decrypted password as an object 52 | return [pscustomobject]@{ 53 | DecryptedPassword = $decryptedPassword 54 | } 55 | } 56 | 57 | # Example usage 58 | $path = "c:\temp\configs\vnc.ini" 59 | $passwordObject = Get-VNCPassword -VncIniPath $path 60 | $passwordObject 61 | 62 | 63 | 64 | 65 | <# vnc.ini 66 | 67 | [Server] 68 | # The port on which the VNC server listens for connections (default: 5900) 69 | Port=5900 70 | 71 | # Defines the IP address to bind the VNC server to. Leave blank to bind to all interfaces. 72 | BindTo=0.0.0.0 73 | 74 | # Enable or disable authentication. If 1, authentication is enabled. 75 | Authentication=1 76 | 77 | # VNC password (encoded or plain text depending on the software) 78 | Password=01d47b4186dfa5a3 79 | 80 | # Encryption (optional). Enable or disable encryption for VNC connections. 81 | Encryption=1 82 | 83 | # Set the idle timeout for client connections (in seconds) 84 | IdleTimeout=600 85 | 86 | # Maximum number of clients that can connect at once 87 | MaxClients=5 88 | 89 | [Security] 90 | # Use SSL encryption for communication between VNC clients and server 91 | UseSSL=0 92 | 93 | # If SSL is enabled, provide the path to the SSL certificate file. 94 | SSLCertificateFile=C:\path\to\ssl\certificate.pem 95 | 96 | # Enable or disable TLS encryption 97 | UseTLS=1 98 | 99 | [Logging] 100 | # Enable or disable logging. If 1, logging is enabled. 101 | EnableLogging=1 102 | 103 | # Log file location 104 | LogFile=C:\path\to\log\vncserver.log 105 | 106 | # Log level (INFO, DEBUG, ERROR, etc.) 107 | LogLevel=INFO 108 | 109 | 110 | #> -------------------------------------------------------------------------------- /Scripts/ConfigParsers/parser-winscp.ini.ps1: -------------------------------------------------------------------------------- 1 | # Author: Scott Sutherland, NetSPI (@_nullbind / nullbind) 2 | 3 | function Get-WinSCPConfig { 4 | param ( 5 | [Parameter(Mandatory = $true)] 6 | [string]$FilePath 7 | ) 8 | 9 | # Check if file exists 10 | if (-not (Test-Path $FilePath)) { 11 | Write-Error "File not found: $FilePath" 12 | return 13 | } 14 | 15 | # Read the WinSCP.ini file content 16 | $content = Get-Content -Path $FilePath 17 | 18 | # Initialize an empty object for results 19 | $result = [PSCustomObject]@{ 20 | HostName = $null 21 | PortNumber = $null 22 | PrivateKeyFile = $null 23 | UserName = $null 24 | Password = $null 25 | } 26 | 27 | # Parse the .ini file for relevant information 28 | foreach ($line in $content) { 29 | if ($line -match '^HostName=(.*)') { 30 | $result.HostName = $matches[1] 31 | } elseif ($line -match '^PortNumber=(.*)') { 32 | $result.PortNumber = [int]$matches[1] 33 | } elseif ($line -match '^PrivateKeyFile=(.*)') { 34 | $result.PrivateKeyFile = $matches[1] 35 | } elseif ($line -match '^UserName=(.*)') { 36 | $result.UserName = $matches[1] 37 | } elseif ($line -match '^Password=(.*)') { 38 | $result.Password = $matches[1] # Encrypted password in .ini 39 | } 40 | } 41 | 42 | # Return the result object 43 | return $result 44 | } 45 | 46 | # Example usage 47 | $winSCPConfig = Get-WinSCPConfig -FilePath "c:\temp\configs\WinSCP.ini" 48 | $winSCPConfig 49 | 50 | <# winscp decryption function that uses dpapi below 51 | 52 | function ConvertFrom-DPAPI { 53 | param ( 54 | [Parameter(Mandatory = $true)] 55 | [string]$EncryptedPassword 56 | ) 57 | 58 | # Convert the base64 encoded password back to byte array 59 | $passwordBytes = [Convert]::FromBase64String($EncryptedPassword) 60 | 61 | # Use the Windows DPAPI to decrypt the password 62 | $decryptedBytes = [System.Security.Cryptography.ProtectedData]::Unprotect($passwordBytes, $null, [System.Security.Cryptography.DataProtectionScope]::CurrentUser) 63 | 64 | # Convert the decrypted byte array back to a string (UTF-8 encoded) 65 | $decryptedPassword = [System.Text.Encoding]::UTF8.GetString($decryptedBytes) 66 | 67 | return $decryptedPassword 68 | } 69 | 70 | # Example usage with an encrypted password from WinSCP.ini 71 | $encryptedPassword = "Base64EncryptedPasswordHere" 72 | $decryptedPassword = ConvertFrom-DPAPI -EncryptedPassword $encryptedPassword 73 | Write-Output "Decrypted Password: $decryptedPassword" 74 | 75 | 76 | #> 77 | 78 | 79 | <# winscp.ini 80 | 81 | 82 | [Configuration\Interface] 83 | Random=4074A9829D979781989E96 84 | 85 | [Sessions\example] 86 | HostName=ftp.example.com 87 | PortNumber=21 88 | UserName=myuser 89 | Password=0V5aNH+/kT8= ; Encrypted password 90 | LocalDirectory=C:\Users\myuser\Documents 91 | RemoteDirectory=/public_html 92 | FSProtocol=0 93 | PostLoginCommands= 94 | PrivateKeyFile= 95 | 96 | [Configuration\Interface\Commander] 97 | LastLocalDirectory=C:\Users\myuser\Documents 98 | LastRemoteDirectory=/public_html 99 | 100 | 101 | #> -------------------------------------------------------------------------------- /Scripts/ConfigParsers/parser-wp-config.php.ps1: -------------------------------------------------------------------------------- 1 | # Author: Scott Sutherland, NetSPI (@_nullbind / nullbind) 2 | 3 | function Get-WPConfigCredentials { 4 | param ( 5 | [string]$FilePath 6 | ) 7 | 8 | # Check if the file exists 9 | if (-Not (Test-Path $FilePath)) { 10 | Write-Error "File not found: $FilePath" 11 | return 12 | } 13 | 14 | # Initialize variables for username and password 15 | $dbUsername = $null 16 | $dbPassword = $null 17 | 18 | # Read the file line by line 19 | Get-Content $FilePath | ForEach-Object { 20 | $line = $_ 21 | 22 | # Match the DB_USER line and extract the username 23 | if ($line -match "define\(\s*'DB_USER'\s*,\s*'([^']+)'\s*\)") { 24 | $dbUsername = $matches[1] 25 | } 26 | 27 | # Match the DB_PASSWORD line and extract the password 28 | if ($line -match "define\(\s*'DB_PASSWORD'\s*,\s*'([^']+)'\s*\)") { 29 | $dbPassword = $matches[1] 30 | } 31 | } 32 | 33 | # Check if both username and password were found 34 | if ($dbUsername -and $dbPassword) { 35 | # Return the results as a PowerShell object 36 | [PSCustomObject]@{ 37 | Username = $dbUsername 38 | Password = $dbPassword 39 | } 40 | } 41 | else { 42 | Write-Error "Username or Password not found in the configuration file." 43 | } 44 | } 45 | 46 | # Example usage 47 | $credentials = Get-WPConfigCredentials -FilePath "c:\temp\configs\wp-config.php" 48 | $credentials 49 | 50 | 51 | <# wp-config.php 52 | 53 | <?php 54 | // ** MySQL settings - You can get this info from your web host ** // 55 | /** The name of the database for WordPress */ 56 | define( 'DB_NAME', 'your_database_name' ); 57 | 58 | /** MySQL database username */ 59 | define( 'DB_USER', 'your_database_username' ); 60 | 61 | /** MySQL database password */ 62 | define( 'DB_PASSWORD', 'your_secure_password_here' ); 63 | 64 | /** MySQL hostname */ 65 | define( 'DB_HOST', 'localhost' ); 66 | 67 | /** Database Charset to use in creating database tables. */ 68 | define( 'DB_CHARSET', 'utf8' ); 69 | 70 | /** The Database Collate type. Don't change this if in doubt. */ 71 | define( 'DB_COLLATE', '' ); 72 | 73 | /**#@+ 74 | * Authentication Unique Keys and Salts. 75 | * 76 | * Change these to different unique phrases! 77 | * You can generate these using the WordPress.org secret-key service 78 | * https://api.wordpress.org/secret-key/1.1/salt/ 79 | * You can change these at any point in time to invalidate all existing cookies. 80 | * This will force all users to have to log in again. 81 | */ 82 | define('AUTH_KEY', 'put_your_unique_phrase_here'); 83 | define('SECURE_AUTH_KEY', 'put_your_unique_phrase_here'); 84 | define('LOGGED_IN_KEY', 'put_your_unique_phrase_here'); 85 | define('NONCE_KEY', 'put_your_unique_phrase_here'); 86 | define('AUTH_SALT', 'put_your_unique_phrase_here'); 87 | define('SECURE_AUTH_SALT', 'put_your_unique_phrase_here'); 88 | define('LOGGED_IN_SALT', 'put_your_unique_phrase_here'); 89 | define('NONCE_SALT', 'put_your_unique_phrase_here'); 90 | 91 | /**#@-*/ 92 | 93 | /** 94 | * WordPress Database Table prefix. 95 | * 96 | * You can have multiple installations in one database if you give each a unique 97 | * prefix. Only numbers, letters, and underscores please! 98 | */ 99 | $table_prefix = 'wp_'; 100 | 101 | /** 102 | * For developers: WordPress debugging mode. 103 | * 104 | * Change this to true to enable the display of notices during development. 105 | * It is strongly recommended that plugin and theme developers use WP_DEBUG 106 | * in their development environments. 107 | */ 108 | define( 'WP_DEBUG', false ); 109 | 110 | /* That's all, stop editing! Happy publishing. */ 111 | 112 | /** Absolute path to the WordPress directory. */ 113 | if ( ! defined( 'ABSPATH' ) ) { 114 | define( 'ABSPATH', __DIR__ . '/' ); 115 | } 116 | 117 | /** Sets up WordPress vars and included files. */ 118 | require_once ABSPATH . 'wp-settings.php'; 119 | 120 | 121 | #> -------------------------------------------------------------------------------- /Scripts/SampleConfigs/.fetchmailrc: -------------------------------------------------------------------------------- 1 | # Global options 2 | set daemon 300 3 | 4 | # Default options for all servers 5 | defaults 6 | protocol IMAP 7 | port 993 8 | keep 9 | 10 | # Fetch mail from the first server 11 | poll mail.example.com 12 | proto IMAP 13 | user "user1@example.com" pass "password1" 14 | ssl 15 | 16 | # Fetch mail from another server with custom settings 17 | poll mail.anotherexample.com 18 | proto POP3 19 | user "user2@anotherexample.com" pass "password2" 20 | port 995 21 | ssl 22 | 23 | # Another example with a forwarding SMTP setup 24 | poll mail.forwardexample.com via smtp.example.com 25 | proto IMAP 26 | user "forwarduser@forwardexample.com" pass "forwardpassword" 27 | smtphost smtp.example.com 28 | esmtpname "smtpuser@example.com" esmtppassword "smtppassword" 29 | 30 | # Additional account with a different protocol and no SSL 31 | poll plainexample.com 32 | proto POP3 33 | user "plainuser@plainexample.com" pass "plainpassword" 34 | port 110 35 | -------------------------------------------------------------------------------- /Scripts/SampleConfigs/.git-credentials: -------------------------------------------------------------------------------- 1 | https://username1:ghp_token1example@github.com 2 | https://username2:ghp_token2example@bitbucket.org 3 | https://my-gitlab-username:glpat_token3example@gitlab.com 4 | https://username4:ghp_token4example@company-git.example.com 5 | -------------------------------------------------------------------------------- /Scripts/SampleConfigs/.htpasswd: -------------------------------------------------------------------------------- 1 | user1:$apr1$5lRQ1y3v$pmOQf9/fNVE5dTtQDBl9D1 2 | user2:$apr1$Jd9UE91p$J/H8G9HSvj5l8LKQ2qfd3. 3 | admin:$apr1$GZJoqjNF$wl8IjDhZC84z5Bb4wHOv50 4 | -------------------------------------------------------------------------------- /Scripts/SampleConfigs/.netrc: -------------------------------------------------------------------------------- 1 | # Sample .netrc file 2 | 3 | # Configuration for accessing example.com 4 | machine example.com 5 | login exampleuser 6 | password examplepass 7 | 8 | # Configuration for accessing another-site.com 9 | machine another-site.com 10 | login anotheruser 11 | password anotherpass 12 | 13 | # Configuration for accessing an FTP server at ftp.myserver.com 14 | machine ftp.myserver.com 15 | login ftpuser 16 | password ftppass 17 | 18 | # Configuration with an account for systems that require it 19 | machine account-required.com 20 | login myuser 21 | password mypassword 22 | account myaccount 23 | 24 | # Wildcard for default login when no specific machine is specified 25 | default 26 | login defaultuser 27 | password defaultpass 28 | -------------------------------------------------------------------------------- /Scripts/SampleConfigs/.pgpass: -------------------------------------------------------------------------------- 1 | # Format: hostname:port:database:username:password 2 | 3 | # Local database connection 4 | localhost:5432:mydatabase:myuser:mypassword 5 | 6 | # Remote database connection 7 | remote.server.com:5432:anotherdb:anotheruser:anotherpassword 8 | 9 | # Default connection for any database on localhost 10 | localhost:*:*:defaultuser:defaultpassword 11 | 12 | # Wildcard example: Any database and any user connecting to localhost 13 | localhost:*:*:*:supersecretpassword 14 | -------------------------------------------------------------------------------- /Scripts/SampleConfigs/.remmina: -------------------------------------------------------------------------------- 1 | [remmina] 2 | name=myvnc 3 | group=RemoteServers ; Group label for organization, such as "RemoteServers" 4 | server=192.168.1.10 5 | protocol=VNC 6 | username=myusername 7 | password=mysecretpassword 8 | domain=demo.com 9 | clientname= ; Leave empty to use the default client name 10 | 11 | # Display settings 12 | resolution=AUTO ; Use AUTO for adaptive resolution 13 | keymap=default ; Default keymap for the connection 14 | gkeymap= ; Global keymap if different from the default 15 | colordepth=16 ; Color depth setting 16 | quality=9 ; Set connection quality, 0 to 9 (9 = best quality) 17 | viewmode=1 ; Set view mode: 1 for full screen, 4 for windowed 18 | 19 | # Connection and scaling 20 | listenport=5500 ; Port Remmina listens on for reverse connections 21 | hscale=100 ; Horizontal scale in percent, e.g., 100% = no scaling 22 | vscale=100 ; Vertical scale in percent, e.g., 100% = no scaling 23 | bitmapcaching=false ; Bitmap caching to improve speed at cost of memory 24 | compression=true ; Enable compression to improve speed (especially on slower networks) 25 | showcursor=true ; Show remote cursor in VNC sessions 26 | viewonly=false ; Set true for view-only mode (no interaction) 27 | console=false ; Use this as a console session 28 | disableserverinput=false ; Allow server to receive input events 29 | aspectscale=false ; Maintain aspect ratio while scaling 30 | 31 | # Advanced features 32 | shareprinter=false ; Set to true to share printers 33 | once=false ; Connect only once if true 34 | 35 | # SSH tunneling settings 36 | ssh_enabled=true ; Enable SSH tunneling 37 | ssh_server=192.168.1.20 38 | ssh_auth=1 ; SSH authentication method (1 = private key, 0 = password) 39 | ssh_username=sshuser 40 | ssh_privatekey=/home/user/.ssh/id_rsa 41 | ssh_charset=UTF-8 ; Character set for SSH if necessary 42 | 43 | # Window settings 44 | scale=false ; Auto scale window to screen resolution 45 | keyboard_grab=false ; Allow keyboard grabbing for shortcuts 46 | window_width=1024 ; Window width in pixels 47 | window_height=808 ; Window height in pixels 48 | window_maximize=false ; Start maximized if true 49 | toolbar_opacity=0 ; Opacity of the toolbar when visible (0 = transparent) 50 | -------------------------------------------------------------------------------- /Scripts/SampleConfigs/DataSources.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <DataSources clsid="{380F820F-F21B-41ac-A3CC-24D4F80F067B}" disabled="0"> 3 | <DataSource clsid="{5C209626-D820-4d69-8D50-1FACD6214488}" name="LocalContacts" 4 | image="1" bypassErrors="0" userContext="1" removePolicy="1" 5 | desc="This is a local database on the local machine." 6 | changed="2007-07-06 20:33:47" uid="{5AA6C3F8-B6D3-4FE1-8925-FEBE6F15310A}"> 7 | <Properties action="R" userDSN="1" dsn="LocalContacts" 8 | driver="Microsoft Access (*.mdb)" description="Local Access Database" 9 | username="test" cpassword="5gn5fUqMaeGJkLEPgl3iH9UfLATVxRAHE8GvAvekwnicLYf2Pynj7ifihvajBRA3"> 10 | <Attributes> 11 | <Attribute name="DSN" value="C:\USERS\DEMO.MDB"/> 12 | </Attributes> 13 | </Properties> 14 | </DataSource> 15 | <DataSource clsid="{5C209626-D820-4d69-8D50-1FACD6214488}" name="SystemNodes" 16 | image="2" bypassErrors="0" userContext="1" removePolicy="0" 17 | changed="2007-07-06 20:35:31" uid="{F2174147-A906-4977-AE6F-019C427979D8}"> 18 | <Properties action="U" userDSN="0" dsn="SystemNodes" 19 | driver="Microsoft Access (*.mdb)" description="All system nodes." 20 | username="test23" cpassword="j1Uyj3Vx8TY9LtLZil2uAuZkFQA/4latT76ZwgdHdhw"> 21 | <Attributes> 22 | <Attribute name="DSN" value="c:\nodelist.mdb"/> 23 | </Attributes> 24 | </Properties> 25 | <Filters> 26 | <FilterRunOnce hidden="1" not="0" bool="AND" 27 | id="{8F7D51B0-F798-4C5F-972B-36FCD0399A33}"/> 28 | </Filters> 29 | </DataSource> 30 | </DataSources> -------------------------------------------------------------------------------- /Scripts/SampleConfigs/Drives.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <Drives clsid="{8FDDCC1A-0C3C-43cd-A6B4-71A6DF20DA8C}" 3 | disabled="1"> 4 | <Drive clsid="{935D1B74-9CB8-4e3c-9914-7DD559B7A417}" 5 | name="S:" 6 | status="S:" 7 | image="2" 8 | changed="2007-07-06 20:57:37" 9 | uid="{4DA4A7E3-F1D8-4FB1-874F-D2F7D16F7065}"> 10 | <Properties action="U" 11 | thisDrive="NOCHANGE" 12 | allDrives="NOCHANGE" 13 | userName="test" 14 | cpassword="5gn5fUqMaeGJkLEPgl3iH9UfLATVxRAHE8GvAvekwnicLYf2Pynj7ifihvajBRA3" 15 | path="\\scratch" 16 | label="SCRATCH" 17 | persistent="1" 18 | useLetter="1" 19 | letter="S"/> 20 | </Drive> 21 | </Drives> -------------------------------------------------------------------------------- /Scripts/SampleConfigs/Groups.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <Groups clsid="{D4A3F943-1B57-4B98-B5E4-1E9C7A84B292}"> 3 | <User clsid="{A7D5F186-71E5-4A24-8B2A-C3BDE98BA2D2}" 4 | name="example.com\IT_Dept" 5 | image="2" 6 | changed="2023-09-23 12:00:00" 7 | uid="{B8C7DA29-6F69-4530-B99E-B9B5B88B215B}"> 8 | <Properties action="U" 9 | newName="" 10 | fullName="IT Department" 11 | description="Group for IT department staff" 12 | cpassword="5gn5fUqMaeGJkLEPgl3iH9UfLATVxRAHE8GvAvekwnicLYf2Pynj7ifihvajBRA3" 13 | changeLogon="0" 14 | noChange="0" 15 | neverExpires="0" 16 | acctDisabled="0" 17 | userName="example.com\IT_Dept"/> 18 | </User> 19 | </Groups> 20 | -------------------------------------------------------------------------------- /Scripts/SampleConfigs/Printers.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <Printers 3 | clsid="{1F577D12-3D1B-471e-A1B7-060317597B9C}" 4 | disabled="1"> 5 | <SharedPrinter 6 | clsid="{9A5E9697-9095-436d-A0EE-4D128FDFBCE5}" 7 | name="b35-1053-a" status="b35-1053-a" 8 | image="2" 9 | changed="2007-07-06 20:49:50" 10 | uid="{D954AF72-DDFC-498D-A185-A569A0D02FC4}"> 11 | <Properties 12 | action="U" 13 | comment="" 14 | path="\\PRN-CORP1\b35-1053-a" 15 | location="" 16 | default="1" 17 | skipLocal="1" 18 | deleteAll="0" 19 | persistent="0" 20 | deleteMaps="0" 21 | cpassword="5gn5fUqMaeGJkLEPgl3iH9UfLATVxRAHE8GvAvekwnicLYf2Pynj7ifihvajBRA3" 22 | port=""/> 23 | </SharedPrinter> 24 | <PortPrinter 25 | clsid="{C3A739D2-4A44-401e-9F9D-88E5E77DFB3E}" 26 | name="10.10.10.10" 27 | status="10.10.10.10" 28 | image="2" 29 | changed="2007-07-06 20:50:43" 30 | uid="{6A331F02-C488-44B6-988C-0730C2C1E374}"> 31 | <Properties 32 | ipAddress="10.10.10.10" 33 | action="U" 34 | location="1st Floor" 35 | localName="Lexmark 1150S" 36 | comment="Only for use by graphics" 37 | default="1" 38 | skipLocal="1" 39 | useDNS="0" 40 | path="Lexmark 1150S (Color)" 41 | deleteAll="0" 42 | lprQueue="" 43 | snmpCommunity="Local" 44 | protocol="PROTOCOL_RAWTCP_TYPE" 45 | portNumber="9100" 46 | doubleSpool="0" 47 | snmpEnabled="1" 48 | snmpDevIndex="1"/> 49 | </PortPrinter> 50 | <LocalPrinter 51 | clsid="{F08996D5-568B-45f5-BB7A-D3FB1E370B0A}" 52 | name="Epsom DotMatrix" 53 | status="1st Floor Copy Room" 54 | image="2" 55 | changed="2007-07-06 20:51:47" 56 | uid="{65D3663D-BC4E-45D2-8EA8-1DB3AC7158CB}"> 57 | <Properties 58 | action="U" 59 | name="Epsom DotMatrix" 60 | port="LPT1:" 61 | path="EpsomDots" 62 | default="1" 63 | deleteAll="0" 64 | location="1st Floor Copy Room" 65 | comment="Old printer. Don't use."/> 66 | </LocalPrinter> 67 | </Printers> -------------------------------------------------------------------------------- /Scripts/SampleConfigs/Services.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <NTServices clsid="{2CFB484A-4E96-4b5d-A0B6-093D2F91E6AE}"> 3 | <NTService 4 | clsid="{AB6F0B67-341F-4e51-92F9-005FBFBA1A43}" 5 | name="Computer Browser" 6 | image="0" 7 | changed="2007-07-10 22:52:45" 8 | uid="{8A3CC7D5-89F1-44DB-8D41-80F6471E17BF}"> 9 | <Properties 10 | startupType="NOCHANGE" 11 | serviceName="Computer Browser" 12 | timeout="30" 13 | accountName="LocalSystem" 14 | interact="1" 15 | firstFailure="NOACTION" 16 | secondFailure="NOACTION" 17 | thirdFailure="RESTART" 18 | resetFailCountDelay="0" 19 | cpassword="5gn5fUqMaeGJkLEPgl3iH9UfLATVxRAHE8GvAvekwnicLYf2Pynj7ifihvajBRA3" 20 | restartServiceDelay="900000"/> 21 | </NTService> 22 | </NTServices> -------------------------------------------------------------------------------- /Scripts/SampleConfigs/SiteManager.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <FileZilla3> 3 | <Servers> 4 | <Server> 5 | <Host>ftp.example.com</Host> 6 | <Port>21</Port> 7 | <Protocol>0</Protocol> <!-- 0 for FTP, 1 for SFTP --> 8 | <Type>0</Type> <!-- 0 for normal FTP, 1 for FTP over TLS/SSL --> 9 | <User>username</User> 10 | <Pass encoding="base64">SGVsbG9QYXNzd29yZA==</Pass> <!-- Password encoded in base64 --> 11 | <Logontype>1</Logontype> <!-- 0 for anonymous, 1 for normal --> 12 | <TimezoneOffset>0</TimezoneOffset> 13 | <PasvMode>MODE_DEFAULT</PasvMode> <!-- Default is passive mode --> 14 | <MaximumMultipleConnections>0</MaximumMultipleConnections> 15 | <EncodingType>Auto</EncodingType> 16 | <BypassProxy>0</BypassProxy> 17 | <Name>My FTP Site</Name> 18 | <Comments>Sample FTP site for demonstration</Comments> 19 | <LocalDir/> 20 | <RemoteDir/> 21 | <SyncBrowsing>0</SyncBrowsing> 22 | <DirectoryComparison>0</DirectoryComparison> 23 | </Server> 24 | 25 | <Server> 26 | <Host>sftp.example.com</Host> 27 | <Port>22</Port> 28 | <Protocol>1</Protocol> <!-- 1 for SFTP --> 29 | <Type>1</Type> <!-- 1 for explicit FTP over TLS --> 30 | <User>sftpuser</User> 31 | <Pass encoding="base64">SGVsbG9QYXNzd29yZA==</Pass> 32 | <Logontype>1</Logontype> 33 | <TimezoneOffset>0</TimezoneOffset> 34 | <PasvMode>MODE_DEFAULT</PasvMode> 35 | <MaximumMultipleConnections>1</MaximumMultipleConnections> 36 | <EncodingType>Auto</EncodingType> 37 | <BypassProxy>0</BypassProxy> 38 | <Name>My SFTP Site</Name> 39 | <Comments>Sample SFTP site</Comments> 40 | <LocalDir/> 41 | <RemoteDir/> 42 | <SyncBrowsing>0</SyncBrowsing> 43 | <DirectoryComparison>0</DirectoryComparison> 44 | </Server> 45 | </Servers> 46 | </FileZilla3> 47 | -------------------------------------------------------------------------------- /Scripts/SampleConfigs/WinSCP.ini: -------------------------------------------------------------------------------- 1 | [Configuration\Interface] 2 | Random=4074A9829D979781989E96 3 | 4 | [Sessions\example] 5 | HostName=ftp.example.com 6 | PortNumber=21 7 | UserName=myuser 8 | Password=0V5aNH+/kT8= ; Encrypted password 9 | LocalDirectory=C:\Users\myuser\Documents 10 | RemoteDirectory=/public_html 11 | FSProtocol=0 12 | PostLoginCommands= 13 | PrivateKeyFile= 14 | 15 | [Configuration\Interface\Commander] 16 | LastLocalDirectory=C:\Users\myuser\Documents 17 | LastRemoteDirectory=/public_html 18 | -------------------------------------------------------------------------------- /Scripts/SampleConfigs/app.config: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <configuration> 3 | <configSections> 4 | <!-- Section handlers for custom service credentials --> 5 | <section name="serviceCredentials" type="System.Configuration.NameValueSectionHandler" /> 6 | <sectionGroup name="system.net"> 7 | <section name="settings" type="System.Net.Configuration.SettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> 8 | </sectionGroup> 9 | </configSections> 10 | 11 | <!-- Application-specific settings --> 12 | <appSettings> 13 | <add key="ApplicationUsername" value="myAppUser" /> 14 | <add key="ApplicationPassword" value="myAppPassword" /> 15 | <add key="OAuthServiceUrl" value="https://oauth.example.com/token" /> 16 | <add key="ClientId" value="myClientId" /> 17 | <add key="ClientSecret" value="myClientSecret" /> 18 | <add key="ServiceUrl" value="https://service.example.com/api" /> 19 | <add key="ServiceUserName" value="serviceUser" /> 20 | <add key="ServicePassword" value="servicePassword" /> 21 | <add key="ApiEndpoint" value="https://api.example.com/endpoint" /> 22 | <add key="ApiUserName" value="apiUser" /> 23 | <add key="ApiPassword" value="apiPassword" /> 24 | </appSettings> 25 | 26 | <!-- Custom service credentials --> 27 | <serviceCredentials> 28 | <add key="ServiceUrl" value="https://customservice.example.com" /> 29 | <add key="UserName" value="customUser" /> 30 | <add key="Password" value="customPassword" /> 31 | </serviceCredentials> 32 | 33 | <!-- Connection strings for various databases --> 34 | <connectionStrings> 35 | <add name="SqlServerConnection" 36 | connectionString="Data Source=localhost;Initial Catalog=myDB;User ID=myUser;Password=myPass;" 37 | providerName="System.Data.SqlClient" /> 38 | <add name="SqlServerIntegratedSecurity" 39 | connectionString="Data Source=localhost;Initial Catalog=myDB;Integrated Security=True;" 40 | providerName="System.Data.SqlClient" /> 41 | <add name="MySqlConnection" 42 | connectionString="Server=localhost;Database=myDB;User=myUser;Password=myPass;" 43 | providerName="MySql.Data.MySqlClient" /> 44 | <add name="PostgreSqlConnection" 45 | connectionString="Host=localhost;Port=5432;Database=myDB;Username=myUser;Password=myPass;" 46 | providerName="Npgsql" /> 47 | <add name="OracleConnection" 48 | connectionString="Data Source=MyOracleDB;User Id=oracleUser;Password=oraclePass;" 49 | providerName="Oracle.ManagedDataAccess.Client" /> 50 | </connectionStrings> 51 | 52 | <!-- Web-specific settings --> 53 | <system.web> 54 | <compilation debug="true" /> 55 | <authentication mode="Forms"> 56 | <forms loginUrl="login.aspx" timeout="30"> 57 | <credentials passwordFormat="Clear"> 58 | <user name="user1" password="password1" /> 59 | <user name="user2" password="password2" /> 60 | </credentials> 61 | </forms> 62 | </authentication> 63 | <customErrors mode="Off" /> 64 | </system.web> 65 | 66 | <!-- Email (SMTP) configuration --> 67 | <system.net> 68 | <mailSettings> 69 | <smtp from="you@example.com"> 70 | <network host="smtp.example.com" port="587" 71 | userName="smtpUser" 72 | password="smtpPassword" 73 | defaultCredentials="false" /> 74 | </smtp> 75 | </mailSettings> 76 | </system.net> 77 | 78 | <!-- WCF Service configuration --> 79 | <system.serviceModel> 80 | <bindings> 81 | <basicHttpBinding> 82 | <binding name="MyBinding"> 83 | <security mode="Transport"> 84 | <transport clientCredentialType="Basic" /> 85 | </security> 86 | </binding> 87 | </basicHttpBinding> 88 | </bindings> 89 | <client> 90 | <endpoint address="https://example.com/service" 91 | binding="basicHttpBinding" 92 | bindingConfiguration="MyBinding" 93 | contract="IMyService" /> 94 | </client> 95 | <behaviors> 96 | <endpointBehaviors> 97 | <behavior> 98 | <clientCredentials> 99 | <userName userName="serviceUser" password="servicePassword" /> 100 | </clientCredentials> 101 | </behavior> 102 | </endpointBehaviors> 103 | </behaviors> 104 | </system.serviceModel> 105 | 106 | </configuration> 107 | -------------------------------------------------------------------------------- /Scripts/SampleConfigs/bootstrap.ini: -------------------------------------------------------------------------------- 1 | [GeneralSettings] 2 | username=adminUser 3 | password=P@ssw0rd123 4 | timeout=30 5 | loglevel=info 6 | public=public 7 | private=mysecret 8 | secret=mysecret 9 | key=mykey 10 | 11 | [DatabaseSettings] 12 | db_name=my_database 13 | db_host=localhost 14 | db_port=3306 15 | 16 | [NetworkSettings] 17 | protocol=http 18 | port=8080 -------------------------------------------------------------------------------- /Scripts/SampleConfigs/config.xml: -------------------------------------------------------------------------------- 1 | <?xml version='1.1' encoding='UTF-8'?> 2 | <user> 3 | <fullName>John Doe</fullName> 4 | <properties> 5 | <hudson.security.HudsonPrivateSecurityRealm_-Details> 6 | <!-- Hashed password using bcrypt --> 7 | <passwordHash>#jbcrypt:$2a$10$D6wVozrLhk.TIq.jBBKZluIh/EqzpjCUJFT/mWUnyAO4EYmxk5.aK</passwordHash> 8 | </hudson.security.HudsonPrivateSecurityRealm_-Details> 9 | </properties> 10 | </user> 11 | -------------------------------------------------------------------------------- /Scripts/SampleConfigs/context.xml: -------------------------------------------------------------------------------- 1 | <Context> 2 | <Resource name="jdbc/MyDB" 3 | auth="Container" 4 | type="javax.sql.DataSource" 5 | maxTotal="100" 6 | maxIdle="30" 7 | maxWaitMillis="10000" 8 | username="dbuser" 9 | password="dbpassword" 10 | driverClassName="com.mysql.jdbc.Driver" 11 | url="jdbc:mysql://localhost:3306/mydb"/> 12 | </Context> -------------------------------------------------------------------------------- /Scripts/SampleConfigs/dbvis.xml: -------------------------------------------------------------------------------- 1 | <dbvis> 2 | <connections> 3 | <connection> 4 | <name>MyDatabaseConnection</name> 5 | <url>jdbc:mysql://localhost:3306/mydatabase</url> 6 | <user>db_user</user> 7 | <password>+mQwYxIFaEjZ/MWJDkm1SCWhHw7xPXWd</password> <!-- Encrypted using DES with default key or a master password --> 8 | <driver>com.mysql.jdbc.Driver</driver> 9 | </connection> 10 | </connections> 11 | </dbvis> 12 | -------------------------------------------------------------------------------- /Scripts/SampleConfigs/dbxdrivers.ini: -------------------------------------------------------------------------------- 1 | [Installed Drivers] 2 | DB2=1 3 | Interbase=1 4 | MySQL=1 5 | Oracle=1 6 | Informix=1 7 | MSSQL=1 8 | UIB Interbase6=1 9 | UIB Interbase65=1 10 | UIB Interbase7=1 11 | UIB Interbase71=1 12 | UIB FireBird102=1 13 | UIB FireBird103=1 14 | UIB FireBird15=1 15 | UIB Yaffil=1 16 | 17 | [DB2] 18 | GetDriverFunc=getSQLDriverDB2 19 | LibraryName=dbexpdb2.dll 20 | VendorLib=db2cli.dll 21 | Database=DBNAME 22 | User_Name=user 23 | Password=password 24 | BlobSize=-1 25 | ErrorResourceFile= 26 | LocaleCode=0000 27 | DB2 TransIsolation=ReadCommited 28 | 29 | [Interbase] 30 | GetDriverFunc=getSQLDriverINTERBASE 31 | LibraryName=dbexpint.dll 32 | VendorLib=gds32.dll 33 | Database=database.gdb 34 | RoleName=RoleName 35 | User_Name=sysdba 36 | Password=masterkey 37 | ServerCharSet= 38 | SQLDialect=1 39 | BlobSize=-1 40 | CommitRetain=False 41 | WaitOnLocks=True 42 | ErrorResourceFile= 43 | LocaleCode=0000 44 | Interbase TransIsolation=ReadCommited 45 | Trim Char=False 46 | 47 | [MySQL] 48 | GetDriverFunc=getSQLDriverMYSQL 49 | LibraryName=dbexpmysql.dll 50 | VendorLib=libmysql.dll 51 | HostName=localhost 52 | Database=DBNAME 53 | User_Name=root 54 | Password= 55 | BlobSize=-1 56 | ErrorResourceFile= 57 | LocaleCode=0000 58 | 59 | [Oracle] 60 | GetDriverFunc=getSQLDriverORACLE 61 | LibraryName=dbexpora.dll 62 | VendorLib=oci.dll 63 | DataBase=Database Name 64 | User_Name=user 65 | Password=password 66 | BlobSize=-1 67 | ErrorResourceFile= 68 | LocaleCode=0000 69 | Oracle TransIsolation=ReadCommited 70 | RowsetSize=20 71 | OS Authentication=False 72 | Multiple Transaction=False 73 | Trim Char=False 74 | 75 | [Informix] 76 | GetDriverFunc=getSQLDriverINFORMIX 77 | LibraryName=dbexpinf.dll 78 | VendorLib=isqlb09a.dll 79 | HostName=ServerName 80 | DataBase=Database Name 81 | User_Name=user 82 | Password=password 83 | BlobSize=-1 84 | ErrorResourceFile= 85 | LocaleCode=0000 86 | Informix TransIsolation=ReadCommited 87 | Trim Char=False 88 | 89 | [MSSQL] 90 | GetDriverFunc=getSQLDriverMSSQL 91 | LibraryName=dbexpmss.dll 92 | VendorLib=oledb 93 | HostName=ServerName 94 | DataBase=Database Name 95 | User_Name=user 96 | Password=password 97 | BlobSize=-1 98 | ErrorResourceFile= 99 | LocaleCode=0000 100 | MSSQL TransIsolation=ReadCommited 101 | OS Authentication=False 102 | 103 | 104 | [AutoCommit] 105 | False=0 106 | True=1 107 | 108 | [BlockingMode] 109 | False=0 110 | True=1 111 | 112 | [WaitOnLocks] 113 | False=1 114 | True=0 115 | 116 | [CommitRetain] 117 | False=0 118 | True=1 119 | 120 | [OS Authentication] 121 | False=0 122 | True=1 123 | 124 | [Multiple Transaction] 125 | False=0 126 | True=1 127 | 128 | [Trim Char] 129 | False=0 130 | True=1 131 | 132 | [DB2 TransIsolation] 133 | DirtyRead=0 134 | ReadCommited=1 135 | RepeatableRead=2 136 | 137 | [Interbase TransIsolation] 138 | ReadCommited=1 139 | RepeatableRead=2 140 | 141 | [Oracle TransIsolation] 142 | DirtyRead=0 143 | ReadCommited=1 144 | RepeatableRead=2 145 | 146 | [Informix TransIsolation] 147 | DirtyRead=0 148 | ReadCommited=1 149 | RepeatableRead=2 150 | 151 | [MSSQL TransIsolation] 152 | DirtyRead=0 153 | ReadCommited=1 154 | RepeatableRead=2 155 | 156 | [SQLDialect] 157 | 1=0 158 | 2=1 159 | 3=2 160 | 161 | [UIB Interbase6] 162 | GetDriverFunc=getSQLDriverINTERBASE 163 | LibraryName=dbexpUIBint6.dll 164 | VendorLib=GDS32.DLL 165 | BlobSize=-1 166 | CommitRetain=False 167 | Database=database.ib 168 | ErrorResourceFile= 169 | LocaleCode=0000 170 | Password=masterkey 171 | RoleName=RoleName 172 | ServerCharSet= 173 | SQLDialect=3 174 | Interbase TransIsolation=ReadCommited 175 | User_Name=SYSDBA 176 | WaitOnLocks=True 177 | 178 | [UIB Interbase65] 179 | GetDriverFunc=getSQLDriverINTERBASE 180 | LibraryName=dbexpUIBint65.dll 181 | VendorLib=GDS32.DLL 182 | BlobSize=-1 183 | CommitRetain=False 184 | Database=database.ib 185 | ErrorResourceFile= 186 | LocaleCode=0000 187 | Password=masterkey 188 | RoleName=RoleName 189 | ServerCharSet= 190 | SQLDialect=3 191 | Interbase TransIsolation=ReadCommited 192 | User_Name=SYSDBA 193 | WaitOnLocks=True 194 | 195 | [UIB Interbase7] 196 | GetDriverFunc=getSQLDriverINTERBASE 197 | LibraryName=dbexpUIBint7.dll 198 | VendorLib=GDS32.DLL 199 | BlobSize=-1 200 | CommitRetain=False 201 | Database=database.ib 202 | ErrorResourceFile= 203 | LocaleCode=0000 204 | Password=masterkey 205 | RoleName=RoleName 206 | ServerCharSet= 207 | SQLDialect=3 208 | Interbase TransIsolation=ReadCommited 209 | User_Name=SYSDBA 210 | WaitOnLocks=True 211 | 212 | [UIB Interbase71] 213 | GetDriverFunc=getSQLDriverINTERBASE 214 | LibraryName=dbexpUIBint71.dll 215 | VendorLib=GDS32.DLL 216 | BlobSize=-1 217 | CommitRetain=False 218 | Database=database.ib 219 | ErrorResourceFile= 220 | LocaleCode=0000 221 | Password=masterkey 222 | RoleName=RoleName 223 | ServerCharSet= 224 | SQLDialect=3 225 | Interbase TransIsolation=ReadCommited 226 | User_Name=SYSDBA 227 | WaitOnLocks=True 228 | 229 | [UIB FireBird102] 230 | GetDriverFunc=getSQLDriverINTERBASE 231 | LibraryName=dbexpUIBfire102.dll 232 | VendorLib=GDS32.DLL 233 | BlobSize=-1 234 | CommitRetain=False 235 | Database=database.fb 236 | ErrorResourceFile= 237 | LocaleCode=0000 238 | Password=masterkey 239 | RoleName=RoleName 240 | ServerCharSet= 241 | SQLDialect=3 242 | Interbase TransIsolation=ReadCommited 243 | User_Name=SYSDBA 244 | WaitOnLocks=True 245 | 246 | [UIB FireBird103] 247 | GetDriverFunc=getSQLDriverINTERBASE 248 | LibraryName=dbexpUIBfire103.dll 249 | VendorLib=GDS32.DLL 250 | BlobSize=-1 251 | CommitRetain=False 252 | Database=database.fb 253 | ErrorResourceFile= 254 | LocaleCode=0000 255 | Password=masterkey 256 | RoleName=RoleName 257 | ServerCharSet= 258 | SQLDialect=3 259 | Interbase TransIsolation=ReadCommited 260 | User_Name=SYSDBA 261 | WaitOnLocks=True 262 | 263 | [UIB FireBird15] 264 | GetDriverFunc=getSQLDriverINTERBASE 265 | LibraryName=dbexpUIBfire15.dll 266 | VendorLib=fbclient.dll 267 | BlobSize=-1 268 | CommitRetain=False 269 | Database=database.fb 270 | ErrorResourceFile= 271 | LocaleCode=0000 272 | Password=masterkey 273 | RoleName=RoleName 274 | ServerCharSet= 275 | SQLDialect=3 276 | Interbase TransIsolation=ReadCommited 277 | User_Name=SYSDBA 278 | WaitOnLocks=True 279 | 280 | [UIB Yaffil] 281 | GetDriverFunc=getSQLDriverINTERBASE 282 | LibraryName=dbexpUIByaffil.dll 283 | VendorLib=GDS32.DLL 284 | BlobSize=-1 285 | CommitRetain=False 286 | Database=database.gdb 287 | ErrorResourceFile= 288 | LocaleCode=0000 289 | Password=masterkey 290 | RoleName=RoleName 291 | ServerCharSet= 292 | SQLDialect=3 293 | Interbase TransIsolation=ReadCommited 294 | User_Name=SYSDBA 295 | WaitOnLocks=True 296 | -------------------------------------------------------------------------------- /Scripts/SampleConfigs/example.dtsx: -------------------------------------------------------------------------------- 1 | <DTS:Executable 2 | xmlns:DTS="http://schemas.microsoft.com/sqlserver/Dts" 3 | DTS:refId="Package" 4 | DTS:CreationName="Microsoft.SqlServer.Dts.Runtime.Package"> 5 | 6 | <DTS:ConnectionManagers> 7 | 8 | <!-- Database Connection 1 --> 9 | <DTS:ConnectionManager 10 | DTS:refId="Package.ConnectionManagers[DB1]" 11 | DTS:CreationName="OLEDB"> 12 | <DTS:Properties> 13 | <DTS:Property DTS:Name="ConnectionString"> 14 | Data Source=dbserver1;Initial Catalog=Database1;User ID=dbuser1;Password=dbpassword1; 15 | </DTS:Property> 16 | <DTS:Property DTS:Name="Description">Primary Database Connection</DTS:Property> 17 | <DTS:Property DTS:Name="RetainSameConnection">True</DTS:Property> 18 | </DTS:Properties> 19 | </DTS:ConnectionManager> 20 | 21 | <!-- Database Connection 2 --> 22 | <DTS:ConnectionManager 23 | DTS:refId="Package.ConnectionManagers[DB2]" 24 | DTS:CreationName="OLEDB"> 25 | <DTS:Properties> 26 | <DTS:Property DTS:Name="ConnectionString"> 27 | Data Source=dbserver2;Initial Catalog=Database2;User ID=dbuser2;Password=dbpassword2; 28 | </DTS:Property> 29 | <DTS:Property DTS:Name="Description">Secondary Database Connection</DTS:Property> 30 | <DTS:Property DTS:Name="RetainSameConnection">True</DTS:Property> 31 | </DTS:Properties> 32 | </DTS:ConnectionManager> 33 | 34 | <!-- FTP Connection --> 35 | <DTS:ConnectionManager 36 | DTS:refId="Package.ConnectionManagers[FTPConnection]" 37 | DTS:CreationName="FTP"> 38 | <DTS:Properties> 39 | <DTS:Property DTS:Name="ServerName">ftpserver.com</DTS:Property> 40 | <DTS:Property DTS:Name="ServerUserName">ftpuser</DTS:Property> 41 | <DTS:Property DTS:Name="ServerPassword">ftppassword</DTS:Property> 42 | <DTS:Property DTS:Name="ServerPort">21</DTS:Property> 43 | <DTS:Property DTS:Name="Timeout">60</DTS:Property> 44 | <DTS:Property DTS:Name="UsePassiveMode">True</DTS:Property> 45 | </DTS:Properties> 46 | </DTS:ConnectionManager> 47 | 48 | <!-- SMTP Connection --> 49 | <DTS:ConnectionManager 50 | DTS:refId="Package.ConnectionManagers[SMTPConnection]" 51 | DTS:CreationName="SMTP"> 52 | <DTS:Properties> 53 | <DTS:Property DTS:Name="SmtpServer">smtp.mailserver.com</DTS:Property> 54 | <DTS:Property DTS:Name="Port">25</DTS:Property> 55 | <DTS:Property DTS:Name="UserName">smtpuser</DTS:Property> 56 | <DTS:Property DTS:Name="Password">smtppassword</DTS:Property> 57 | <DTS:Property DTS:Name="EnableSsl">True</DTS:Property> 58 | <DTS:Property DTS:Name="Description">SMTP Server Connection for Emails</DTS:Property> 59 | </DTS:Properties> 60 | </DTS:ConnectionManager> 61 | 62 | </DTS:ConnectionManagers> 63 | 64 | <!-- Tasks or Control Flow Elements --> 65 | <DTS:Executables> 66 | <!-- Sample Execute SQL Task using Database 1 --> 67 | <DTS:Executable 68 | DTS:refId="Package.Executable[SQLTask1]" 69 | DTS:CreationName="Microsoft.SqlServer.Dts.Tasks.ExecuteSQLTask.ExecuteSQLTask"> 70 | <DTS:Properties> 71 | <DTS:Property DTS:Name="Connection">Package.ConnectionManagers[DB1]</DTS:Property> 72 | <DTS:Property DTS:Name="SQLStatement">SELECT * FROM Table1;</DTS:Property> 73 | </DTS:Properties> 74 | </DTS:Executable> 75 | 76 | <!-- Sample FTP Task --> 77 | <DTS:Executable 78 | DTS:refId="Package.Executable[FTPTask1]" 79 | DTS:CreationName="Microsoft.SqlServer.Dts.Tasks.FtpTask.FtpTask"> 80 | <DTS:Properties> 81 | <DTS:Property DTS:Name="Connection">Package.ConnectionManagers[FTPConnection]</DTS:Property> 82 | <DTS:Property DTS:Name="RemotePath">/data/</DTS:Property> 83 | <DTS:Property DTS:Name="LocalPath">C:\data\</DTS:Property> 84 | <DTS:Property DTS:Name="Operation">Receive</DTS:Property> 85 | </DTS:Properties> 86 | </DTS:Executable> 87 | 88 | <!-- Sample Email Task --> 89 | <DTS:Executable 90 | DTS:refId="Package.Executable[EmailTask1]" 91 | DTS:CreationName="Microsoft.SqlServer.Dts.Tasks.SendMailTask.SendMailTask"> 92 | <DTS:Properties> 93 | <DTS:Property DTS:Name="Connection">Package.ConnectionManagers[SMTPConnection]</DTS:Property> 94 | <DTS:Property DTS:Name="From">noreply@mailserver.com</DTS:Property> 95 | <DTS:Property DTS:Name="To">user@example.com</DTS:Property> 96 | <DTS:Property DTS:Name="Subject">SSIS Task Notification</DTS:Property> 97 | <DTS:Property DTS:Name="MessageSource">Task has been completed successfully.</DTS:Property> 98 | </DTS:Properties> 99 | </DTS:Executable> 100 | 101 | </DTS:Executables> 102 | </DTS:Executable> 103 | -------------------------------------------------------------------------------- /Scripts/SampleConfigs/example.rdp: -------------------------------------------------------------------------------- 1 | screen mode id:i:2 2 | desktopwidth:i:1920 3 | desktopheight:i:1080 4 | session bpp:i:32 5 | winposstr:s:0,3,0,0,800,600 6 | full address:s:yourserver.com 7 | username:s:YourUsername 8 | password 51:b:encrypted_password_value 9 | -------------------------------------------------------------------------------- /Scripts/SampleConfigs/grub.cfg: -------------------------------------------------------------------------------- 1 | # Set the default menu entry to boot 2 | set default=0 3 | 4 | # Set the timeout for the GRUB menu 5 | set timeout=5 6 | 7 | # Set the GRUB background image (optional) 8 | if loadfont /boot/grub/fonts/unicode.pf2; then 9 | insmod gfxterm 10 | insmod png 11 | set gfxmode=auto 12 | set background_image="/boot/grub/background.png" 13 | terminal_output gfxterm 14 | fi 15 | 16 | # Define the superuser and plain-text password (for demo purposes only) 17 | set superusers="admin" 18 | password admin myplaintextpassword 19 | 20 | # Load necessary modules for Linux booting 21 | insmod gzio 22 | insmod part_msdos 23 | insmod ext2 24 | 25 | # Specify the path to the main GRUB boot configuration 26 | set root='hd0,msdos1' 27 | search --no-floppy --fs-uuid --set=root 1234-5678 28 | 29 | # Boot menu entries 30 | menuentry 'Ubuntu 22.04 LTS' --class ubuntu --class gnu-linux --class os { 31 | recordfail 32 | load_video 33 | gfxmode $linux_gfx_mode 34 | insmod gzio 35 | insmod part_msdos 36 | insmod ext2 37 | set root='hd0,msdos1' 38 | linux /vmlinuz-5.15.0-30-generic root=UUID=1234-5678 ro quiet splash 39 | initrd /initrd.img-5.15.0-30-generic 40 | } 41 | 42 | # Protected entry for recovery mode (requires superuser password) 43 | menuentry 'Ubuntu 22.04 LTS (Recovery Mode)' --class ubuntu --class gnu-linux --class os --unrestricted { 44 | recordfail 45 | load_video 46 | gfxmode $linux_gfx_mode 47 | insmod gzio 48 | insmod part_msdos 49 | insmod ext2 50 | set root='hd0,msdos1' 51 | linux /vmlinuz-5.15.0-30-generic root=UUID=1234-5678 ro recovery nomodeset 52 | initrd /initrd.img-5.15.0-30-generic 53 | } 54 | 55 | # Additional entry for Windows booting (if dual-booted) 56 | menuentry 'Windows 10' --class windows --class os { 57 | insmod part_msdos 58 | insmod ntfs 59 | set root='hd0,msdos2' 60 | chainloader +1 61 | } 62 | 63 | # Boot to GRUB command line (restricted access, requires superuser password) 64 | menuentry 'GRUB Command Line' --class cmdline --unrestricted { 65 | insmod all_video 66 | terminal_input console 67 | terminal_output console 68 | } 69 | -------------------------------------------------------------------------------- /Scripts/SampleConfigs/grub.conf: -------------------------------------------------------------------------------- 1 | # Set the default menu entry to boot 2 | set default=0 3 | 4 | # Set the timeout for the GRUB menu 5 | set timeout=5 6 | 7 | # Set the GRUB background image (optional) 8 | if loadfont /boot/grub/fonts/unicode.pf2; then 9 | insmod gfxterm 10 | insmod png 11 | set gfxmode=auto 12 | set background_image="/boot/grub/background.png" 13 | terminal_output gfxterm 14 | fi 15 | 16 | # Define the superuser and plain-text password (for demo purposes only) 17 | set superusers="admin" 18 | password admin myplaintextpassword 19 | 20 | # Load necessary modules for Linux booting 21 | insmod gzio 22 | insmod part_msdos 23 | insmod ext2 24 | 25 | # Specify the path to the main GRUB boot configuration 26 | set root='hd0,msdos1' 27 | search --no-floppy --fs-uuid --set=root 1234-5678 28 | 29 | # Boot menu entries 30 | menuentry 'Ubuntu 22.04 LTS' --class ubuntu --class gnu-linux --class os { 31 | recordfail 32 | load_video 33 | gfxmode $linux_gfx_mode 34 | insmod gzio 35 | insmod part_msdos 36 | insmod ext2 37 | set root='hd0,msdos1' 38 | linux /vmlinuz-5.15.0-30-generic root=UUID=1234-5678 ro quiet splash 39 | initrd /initrd.img-5.15.0-30-generic 40 | } 41 | 42 | # Protected entry for recovery mode (requires superuser password) 43 | menuentry 'Ubuntu 22.04 LTS (Recovery Mode)' --class ubuntu --class gnu-linux --class os --unrestricted { 44 | recordfail 45 | load_video 46 | gfxmode $linux_gfx_mode 47 | insmod gzio 48 | insmod part_msdos 49 | insmod ext2 50 | set root='hd0,msdos1' 51 | linux /vmlinuz-5.15.0-30-generic root=UUID=1234-5678 ro recovery nomodeset 52 | initrd /initrd.img-5.15.0-30-generic 53 | } 54 | 55 | # Additional entry for Windows booting (if dual-booted) 56 | menuentry 'Windows 10' --class windows --class os { 57 | insmod part_msdos 58 | insmod ntfs 59 | set root='hd0,msdos2' 60 | chainloader +1 61 | } 62 | 63 | # Boot to GRUB command line (restricted access, requires superuser password) 64 | menuentry 'GRUB Command Line' --class cmdline --unrestricted { 65 | insmod all_video 66 | terminal_input console 67 | terminal_output console 68 | } 69 | -------------------------------------------------------------------------------- /Scripts/SampleConfigs/jboss-cli.xml: -------------------------------------------------------------------------------- 1 | <jboss-cli xmlns="urn:jboss:cli:1.2"> 2 | <!-- The default controller host and port --> 3 | <controller> 4 | <host>127.0.0.1</host> <!-- Specify the host, e.g., localhost or a remote address --> 5 | <port>9990</port> <!-- The management port of JBoss/WildFly, default is 9990 --> 6 | </controller> 7 | 8 | <!-- The authentication details for the controller --> 9 | <authentication> 10 | <username>admin</username> <!-- Your management user --> 11 | <password>password</password> <!-- Your management user's password --> 12 | </authentication> 13 | 14 | <!-- Optionally enable secure connections using SSL --> 15 | <ssl> 16 | <enabled>false</enabled> <!-- Set to true if using SSL/TLS for the connection --> 17 | <keystore-path></keystore-path> 18 | <keystore-password></keystore-password> 19 | <truststore-path></truststore-path> 20 | <truststore-password></truststore-password> 21 | </ssl> 22 | 23 | <!-- Custom properties for the CLI session --> 24 | <properties> 25 | <!-- For example, to disable coloring in the CLI output --> 26 | <property name="jboss.cli.color" value="false"/> 27 | </properties> 28 | 29 | <!-- Configuration of command history behavior --> 30 | <history> 31 | <enabled>true</enabled> <!-- Whether to enable CLI command history --> 32 | <max-size>500</max-size> <!-- The maximum number of commands to store in history --> 33 | </history> 34 | </jboss-cli> 35 | -------------------------------------------------------------------------------- /Scripts/SampleConfigs/krb5.conf: -------------------------------------------------------------------------------- 1 | [libdefaults] 2 | default_realm = EXAMPLE.COM 3 | dns_lookup_realm = false 4 | dns_lookup_kdc = true 5 | rdns = false 6 | ticket_lifetime = 24h 7 | forwardable = yes 8 | 9 | [realms] 10 | EXAMPLE.COM = { 11 | kdc = ad.example.com 12 | admin_server = ad.example.com 13 | default_domain = example.com 14 | } 15 | 16 | [domain_realm] 17 | .example.com = EXAMPLE.COM 18 | example.com = EXAMPLE.COM 19 | 20 | # Insecure: Exposing credentials in krb5.conf for automated ticket retrieval (NOT recommended) 21 | [login] 22 | krb5_get_init_creds_keytab = false 23 | 24 | # Insecure: Plaintext credentials for AD principal 25 | [appdefaults] 26 | kinit = { 27 | principal = admin@EXAMPLE.COM 28 | password = P@ssw0rd123 29 | } 30 | 31 | pam = { 32 | debug = false 33 | ticket_lifetime = 36000 34 | renew_lifetime = 36000 35 | forwardable = true 36 | } 37 | -------------------------------------------------------------------------------- /Scripts/SampleConfigs/machine.config: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <configuration> 3 | <configSections> 4 | <!-- Section handlers for configuration settings --> 5 | <sectionGroup name="system.net"> 6 | <section name="settings" type="System.Net.Configuration.SettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> 7 | </sectionGroup> 8 | </configSections> 9 | 10 | <!-- App settings for all .NET applications --> 11 | <appSettings> 12 | <!-- Example of username and password in appSettings --> 13 | <add key="ApplicationUsername" value="myAppUser" /> 14 | <add key="ApplicationPassword" value="myAppPassword" /> 15 | </appSettings> 16 | 17 | <!-- OAuth/Token-Based Service Endpoints --> 18 | <appSettings> 19 | <add key="OAuthServiceUrl" value="https://oauth.example.com/token" /> 20 | <add key="ClientId" value="myClientId" /> 21 | <add key="ClientSecret" value="myClientSecret" /> 22 | </appSettings> 23 | 24 | <!-- WebClient or HttpClient Credentials --> 25 | <appSettings> 26 | <add key="ServiceUrl" value="https://service.example.com/api" /> 27 | <add key="ServiceUserName" value="serviceUser" /> 28 | <add key="ServicePassword" value="servicePassword" /> 29 | </appSettings> 30 | 31 | <!-- AppSettings Section --> 32 | <appSettings> 33 | <add key="ApiEndpoint" value="https://api.example.com/endpoint" /> 34 | <add key="ApiUserName" value="apiUser" /> 35 | <add key="ApiPassword" value="apiPassword" /> 36 | </appSettings> 37 | 38 | <!-- Custom Sections for Service Credentials --> 39 | <configSections> 40 | <section name="serviceCredentials" type="System.Configuration.NameValueSectionHandler" /> 41 | </configSections> 42 | 43 | <serviceCredentials> 44 | <add key="ServiceUrl" value="https://customservice.example.com" /> 45 | <add key="UserName" value="customUser" /> 46 | <add key="Password" value="customPassword" /> 47 | </serviceCredentials> 48 | 49 | <!-- Connection string settings --> 50 | <connectionStrings> 51 | <!-- SQL Server (Standard Authentication) --> 52 | <add name="SqlServerConnection" 53 | connectionString="Data Source=localhost;Initial Catalog=myDB;User ID=myUser;Password=myPass;" 54 | providerName="System.Data.SqlClient" /> 55 | 56 | <!-- SQL Server (Windows Authentication) --> 57 | <add name="SqlServerIntegratedSecurity" 58 | connectionString="Data Source=localhost;Initial Catalog=myDB;Integrated Security=True;" 59 | providerName="System.Data.SqlClient" /> 60 | 61 | <!-- SQL Server (Encrypted Connection) --> 62 | <add name="SqlServerEncryptedConnection" 63 | connectionString="Data Source=localhost;Initial Catalog=myDB;User ID=myUser;Password=myPass;Encrypt=True;TrustServerCertificate=False;" 64 | providerName="System.Data.SqlClient" /> 65 | 66 | <!-- MySQL (Standard Connection) --> 67 | <add name="MySqlConnection" 68 | connectionString="Server=localhost;Database=myDB;User=myUser;Password=myPass;" 69 | providerName="MySql.Data.MySqlClient" /> 70 | 71 | <!-- MySQL (SSL/Encrypted Connection) --> 72 | <add name="MySqlConnectionWithSSL" 73 | connectionString="Server=localhost;Database=myDB;User=myUser;Password=myPass;SslMode=Required;" 74 | providerName="MySql.Data.MySqlClient" /> 75 | 76 | <!-- PostgreSQL (Standard Connection) --> 77 | <add name="PostgreSqlConnection" 78 | connectionString="Host=localhost;Port=5432;Database=myDB;Username=myUser;Password=myPass;" 79 | providerName="Npgsql" /> 80 | 81 | <!-- Oracle (Standard Connection) --> 82 | <add name="OracleConnection" 83 | connectionString="Data Source=MyOracleDB;User Id=oracleUser;Password=oraclePass;" 84 | providerName="System.Data.OracleClient" /> 85 | 86 | <!-- Oracle (TNS Connection) --> 87 | <add name="OracleTNSConnection" 88 | connectionString="Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=myHost)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=myService)));User Id=oracleUser;Password=oraclePass;" 89 | providerName="Oracle.ManagedDataAccess.Client" /> 90 | 91 | <!-- SQLite (No Authentication Required) --> 92 | <add name="SQLiteConnection" 93 | connectionString="Data Source=myDatabase.db;" 94 | providerName="System.Data.SQLite" /> 95 | 96 | <!-- Microsoft Access (OLEDB with username and password) --> 97 | <add name="AccessConnection" 98 | connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\myAccessFile.accdb;User Id=admin;Password=myPass;" 99 | providerName="System.Data.OleDb" /> 100 | 101 | <!-- Azure SQL (Standard SQL Authentication) --> 102 | <add name="AzureSqlConnection" 103 | connectionString="Server=tcp:myserver.database.windows.net,1433;Initial Catalog=myDB;Persist Security Info=False;User ID=myUser;Password=myPass;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;" 104 | providerName="System.Data.SqlClient" /> 105 | </connectionStrings> 106 | 107 | <!-- Compilation settings for applications --> 108 | <system.web> 109 | <compilation debug="false" /> 110 | <authentication mode="Forms"> 111 | <!-- Forms authentication with username and password --> 112 | <forms loginUrl="login.aspx" timeout="30"> 113 | <credentials passwordFormat="Clear"> 114 | <user name="user1" password="password1" /> 115 | <user name="user2" password="password2" /> 116 | </credentials> 117 | </forms> 118 | </authentication> 119 | <customErrors mode="Off" /> 120 | </system.web> 121 | 122 | <!-- Machine-wide database settings --> 123 | <system.data> 124 | <DbProviderFactories> 125 | <add name="Microsoft SQL Server Compact Data Provider" 126 | invariant="System.Data.SqlServerCe.4.0" 127 | description=".NET Framework Data Provider for Microsoft SQL Server Compact" 128 | type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" /> 129 | </DbProviderFactories> 130 | </system.data> 131 | 132 | <!-- Credentials for SMTP (system.net) --> 133 | <system.net> 134 | <mailSettings> 135 | <smtp from="you@example.com"> 136 | <network host="smtp.example.com" port="587" 137 | userName="smtpUser" 138 | password="smtpPassword" 139 | defaultCredentials="false" /> 140 | </smtp> 141 | </mailSettings> 142 | </system.net> 143 | 144 | <!-- Global assembly cache settings --> 145 | <runtime> 146 | <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 147 | <dependentAssembly> 148 | <assemblyIdentity name="System.Web" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> 149 | <bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.0.0.0" /> 150 | </dependentAssembly> 151 | </assemblyBinding> 152 | </runtime> 153 | 154 | <!-- Logging and tracing settings --> 155 | <system.diagnostics> 156 | <sources> 157 | <source name="System.Net" switchValue="Verbose"> 158 | <listeners> 159 | <add name="consoleListener" type="System.Diagnostics.ConsoleTraceListener" /> 160 | </listeners> 161 | </source> 162 | </sources> 163 | </system.diagnostics> 164 | 165 | <!-- WCF (Windows Communication Foundation) Service Bindings --> 166 | <system.serviceModel> 167 | <bindings> 168 | <basicHttpBinding> 169 | <binding name="MyBinding"> 170 | <security mode="Transport"> 171 | <transport clientCredentialType="Basic" /> 172 | </security> 173 | </binding> 174 | </basicHttpBinding> 175 | </bindings> 176 | <client> 177 | <endpoint address="https://example.com/service" 178 | binding="basicHttpBinding" 179 | bindingConfiguration="MyBinding" 180 | contract="IMyService" /> 181 | </client> 182 | <behaviors> 183 | <endpointBehaviors> 184 | <behavior> 185 | <clientCredentials> 186 | <userName userName="serviceUser" password="servicePassword" /> 187 | </clientCredentials> 188 | </behavior> 189 | </endpointBehaviors> 190 | </behaviors> 191 | </system.serviceModel> 192 | </configuration> 193 | -------------------------------------------------------------------------------- /Scripts/SampleConfigs/my.cnf: -------------------------------------------------------------------------------- 1 | 2 | 3 | [client] 4 | # Client configuration options 5 | user=yourusername 6 | password=yourpassword 7 | port=3306 8 | socket=/var/run/mysqld/mysqld.sock 9 | 10 | [mysqld] 11 | # MySQL server configuration 12 | user=mysql 13 | pid-file=/var/run/mysqld/mysqld.pid 14 | socket=/var/run/mysqld/mysqld.sock 15 | port=3306 16 | basedir=/usr 17 | datadir=/var/lib/mysql 18 | tmpdir=/tmp 19 | log-error=/var/log/mysql/error.log 20 | bind-address=127.0.0.1 21 | max_connections=100 22 | skip-external-locking 23 | 24 | # Buffer pool size for InnoDB 25 | innodb_buffer_pool_size=256M 26 | 27 | # Other MySQL server settings 28 | max_allowed_packet=16M 29 | query_cache_limit=1M 30 | query_cache_size=16M 31 | log_bin=/var/log/mysql/mysql-bin.log 32 | 33 | [mysql] 34 | # Client-specific settings for the MySQL command-line tool 35 | user=yourusername 36 | password=yourpassword 37 | no-auto-rehash 38 | -------------------------------------------------------------------------------- /Scripts/SampleConfigs/php.ini: -------------------------------------------------------------------------------- 1 | [PHP] 2 | ; Basic PHP settings 3 | 4 | ; Maximum size of POST data allowed 5 | post_max_size = 8M 6 | 7 | ; Maximum allowed size for uploaded files 8 | upload_max_filesize = 2M 9 | 10 | ; INSECURE: Storing database credentials in php.ini (not recommended) 11 | ; This exposes credentials to anyone with access to php.ini or via phpinfo() if not secured. 12 | 13 | mysql.default_user = "dbuser" 14 | mysql.default_password = "P@ssw0rd123" 15 | mysql.default_host = "localhost" 16 | mysql.default_database = "example_db" 17 | 18 | ; Log errors to a file 19 | log_errors = On 20 | error_log = /var/log/php_errors.log 21 | 22 | ; Ensure that this option is Off to avoid disclosing sensitive configuration details 23 | expose_php = Off 24 | 25 | ; Ensure that phpinfo() is secured or disabled to prevent exposure of configuration data 26 | disable_functions = phpinfo 27 | -------------------------------------------------------------------------------- /Scripts/SampleConfigs/pureftpd.passwd: -------------------------------------------------------------------------------- 1 | username:$1$X9p2ER8W$M7P5CxX5CHPxuAiB5BBJq/:1001:1001::/home/ftp/username:/bin/false:: 2 | user2:$1$XYz3ERzW$G9P7CxF6CPxxuAiB6BBJq/:1002:1002::/home/ftp/user2:/bin/false:: 3 | -------------------------------------------------------------------------------- /Scripts/SampleConfigs/putty.reg: -------------------------------------------------------------------------------- 1 | Windows Registry Editor Version 5.00 2 | 3 | [HKEY_CURRENT_USER\Software\SimonTatham\PuTTY] 4 | "TermWidth"=dword:00000050 5 | "TermHeight"=dword:00000018 6 | "WinTitle"="PuTTY" 7 | 8 | [HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\Default%20Settings] 9 | "HostName"="" 10 | "PortNumber"=dword:00000016 11 | "Protocol"="ssh" 12 | "TerminalType"="xterm" 13 | "Font"="Courier New" 14 | "FontHeight"=dword:0000000a 15 | "WinHeight"=dword:00000018 16 | "WinWidth"=dword:00000050 17 | "ConnectionSharing"=dword:00000001 18 | 19 | [HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\My%20SSH%20Session] 20 | "HostName"="192.168.1.100" 21 | "PortNumber"=dword:00000016 22 | "Protocol"="ssh" 23 | "TerminalType"="xterm" 24 | "Font"="Courier New" 25 | "FontHeight"=dword:0000000a 26 | "WinHeight"=dword:00000018 27 | "WinWidth"=dword:00000050 28 | "Compression"=dword:00000001 29 | "ConnectionSharing"=dword:00000001 30 | "PublicKeyFile"="C:\\Users\\YourUsername\\.ssh\\id_rsa.ppk" 31 | "LogFileName"="C:\\putty_logs\\my_session.log" 32 | "LogType"=dword:00000001 33 | "LogFileClash"=dword:00000001 34 | "LogFlush"=dword:00000001 35 | "LogOmitPasswords"=dword:00000001 36 | "LogOmitData"=dword:00000000 37 | "UserName"="myusername" ; Username stored here 38 | -------------------------------------------------------------------------------- /Scripts/SampleConfigs/remmina.pref: -------------------------------------------------------------------------------- 1 | [remmina_pref] 2 | secret=A123kgXlYRiCAdDcbFsE8SAoCGUanspg123= 3 | recent_RDP=myserver.demo.local 4 | save_view_mode=true 5 | invisible_toolbar=false 6 | default_action=0 7 | scale_quality=0 8 | hide_toolbar=false 9 | hide_statusbar=false 10 | small_toolbutton=false 11 | view_file_mode=0 12 | resolutions=640x480,800x600,1024x768,1152x864,1280x960,1400x1050 13 | main_width=600 14 | main_height=400 15 | main_maximize=false 16 | main_sort_column_id=1 17 | main_sort_order=0 18 | sshtunnel_port=4732 19 | applet_quick_ontop=false 20 | applet_hide_count=false 21 | recent_maximum=10 22 | default_mode=0 23 | tab_mode=9 24 | -------------------------------------------------------------------------------- /Scripts/SampleConfigs/running-config: -------------------------------------------------------------------------------- 1 | ! 2 | ! Cisco IOS Software, C3560 Software (C3560-IPBASEK9-M), Version 15.0(2)SE11 3 | ! Compiled Mon 28-Mar-21 08:55 by prod_rel_team 4 | ! 5 | version 15.0 6 | service timestamps debug datetime msec 7 | service timestamps log datetime msec 8 | no service password-recovery 9 | service password-encryption 10 | ! 11 | hostname Router1 12 | ! 13 | enable secret 5 $1$DkGh$XSdDk6LdoqM0eO67V0lJ71 14 | enable password mycleartextpassword 15 | ! 16 | no aaa new-model 17 | ! 18 | ! 19 | username admin privilege 15 password 0 cleartext123 20 | username cisco privilege 15 password 7 12140A05171F15142F7C343F 21 | username secureadmin secret 5 $1$lpb1$kGc1R/tGbT6aYZEXw5lqa0 22 | ! 23 | ip ssh version 2 24 | ip domain-name example.com 25 | ! 26 | interface GigabitEthernet0/0 27 | description Uplink to ISP 28 | ip address 192.168.1.1 255.255.255.0 29 | duplex auto 30 | speed auto 31 | ! 32 | interface GigabitEthernet0/1 33 | description Internal LAN 34 | ip address 192.168.2.1 255.255.255.0 35 | duplex auto 36 | speed auto 37 | ! 38 | ip route 0.0.0.0 0.0.0.0 192.168.1.254 39 | ! 40 | snmp-server community public RO 41 | snmp-server community private RW 42 | ! 43 | line con 0 44 | exec-timeout 0 0 45 | password consolepassword123 46 | logging synchronous 47 | login 48 | ! 49 | line vty 0 4 50 | password 7 02050D4808091B385C4B5E1A09121319 51 | logging synchronous 52 | login 53 | transport input ssh 54 | ! 55 | interface Vlan1 56 | ip address 192.168.3.1 255.255.255.0 57 | no shutdown 58 | ! 59 | dot11 ssid MySSID 60 | authentication open 61 | authentication key-management wpa 62 | wpa-psk ascii 0 cleartextkeywifipassword 63 | ! 64 | banner motd ^C 65 | *********************************************** 66 | Unauthorized access is prohibited! 67 | *********************************************** 68 | ^C 69 | ! 70 | end 71 | -------------------------------------------------------------------------------- /Scripts/SampleConfigs/server.xml: -------------------------------------------------------------------------------- 1 | <!-- 2 | Copyright (c) 2017,2023 IBM Corporation and others. 3 | All rights reserved. This program and the accompanying materials 4 | are made available under the terms of the Eclipse Public License 2.0 5 | which accompanies this distribution, and is available at 6 | http://www.eclipse.org/legal/epl-2.0/ 7 | 8 | SPDX-License-Identifier: EPL-2.0 9 | 10 | Contributors: 11 | IBM Corporation - initial API and implementation 12 | --> 13 | <server> 14 | <include location="../fatTestPorts.xml" /> 15 | 16 | <featureManager> 17 | <feature>componenttest-1.0</feature> 18 | <feature>restConnector-2.0</feature> 19 | <feature>jdbc-4.2</feature> 20 | <feature>mpOpenApi-1.0</feature> 21 | </featureManager> 22 | 23 | <variable name="onError" value="FAIL"/> 24 | 25 | <keyStore id="defaultKeyStore" password="Liberty"/> 26 | 27 | <basicRegistry> 28 | <user name="adminuser" password="adminpwd" /> 29 | <user name="reader" password="readerpwd" /> 30 | <user name="user" password="userpwd" /> 31 | </basicRegistry> 32 | <administrator-role> 33 | <user>adminuser</user> 34 | </administrator-role> 35 | <reader-role> 36 | <user>reader</user> 37 | </reader-role> 38 | 39 | <library id="Derby"> 40 | <file name="${shared.resource.dir}/derby/derby.jar"/> 41 | </library> 42 | 43 | <variable name="DB_USER" value="dbuser"/> 44 | <variable name="DB_PASS" value="dbpass"/> 45 | 46 | <dataSource id="DataSourceWithoutJDBCDriver" jndiName="jdbc/withoutJDBCDriver" connectionSharing="MatchCurrentState" transactional="false"> 47 | <containerAuthData id="dbuser-auth" user="dbuser" password="{xor}Oz0vPiws"/> 48 | <properties.derby.embedded databaseName="memory:withoutJDBCDriver"/> 49 | </dataSource> 50 | 51 | <dataSource id="DefaultDataSource" isolationLevel="TRANSACTION_READ_COMMITTED"> 52 | <jdbcDriver libraryRef="Derby"/> 53 | <!-- user/password settings defined in bootstrap.properties --> 54 | <properties.derby.embedded databaseName="memory:defaultdb" createDatabase="create" 55 | user="${DB_USER}" password="${DB_PASS}"/> 56 | </dataSource> 57 | 58 | <dataSource id="jdbc/nonexistentdb" jndiName="${id}"> 59 | <connectionManager id="NestedConPool" agedTimeout="1h2m3s" connectionTimeout="0s" maxIdleTime="40m" reapTime="2m30s"/> 60 | <jdbcDriver libraryRef="Derby"/> 61 | <properties.derby.embedded databaseName="memory:doesNotExist"/> 62 | </dataSource> 63 | 64 | <transaction enableHADBPeerLocking="false"> 65 | <dataSource transactional="false" containerAuthDataRef="auth1"> 66 | <connectionManager maxPoolSize="5" connectionTimeout="0s"/> 67 | <jdbcDriver libraryRef="Derby"/> 68 | <properties.derby.embedded databaseName="memory:recoverydb" createDatabase="create"/> 69 | </dataSource> 70 | </transaction> 71 | 72 | <!-- ejbLite and batch features are intentionally disabled --> 73 | <databaseStore id="unavailableDBStore"> 74 | <dataSource id="unavailableDS"> 75 | <jdbcDriver libraryRef="Derby"/> 76 | <properties.derby.embedded databaseName="memory:unavailabledb"/> 77 | </dataSource> 78 | </databaseStore> 79 | 80 | <!-- mongo feature intentionally disabled, so it doesn't matter that we are using an incorrect library --> 81 | <mongo id="mongo" libraryRef="DerbyLib"/> 82 | <mongoDB id="MongoDBNotEnabled" jndiName="mongo/db" mongoRef="mongo" databaseName="db-test" /> 83 | 84 | <authData id="auth1" user="dbuser" password="dbpass"/> 85 | 86 | <authData id="auth2" user="dbuser" password="wrong_password"/> 87 | 88 | <dataSource jndiName="jdbc/defaultauth" containerAuthDataRef="auth1"> <!-- id omitted for testing --> 89 | <connectionManager enableSharingForDirectLookups="false"/> 90 | <jdbcDriver id="NestedDerbyDriver" libraryRef="Derby" 91 | javax.sql.DataSource="org.apache.derby.jdbc.EmbeddedDataSource" 92 | javax.sql.ConnectionPoolDataSource="org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource" 93 | javax.sql.XADataSource="org.apache.derby.jdbc.EmbeddedXADataSource"/> 94 | <onConnect>SET CURRENT SCHEMA = APP</onConnect> 95 | <onConnect>SET CURRENT SQLID = APP</onConnect> 96 | <properties.derby.embedded databaseName="memory:defaultdb" createDatabase="create"/> 97 | </dataSource> 98 | 99 | <dataSource id="WrongDefaultAuth" jndiName="jdbc/wrongdefaultauth" 100 | connectionManagerRef="pool1" containerAuthDataRef="auth2" commitOrRollbackOnCleanup="rollback" 101 | invalidProperty="The property's value." jdbcDriverRef="DerbyDriver" queryTimeout="2m10s" 102 | recoveryAuthDataRef="auth2" statementCacheSize="15" validationTimeout="20s"> 103 | <properties databaseName="memory:defaultdb" createDatabase="create"/> 104 | </dataSource> 105 | 106 | <connectionManager id="pool1" maxPoolSize="10" purgePolicy="ValidateAllConnections"/> 107 | 108 | <jdbcDriver id="DerbyDriver" libraryRef="Derby"/> 109 | 110 | <javaPermission codebase="${shared.resource.dir}/derby/derby.jar" className="java.security.AllPermission"/> 111 | </server> -------------------------------------------------------------------------------- /Scripts/SampleConfigs/setting.ini: -------------------------------------------------------------------------------- 1 | [GeneralSettings] 2 | app_name = MyApp 3 | version = 1.0.0 4 | theme = dark 5 | 6 | [DatabaseSettings] 7 | host = localhost 8 | port = 3306 9 | username = dbuser 10 | password = dbpass 11 | 12 | [CustomSettings] 13 | user = myuser 14 | pass = mypass 15 | 16 | [Logging] 17 | log_level = DEBUG 18 | log_file = /var/log/myapp.log 19 | -------------------------------------------------------------------------------- /Scripts/SampleConfigs/shadow: -------------------------------------------------------------------------------- 1 | root:$6$examplehash$E5iNRLtC5/j/kCkRhYlOro.Y9PzE0Gv8jlsfLZUNwlEm7HMBZSO9.mUvefOrKT6BjKSO4obQ.EtCZKhQgmgwV0:19000:0:99999:7::: 2 | user1:$6$examplehash$OwhxlyS5hoxfFE4tmtyOR8Hw1k8PLqokP9FYxYP8QMG3wO0u.0Xvd4g/0Udr6BQZilJk4k7XwlxJ6p0RJ2IL5/:19000:0:99999:7::: 3 | nobody:*:19000:0:99999:7::: 4 | daemon:*:19000:0:99999:7::: 5 | -------------------------------------------------------------------------------- /Scripts/SampleConfigs/smb.conf: -------------------------------------------------------------------------------- 1 | [global] 2 | # General server settings 3 | workgroup = EXAMPLE 4 | realm = EXAMPLE.COM 5 | server string = Samba Server Version %v 6 | security = ads 7 | encrypt passwords = yes 8 | kerberos method = secrets and keytab 9 | log file = /var/log/samba/log.%m 10 | max log size = 50 11 | 12 | # Domain and authentication settings 13 | idmap config * : backend = tdb 14 | idmap config EXAMPLE : backend = rid 15 | idmap config EXAMPLE : range = 10000-20000 16 | template shell = /bin/bash 17 | winbind use default domain = yes 18 | winbind offline logon = yes 19 | winbind enum users = yes 20 | winbind enum groups = yes 21 | 22 | # INSECURE: Credentials for binding to Active Directory (avoid plaintext credentials) 23 | # This exposes the AD admin account and password directly in the smb.conf file 24 | username = ad-admin 25 | password = P@ssw0rd123 26 | 27 | # Kerberos keytab file location (more secure than plaintext credentials) 28 | dedicated keytab file = /etc/krb5.keytab 29 | kerberos method = secrets and keytab 30 | 31 | [homes] 32 | comment = Home Directories 33 | browseable = no 34 | writable = yes 35 | 36 | [printers] 37 | comment = All Printers 38 | path = /var/spool/samba 39 | printable = yes 40 | guest ok = no 41 | writable = no 42 | browseable = no 43 | 44 | [shared] 45 | path = /srv/samba/shared 46 | browseable = yes 47 | read only = no 48 | valid users = @staff 49 | -------------------------------------------------------------------------------- /Scripts/SampleConfigs/sssd.conf: -------------------------------------------------------------------------------- 1 | [sssd] 2 | config_file_version = 2 3 | services = nss, pam, ssh, sudo 4 | domains = example.com 5 | 6 | [nss] 7 | filter_groups = root 8 | filter_users = root 9 | 10 | [pam] 11 | offline_credentials_expiration = 2 12 | offline_failed_login_attempts = 3 13 | offline_failed_login_delay = 5 14 | 15 | [domain/example.com] 16 | # Basic configuration for connecting to Active Directory 17 | id_provider = ad 18 | auth_provider = ad 19 | access_provider = ad 20 | 21 | # Enable Kerberos for authentication 22 | krb5_realm = EXAMPLE.COM 23 | krb5_server = ad.example.com 24 | krb5_kpasswd = ad.example.com 25 | 26 | # Active Directory server information 27 | ad_domain = example.com 28 | ad_server = ad.example.com 29 | ad_hostname = linuxclient.example.com 30 | 31 | # INSECURE PRACTICE: Hardcoding AD username and password in sssd.conf 32 | # These values will expose the username and password in plaintext 33 | ldap_default_bind_dn = cn=admin,cn=users,dc=example,dc=com 34 | ldap_default_authtok = P@ssw0rd123 35 | 36 | # Using the above configuration exposes credentials to anyone who can read this file 37 | 38 | # User and group filtering (optional) 39 | ldap_id_mapping = true 40 | 41 | # Performance optimizations 42 | cache_credentials = true 43 | enumerate = false 44 | use_fully_qualified_names = false 45 | 46 | # Access Control (Optional: limit login to users in AD group 'LinuxAdmins') 47 | access_provider = simple 48 | simple_allow_groups = LinuxAdmins 49 | 50 | # Security settings 51 | min_id = 1000 52 | fallback_homedir = /home/%u 53 | 54 | # Timeout and retry settings for better AD stability 55 | ldap_search_timeout = 10 56 | ldap_connection_expire_timeout = 60 57 | 58 | # Debugging options (uncomment for troubleshooting) 59 | # debug_level = 9 60 | -------------------------------------------------------------------------------- /Scripts/SampleConfigs/standalone.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <server xmlns="urn:jboss:domain:11.0"> 3 | 4 | <extensions> 5 | <extension module="org.jboss.as.connector"/> 6 | <!-- Other extensions --> 7 | </extensions> 8 | 9 | <subsystem xmlns="urn:jboss:domain:datasources:5.0"> 10 | <datasources> 11 | <datasource jndi-name="java:/jdbc/MyDS" pool-name="MyDS_Pool" enabled="true" use-java-context="true"> 12 | <connection-url>jdbc:mysql://localhost:3306/mydatabase</connection-url> 13 | <driver>mysql</driver> 14 | <security> 15 | <user-name>${VAULT::vault::mydbuser}</user-name> 16 | <password>${VAULT::vault::mydbpassword}</password> 17 | </security> 18 | <pool> 19 | <min-pool-size>5</min-pool-size> 20 | <max-pool-size>20</max-pool-size> 21 | </pool> 22 | <validation> 23 | <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker"/> 24 | <validate-on-match>true</validate-on-match> 25 | <background-validation>true</background-validation> 26 | </validation> 27 | <timeout> 28 | <blocking-timeout-millis>5000</blocking-timeout-millis> 29 | </timeout> 30 | <statement> 31 | <track-statements>false</track-statements> 32 | </statement> 33 | </datasource> 34 | 35 | <drivers> 36 | <driver name="mysql" module="com.mysql"> 37 | <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class> 38 | </driver> 39 | </drivers> 40 | </datasources> 41 | </subsystem> 42 | 43 | <security> 44 | <vault> 45 | <vault-option name="KEYSTORE_URL" value="${jboss.server.config.dir}/vault.keystore"/> 46 | <vault-option name="KEYSTORE_PASSWORD" value="password"/> 47 | <vault-option name="VAULT_BLOCK" value="vault"/> 48 | <vault-option name="ATTRIBUTE" value="my_password"/> 49 | </vault> 50 | </security> 51 | 52 | <!-- Other subsystems like transactions, deployments, security, etc. --> 53 | 54 | </server> 55 | -------------------------------------------------------------------------------- /Scripts/SampleConfigs/startup-config: -------------------------------------------------------------------------------- 1 | ! 2 | ! Cisco IOS Software, C3560 Software (C3560-IPBASEK9-M), Version 15.0(2)SE11 3 | ! Compiled Mon 28-Mar-21 08:55 by prod_rel_team 4 | ! 5 | version 15.0 6 | service timestamps debug datetime msec 7 | service timestamps log datetime msec 8 | no service password-recovery 9 | service password-encryption 10 | ! 11 | hostname Router1 12 | ! 13 | enable secret 5 $1$DkGh$XSdDk6LdoqM0eO67V0lJ71 14 | enable password mycleartextpassword 15 | ! 16 | no aaa new-model 17 | ! 18 | ! 19 | username admin privilege 15 password 0 cleartext123 20 | username cisco privilege 15 password 7 12140A05171F15142F7C343F 21 | username secureadmin secret 5 $1$lpb1$kGc1R/tGbT6aYZEXw5lqa0 22 | ! 23 | ip ssh version 2 24 | ip domain-name example.com 25 | ! 26 | interface GigabitEthernet0/0 27 | description Uplink to ISP 28 | ip address 192.168.1.1 255.255.255.0 29 | duplex auto 30 | speed auto 31 | ! 32 | interface GigabitEthernet0/1 33 | description Internal LAN 34 | ip address 192.168.2.1 255.255.255.0 35 | duplex auto 36 | speed auto 37 | ! 38 | ip route 0.0.0.0 0.0.0.0 192.168.1.254 39 | ! 40 | snmp-server community public RO 41 | snmp-server community private RW 42 | ! 43 | line con 0 44 | exec-timeout 0 0 45 | password consolepassword123 46 | logging synchronous 47 | login 48 | ! 49 | line vty 0 4 50 | password 7 02050D4808091B385C4B5E1A09121319 51 | logging synchronous 52 | login 53 | transport input ssh 54 | ! 55 | interface Vlan1 56 | ip address 192.168.3.1 255.255.255.0 57 | no shutdown 58 | ! 59 | dot11 ssid MySSID 60 | authentication open 61 | authentication key-management wpa 62 | wpa-psk ascii 0 cleartextkeywifipassword 63 | ! 64 | banner motd ^C 65 | *********************************************** 66 | Unauthorized access is prohibited! 67 | *********************************************** 68 | ^C 69 | ! 70 | end 71 | -------------------------------------------------------------------------------- /Scripts/SampleConfigs/sysprep.inf: -------------------------------------------------------------------------------- 1 | [Unattended] 2 | OemSkipEula=Yes 3 | InstallFilesPath=C:\sysprep\i386 4 | 5 | [GuiUnattended] 6 | AdminPassword=YourAdminPassword 7 | EncryptedAdminPassword=NO 8 | OEMSkipRegional=1 9 | TimeZone=004 10 | OemSkipWelcome=1 11 | 12 | [UserData] 13 | ProductKey=XXXXX-XXXXX-XXXXX-XXXXX-XXXXX 14 | FullName="Your Name" 15 | OrgName="Your Organization" 16 | ComputerName=* 17 | 18 | [Display] 19 | BitsPerPel=32 20 | Xresolution=1024 21 | YResolution=768 22 | Vrefresh=60 23 | 24 | [SetupMgr] 25 | DistFolder=C:\sysprep\i386 26 | DistShare=windist 27 | 28 | [Identification] 29 | JoinDomain=YourDomain 30 | DomainAdmin=YourDomainAdmin 31 | DomainAdminPassword=YourDomainAdminPassword 32 | 33 | [Networking] 34 | InstallDefaultComponents=Yes 35 | -------------------------------------------------------------------------------- /Scripts/SampleConfigs/tnsnames.ora: -------------------------------------------------------------------------------- 1 | MYDB = 2 | (DESCRIPTION = 3 | (ADDRESS = (PROTOCOL = TCP)(HOST = mydbserver.example.com)(PORT = 1521)) 4 | (CONNECT_DATA = 5 | (SERVICE_NAME = mydbservice) 6 | ) 7 | ) 8 | (USER = myusername) 9 | (PASSWORD = mypassword) 10 | 11 | MYDB_ALIAS = 12 | (DESCRIPTION = 13 | (ADDRESS_LIST = 14 | (ADDRESS = (PROTOCOL = TCP)(HOST = mydbserver.example.com)(PORT = 1521)) 15 | ) 16 | (CONNECT_DATA = 17 | (SERVICE_NAME = mydbservice) 18 | ) 19 | ) 20 | (USER = anotheruser) 21 | (PASSWORD = anotherpassword) 22 | -------------------------------------------------------------------------------- /Scripts/SampleConfigs/tomcat-users.xml: -------------------------------------------------------------------------------- 1 | <?xml version='1.0' encoding='utf-8'?> 2 | <!-- 3 | Licensed to the Apache Software Foundation (ASF) under one or more 4 | contributor license agreements. See the NOTICE file distributed with 5 | this work for additional information regarding copyright ownership. 6 | The ASF licenses this file to You under the Apache License, Version 2.0 7 | (the "License"); you may not use this file except in compliance with 8 | the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | --> 18 | <tomcat-users> 19 | <!-- 20 | NOTE: By default, no user is included in the "manager-gui" role required 21 | to operate the "/manager/html" web application. If you wish to use this app, 22 | you must define such a user - the username and password are arbitrary. 23 | --> 24 | <!-- 25 | NOTE: The sample user and role entries below are wrapped in a comment 26 | and thus are ignored when reading this file. Do not forget to remove 27 | <!.. ..> that surrounds them. 28 | --> 29 | <role rolename="admin-gui"/> 30 | <role rolename="admin-script"/> 31 | <role rolename="manager-gui"/> 32 | <role rolename="manager-status"/> 33 | <role rolename="manager-script"/> 34 | <role rolename="manager-jmx"/> 35 | <user name="admin" password="admin" roles="admin-gui,admin-script,manager-gui,manager-status,manager-script,manager-jmx"/> 36 | </tomcat-users> -------------------------------------------------------------------------------- /Scripts/SampleConfigs/unattend-base64.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <unattend xmlns="urn:schemas-microsoft-com:unattend"> 3 | <settings pass="specialize"> 4 | <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"> 5 | <ComputerName>*</ComputerName> 6 | <RegisteredOrganization>acme corp.</RegisteredOrganization> 7 | <RegisteredOwner>acme corp.</RegisteredOwner> 8 | <WindowsFeatures> 9 | <ShowInternetExplorer>false</ShowInternetExplorer> 10 | </WindowsFeatures> 11 | <AutoLogon> 12 | <Username>LocalAdmin</Username> 13 | <Enabled>true</Enabled> 14 | <LogonCount>10</LogonCount> 15 | <Password> 16 | <Value>UEBzc3dvcmQxMjMh</Value> <!-- This is Base64 for 'P@ssword123!' --> 17 | <PlainText>false</PlainText> 18 | </Password> 19 | </AutoLogon> 20 | </component> 21 | </settings> 22 | 23 | <settings pass="oobeSystem"> 24 | <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"> 25 | <UserAccounts> 26 | <LocalAccounts> 27 | <LocalAccount wcm:action="add"> 28 | <Password> 29 | <Value>UEBzc3dvcmQxMjMh</Value> <!-- This is Base64 for 'P@ssword123!' --> 30 | <PlainText>false</PlainText> 31 | </Password> 32 | <Group>Administrators</Group> 33 | <Description>Provisioning Admin</Description> 34 | <DisplayName>LocalAdmin</DisplayName> 35 | <Name>LocalAdmin</Name> 36 | </LocalAccount> 37 | </LocalAccounts> 38 | </UserAccounts> 39 | <OOBE> 40 | <HideEULAPage>true</HideEULAPage> 41 | <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen> 42 | <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> 43 | <HideOnlineAccountScreens>true</HideOnlineAccountScreens> 44 | <HideLocalAccountScreen>true</HideLocalAccountScreen> 45 | <ProtectYourPC>1</ProtectYourPC> 46 | </OOBE> 47 | </component> 48 | </settings> 49 | </unattend> 50 | -------------------------------------------------------------------------------- /Scripts/SampleConfigs/unattend-cleartext.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <!--Version 2.3--> 3 | <unattend xmlns="urn:schemas-microsoft-com:unattend"> 4 | <settings pass="windowsPE"> 5 | <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 6 | <SetupUILanguage> 7 | <UILanguage>en-US</UILanguage> 8 | </SetupUILanguage> 9 | <InputLocale>en-US</InputLocale> 10 | <SystemLocale>en-US</SystemLocale> 11 | <UILanguage>en-US</UILanguage> 12 | <UserLocale>en-US</UserLocale> 13 | </component> 14 | </settings> 15 | <settings pass="specialize"> 16 | <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 17 | <ComputerName>*</ComputerName> 18 | <RegisteredOrganization>Cool Company, LLC.</RegisteredOrganization> 19 | <RegisteredOwner>Cool Company, LLC.</RegisteredOwner> 20 | <WindowsFeatures> 21 | <ShowInternetExplorer>false</ShowInternetExplorer> 22 | </WindowsFeatures> 23 | <AutoLogon> 24 | <Username>LocalAdmin</Username> 25 | <Enabled>true</Enabled> 26 | <LogonCount>10</LogonCount> 27 | <Password> 28 | <Value>P@ssword</Value> 29 | </Password> 30 | </AutoLogon> 31 | </component> 32 | <component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 33 | <RunSynchronous> 34 | <RunSynchronousCommand wcm:action="add"> 35 | <Description>UnfilterAdminToken</Description> 36 | <Path>cmd /c reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v FilterAdministratorToken /t REG_DWORD /d 0 /f</Path> 37 | <Order>1</Order> 38 | </RunSynchronousCommand> 39 | <RunSynchronousCommand wcm:action="add"> 40 | <Description>Disable consumer features</Description> 41 | <Path>reg add HKLM\Software\Policies\Microsoft\Windows\CloudContent /v DisableWindowsConsumerFeatures /t REG_DWORD /d 1 /f</Path> 42 | <Order>2</Order> 43 | </RunSynchronousCommand> 44 | <RunSynchronousCommand wcm:action="add"> 45 | <Description>DISABLE_UAC_EnableLUA</Description> 46 | <Path>cmd /c reg ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f</Path> 47 | <Order>3</Order> 48 | </RunSynchronousCommand> 49 | <RunSynchronousCommand wcm:action="add"> 50 | <Path>Dism /online /enable-feature /featurename:NetFX3 /All /Source:C:\Temp\sxs /LimitAccess</Path> 51 | <Order>4</Order> 52 | <Description>DISM .net</Description> 53 | </RunSynchronousCommand> 54 | </RunSynchronous> 55 | </component> 56 | </settings> 57 | <settings pass="oobeSystem"> 58 | <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 59 | <InputLocale>en-US</InputLocale> 60 | <SystemLocale>en-US</SystemLocale> 61 | <UILanguage>en-US</UILanguage> 62 | <UserLocale>en-US</UserLocale> 63 | <UILanguageFallback>en-US</UILanguageFallback> 64 | </component> 65 | <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 66 | <OOBE> 67 | <HideEULAPage>true</HideEULAPage> 68 | <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen> 69 | <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> 70 | <HideOnlineAccountScreens>true</HideOnlineAccountScreens> 71 | <HideLocalAccountScreen>true</HideLocalAccountScreen> 72 | <ProtectYourPC>1</ProtectYourPC> 73 | </OOBE> 74 | <UserAccounts> 75 | <LocalAccounts> 76 | <LocalAccount wcm:action="add"> 77 | <Password> 78 | <Value>P@ssword</Value> 79 | <PlainText>true</PlainText> 80 | </Password> 81 | <Group>Administrators</Group> 82 | <Description>Provisioning Admin</Description> 83 | <DisplayName>LocalAdmin</DisplayName> 84 | <Name>LocalAdmin</Name> 85 | </LocalAccount> 86 | </LocalAccounts> 87 | </UserAccounts> 88 | <DesktopOptimization> 89 | <ShowWindowsStoreAppsOnTaskbar>false</ShowWindowsStoreAppsOnTaskbar> 90 | <GoToDesktopOnSignIn>false</GoToDesktopOnSignIn> 91 | </DesktopOptimization> 92 | <FirstLogonCommands> 93 | <SynchronousCommand wcm:action="add"> 94 | <CommandLine>cmd /c net start BESClient</CommandLine> 95 | <Description>Start BigFix Service</Description> 96 | <Order>1</Order> 97 | </SynchronousCommand> 98 | <SynchronousCommand wcm:action="add"> 99 | <CommandLine>cmd /c del C:\Windows\System32\Sysprep\unattend.xml</CommandLine> 100 | <Description>Delete Unattend</Description> 101 | <Order>2</Order> 102 | </SynchronousCommand> 103 | </FirstLogonCommands> 104 | </component> 105 | </settings> 106 | <cpi:offlineImage cpi:source="wim:c:/provisioning/w102k/sources/install.wim#Windows 10 Enterprise" xmlns:cpi="urn:schemas-microsoft-com:cpi" /> 107 | </unattend> -------------------------------------------------------------------------------- /Scripts/SampleConfigs/vnc.ini: -------------------------------------------------------------------------------- 1 | [Server] 2 | # The port on which the VNC server listens for connections (default: 5900) 3 | Port=5900 4 | 5 | # Defines the IP address to bind the VNC server to. Leave blank to bind to all interfaces. 6 | BindTo=0.0.0.0 7 | 8 | # Enable or disable authentication. If 1, authentication is enabled. 9 | Authentication=1 10 | 11 | # VNC password (encoded or plain text depending on the software) 12 | Password=01d47b4186dfa5a3 13 | 14 | # Encryption (optional). Enable or disable encryption for VNC connections. 15 | Encryption=1 16 | 17 | # Set the idle timeout for client connections (in seconds) 18 | IdleTimeout=600 19 | 20 | # Maximum number of clients that can connect at once 21 | MaxClients=5 22 | 23 | [Security] 24 | # Use SSL encryption for communication between VNC clients and server 25 | UseSSL=0 26 | 27 | # If SSL is enabled, provide the path to the SSL certificate file. 28 | SSLCertificateFile=C:\path\to\ssl\certificate.pem 29 | 30 | # Enable or disable TLS encryption 31 | UseTLS=1 32 | 33 | [Logging] 34 | # Enable or disable logging. If 1, logging is enabled. 35 | EnableLogging=1 36 | 37 | # Log file location 38 | LogFile=C:\path\to\log\vncserver.log 39 | 40 | # Log level (INFO, DEBUG, ERROR, etc.) 41 | LogLevel=INFO -------------------------------------------------------------------------------- /Scripts/SampleConfigs/web.config: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <configuration> 3 | <!-- Config Sections for Custom Service Credentials --> 4 | <configSections> 5 | <section name="serviceCredentials" type="System.Configuration.NameValueSectionHandler" /> 6 | <sectionGroup name="system.net"> 7 | <section name="settings" type="System.Net.Configuration.SettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> 8 | </sectionGroup> 9 | </configSections> 10 | 11 | <!-- Application Settings for web application --> 12 | <appSettings> 13 | <add key="ApplicationUsername" value="myAppUser" /> 14 | <add key="ApplicationPassword" value="myAppPassword" /> 15 | <add key="OAuthServiceUrl" value="https://oauth.example.com/token" /> 16 | <add key="ClientId" value="myClientId" /> 17 | <add key="ClientSecret" value="myClientSecret" /> 18 | <add key="ServiceUrl" value="https://service.example.com/api" /> 19 | <add key="ServiceUserName" value="serviceUser" /> 20 | <add key="ServicePassword" value="servicePassword" /> 21 | <add key="ApiEndpoint" value="https://api.example.com/endpoint" /> 22 | <add key="ApiUserName" value="apiUser" /> 23 | <add key="ApiPassword" value="apiPassword" /> 24 | </appSettings> 25 | 26 | <!-- Custom service credentials --> 27 | <serviceCredentials> 28 | <add key="ServiceUrl" value="https://customservice.example.com" /> 29 | <add key="UserName" value="customUser" /> 30 | <add key="Password" value="customPassword" /> 31 | </serviceCredentials> 32 | 33 | <!-- Connection strings for various databases --> 34 | <connectionStrings> 35 | <add name="SqlServerConnection" 36 | connectionString="Data Source=localhost;Initial Catalog=myDB;User ID=myUser;Password=myPass;" 37 | providerName="System.Data.SqlClient" /> 38 | <add name="SqlServerIntegratedSecurity" 39 | connectionString="Data Source=localhost;Initial Catalog=myDB;Integrated Security=True;" 40 | providerName="System.Data.SqlClient" /> 41 | <add name="MySqlConnection" 42 | connectionString="Server=localhost;Database=myDB;User=myUser;Password=myPass;" 43 | providerName="MySql.Data.MySqlClient" /> 44 | <add name="PostgreSqlConnection" 45 | connectionString="Host=localhost;Port=5432;Database=myDB;Username=myUser;Password=myPass;" 46 | providerName="Npgsql" /> 47 | <add name="OracleConnection" 48 | connectionString="Data Source=MyOracleDB;User Id=oracleUser;Password=oraclePass;" 49 | providerName="Oracle.ManagedDataAccess.Client" /> 50 | </connectionStrings> 51 | 52 | <!-- Web-specific settings for forms authentication, session state, and errors --> 53 | <system.web> 54 | <!-- Compilation settings --> 55 | <compilation debug="true" targetFramework="4.0" /> 56 | 57 | <!-- Authentication settings for web applications --> 58 | <authentication mode="Forms"> 59 | <forms loginUrl="login.aspx" timeout="30"> 60 | <credentials passwordFormat="Clear"> 61 | <user name="user1" password="password1" /> 62 | <user name="user2" password="password2" /> 63 | </credentials> 64 | </forms> 65 | </authentication> 66 | 67 | <!-- Authorization settings to allow or deny user access --> 68 | <authorization> 69 | <allow users="*" /> <!-- Allow all users --> 70 | <deny users="?" /> <!-- Deny anonymous users --> 71 | </authorization> 72 | 73 | <!-- Custom error pages --> 74 | <customErrors mode="RemoteOnly"> 75 | <error statusCode="404" redirect="404.aspx" /> 76 | <error statusCode="500" redirect="500.aspx" /> 77 | </customErrors> 78 | 79 | <!-- Session State settings (optional) --> 80 | <sessionState mode="InProc" timeout="20" /> 81 | </system.web> 82 | 83 | <!-- SMTP settings for email (relevant for web applications) --> 84 | <system.net> 85 | <mailSettings> 86 | <smtp from="you@example.com"> 87 | <network host="smtp.example.com" port="587" 88 | userName="smtpUser" 89 | password="smtpPassword" 90 | defaultCredentials="false" /> 91 | </smtp> 92 | </mailSettings> 93 | </system.net> 94 | 95 | <!-- WCF (Windows Communication Foundation) Service configuration for web applications --> 96 | <system.serviceModel> 97 | <bindings> 98 | <basicHttpBinding> 99 | <binding name="MyBinding"> 100 | <security mode="Transport"> 101 | <transport clientCredentialType="Basic" /> 102 | </security> 103 | </binding> 104 | </basicHttpBinding> 105 | </bindings> 106 | <client> 107 | <endpoint address="https://example.com/service" 108 | binding="basicHttpBinding" 109 | bindingConfiguration="MyBinding" 110 | contract="IMyService" /> 111 | </client> 112 | <behaviors> 113 | <endpointBehaviors> 114 | <behavior> 115 | <clientCredentials> 116 | <userName userName="serviceUser" password="servicePassword" /> 117 | </clientCredentials> 118 | </behavior> 119 | </endpointBehaviors> 120 | </behaviors> 121 | </system.serviceModel> 122 | 123 | <!-- IIS-specific settings for URL rewriting and other web server configurations --> 124 | <system.webServer> 125 | <!-- Enable URL rewriting (optional) --> 126 | <rewrite> 127 | <rules> 128 | <rule name="RedirectToHTTPS"> 129 | <match url="(.*)" /> 130 | <conditions> 131 | <add input="{HTTPS}" pattern="^OFF$" /> 132 | </conditions> 133 | <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" /> 134 | </rule> 135 | </rules> 136 | </rewrite> 137 | 138 | <!-- Enable static content compression (optional) --> 139 | <staticContent> 140 | <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="7.00:00:00" /> 141 | </staticContent> 142 | 143 | <!-- HTTP modules and handlers (optional) --> 144 | <modules runAllManagedModulesForAllRequests="true" /> 145 | </system.webServer> 146 | 147 | </configuration> 148 | -------------------------------------------------------------------------------- /Scripts/SampleConfigs/wp-config.php: -------------------------------------------------------------------------------- 1 | <?php 2 | // ** MySQL settings - You can get this info from your web host ** // 3 | /** The name of the database for WordPress */ 4 | define( 'DB_NAME', 'your_database_name' ); 5 | 6 | /** MySQL database username */ 7 | define( 'DB_USER', 'your_database_username' ); 8 | 9 | /** MySQL database password */ 10 | define( 'DB_PASSWORD', 'your_secure_password_here' ); 11 | 12 | /** MySQL hostname */ 13 | define( 'DB_HOST', 'localhost' ); 14 | 15 | /** Database Charset to use in creating database tables. */ 16 | define( 'DB_CHARSET', 'utf8' ); 17 | 18 | /** The Database Collate type. Don't change this if in doubt. */ 19 | define( 'DB_COLLATE', '' ); 20 | 21 | /**#@+ 22 | * Authentication Unique Keys and Salts. 23 | * 24 | * Change these to different unique phrases! 25 | * You can generate these using the WordPress.org secret-key service 26 | * https://api.wordpress.org/secret-key/1.1/salt/ 27 | * You can change these at any point in time to invalidate all existing cookies. 28 | * This will force all users to have to log in again. 29 | */ 30 | define('AUTH_KEY', 'put_your_unique_phrase_here'); 31 | define('SECURE_AUTH_KEY', 'put_your_unique_phrase_here'); 32 | define('LOGGED_IN_KEY', 'put_your_unique_phrase_here'); 33 | define('NONCE_KEY', 'put_your_unique_phrase_here'); 34 | define('AUTH_SALT', 'put_your_unique_phrase_here'); 35 | define('SECURE_AUTH_SALT', 'put_your_unique_phrase_here'); 36 | define('LOGGED_IN_SALT', 'put_your_unique_phrase_here'); 37 | define('NONCE_SALT', 'put_your_unique_phrase_here'); 38 | 39 | /**#@-*/ 40 | 41 | /** 42 | * WordPress Database Table prefix. 43 | * 44 | * You can have multiple installations in one database if you give each a unique 45 | * prefix. Only numbers, letters, and underscores please! 46 | */ 47 | $table_prefix = 'wp_'; 48 | 49 | /** 50 | * For developers: WordPress debugging mode. 51 | * 52 | * Change this to true to enable the display of notices during development. 53 | * It is strongly recommended that plugin and theme developers use WP_DEBUG 54 | * in their development environments. 55 | */ 56 | define( 'WP_DEBUG', false ); 57 | 58 | /* That's all, stop editing! Happy publishing. */ 59 | 60 | /** Absolute path to the WordPress directory. */ 61 | if ( ! defined( 'ABSPATH' ) ) { 62 | define( 'ABSPATH', __DIR__ . '/' ); 63 | } 64 | 65 | /** Sets up WordPress vars and included files. */ 66 | require_once ABSPATH . 'wp-settings.php'; 67 | -------------------------------------------------------------------------------- /interesting-files-template.csv: -------------------------------------------------------------------------------- 1 | "Keyword","Description","Instructions","Category","SampleRegex" 2 | "*credit*","Credit card number and/or PII.","None.","Sensitive","" 3 | "*pci*","","None.","Sensitive","" 4 | "*social*","","None.","Sensitive","" 5 | "*ssn*","","None.","Sensitive","" 6 | "human*","","None.","Sensitive","" 7 | "finance*","","None.","Sensitive","" 8 | "Health*","","None.","Sensitive","" 9 | "Billing*","","None.","Sensitive","" 10 | "patient*","","None.","Sensitive","" 11 | "HR*","","None.","Sensitive","" 12 | "*ftp*","","None.","Sensitive","" 13 | "*Program Files*","","None.","Sensitive","" 14 | "context.xml*","","None.","Secret","" 15 | "db2cli.ini*","","None.","Secret","" 16 | "ftpd.*","","None.","Secret","" 17 | "ftpusers*","","None.","Secret","" 18 | "httpd.conf*","","None.","Secret","" 19 | "hudson.security.HudsonPrivateSecurityRealm.*","","None.","Secret","" 20 | "jboss-cli.xml*","","None.","Secret","" 21 | "jboss-logmanager.properties*","","None.","Secret","" 22 | "jenkins.model.JenkinsLocationConfiguration.*","","None.","Secret","" 23 | "machine.config*","","None.","Secret","" 24 | "my.*","","None.","Secret","" 25 | "mysql.user*","","None.","Secret","" 26 | "nginx.conf*","","None.","Secret","" 27 | "*ntds.dit*","","None.","Secret","" 28 | "pg_hba.conf*","","None.","Secret","" 29 | "php.ini*","","None.","Secret","" 30 | "putty.reg*","","None.","Secret","" 31 | "postgresql.conf*","","None.","Secret","" 32 | "SAM","","None.","Secret","" 33 | "SAM-*","","None.","Secret","" 34 | "SAM_*","","None.","Secret","" 35 | "SYSTEM","","None.","Secret","" 36 | "server.xml*","","None.","Secret","" 37 | "shadow*","","None.","Secret","" 38 | "standalone.xml*","","None.","Secret","" 39 | "tnsnames.ora*","","None.","Secret","" 40 | "tomcat-users.xml*","","None.","Secret","" 41 | "sitemanager.xml*","","None.","Secret","" 42 | "users.*","","None.","Secret","" 43 | "*.vmx*","","None.","Secret","" 44 | "*.vmdk*","","None.","Secret","" 45 | "*.nvram*","","None.","Secret","" 46 | "*.vmsd*","","None.","Secret","" 47 | "*.vmsn*","","None.","Secret","" 48 | "*.vmss*","","None.","Secret","" 49 | "*.vmem*","","None.","Secret","" 50 | "*.vhd*","","None.","Secret","" 51 | "*.vhdx*","","None.","Secret","" 52 | "*.avhd*","","None.","Secret","" 53 | "*.avhdx*","","None.","Secret","" 54 | "*.vsv*","","None.","Secret","" 55 | "*.vbox*","","None.","Secret","" 56 | "*.vbox-prev*","","None.","Secret","" 57 | "*.vdi*","","None.","Secret","" 58 | "*.hdd*","","None.","Secret","" 59 | "*.sav*","","None.","Secret","" 60 | "*.pvm*","","None.","Secret","" 61 | "*.pvs*","","None.","Secret","" 62 | "*.qcow*","","None.","Secret","" 63 | "*.qcow2*","","None.","Secret","" 64 | "*.img*","","None.","Secret","" 65 | "*vcenter*","","None.","Secret","" 66 | "*vault*","","None.","Secret","" 67 | "*DefaultAppPool*","","None.","Secret","" 68 | "*WinSCP.ini*","","None.","Secret","" 69 | "*.kdbx","","None.","Secret","" 70 | "wp-config.php*","","None.","Secret","" 71 | "*.config","","None.","Secret","" 72 | "*database*","","None.","Database","" 73 | "*.sql*","","None.","Database","" 74 | "*.sqlite*","","None.","Database","" 75 | "*.idf*","","None.","Database","" 76 | "*.mdf*","","None.","Database","" 77 | "*.bak*","","None.","Backup","" 78 | "*.bkf*","","None.","Backup","" 79 | "*backup*","","None.","Backup","" 80 | "*.tar*","","None.","Backup","" 81 | "*.zip*","","None.","Backup","" 82 | "*.ps1*","","None.","Script","" 83 | "*.psm1*","","None.","Script","" 84 | "*.bat*","","None.","Script","" 85 | "*.sh*","","None.","Script","" 86 | "*.vbs*","","None.","Script","" 87 | "*.cmd*","","None.","Script","" 88 | "*.wsh*","","None.","Script","" 89 | "*.wsf*","","None.","Script","" 90 | "*.dll","","None.","Binaries","" 91 | "*.exe","","None.","Binaries","" 92 | "*.msi","","None.","Binaries","" 93 | -------------------------------------------------------------------------------- /summary-report.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NetSPI/PowerHuntShares/efa8fc259333915d1ede21d7f56757c5309ef0e9/summary-report.png --------------------------------------------------------------------------------