├── 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
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 | UEBzc3dvcmQxMjMh
121 | false
122 |
123 | Administrators
124 | Provisioning Admin
125 | LocalAdmin
126 | LocalAdmin
127 |
128 |
129 |
130 |
131 | true
132 | true
133 | true
134 | true
135 | true
136 | 1
137 |
138 |
139 |
140 |
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 |
--------------------------------------------------------------------------------
/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 |
2 |
3 |
7 |
10 |
11 |
12 |
13 |
14 |
15 |
18 |
21 |
22 |
23 |
24 |
25 |
26 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/Scripts/SampleConfigs/Drives.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
10 |
20 |
21 |
--------------------------------------------------------------------------------
/Scripts/SampleConfigs/Groups.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/Scripts/SampleConfigs/Printers.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
11 |
23 |
24 |
31 |
49 |
50 |
57 |
66 |
67 |
--------------------------------------------------------------------------------
/Scripts/SampleConfigs/Services.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
21 |
22 |
--------------------------------------------------------------------------------
/Scripts/SampleConfigs/SiteManager.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | ftp.example.com
6 | 21
7 | 0
8 | 0
9 | username
10 | SGVsbG9QYXNzd29yZA==
11 | 1
12 | 0
13 | MODE_DEFAULT
14 | 0
15 | Auto
16 | 0
17 | My FTP Site
18 | Sample FTP site for demonstration
19 |
20 |
21 | 0
22 | 0
23 |
24 |
25 |
26 | sftp.example.com
27 | 22
28 | 1
29 | 1
30 | sftpuser
31 | SGVsbG9QYXNzd29yZA==
32 | 1
33 | 0
34 | MODE_DEFAULT
35 | 1
36 | Auto
37 | 0
38 | My SFTP Site
39 | Sample SFTP site
40 |
41 |
42 | 0
43 | 0
44 |
45 |
46 |
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 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
38 |
41 |
44 |
47 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
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 |
2 |
3 | John Doe
4 |
5 |
6 |
7 | #jbcrypt:$2a$10$D6wVozrLhk.TIq.jBBKZluIh/EqzpjCUJFT/mWUnyAO4EYmxk5.aK
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Scripts/SampleConfigs/context.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
--------------------------------------------------------------------------------
/Scripts/SampleConfigs/dbvis.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | MyDatabaseConnection
5 | jdbc:mysql://localhost:3306/mydatabase
6 | db_user
7 | +mQwYxIFaEjZ/MWJDkm1SCWhHw7xPXWd
8 | com.mysql.jdbc.Driver
9 |
10 |
11 |
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 |
5 |
6 |
7 |
8 |
9 |
12 |
13 |
14 | Data Source=dbserver1;Initial Catalog=Database1;User ID=dbuser1;Password=dbpassword1;
15 |
16 | Primary Database Connection
17 | True
18 |
19 |
20 |
21 |
22 |
25 |
26 |
27 | Data Source=dbserver2;Initial Catalog=Database2;User ID=dbuser2;Password=dbpassword2;
28 |
29 | Secondary Database Connection
30 | True
31 |
32 |
33 |
34 |
35 |
38 |
39 | ftpserver.com
40 | ftpuser
41 | ftppassword
42 | 21
43 | 60
44 | True
45 |
46 |
47 |
48 |
49 |
52 |
53 | smtp.mailserver.com
54 | 25
55 | smtpuser
56 | smtppassword
57 | True
58 | SMTP Server Connection for Emails
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
70 |
71 | Package.ConnectionManagers[DB1]
72 | SELECT * FROM Table1;
73 |
74 |
75 |
76 |
77 |
80 |
81 | Package.ConnectionManagers[FTPConnection]
82 | /data/
83 | C:\data\
84 | Receive
85 |
86 |
87 |
88 |
89 |
92 |
93 | Package.ConnectionManagers[SMTPConnection]
94 | noreply@mailserver.com
95 | user@example.com
96 | SSIS Task Notification
97 | Task has been completed successfully.
98 |
99 |
100 |
101 |
102 |
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 |
2 |
3 |
4 | 127.0.0.1
5 | 9990
6 |
7 |
8 |
9 |
10 | admin
11 | password
12 |
13 |
14 |
15 |
16 | false
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 | true
32 | 500
33 |
34 |
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 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
55 |
56 |
57 |
60 |
61 |
62 |
65 |
66 |
67 |
70 |
71 |
72 |
75 |
76 |
77 |
80 |
81 |
82 |
85 |
86 |
87 |
90 |
91 |
92 |
95 |
96 |
97 |
100 |
101 |
102 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
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 |
13 |
14 |
15 |
16 |
17 | componenttest-1.0
18 | restConnector-2.0
19 | jdbc-4.2
20 | mpOpenApi-1.0
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 | adminuser
34 |
35 |
36 | reader
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
94 | SET CURRENT SCHEMA = APP
95 | SET CURRENT SQLID = APP
96 |
97 |
98 |
99 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
--------------------------------------------------------------------------------
/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 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | jdbc:mysql://localhost:3306/mydatabase
13 | mysql
14 |
15 | ${VAULT::vault::mydbuser}
16 | ${VAULT::vault::mydbpassword}
17 |
18 |
19 | 5
20 | 20
21 |
22 |
23 |
24 | true
25 | true
26 |
27 |
28 | 5000
29 |
30 |
31 | false
32 |
33 |
34 |
35 |
36 |
37 | com.mysql.jdbc.jdbc2.optional.MysqlXADataSource
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
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 |
2 |
18 |
19 |
24 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/Scripts/SampleConfigs/unattend-base64.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | *
6 | acme corp.
7 | acme corp.
8 |
9 | false
10 |
11 |
12 | LocalAdmin
13 | true
14 | 10
15 |
16 | UEBzc3dvcmQxMjMh
17 | false
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | UEBzc3dvcmQxMjMh
30 | false
31 |
32 | Administrators
33 | Provisioning Admin
34 | LocalAdmin
35 | LocalAdmin
36 |
37 |
38 |
39 |
40 | true
41 | true
42 | true
43 | true
44 | true
45 | 1
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/Scripts/SampleConfigs/unattend-cleartext.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | en-US
8 |
9 | en-US
10 | en-US
11 | en-US
12 | en-US
13 |
14 |
15 |
16 |
17 | *
18 | Cool Company, LLC.
19 | Cool Company, LLC.
20 |
21 | false
22 |
23 |
24 | LocalAdmin
25 | true
26 | 10
27 |
28 | P@ssword
29 |
30 |
31 |
32 |
33 |
34 |
35 | UnfilterAdminToken
36 | cmd /c reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v FilterAdministratorToken /t REG_DWORD /d 0 /f
37 | 1
38 |
39 |
40 | Disable consumer features
41 | reg add HKLM\Software\Policies\Microsoft\Windows\CloudContent /v DisableWindowsConsumerFeatures /t REG_DWORD /d 1 /f
42 | 2
43 |
44 |
45 | DISABLE_UAC_EnableLUA
46 | cmd /c reg ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f
47 | 3
48 |
49 |
50 | Dism /online /enable-feature /featurename:NetFX3 /All /Source:C:\Temp\sxs /LimitAccess
51 | 4
52 | DISM .net
53 |
54 |
55 |
56 |
57 |
58 |
59 | en-US
60 | en-US
61 | en-US
62 | en-US
63 | en-US
64 |
65 |
66 |
67 | true
68 | true
69 | true
70 | true
71 | true
72 | 1
73 |
74 |
75 |
76 |
77 |
78 | P@ssword
79 | true
80 |
81 | Administrators
82 | Provisioning Admin
83 | LocalAdmin
84 | LocalAdmin
85 |
86 |
87 |
88 |
89 | false
90 | false
91 |
92 |
93 |
94 | cmd /c net start BESClient
95 | Start BigFix Service
96 | 1
97 |
98 |
99 | cmd /c del C:\Windows\System32\Sysprep\unattend.xml
100 | Delete Unattend
101 | 2
102 |
103 |
104 |
105 |
106 |
107 |
--------------------------------------------------------------------------------
/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 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
38 |
41 |
44 |
47 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
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 |
--------------------------------------------------------------------------------
/Scripts/SampleConfigs/wp-config.php:
--------------------------------------------------------------------------------
1 |