diff --git a/.github/workflows/CI-linpeas_dev.yml b/.github/workflows/CI-linpeas_build_test.yml similarity index 54% rename from .github/workflows/CI-linpeas_dev.yml rename to .github/workflows/CI-linpeas_build_test.yml index f4d4d98..cf7d518 100644 --- a/.github/workflows/CI-linpeas_dev.yml +++ b/.github/workflows/CI-linpeas_build_test.yml @@ -1,27 +1,21 @@ -# This is a basic workflow to help you get started with Actions +name: CI-linpeas_test -name: CI-linpeas_dev - -# Controls when the action will run. on: - # Triggers the workflow on push or pull request events but only for the master branch - push: - branches: + pull_request: + branches: - linpeas_dev + - master + paths: + - 'build_lists\sensitive_files.yaml' + - 'linpeas\**' - # Allows you to run this workflow manually from the Actions tab workflow_dispatch: -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on + Build_and_test_linpeas: runs-on: ubuntu-latest - # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 - name: Build linpeas @@ -30,9 +24,8 @@ jobs: cd linPEAS python3 -m builder.linpeas_builder - # Runs a single command using the runners shell - name: Run linpeas - run: linPEAS/linpeas.sh -h + run: linPEAS/linpeas.sh - name: Create local changes run: git add linPEAS/linpeas.sh @@ -53,5 +46,20 @@ jobs: - name: pull-request uses: repo-sync/pull-request@v2 with: - destination_branch: "linpeas_prod" + destination_branch: "master" github_token: ${{ secrets.PULL_REQUEST_TOKEN }} + + Build_and_test_macpeas: + runs-on: macos-latest + + steps: + - uses: actions/checkout@v2 + + - name: Build macpeas + run: | + python3 -m pip install PyYAML + cd linPEAS + python3 -m builder.linpeas_builder + + - name: Run macpeas + run: linPEAS/linpeas.sh -o SysI,Container,Devs,AvaSof,ProCronSrvcsTmrsSocks,Net,UsrI,SofI \ No newline at end of file diff --git a/.github/workflows/CI-linpeas_prod.yml b/.github/workflows/CI-linpeas_prod.yml deleted file mode 100644 index d203084..0000000 --- a/.github/workflows/CI-linpeas_prod.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: CI-linpeas_prod - -on: - pull_request: - branches: - - linpeas_prod - - workflow_dispatch: - -jobs: - Test_linpeas_macos: - runs-on: macos-latest - - steps: - - uses: actions/checkout@v2 - - - name: Run linpeas - run: linPEAS/linpeas.sh -o SysI,Container,Devs,AvaSof,ProCronSrvcsTmrsSocks,Net,UsrI,SofI - - Test_linpeas_ubuntu: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Run linpeas - run: linPEAS/linpeas.sh -a diff --git a/.github/workflows/CI-linpeas_prod_rebuild.yml b/.github/workflows/CI-linpeas_prod_rebuild.yml deleted file mode 100644 index 5228a2d..0000000 --- a/.github/workflows/CI-linpeas_prod_rebuild.yml +++ /dev/null @@ -1,52 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: CI-linpeas_prod_rebuild - -# Controls when the action will run. -on: - # Triggers the workflow on push or pull request events but only for the master branch - pull_request: - branches: - - master - paths: - - 'build_lists/sensitive_files.yaml' - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - - - name: Build linpeas - run: | - python3 -m pip install PyYAML - cd linPEAS - python3 -m builder.linpeas_builder - - # Runs a single command using the runners shell - - name: Run linpeas - run: linPEAS/linpeas.sh -h - - - name: Create local changes - run: git add linPEAS/linpeas.sh - - - name: Commit results to Github - run: | - git config --local user.email "" - git config --global user.name "CI-linpeas-ubuntu" - git commit -m "linpeas.sh auto update" -a --allow-empty - - - name: Push changes - uses: ad-m/github-push-action@master - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - branch: ${{ github.ref }} diff --git a/.github/workflows/CI-linpeas_master.yml b/.github/workflows/CI-winpeas_PR.yml similarity index 61% rename from .github/workflows/CI-linpeas_master.yml rename to .github/workflows/CI-winpeas_PR.yml index 143dc3c..4c29951 100644 --- a/.github/workflows/CI-linpeas_master.yml +++ b/.github/workflows/CI-winpeas_PR.yml @@ -1,13 +1,18 @@ -name: CI-linpeas_master +name: CI-winpeas_PR on: push: branches: - - linpeas_prod + - winpeas_dev + - linpeas_dev + - master + paths: + - 'build_lists\sensitive_files.yaml' + - 'winPEAS\winPEASexe\**' jobs: build: - runs-on: ubuntu-latest + runs-on: windows-latest steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/CI-winpeas_build_test.yml b/.github/workflows/CI-winpeas_build_test.yml new file mode 100644 index 0000000..012269f --- /dev/null +++ b/.github/workflows/CI-winpeas_build_test.yml @@ -0,0 +1,116 @@ +name: CI-winpeas_test + +on: + pull_request: + branches: + - winpeas_dev + paths: + - 'build_lists\sensitive_files.yaml' + - 'winPEAS\winPEASexe\**' + + workflow_dispatch: + +jobs: + + Build_and_test_winpeas: + runs-on: windows-latest + + # environment variables + env: + Solution_Path: 'winPEAS\winPEASexe\winPEAS.sln' + Configuration: 'Release' + DotFuscatorGeneratedPath: 'winPEAS\winPEASexe\binaries\Obfuscated Releases\Dotfuscated' + + steps: + # checkout + - name: Checkout + uses: actions/checkout@v2 + + # Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild + - name: Setup MSBuild.exe + uses: microsoft/setup-msbuild@v1.0.2 + + # Setup NuGet + - name: Setup NuGet.exe + uses: nuget/setup-nuget@v1 + + # Restore the packages for testing + - name: Restore the application + run: nuget restore $env:Solution_Path + + # build + - name: run MSBuild + run: msbuild $env:Solution_Path + + # Execute all unit tests in the solution + - name: Execute unit tests + run: dotnet test $env:Solution_Path + + # Build & update all versions + - name: Build all versions + run: | + echo "build x64" + msbuild -m $env:Solution_Path /t:Rebuild /p:Configuration=$env:Configuration /p:Platform="x64" + + echo "build x86" + msbuild -m $env:Solution_Path /t:Rebuild /p:Configuration=$env:Configuration /p:Platform="x86" + + echo "build Any CPU" + msbuild -m $env:Solution_Path /t:Rebuild /p:Configuration=$env:Configuration /p:Platform="Any CPU" + + # Copy the built versions + - name: Copy all versions + run: | + echo "copy x64" + cp winPEAS\winPEASexe\winPEAS\bin\x64\$env:Configuration\winPEAS.exe winPEAS\winPEASexe\binaries\x64\$env:Configuration\winPEASx64.exe + + echo "copy x86" + cp winPEAS\winPEASexe\winPEAS\bin\x86\$env:Configuration\winPEAS.exe winPEAS\winPEASexe\binaries\x86\$env:Configuration\winPEASx86.exe + + echo "copy Any" + cp winPEAS\winPEASexe\winPEAS\bin\$env:Configuration\winPEAS.exe winPEAS\winPEASexe\binaries\$env:Configuration\winPEASany.exe + + # build obfuscated versions + - name: Setup DotFuscator + run: | + 7z x winPEAS\winPEASexe\Dotfuscator\DotfuscatorCE.zip + whoami + mkdir -p $env:USERPROFILE\AppData\Local\"PreEmptive Solutions"\"Dotfuscator Community Edition"\6.0 -erroraction 'silentlycontinue' + cp DotfuscatorCE\license\* $env:USERPROFILE\AppData\Local\"PreEmptive Solutions"\"Dotfuscator Community Edition"\6.0\ + + # build obfuscated versions + - name: Build obfuscated versions + run: | + DotfuscatorCE\dotfuscator.exe "winPEAS\winPEASexe\binaries\Obfuscated Releases\x64.xml" + DotfuscatorCE\dotfuscator.exe "winPEAS\winPEASexe\binaries\Obfuscated Releases\x86.xml" + DotfuscatorCE\dotfuscator.exe "winPEAS\winPEASexe\binaries\Obfuscated Releases\any.xml" + + + # copy the files + - name: Copy Dotfuscator generated files + run: | + cp $env:DotFuscatorGeneratedPath\x64\winPEASx64.exe "winPEAS\winPEASexe\binaries\Obfuscated Releases\winPEASx64.exe" + cp $env:DotFuscatorGeneratedPath\x86\winPEASx86.exe "winPEAS\winPEASexe\binaries\Obfuscated Releases\winPEASx86.exe" + cp $env:DotFuscatorGeneratedPath\any\winPEASany.exe "winPEAS\winPEASexe\binaries\Obfuscated Releases\winPEASany.exe" + + # Git add + - name: Create local changes + run: | + git add winPEAS\winPEASexe\binaries\Release\* + git add winPEAS\winPEASexe\binaries\x64\* + git add winPEAS\winPEASexe\binaries\x86\* + git add "winPEAS\winPEASexe\binaries\Obfuscated Releases\*.exe" + + # Git commit + - name: Commit results to Github + run: | + git config --local user.email "ci@winpeas.com" + git config --global user.name "CI-winpeas" + git commit -m "winpeas binaries auto update" -a --allow-empty + + # Git push + - name: Push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: master diff --git a/build_lists/sensitive_files.yaml b/build_lists/sensitive_files.yaml index 4115fdc..456ee95 100644 --- a/build_lists/sensitive_files.yaml +++ b/build_lists/sensitive_files.yaml @@ -77,7 +77,7 @@ int_hidden_files_markup: "peass{INT_HIDDEN_FILES}" defaults: - auto_check: False #The builder will generate a ceck for the file + auto_check: False #The builder will generate a check for the file bad_regex: "" #The regex used to color red and grep lines (if only_bad_lines and no line_grep) check_extra_path: "" #Check if the found files are in a specific path good_regex: "" #The regex to color green @@ -93,2004 +93,2218 @@ defaults: exec: [] +variables_markup: "peass{VARIABLES}" + +variables: + - name: pwd_inside_history + value: "7z|unzip|useradd|linenum|linpeas|mkpasswd|htpasswd|openssl|PASSW|passw|shadow|root|sudo|^su|pkexec|^ftp|mongo|psql|mysql|rdesktop|xfreerdp|^ssh|steghide|@" + #Files & folders to search search: - Systemd: - config: - auto_check: False - - files: - ? "*.service" - : - type: f - search_in: - - all + - name: Systemd + value: + disable: + - winpeas - Timer: - config: - auto_check: False - - files: - ? "*.timer" - : - type: f - search_in: - - all - - Socket: - config: - auto_check: False + config: + auto_check: False - files: - ? "*.socket" - : - type: f - search_in: - - all - - DBus: - config: - auto_check: False - - files: - ? "system.d" - : - type: d - search_in: - - /etc - - MySQL: - config: - auto_check: False - - files: - mysql: - type: d - check_extra_path: "^/etc/.*mysql|/usr/var/lib/.*mysql|/var/lib/.*mysql" - remove_path: "mysql/mysql" - search_in: - - common - - PostgreSQL: - config: - auto_check: True - exec: - - 'echo "Version: $(warn_exec psql -V 2>/dev/null)"' - - files: - ? "pgadmin*.db" - : - type: f - just_list_file: True - search_in: - - common - - ? "pg_hba.conf" - : - bad_regex: "auth|password|md5|user=|pass=|trust" - type: f - remove_empty_lines: True - remove_regex: '\W+\#|^#' - search_in: - - common - - ? "postgresql.conf" - : - bad_regex: "auth|password|md5|user=|pass=|trust" - type: f - remove_empty_lines: True - remove_regex: '\W+\#|^#' - search_in: - - common - - ? "pgsql.conf" - : - bad_regex: "auth|password|md5|user=|pass=|trust" - type: f - remove_empty_lines: True - remove_regex: '\W+\#|^#' - search_in: - - common - - Apache: - config: - auto_check: True - exec: - - 'echo "Version: $(warn_exec apache2 -v 2>/dev/null; warn_exec httpd -v 2>/dev/null)"' - - "print_3title 'PHP exec extensions'" - - 'grep -R -B1 "httpd-php" /etc/apache2 2>/dev/null' - - files: - ? "sites-enabled" - : - type: d files: - ? "*" - : - bad_regex: "AuthType|AuthName|AuthUserFile|ServerName|ServerAlias" - only_bad_lines: True - remove_empty_lines: True - remove_regex: '^#' - search_in: - - common - - ? "000-default.conf" - : - bad_regex: "AuthType|AuthName|AuthUserFile|ServerName|ServerAlias" - type: f - search_in: - - common - - PHPCookies: - config: - auto_check: True - exec: - - "ls /var/lib/php/sessions 2>/dev/null || echo_not_found /var/lib/php/sessions" - - files: - ? "sess_*" - : - check_extra_path: '/tmp/.*sess_.*|/var/tmp/.*sess_.*' - type: f - search_in: - - /tmp - - /var - - /mnt + - name: "*.service" + value: + type: f + search_in: + - all - PHP_files: - config: - auto_check: False + - name: Timer + value: + disable: + - winpeas + + config: + auto_check: False - files: - ? "*config*.php" - : - type: f - search_in: - - common - - ? "database.php" - : - type: f - search_in: - - common - - ? "db.php" - : - type: f - search_in: - - common - - ? "storage.php" - : - type: f - search_in: - - common - - ? "settings.php" - : - type: f - search_in: - - common - - Wordpress: - config: - auto_check: True - - files: - ? "wp-config.php" - : - bad_regex: "PASSWORD|USER|NAME|HOST" - only_bad_lines: True - type: f - search_in: - - common - - Drupal: - config: - auto_check: True - - files: - ? "settings.php" - : - bad_regex: "drupal_hash_salt|'database'|'username'|'password'|'host'|'port'|'driver'|'prefix'" - check_extra_path: "/default/settings.php" - only_bad_lines: True - type: f - search_in: - - common - - Moodle: - config: - auto_check: True - - files: - ? "config.php" - : - bad_regex: "dbtype|dbhost|dbuser|dbhost|dbpass|dbport" - check_extra_path: "moodle/config.php" - only_bad_lines: True - type: f - search_in: - - common - - Tomcat: - config: - auto_check: True - - files: - ? "tomcat-users.xml" - : - bad_regex: "dbtype|dbhost|dbuser|dbhost|dbpass|dbport" - line_grep: '"username=|password="' - only_bad_lines: True - type: f - search_in: - - common - - Mongo: - config: - auto_check: True - exec: - - 'echo "Version: $(warn_exec mongo --version 2>/dev/null; warn_exec mongod --version 2>/dev/null)"' - - files: - ? "mongod*.conf" - : - type: f - remove_empty_lines: True - remove_regex: '\W+\#|^#' - search_in: - - common - - Supervisord: - config: - auto_check: True - - files: - ? "supervisord.conf" - : - bad_regex: "port.*=|username.*=|password.*=" - only_bad_lines: True - type: f - search_in: - - common - - Cesi: - config: - auto_check: True - - files: - ? "cesi.conf" - : - bad_regex: "username.*=|password.*=|host.*=|port.*=|database.*=" - only_bad_lines: True - type: f - search_in: - - common - - Rsync: - config: - auto_check: True - - files: - ? "rsyncd.conf" - : - bad_regex: "secrets.*|auth.*users.*=" - type: f - remove_empty_lines: True - remove_regex: '\W+\#|^#' - search_in: - - common - - ? "rsyncd.secrets" - : - bad_regex: ".*" - type: f - search_in: - - common - - Hostapd: - config: - auto_check: True - - files: - ? "hostapd.conf" - : - bad_regex: "passphrase.*" - type: f - search_in: - - common - - Anaconda-ks: - config: - auto_check: True - - files: - ? "anaconda-ks.cfg" - : - bad_regex: "rootpw.*" - only_bad_lines: True - type: f - search_in: - - common - - VNC: - config: - auto_check: True - - files: - ? ".vnc" - : files: - ? "passwd" - : - just_list_file: True - type: d - search_in: - - common + - name: "*.timer" + value: + type: f + search_in: + - all + + - name: Socket + value: + disable: + - winpeas + + config: + auto_check: False - ? "*vnc*.c*nf*" - : - bad_regex: ".*" - type: f - search_in: - - common - - ? "*vnc*.ini" - : - just_list_file: True - type: f - search_in: - - common - - ? "*vnc*.txt" - : - bad_regex: ".*" - type: f - search_in: - - common - - ? "*vnc*.xml" - : - bad_regex: ".*" - type: f - search_in: - - common - - Ldap: - config: - auto_check: True - exec: - - echo "The password hash is from the {SSHA} to 'structural'" - - files: - ? "ldap" - : - files: - ? "*.bdb" - : - bad_regex: "administrator|password|ADMINISTRATOR|PASSWORD|Password|Administrator" - line_grep: '-i -a -o "description.*" | sort | uniq' - type: d - search_in: - - common - - Open_VPN: - config: - auto_check: True - - files: - ? "*.ovpn" - : - bad_regex: "auth-user-pass.+" - only_bad_lines: True - type: f - search_in: - - common + - name: "*.socket" + value: + type: f + search_in: + - all - SSH_FILES: - config: - auto_check: True - - files: - ? "id_dsa*" - : - type: f - search_in: - - common - - ? "id_rsa*" - : - type: f - search_in: - - common - - ? "known_hosts" - : - type: f - search_in: - - common - - ? "authorized_hosts" - : - type: f - search_in: - - common - - ? "authorized_keys" - : - good_regex: 'from=[\w\._\-]+' - type: f - search_in: - - common + - name: DBus + value: + disable: + - winpeas - CERTSB4: - config: - auto_check: False - - files: - ? "*.pem" - : - type: f - remove_path: '^/usr/share/|^/etc/ssl/|^/usr/local/lib/|^/usr/lib.*' - search_in: - - common - - ? "*.cer" - : - type: f - remove_path: '^/usr/share/|^/etc/ssl/|^/usr/local/lib/|^/usr/lib.*' - search_in: - - common - - ? "*.crt" - : - type: f - remove_path: '^/usr/share/|^/etc/ssl/|^/usr/local/lib/|^/usr/lib.*' - search_in: - - common - - CERTSBIN: - config: - auto_check: False - - files: - ? "*.csr" - : - type: f - remove_path: '^/usr/share/|^/etc/ssl/|^/usr/local/lib/|^/usr/lib/.*' - search_in: - - common - - ? "*.der" - : - type: f - remove_path: '^/usr/share/|^/etc/ssl/|^/usr/local/lib/|^/usr/lib/.*' - search_in: - - common - - CERTSCLIENT: - config: - auto_check: False - - files: - ? "*.pfx" - : - type: f - remove_path: '^/usr/share/|^/etc/ssl/|^/usr/local/lib/|^/usr/lib/.*' - search_in: - - common - - ? "*.p12" - : - type: f - remove_path: '^/usr/share/|^/etc/ssl/|^/usr/local/lib/|^/usr/lib/.*' - search_in: - - common - - SSH_AGENTS: - config: - auto_check: False - - files: - ? "agent*" - : - type: f - search_in: - - /tmp - - SSH_CONFIG: - config: - auto_check: False - - files: - ? "ssh*config" - : - type: f - search_in: - - /usr - - $HOMESEARCH - - Cloud_credentials: - config: - auto_check: True + config: + auto_check: False - files: - ? "credentials" - : - bad_regex: ".*" - type: f - search_in: - - common - - ? "credentials.db" - : - bad_regex: ".*" - type: f - search_in: - - common - - ? "legacy_credentials.db" - : - bad_regex: ".*" - type: f - search_in: - - common - - ? "access_tokens.db" - : - bad_regex: ".*" - type: f - search_in: - - common - - ? "access_tokens.json" - : - bad_regex: ".*" - type: f - search_in: - - common - - ? "accessTokens.json" - : - bad_regex: ".*" - type: f - search_in: - - common - - ? "azureProfile.json" - : - bad_regex: ".*" - type: f - search_in: - - common - - ? "TokenCache.dat" - : - bad_regex: ".*" - type: f - search_in: - - common - - ? "AzureRMContext.json" - : - bad_regex: ".*" - type: f - search_in: - - common - - ? ".bluemix" - : files: - ? "config.json" - : - bad_regex: ".*" - type: d - search_in: - - common - - Kerberos: - config: - auto_check: False - - files: - ? "krb5.conf" - : - type: f - search_in: - - common - - ? "krb5.keytab" - : - type: f - search_in: - - common - - ? ".k5login" - : - type: f - search_in: - - common - - ? "kadm5.acl" - : - type: f - search_in: - - common - - Kibana: - config: - auto_check: True - - files: - ? "kibana.y*ml" - : - bad_regex: "username|password|host|port|elasticsearch|ssl" - type: f - remove_empty_lines: True - remove_regex: '\W+\#|^#|^[[:space:]]*$' - search_in: - - common - - Knockd: - config: - auto_check: True + - name: "system.d" + value: + type: d + search_in: + - /etc - files: - ? "*knockd*" - : - check_extra_path: "/etc/init.d/" - type: f - search_in: - - /etc + - name: MySQL + value: + config: + auto_check: False - Logstash: - config: - auto_check: False - - files: - ? "logstash" - : - type: d - search_in: - - common - - Elasticsearch: - config: - auto_check: True - exec: - - echo "The version is $(curl -X GET '127.0.0.1:9200' 2>/dev/null | grep number | cut -d ':' -f 2)" - - files: - ? "elasticsearch.y*ml" - : - line_grep: '"path.data|path.logs|cluster.name|node.name|network.host|discovery.zen.ping.unicast.hosts"' - remove_regex: '\W+\#|^#' - type: f - search_in: - - common - - Vault_ssh_helper: - config: - auto_check: False - - files: - ? "vault-ssh-helper.hcl" - : - type: f - search_in: - - common - - Vault_ssh_token: - config: - auto_check: False - - files: - ? ".vault-token" - : - type: f - search_in: - - common - - CouchDB: - config: - auto_check: True - - files: - ? "couchdb" - : files: - ? "local.ini" - : - bad_regex: "admin.*|password.*|cert_file.*|key_file.*|hashed.*|pbkdf2.*" - remove_empty_lines: True - remove_regex: "^;" - type: d - search_in: - - common + - name: mysql + value: + type: d + check_extra_path: "^/etc/.*mysql|/usr/var/lib/.*mysql|/var/lib/.*mysql" + remove_path: "mysql/mysql" + search_in: + - common + + - name: "debian.cnf" + value: + bad_regex: "user.*|password.*" + type: f + only_bad_lines: True + search_in: + - common + + - Redis: - config: - auto_check: True + - name: PostgreSQL + value: + config: + auto_check: True + exec: + - 'echo "Version: $(warn_exec psql -V 2>/dev/null)"' - files: - ? "redis.conf" - : - bad_regex: "masterauth.*|requirepass.*" - type: f - remove_empty_lines: True - remove_regex: '\W+\#|^#' - search_in: - - common - - Mosquitto: - config: - auto_check: True - - files: - ? "mosquitto.conf" - : - bad_regex: "password_file.*|psk_file.*|allow_anonymous.*true|auth" - type: f - remove_empty_lines: True - remove_regex: '\W+\#|^#' - search_in: - - common - - Neo4j: - config: - auto_check: True - - files: - ? "neo4j" - : files: - ? "auth" - : - bad_regex: ".*" - remove_empty_lines: True - type: d - search_in: - - common - - Cloud-Init: - config: - auto_check: True - - files: - ? "cloud.cfg" - : - bad_regex: "consumer_key|token_key|token_secret|metadata_url|password:|passwd:|PRIVATE KEY|PRIVATE KEY|encrypted_data_bag_secret|_proxy" - only_bad_lines: True - type: f - remove_empty_lines: True - remove_regex: '\W+\#|^#' - search_in: - - common - - Erlang: - config: - auto_check: True + - name: "pgadmin*.db" + value: + type: f + just_list_file: True + search_in: + - common + + - name: "pg_hba.conf" + value: + bad_regex: "auth|password|md5|user=|pass=|trust" + type: f + remove_empty_lines: True + remove_regex: '\W+\#|^#' + search_in: + - common + + - name: "postgresql.conf" + value: + bad_regex: "auth|password|md5|user=|pass=|trust" + type: f + remove_empty_lines: True + remove_regex: '\W+\#|^#' + search_in: + - common + + - name: "pgsql.conf" + value: + bad_regex: "auth|password|md5|user=|pass=|trust" + type: f + remove_empty_lines: True + remove_regex: '\W+\#|^#' + search_in: + - common - files: - ? ".erlang.cookie" - : - bad_regex: ".*" - type: f - search_in: - - common - - GMV Auth: - config: - auto_check: True - - files: - ? "gvm-tools.conf" - : - bad_regex: "username.*|password.*" - type: f - search_in: - - common + - name: Apache + value: + config: + auto_check: True + exec: + - 'echo "Version: $(warn_exec apache2 -v 2>/dev/null; warn_exec httpd -v 2>/dev/null)"' + - "print_3title 'PHP exec extensions'" + - 'grep -R -B1 "httpd-php" /etc/apache2 2>/dev/null' - IPSec: - config: - auto_check: True - - files: - ? "ipsec.secrets" - : - bad_regex: ".*PSK.*|.*RSA.*|.*EAP =.*|.*XAUTH.*" - type: f - search_in: - - common - - ? "ipsec.conf" - : - bad_regex: ".*PSK.*|.*RSA.*|.*EAP =.*|.*XAUTH.*" - type: f - search_in: - - common - - IRSSI: - config: - auto_check: True - - files: - ? ".irssi" - : files: - ? "config" - : - bad_regex: "password.*" - type: d - search_in: - - common - - Keyring: - config: - auto_check: True + - name: "sites-enabled" + value: + type: d + files: + - name: "*" + value: + bad_regex: "AuthType|AuthName|AuthUserFile|ServerName|ServerAlias" + only_bad_lines: True + remove_empty_lines: True + remove_regex: '^#' + search_in: + - common + + - name: "000-default.conf" + value: + bad_regex: "AuthType|AuthName|AuthUserFile|ServerName|ServerAlias" + type: f + search_in: + - common - files: - ? "keyrings" - : - type: d - search_in: - - common - - ? "*.keyring" - : - just_list_file: True - type: f - search_in: - - common - - ? "*.keystore" - : - just_list_file: True - type: f - search_in: - - common - - ? "*.jks" - : - just_list_file: True - type: f - search_in: - - common - - Filezilla: - config: - auto_check: True + - name: PHP Sessions + value: + config: + auto_check: True + exec: + - "ls /var/lib/php/sessions 2>/dev/null || echo_not_found /var/lib/php/sessions" - files: - ? "filelliza" - : files: - ? "sitemanager.xml" - : - bad_regex: "Host.*|Port.*|Protocol.*|User.*|Pass.*" - remove_empty_lines: True - remove_regex: "^;" - type: d - search_in: - - common - - ? "filezilla.xml" - : - just_list_file: True - type: f - search_in: - - common - - Backup_Manager: - config: - auto_check: True - - files: - ? "storage.php" - : - - bad_regex: "password|pass|user|database|host" - line_grep: >- - "'pass'|'password'|'user'|'database'|'host'" - type: f - search_in: - - common - - ? "database.php" - : - bad_regex: "password|pass|user|database|host" - line_grep: >- - "'pass'|'password'|'user'|'database'|'host'" - only_bad_lines: True - type: f - search_in: - - common - - Splunk: - config: - auto_check: False - - files: - ? "passwd" - : - type: f - search_in: - - common + - name: "sess_*" + value: + check_extra_path: '/tmp/.*sess_.*|/var/tmp/.*sess_.*' + type: f + search_in: + - /tmp + - /var + - /mnt - GitLab: - config: - auto_check: False + - name: PHP_files + value: + config: + auto_check: False - files: - ? "secrets.yml" - : - type: f - remove_path: "/lib" - search_in: - - common - - ? "gitlab.yml" - : - type: f - remove_path: "/lib" - search_in: - - common - - ? "gitlab.rm" - : - type: f - remove_path: "/lib" - search_in: - - common - - PGP-GPG: - config: - auto_check: True - exec: - - '((command -v gpg && gpg --list-keys) || echo_not_found "gpg") 2>/dev/null' - - '((command -v netpgpkeys && netpgpkeys --list-keys) || echo_not_found "netpgpkeys") 2>/dev/null' - - '(command -v netpgp || echo_not_found "netpgp") 2>/dev/null' - - files: - ? "*.pgp" - : - type: f - search_in: - - common - - ? "*.gpg" - : - type: f - search_in: - - common - - ? "*.gnupg" - : - type: f - remove_path: "README.gnupg" - search_in: - - common - - Cache Vi: - config: - auto_check: True - - files: - ? "*.swp" - : - just_list_file: True - type: f - search_in: - - common - - ? "*.viminfo" - : - just_list_file: True - type: f - search_in: - - common - - Docker: - config: - auto_check: False - - files: - ? "docker.socket" - : - type: f - search_in: - - common - - ? "docker.sock" - : - type: f - search_in: - - common - - ? "Dockerfile" - : - type: f - search_in: - - common - - ? "docker-compose.yml" - : - type: f - search_in: - - common - - Firefox: - config: - auto_check: True - - files: - ? ".mozilla" - : files: - ? "places.sqlite" - : - just_list_file: True + - name: "*config*.php" + value: + type: f + search_in: + - common + + - name: "database.php" + value: + type: f + search_in: + - common + + - name: "db.php" + value: + type: f + search_in: + - common + + - name: "storage.php" + value: + type: f + search_in: + - common + + - name: "settings.php" + value: + type: f + search_in: + - common + + - name: Wordpress + value: + config: + auto_check: True + + files: + - name: "wp-config.php" + value: + bad_regex: "PASSWORD|USER|NAME|HOST" + only_bad_lines: True + type: f + search_in: + - common + + - name: Drupal + value: + config: + auto_check: True + + files: + - name: "settings.php" + value: + bad_regex: "drupal_hash_salt|'database'|'username'|'password'|'host'|'port'|'driver'|'prefix'" + check_extra_path: "/default/settings.php" + only_bad_lines: True + type: f + search_in: + - common + + - name: Moodle + value: + config: + auto_check: True + + files: + - name: "config.php" + value: + bad_regex: "dbtype|dbhost|dbuser|dbhost|dbpass|dbport" + check_extra_path: "moodle/config.php" + only_bad_lines: True + type: f + search_in: + - common + + - name: Tomcat + value: + config: + auto_check: True + + files: + - name: "tomcat-users.xml" + value: + bad_regex: "dbtype|dbhost|dbuser|dbhost|dbpass|dbport" + line_grep: '"username=|password="' + only_bad_lines: True + type: f + search_in: + - common + + - name: Mongo + value: + config: + auto_check: True + exec: + - 'echo "Version: $(warn_exec mongo --version 2>/dev/null; warn_exec mongod --version 2>/dev/null)"' + + files: + - name: "mongod*.conf" + value: + type: f + remove_empty_lines: True + remove_regex: '\W+\#|^#' + search_in: + - common + + + - name: Supervisord + value: + config: + auto_check: True + + files: + - name: "supervisord.conf" + value: + bad_regex: "port.*=|username.*=|password.*=" + only_bad_lines: True + type: f + search_in: + - common + + - name: Cesi + value: + config: + auto_check: True + + files: + - name: "cesi.conf" + value: + bad_regex: "username.*=|password.*=|host.*=|port.*=|database.*=" + only_bad_lines: True + type: f + search_in: + - common + + - name: Rsync + value: + config: + auto_check: True + + files: + - name: "rsyncd.conf" + value: + bad_regex: "secrets.*|auth.*users.*=" + type: f + remove_empty_lines: True + remove_regex: '\W+\#|^#' + search_in: + - common + + - name: "rsyncd.secrets" + value: + bad_regex: ".*" + type: f + search_in: + - common + + - name: Hostapd + value: + config: + auto_check: True + + files: + - name: "hostapd.conf" + value: + bad_regex: "passphrase.*" + type: f + search_in: + - common + + - name: Anaconda ks + value: + config: + auto_check: True + + files: + - name: "anaconda-ks.cfg" + value: + bad_regex: "rootpw.*" + only_bad_lines: True + type: f + search_in: + - common + + - name: VNC + value: + config: + auto_check: True + + files: + - name: ".vnc" + value: + files: + - name: "passwd" + value: + just_list_file: True + type: d + search_in: + - common + + - name: "*vnc*.c*nf*" + value: + bad_regex: ".*" + type: f + search_in: + - common + + - name: "*vnc*.ini" + value: + just_list_file: True + type: f + search_in: + - common + + - name: "*vnc*.txt" + value: + bad_regex: ".*" + type: f + search_in: + - common + + - name: "*vnc*.xml" + value: + bad_regex: ".*" + type: f + search_in: + - common + + - name: Ldap + value: + config: + auto_check: True + exec: + - echo "The password hash is from the {SSHA} to 'structural'" + + files: + - name: "ldap" + value: + files: + - name: "*.bdb" + value: + bad_regex: "administrator|password|ADMINISTRATOR|PASSWORD|Password|Administrator" + line_grep: '-i -a -o "description.*" | sort | uniq' + type: f + type: d + search_in: + - common + + - name: OpenVPN + value: + config: + auto_check: True + + files: + - name: "*.ovpn" + value: + bad_regex: "auth-user-pass.+" + only_bad_lines: True + type: f + search_in: + - common + + - name: SSH + value: + config: + auto_check: True + + files: + - name: "id_dsa*" + value: + type: f + search_in: + - common + + - name: "id_rsa*" + value: + type: f + search_in: + - common + + - name: "known_hosts" + value: + type: f + search_in: + - common + + - name: "authorized_hosts" + value: + type: f + search_in: + - common + + - name: "authorized_keys" + value: + good_regex: 'from=[\w\._\-]+' + type: f + search_in: + - common + + - name: CERTSB4 + value: + config: + auto_check: False + + files: + - name: "*.pem" + value: + type: f + remove_path: '^/usr/share/|^/etc/ssl/|^/usr/local/lib/|^/usr/lib.*' + search_in: + - common + + - name: "*.cer" + value: + type: f + remove_path: '^/usr/share/|^/etc/ssl/|^/usr/local/lib/|^/usr/lib.*' + search_in: + - common + + - name: "*.crt" + value: + type: f + remove_path: '^/usr/share/|^/etc/ssl/|^/usr/local/lib/|^/usr/lib.*' + search_in: + - common + + - name: CERTSBIN + value: + config: + auto_check: False + + files: + - name: "*.csr" + value: + type: f + remove_path: '^/usr/share/|^/etc/ssl/|^/usr/local/lib/|^/usr/lib/.*' + search_in: + - common + + - name: "*.der" + value: + type: f + remove_path: '^/usr/share/|^/etc/ssl/|^/usr/local/lib/|^/usr/lib/.*' + search_in: + - common + + - name: CERTSCLIENT + value: + config: + auto_check: False + + files: + - name: "*.pfx" + value: + type: f + remove_path: '^/usr/share/|^/etc/ssl/|^/usr/local/lib/|^/usr/lib/.*' + search_in: + - common + + - name: "*.p12" + value: + type: f + remove_path: '^/usr/share/|^/etc/ssl/|^/usr/local/lib/|^/usr/lib/.*' + search_in: + - common + + - name: SSH AGENTS + value: + config: + auto_check: False + + files: + - name: "agent*" + value: + type: f + search_in: + - /tmp + + - name: SSH_CONFIG + value: + config: + auto_check: False + + files: + - name: "ssh*config" + value: + type: f + search_in: + - /usr + - $HOMESEARCH + + - name: Cloud Credentials + value: + config: + auto_check: True + + files: + - name: "credentials" + value: + bad_regex: ".*" + type: f + search_in: + - common + + - name: "credentials.db" + value: + bad_regex: ".*" + type: f + search_in: + - common + + - name: "legacy_credentials.db" + value: + bad_regex: ".*" + type: f + search_in: + - common + + - name: "access_tokens.db" + value: + bad_regex: ".*" + type: f + search_in: + - common + + - name: "access_tokens.json" + value: + bad_regex: ".*" + type: f + search_in: + - common + + - name: "accessTokens.json" + value: + bad_regex: ".*" + type: f + search_in: + - common + + - name: "azureProfile.json" + value: + bad_regex: ".*" + type: f + search_in: + - common + + - name: "TokenCache.dat" + value: + bad_regex: ".*" + type: f + search_in: + - common + + - name: "AzureRMContext.json" + value: + bad_regex: ".*" + type: f + search_in: + - common + + - name: ".bluemix" + value: + files: + - name: "config.json" + value: + bad_regex: ".*" + type: d + search_in: + - common + + - name: Kerberos + value: + config: + auto_check: False + + files: + - name: "krb5.conf" + value: + type: f + search_in: + - common + + - name: "krb5.keytab" + value: + type: f + search_in: + - common + + - name: ".k5login" + value: + type: f + search_in: + - common + + - name: "kadm5.acl" + value: + type: f + search_in: + - common + + - name: Kibana + value: + config: + auto_check: True + + files: + - name: "kibana.y*ml" + value: + bad_regex: "username|password|host|port|elasticsearch|ssl" + type: f + remove_empty_lines: True + remove_regex: '\W+\#|^#|^[[:space:]]*$' + search_in: + - common + + - name: Knockd + value: + config: + auto_check: True + + files: + - name: "*knockd*" + value: + check_extra_path: "/etc/init.d/" + type: f + search_in: + - /etc + + - name: Logstash + value: + config: + auto_check: False + + files: + - name: "logstash" + value: + type: d + search_in: + - common + + - name: Elasticsearch + value: + config: + auto_check: True + exec: + - echo "The version is $(curl -X GET '127.0.0.1:9200' 2>/dev/null | grep number | cut -d ':' -f 2)" + + files: + - name: "elasticsearch.y*ml" + value: + line_grep: '"path.data|path.logs|cluster.name|node.name|network.host|discovery.zen.ping.unicast.hosts"' + remove_regex: '\W+\#|^#' + type: f + search_in: + - common + + - name: Vault_ssh_helper + value: + config: + auto_check: False + + files: + - name: "vault-ssh-helper.hcl" + value: + type: f + search_in: + - common + + - name: Vault_ssh_token + value: + config: + auto_check: False + + files: + - name: ".vault-token" + value: + type: f + search_in: + - common + + - name: CouchDB + value: + config: + auto_check: True + + files: + - name: "couchdb" + value: + files: + - name: "local.ini" + value: + bad_regex: "admin.*|password.*|cert_file.*|key_file.*|hashed.*|pbkdf2.*" + remove_empty_lines: True + remove_regex: "^;" + type: d + search_in: + - common + + - name: Redis + value: + config: + auto_check: True + + files: + - name: "redis.conf" + value: + bad_regex: "masterauth.*|requirepass.*" + type: f + remove_empty_lines: True + remove_regex: '\W+\#|^#' + search_in: + - common + + - name: Mosquitto + value: + config: + auto_check: True + + files: + - name: "mosquitto.conf" + value: + bad_regex: "password_file.*|psk_file.*|allow_anonymous.*true|auth" + type: f + remove_empty_lines: True + remove_regex: '\W+\#|^#' + search_in: + - common + + - name: Neo4j + value: + config: + auto_check: True + + files: + - name: "neo4j" + value: + files: + - name: "auth" + value: + bad_regex: ".*" + remove_empty_lines: True + type: d + search_in: + - common + + - name: Cloud Init + value: + config: + auto_check: True + + files: + - name: "cloud.cfg" + value: + bad_regex: "consumer_key|token_key|token_secret|metadata_url|password:|passwd:|PRIVATE KEY|PRIVATE KEY|encrypted_data_bag_secret|_proxy" + only_bad_lines: True + type: f + remove_empty_lines: True + remove_regex: '\W+\#|^#' + search_in: + - common + + - name: Erlang + value: + config: + auto_check: True + + files: + - name: ".erlang.cookie" + value: + bad_regex: ".*" + type: f + search_in: + - common + + - name: GMV Auth + value: + config: + auto_check: True + + files: + - name: "gvm-tools.conf" + value: + bad_regex: "username.*|password.*" + type: f + search_in: + - common + + - name: IPSec + value: + config: + auto_check: True + + files: + - name: "ipsec.secrets" + value: + bad_regex: ".*PSK.*|.*RSA.*|.*EAP =.*|.*XAUTH.*" + type: f + search_in: + - common + + - name: "ipsec.conf" + value: + bad_regex: ".*PSK.*|.*RSA.*|.*EAP =.*|.*XAUTH.*" + type: f + search_in: + - common + + - name: IRSSI + value: + config: + auto_check: True + + files: + - name: ".irssi" + value: + files: + - name: "config" + value: + bad_regex: "password.*" + type: d + search_in: + - common + + - name: Keyring + value: + config: + auto_check: True + + files: + - name: "keyrings" + value: + type: d + search_in: + - common + + - name: "*.keyring" + value: + just_list_file: True + type: f + search_in: + - common + + - name: "*.keystore" + value: + just_list_file: True + type: f + search_in: + - common + + - name: "*.jks" + value: + just_list_file: True + type: f + search_in: + - common + + - name: Filezilla + value: + config: + auto_check: True + + files: + - name: "filezilla" + value: + files: + - name: "sitemanager.xml" + value: + bad_regex: "Host.*|Port.*|Protocol.*|User.*|Pass.*" + remove_empty_lines: True + remove_regex: "^;" + type: d + search_in: + - common + + - name: "filezilla.xml" + value: + just_list_file: True + type: f + search_in: + - common + + - name: "recentservers.xml" + value: + just_list_file: True + type: f + search_in: + - common + + - name: Backup Manager + value: + config: + auto_check: True + + files: + - name: "storage.php" + value: + bad_regex: "password|pass|user|database|host" + line_grep: >- + "'pass'|'password'|'user'|'database'|'host'" + type: f + search_in: + - common + + - name: "database.php" + value: + bad_regex: "password|pass|user|database|host" + line_grep: >- + "'pass'|'password'|'user'|'database'|'host'" + only_bad_lines: True + type: f + search_in: + - common + + - name: Splunk + value: + config: + auto_check: False + + files: + - name: "passwd" + value: + type: f + search_in: + - common + + - name: GitLab + value: + config: + auto_check: False + + files: + - name: "secrets.yml" + value: + type: f + remove_path: "/lib" + search_in: + - common + + - name: "gitlab.yml" + value: + type: f + remove_path: "/lib" + search_in: + - common + + - name: "gitlab.rm" + value: + type: f + remove_path: "/lib" + search_in: + - common + + - name: PGP-GPG + value: + config: + auto_check: True + exec: + - '((command -v gpg && gpg --list-keys) || echo_not_found "gpg") 2>/dev/null' + - '((command -v netpgpkeys && netpgpkeys --list-keys) || echo_not_found "netpgpkeys") 2>/dev/null' + - '(command -v netpgp || echo_not_found "netpgp") 2>/dev/null' + + files: + - name: "*.pgp" + value: + type: f + search_in: + - common + + - name: "*.gpg" + value: + type: f + search_in: + - common + + - name: "*.gnupg" + value: + type: f + remove_path: "README.gnupg" + search_in: + - common + + - name: Cache Vi + value: + disable: + - winpeas + + config: + auto_check: True + + files: + - name: "*.swp" + value: + just_list_file: True + type: f + search_in: + - common + + - name: "*.viminfo" + value: + just_list_file: True + type: f + search_in: + - common + + - name: Docker + value: + config: + auto_check: False + + files: + - name: "docker.socket" + value: + type: f + search_in: + - common + + - name: "docker.sock" + value: + type: f + search_in: + - common + + - name: "Dockerfile" + value: + type: f + search_in: + - common + + - name: "docker-compose.yml" + value: + type: f + search_in: + - common + + - name: Firefox + value: + disable: + - winpeas + + config: + auto_check: True + + files: + - name: ".mozilla" + value: + files: + - name: "places.sqlite" + value: + just_list_file: True - ? "bookmarkbackups" - : - just_list_file: True + - name: "bookmarkbackups" + value: + just_list_file: True - ? "formhistory.sqlite" - : - just_list_file: True + - name: "formhistory.sqlite" + value: + just_list_file: True - ? "handlers.json" - : - just_list_file: True + - name: "handlers.json" + value: + just_list_file: True - ? "persdict.dat" - : - just_list_file: True + - name: "persdict.dat" + value: + just_list_file: True - ? "addons.json" - : - just_list_file: True + - name: "addons.json" + value: + just_list_file: True - ? "cookies.sqlite" - : - just_list_file: True + - name: "cookies.sqlite" + value: + just_list_file: True - ? "cache2" - : - just_list_file: True + - name: "cache2" + value: + just_list_file: True - ? "startupCache" - : - just_list_file: True + - name: "startupCache" + value: + just_list_file: True - ? "favicons.sqlite" - : - just_list_file: True + - name: "favicons.sqlite" + value: + just_list_file: True - ? "prefs.js" - : - just_list_file: True + - name: "prefs.js" + value: + just_list_file: True - ? "downloads.sqlite" - : - just_list_file: True + - name: "downloads.sqlite" + value: + just_list_file: True - ? "thumbnails" - : - just_list_file: True + - name: "thumbnails" + value: + just_list_file: True - ? "logins.json" - : - just_list_file: True + - name: "logins.json" + value: + just_list_file: True - ? "key4.db" - : - just_list_file: True + - name: "key4.db" + value: + just_list_file: True - ? "key3.db" - : - just_list_file: True + - name: "key3.db" + value: + just_list_file: True - type: d - search_in: - - $HOMESEARCH + type: d + search_in: + - $HOMESEARCH - Chrome: - config: - auto_check: True + - name: Chrome + value: + disable: + - winpeas + + config: + auto_check: True - files: - ? "google-chrome" - : files: - ? "Cookies" - : - just_list_file: True + - name: "google-chrome" + value: + files: + - name: "Cookies" + value: + just_list_file: True - ? "Cache" - : - just_list_file: True + - name: "Cache" + value: + just_list_file: True - ? "Bookmarks" - : - just_list_file: True + - name: "Bookmarks" + value: + just_list_file: True - ? "Web Data" - : - just_list_file: True + - name: "Web Data" + value: + just_list_file: True - ? "Favicons" - : - just_list_file: True + - name: "Favicons" + value: + just_list_file: True - ? "Login Data" - : - just_list_file: True + - name: "Login Data" + value: + just_list_file: True - ? "Current Session" - : - just_list_file: True + - name: "Current Session" + value: + just_list_file: True - ? "Current Tabs" - : - just_list_file: True + - name: "Current Tabs" + value: + just_list_file: True - ? "Last Session" - : - just_list_file: True + - name: "Last Session" + value: + just_list_file: True - ? "Last Tabs" - : - just_list_file: True + - name: "Last Tabs" + value: + just_list_file: True - ? "Extensions" - : - just_list_file: True + - name: "Extensions" + value: + just_list_file: True - ? "Thumbnails" - : - just_list_file: True + - name: "Thumbnails" + value: + just_list_file: True + + type: d + search_in: + - $HOMESEARCH + + - name: Autologin + value: + disable: + - winpeas - search_in: - - $HOMESEARCH + config: + auto_check: True - Autologin: - config: - auto_check: True + files: + - name: "autologin" + value: + bad_regex: "passwd" + type: f + search_in: + - common - files: - ? "autologin" - : - bad_regex: "passwd" - type: f - search_in: - - common - - ? "autologin.conf" - : - bad_regex: "passwd" - type: f - search_in: - - common + - name: "autologin.conf" + value: + bad_regex: "passwd" + type: f + search_in: + - common - FastCGI: - config: - auto_check: True + - name: FastCGI + value: + config: + auto_check: True - files: - ? "fastcgi_params" - : - bad_regex: "DB_NAME|DB_USER|DB_PASS" - only_bad_lines: True - type: f - search_in: - - common + files: + - name: "fastcgi_params" + value: + bad_regex: "DB_NAME|DB_USER|DB_PASS" + only_bad_lines: True + type: f + search_in: + - common - SNMP: - config: - auto_check: True + - name: SNMP + value: + config: + auto_check: True - files: - ? "snmpd.conf" - : - bad_regex: "rocommunity|rwcommunity|extend.*" - only_bad_lines: True - type: f - search_in: - - common + files: + - name: "snmpd.conf" + value: + bad_regex: "rocommunity|rwcommunity|extend.*" + only_bad_lines: True + type: f + search_in: + - common - Pypirc: - config: - auto_check: True + - name: Pypirc + value: + config: + auto_check: True - files: - ? ".pypirc" - : - bad_regex: "username|password" - type: f - search_in: - - common + files: + - name: ".pypirc" + value: + bad_regex: "username|password" + type: f + search_in: + - common - CloudFlare: - config: - auto_check: True + - name: CloudFlare + value: + config: + auto_check: True - files: - ? ".cloudflared" - : - type: d - search_in: - - common + files: + - name: ".cloudflared" + value: + type: d + just_list_file: True + search_in: + - common - History: - config: - auto_check: False + - name: History + value: + config: + auto_check: False - files: - ? ".*_history" - : - bad_regex: "$pwd_inside_history" - line_grep: '-a "$pwd_inside_history"' - type: f - search_in: - - common + files: + - name: ".*_history.*" + value: + bad_regex: "$pwd_inside_history" + line_grep: '-a "$pwd_inside_history"' + type: f + search_in: + - common - Http_conf: - config: - auto_check: True + - name: Http_conf + value: + config: + auto_check: True - files: - ? "httpd.conf" - : - bad_regex: "htaccess.*|htpasswd.*" - only_bad_lines: True - remove_regex: '\W+\#|^#' - remove_empty_lines: True - type: f - search_in: - - common + files: + - name: "httpd.conf" + value: + bad_regex: "htaccess.*|htpasswd.*" + only_bad_lines: True + remove_regex: '\W+\#|^#' + remove_empty_lines: True + type: f + search_in: + - common - Htpasswd: - config: - auto_check: True + - name: Htpasswd + value: + config: + auto_check: True - files: - ? ".htpasswd" - : - bad_regex: ".*" - remove_regex: '^#' - remove_empty_lines: True - type: f - search_in: - - common + files: + - name: ".htpasswd" + value: + bad_regex: ".*" + remove_regex: '^#' + remove_empty_lines: True + type: f + search_in: + - common - Ldaprc: - config: - auto_check: True + - name: Ldaprc + value: + config: + auto_check: True - files: - ? ".ldaprc" - : - bad_regex: ".*" - remove_regex: '^#' - remove_empty_lines: True - type: f - search_in: - - common + files: + - name: ".ldaprc" + value: + bad_regex: ".*" + remove_regex: '^#' + remove_empty_lines: True + type: f + search_in: + - common - Env: - config: - auto_check: True + - name: Env + value: + config: + auto_check: True - files: - ? ".env" - : - bad_regex: "[pP][aA][sS][sS].*" - remove_regex: '^#' - remove_empty_lines: True - type: f - search_in: - - common + files: + - name: ".env" + value: + bad_regex: "[pP][aA][sS][sS].*" + remove_regex: '^#' + remove_empty_lines: True + type: f + search_in: + - common - Msmtprc: - config: - auto_check: True + - name: Msmtprc + value: + config: + auto_check: True - files: - ? ".msmtprc" - : - bad_regex: "user.*|password.*" - remove_regex: '^#' - remove_empty_lines: True - type: f - search_in: - - common + files: + - name: ".msmtprc" + value: + bad_regex: "user.*|password.*" + remove_regex: '^#' + remove_empty_lines: True + type: f + search_in: + - common - Github: - config: - auto_check: True + - name: Github + value: + config: + auto_check: True - files: - ? ".github" - : - just_list_file: True - type: f - search_in: - - common + files: + - name: ".github" + value: + just_list_file: True + type: f + search_in: + - common - ? ".gitconfig" - : - just_list_file: True - type: f - search_in: - - common + - name: ".gitconfig" + value: + just_list_file: True + type: f + search_in: + - common - ? ".git-credentials" - : - just_list_file: True - type: f - search_in: - - common + - name: ".git-credentials" + value: + just_list_file: True + type: f + search_in: + - common - ? ".git" - : - just_list_file: True - type: f - search_in: - - common + - name: ".git" + value: + just_list_file: True + type: f + search_in: + - common - Svn: - config: - auto_check: True + - name: Svn + value: + config: + auto_check: True - files: - ? ".svn" - : - just_list_file: True - type: d - search_in: - - common - - Keepass: - config: - auto_check: True - - files: - ? "*.kdbx" - : - just_list_file: True - type: f - search_in: - - common - - ? "KeePass.config*" - : - just_list_file: True - type: f - search_in: - - common - - ? "KeePass.ini" - : - just_list_file: True - type: f - search_in: - - common - - ? "KeePass.enforced*" - : - just_list_file: True - type: f - search_in: - - common - - FTP: - config: - auto_check: True - - files: - ? "*.ftpconfig" - : - just_list_file: True - type: f - search_in: - - common - - ? "ffftp.ini" - : - just_list_file: True - type: f - search_in: - - common - - ? "ftp.ini" - : - just_list_file: True - type: f - search_in: - - common - - ? "ftp.config" - : - just_list_file: True - type: f - search_in: - - common - - ? "ws_ftp.ini" - : - just_list_file: True - type: f - search_in: - - common - - Bind: - config: - auto_check: True - - files: - ? "bind" - : files: - ? "*" - : - just_list_file: True + - name: ".svn" + value: + just_list_file: True + type: d + search_in: + - common - ? "*.key" - : - bad_regex: ".*" - remove_empty_lines: True - remove_regex: '^#' - type: d - search_in: - - common + - name: Keepass + value: + config: + auto_check: True - SeedDMS: - config: - auto_check: True - - files: - ? "seeddms*" - : files: - ? "settings.xml" - : - bad_regex: "[pP][aA][sS][sS]" - line_grep: '"="' - type: d - search_in: - - common + - name: "*.kdbx" + value: + just_list_file: True + type: f + search_in: + - common - Ddclient: - config: - auto_check: True + - name: "KeePass.config*" + value: + just_list_file: True + type: f + search_in: + - common - files: - ? "ddclient.conf" - : - bad_regex: ".*password.*" - type: f - search_in: - - common + - name: "KeePass.ini" + value: + just_list_file: True + type: f + search_in: + - common - Interesting_logs: - config: - auto_check: True + - name: "KeePass.enforced*" + value: + just_list_file: True + type: f + search_in: + - common - files: - ? "access.log" - : - just_list_file: True - type: f - search_in: - - common + - name: FTP + value: + config: + auto_check: True - ? "error.log" - : - just_list_file: True - type: f - search_in: - - common + files: + - name: "*.ftpconfig" + value: + just_list_file: True + type: f + search_in: + - common - Other_Interesting_Files: - config: - auto_check: True + - name: "ffftp.ini" + value: + just_list_file: True + type: f + search_in: + - common - files: - ? ".bashrc" - : - just_list_file: True - type: f - search_in: - - common + - name: "ftp.ini" + value: + just_list_file: True + type: f + search_in: + - common + + - name: "ftp.config" + value: + just_list_file: True + type: f + search_in: + - common + + - name: "sites.ini" + value: + just_list_file: True + type: f + search_in: + - common + + - name: "wcx_ftp.ini" + value: + just_list_file: True + type: f + search_in: + - common + + - name: "winscp.ini" + value: + just_list_file: True + type: f + search_in: + - common + + - name: "ws_ftp.ini" + value: + just_list_file: True + type: f + search_in: + - common + + - name: Bind + value: + config: + auto_check: True + + files: + - name: "bind" + value: + files: + - name: "*" + value: + just_list_file: True + + - name: "*.key" + value: + bad_regex: ".*" + remove_empty_lines: True + remove_regex: '^#' + type: d + search_in: + - common + + - name: SeedDMS + value: + config: + auto_check: True + + files: + - name: "seeddms*" + value: + files: + - name: "settings.xml" + value: + bad_regex: "[pP][aA][sS][sS]" + line_grep: '"="' + type: d + search_in: + - common + + - name: Ddclient + value: + config: + auto_check: True + + files: + - name: "ddclient.conf" + value: + bad_regex: ".*password.*" + type: f + search_in: + - common + + - name: Cacti + value: + config: + auto_check: True + + files: + - name: "cacti" + value: + files: + - name: "config.php" + value: + bad_regex: "database_pw.*|database_user.*|database_pass.*" + line_grep: '"database_pw|database_user|database_pass|database_type|database_default|detabase_hostname|database_port|database_ssl"' + + - name: "config.php.dist" + value: + bad_regex: "database_pw.*|database_user.*|database_pass.*" + line_grep: '"database_pw|database_user|database_pass|database_type|database_default|detabase_hostname|database_port|database_ssl"' + + - name: "installer.php" + value: + bad_regex: "database_pw.*|database_user.*|database_pass.*" + line_grep: '"database_pw|database_user|database_pass|database_type|database_default|detabase_hostname|database_port|database_ssl"' + + - name: "check_all_pages" + value: + bad_regex: "database_pw.*|database_user.*|database_pass.*" + line_grep: '"database_pw|database_user|database_pass|database_type|database_default|detabase_hostname|database_port|database_ssl"' + + + type: d + search_in: + - common + + + - name: Interesting logs + value: + config: + auto_check: True + + files: + - name: "access.log" + value: + just_list_file: True + type: f + search_in: + - common + + - name: "error.log" + value: + just_list_file: True + type: f + search_in: + - common + + - name: Other Interesting Files + value: + config: + auto_check: True + + files: + - name: ".bashrc" + value: + just_list_file: True + type: f + search_in: + - common - ? ".google_authenticator" - : - just_list_file: True - type: f - search_in: - - common + - name: ".google_authenticator" + value: + just_list_file: True + type: f + search_in: + - common - ? "hosts.equiv" - : - just_list_file: True - type: f - search_in: - - common + - name: "hosts.equiv" + value: + just_list_file: True + type: f + search_in: + - common - ? ".lesshst" - : - just_list_file: True - type: f - search_in: - - common + - name: ".lesshst" + value: + just_list_file: True + type: f + search_in: + - common - ? ".plan" - : - just_list_file: True - type: f - search_in: - - common + - name: ".plan" + value: + just_list_file: True + type: f + search_in: + - common - ? ".profile" - : - just_list_file: True - type: f - search_in: - - common + - name: ".profile" + value: + just_list_file: True + type: f + search_in: + - common - ? ".recently-used.xbel" - : - just_list_file: True - type: f - search_in: - - common + - name: ".recently-used.xbel" + value: + just_list_file: True + type: f + search_in: + - common - ? ".rhosts" - : - just_list_file: True - type: f - search_in: - - common + - name: ".rhosts" + value: + just_list_file: True + type: f + search_in: + - common - ? ".sudo_as_admin_successful" - : - just_list_file: True - type: f - search_in: - - common + - name: ".sudo_as_admin_successful" + value: + just_list_file: True + type: f + search_in: + - common - Windows_Files: - config: - auto_check: True + - name: Windows Files + value: + config: + auto_check: True - files: - ? "unattend.inf" - : - just_list_file: True - type: f - search_in: - - common + files: + - name: "unattend.inf" + value: + just_list_file: True + type: f + search_in: + - common - ? "*.rdg" - : - just_list_file: True - type: f - search_in: - - common + - name: "*.rdg" + value: + just_list_file: True + type: f + search_in: + - common - ? "AppEvent.Evt" - : - just_list_file: True - type: f - search_in: - - common + - name: "AppEvent.Evt" + value: + just_list_file: True + type: f + search_in: + - common - ? "ConsoleHost_history.txt" - : - just_list_file: True - type: f - search_in: - - common + - name: "ConsoleHost_history.txt" + value: + just_list_file: True + type: f + search_in: + - common - ? "FreeSSHDservice.ini" - : - just_list_file: True - type: f - search_in: - - common + - name: "FreeSSHDservice.ini" + value: + just_list_file: True + type: f + search_in: + - common - ? "NetSetup.log" - : - just_list_file: True - type: f - search_in: - - common + - name: "NetSetup.log" + value: + just_list_file: True + type: f + search_in: + - common - ? "Ntds.dit" - : - just_list_file: True - type: f - search_in: - - common + - name: "Ntds.dit" + value: + just_list_file: True + type: f + search_in: + - common - ? "RDCMan.settings" - : - just_list_file: True - type: f - search_in: - - common + - name: "protecteduserkey.bin" + value: + just_list_file: True + type: f + search_in: + - common - ? "SAM" - : - just_list_file: True - type: f - search_in: - - common + - name: "RDCMan.settings" + value: + just_list_file: True + type: f + search_in: + - common - ? "SYSTEM" - : - just_list_file: True - type: f - search_in: - - common + - name: "SAM" + value: + just_list_file: True + type: f + search_in: + - common - ? "SecEvent.Evt" - : - just_list_file: True - type: f - search_in: - - common + - name: "SYSTEM" + value: + just_list_file: True + type: f + search_in: + - common - ? "appcmd.exe" - : - just_list_file: True - type: f - search_in: - - common + - name: "SecEvent.Evt" + value: + just_list_file: True + type: f + search_in: + - common - ? "bash.exe" - : - just_list_file: True - type: f - search_in: - - common + - name: "appcmd.exe" + value: + just_list_file: True + type: f + search_in: + - common - ? "datasources.xml" - : - just_list_file: True - type: f - search_in: - - common + - name: "bash.exe" + value: + just_list_file: True + type: f + search_in: + - common - ? "default.sav" - : - just_list_file: True - type: f - search_in: - - common + - name: "datasources.xml" + value: + just_list_file: True + type: f + search_in: + - common - ? "drives.xml" - : - just_list_file: True - type: f - search_in: - - common + - name: "default.sav" + value: + just_list_file: True + type: f + search_in: + - common - ? "groups.xml" - : - just_list_file: True - type: f - search_in: - - common + - name: "drives.xml" + value: + just_list_file: True + type: f + search_in: + - common - ? "https-xampp.conf" - : - just_list_file: True - type: f - search_in: - - common + - name: "groups.xml" + value: + just_list_file: True + type: f + search_in: + - common - ? "https.conf" - : - just_list_file: True - type: f - search_in: - - common + - name: "https-xampp.conf" + value: + just_list_file: True + type: f + search_in: + - common - ? "iis6.log" - : - just_list_file: True - type: f - search_in: - - common + - name: "https.conf" + value: + just_list_file: True + type: f + search_in: + - common - ? "index.dat" - : - just_list_file: True - type: f - search_in: - - common + - name: "iis6.log" + value: + just_list_file: True + type: f + search_in: + - common - ? "my.cnf" - : - just_list_file: True - type: f - search_in: - - common + - name: "index.dat" + value: + just_list_file: True + type: f + search_in: + - common - ? "my.ini" - : - just_list_file: True - type: f - search_in: - - common + - name: "my.cnf" + value: + just_list_file: True + type: f + search_in: + - common - ? "ntuser.dat" - : - just_list_file: True - type: f - search_in: - - common + - name: "my.ini" + value: + just_list_file: True + type: f + search_in: + - common - ? "pagefile.sys" - : - just_list_file: True - type: f - search_in: - - common + - name: "ntuser.dat" + value: + just_list_file: True + type: f + search_in: + - common - ? "php.ini" - : - just_list_file: True - type: f - search_in: - - common + - name: "pagefile.sys" + value: + just_list_file: True + type: f + search_in: + - common - ? "printers.xml" - : - just_list_file: True - type: f - search_in: - - common + - name: "php.ini" + value: + just_list_file: True + type: f + search_in: + - common - ? "recentservers.xml" - : - just_list_file: True - type: f - search_in: - - common + - name: "printers.xml" + value: + just_list_file: True + type: f + search_in: + - common - ? "scclient.exe" - : - just_list_file: True - type: f - search_in: - - common + - name: "recentservers.xml" + value: + just_list_file: True + type: f + search_in: + - common - ? "scheduledtasks.xml" - : - just_list_file: True - type: f - search_in: - - common + - name: "scclient.exe" + value: + just_list_file: True + type: f + search_in: + - common - ? "security" - : - just_list_file: True - type: f - search_in: - - common + - name: "scheduledtasks.xml" + value: + just_list_file: True + type: f + search_in: + - common - ? "security.sav" - : - just_list_file: True - type: f - search_in: - - common + - name: "security.sav" + value: + just_list_file: True + type: f + search_in: + - common - ? "server.xml" - : - just_list_file: True - type: f - search_in: - - common + - name: "server.xml" + value: + just_list_file: True + type: f + search_in: + - common - ? "services.xml" - : - just_list_file: True - type: f - search_in: - - common + - name: "setupinfo" + value: + just_list_file: True + type: f + search_in: + - common - ? "setupinfo" - : - just_list_file: True - type: f - search_in: - - common + - name: "setupinfo.bak" + value: + just_list_file: True + type: f + search_in: + - common - ? "setupinfo.bak" - : - just_list_file: True - type: f - search_in: - - common + - name: "sitemanager.xml" + value: + just_list_file: True + type: f + search_in: + - common - ? "sitemanager.xml" - : - just_list_file: True - type: f - search_in: - - common + - name: "sites.ini" + value: + just_list_file: True + type: f + search_in: + - common - ? "sites.ini" - : - just_list_file: True - type: f - search_in: - - common + - name: "software" + value: + just_list_file: True + type: f + search_in: + - common - ? "software" - : - just_list_file: True - type: f - search_in: - - common + - name: "software.sav" + value: + just_list_file: True + type: f + search_in: + - common - ? "software.sav" - : - just_list_file: True - type: f - search_in: - - common + - name: "sysprep.inf" + value: + just_list_file: True + type: f + search_in: + - common - ? "sysprep.inf" - : - just_list_file: True - type: f - search_in: - - common + - name: "sysprep.xml" + value: + just_list_file: True + type: f + search_in: + - common - ? "sysprep.xml" - : - just_list_file: True - type: f - search_in: - - common + - name: "system" + value: + just_list_file: True + type: f + search_in: + - common - ? "system.sav" - : - just_list_file: True - type: f - search_in: - - common + - name: "system.sav" + value: + just_list_file: True + type: f + search_in: + - common - ? "unattend.txt" - : - just_list_file: True - type: f - search_in: - - common + - name: "unattend.txt" + value: + just_list_file: True + type: f + search_in: + - common - ? "unattend.xml" - : - just_list_file: True - type: f - search_in: - - common + - name: "unattend.xml" + value: + just_list_file: True + type: f + search_in: + - common - ? "unattended.xml" - : - just_list_file: True - type: f - search_in: - - common + - name: "unattended.xml" + value: + just_list_file: True + type: f + search_in: + - common - ? "wcx_ftp.ini" - : - just_list_file: True - type: f - search_in: - - common + - name: "wcx_ftp.ini" + value: + just_list_file: True + type: f + search_in: + - common - ? "web*.config" - : - just_list_file: True - type: f - search_in: - - common + - name: "ws_ftp.ini" + value: + just_list_file: True + type: f + search_in: + - common - ? "winscp.ini" - : - just_list_file: True - type: f - search_in: - - common + - name: "web*.config" + value: + just_list_file: True + type: f + search_in: + - common - ? "wsl.exe" - : - just_list_file: True - type: f - search_in: - - common + - name: "winscp.ini" + value: + just_list_file: True + type: f + search_in: + - common + + - name: "wsl.exe" + value: + just_list_file: True + type: f + search_in: + - common + + - name: Other Windows Files + value: + config: + auto_check: True + disable: + - linpeas + + files: + - name: "security" + value: + just_list_file: True + type: f + search_in: + - common + + - name: "services.xml" + value: + just_list_file: True + type: f + search_in: + - common # Final section - Database: - config: - auto_check: False + - name: Database + value: + config: + auto_check: False - files: - ? "*.db" - : - remove_path: "/man/|/usr/|/var/cache/" - type: f - search_in: - - common + files: + - name: "*.db" + value: + remove_path: "/man/|/usr/|/var/cache/" + type: f + search_in: + - common - ? "*.sqlite" - : - remove_path: "/man/|/usr/|/var/cache/" - type: f - search_in: - - common + - name: "*.sqlite" + value: + remove_path: "/man/|/usr/|/var/cache/" + type: f + search_in: + - common - ? "*.sqlite3" - : - remove_path: "/man/|/usr/|/var/cache/" - type: f - search_in: - - common + - name: "*.sqlite3" + value: + remove_path: "/man/|/usr/|/var/cache/" + type: f + search_in: + - common - Backups: - config: - auto_check: False + - name: Backups + value: + config: + auto_check: False - files: - ? "backup" - : - type: f - search_in: - - common + files: + - name: "backup" + value: + type: f + search_in: + - common - ? "backups" - : - type: f - search_in: - - common + - name: "backups" + value: + type: f + search_in: + - common - Password_Files: - config: - auto_check: False + - name: Password Files + value: + config: + auto_check: False - files: - ? "*password*" - : - just_list_file: True - type: f - search_in: - - common + files: + - name: "*password*" + value: + just_list_file: True + type: f + search_in: + - common - ? "*credential*" - : - just_list_file: True - type: f - search_in: - - common + - name: "*credential*" + value: + just_list_file: True + type: f + search_in: + - common - ? "creds*" - : - just_list_file: True - type: f - search_in: - - common + - name: "creds*" + value: + just_list_file: True + type: f + search_in: + - common - ? "*.key" - : - just_list_file: True - type: f - search_in: - - common + - name: "*.key" + value: + just_list_file: True + type: f + search_in: + - common diff --git a/linPEAS/builder/linpeas_base.sh b/linPEAS/builder/linpeas_base.sh index a44576a..5a0d392 100755 --- a/linPEAS/builder/linpeas_base.sh +++ b/linPEAS/builder/linpeas_base.sh @@ -1,6 +1,6 @@ #!/bin/sh -VERSION="v3.2.6" +VERSION="ng" ADVISORY="This script should be used for authorized penetration testing and/or educational purposes only. Any misuse of this software will not be the responsibility of the author or of any other collaborator. Use it at your own networks and/or with the network owner's permission." ########################################### @@ -211,7 +211,7 @@ print_banner(){ echo "" if [ !"$QUIET" ]; then print_banner; fi -printf ${BLUE}" $SCRIPTNAME $VERSION ${YELLOW}by carlospolop\n"$NC; +printf ${BLUE}" $SCRIPTNAME-$VERSION ${YELLOW}by carlospolop\n"$NC; echo "" printf ${YELLOW}"ADVISORY: "${BLUE}"$ADVISORY\n"$NC echo "" @@ -400,7 +400,7 @@ fi Groups="ImPoSSssSiBlEee"`groups "$USER" 2>/dev/null | cut -d ":" -f 2 | tr ' ' '|'` #This variables are dived in several different ones because NetBSD required it -pwd_inside_history="7z|unzip|useradd|linenum|linpeas|mkpasswd|htpasswd|openssl|PASSW|passw|shadow|root|sudo|^su|pkexec|^ftp|mongo|psql|mysql|rdesktop|xfreerdp|^ssh|steghide|@" +peass{VARIABLES} pwd_in_variables1="Dgpg.passphrase|Dsonar.login|Dsonar.projectKey|GITHUB_TOKEN|HB_CODESIGN_GPG_PASS|HB_CODESIGN_KEY_PASS|PUSHOVER_TOKEN|PUSHOVER_USER|VIRUSTOTAL_APIKEY|ACCESSKEY|ACCESSKEYID|ACCESS_KEY|ACCESS_KEY_ID|ACCESS_KEY_SECRET|ACCESS_SECRET|ACCESS_TOKEN|ACCOUNT_SID|ADMIN_EMAIL|ADZERK_API_KEY|ALGOLIA_ADMIN_KEY_1|ALGOLIA_ADMIN_KEY_2|ALGOLIA_ADMIN_KEY_MCM|ALGOLIA_API_KEY|ALGOLIA_API_KEY_MCM|ALGOLIA_API_KEY_SEARCH|ALGOLIA_APPLICATION_ID|ALGOLIA_APPLICATION_ID_1|ALGOLIA_APPLICATION_ID_2|ALGOLIA_APPLICATION_ID_MCM|ALGOLIA_APP_ID|ALGOLIA_APP_ID_MCM|ALGOLIA_SEARCH_API_KEY|ALGOLIA_SEARCH_KEY|ALGOLIA_SEARCH_KEY_1|ALIAS_NAME|ALIAS_PASS|ALICLOUD_ACCESS_KEY|ALICLOUD_SECRET_KEY|amazon_bucket_name|AMAZON_SECRET_ACCESS_KEY|ANDROID_DOCS_DEPLOY_TOKEN|android_sdk_license|android_sdk_preview_license|aos_key|aos_sec|APIARY_API_KEY|APIGW_ACCESS_TOKEN|API_KEY|API_KEY_MCM|API_KEY_SECRET|API_KEY_SID|API_SECRET|appClientSecret|APP_BUCKET_PERM|APP_NAME|APP_REPORT_TOKEN_KEY|APP_TOKEN|ARGOS_TOKEN|ARTIFACTORY_KEY|ARTIFACTS_AWS_ACCESS_KEY_ID|ARTIFACTS_AWS_SECRET_ACCESS_KEY|ARTIFACTS_BUCKET|ARTIFACTS_KEY|ARTIFACTS_SECRET|ASSISTANT_IAM_APIKEY|AURORA_STRING_URL|AUTH0_API_CLIENTID|AUTH0_API_CLIENTSECRET|AUTH0_AUDIENCE|AUTH0_CALLBACK_URL|AUTH0_CLIENT_ID" pwd_in_variables2="AUTH0_CLIENT_SECRET|AUTH0_CONNECTION|AUTH0_DOMAIN|AUTHOR_EMAIL_ADDR|AUTHOR_NPM_API_KEY|AUTH_TOKEN|AWS-ACCT-ID|AWS-KEY|AWS-SECRETS|AWS.config.accessKeyId|AWS.config.secretAccessKey|AWSACCESSKEYID|AWSCN_ACCESS_KEY_ID|AWSCN_SECRET_ACCESS_KEY|AWSSECRETKEY|AWS_ACCESS|AWS_ACCESS_KEY|AWS_ACCESS_KEY_ID|AWS_CF_DIST_ID|AWS_DEFAULT|AWS_DEFAULT_REGION|AWS_S3_BUCKET|AWS_SECRET|AWS_SECRET_ACCESS_KEY|AWS_SECRET_KEY|AWS_SES_ACCESS_KEY_ID|AWS_SES_SECRET_ACCESS_KEY|B2_ACCT_ID|B2_APP_KEY|B2_BUCKET|baseUrlTravis|bintrayKey|bintrayUser|BINTRAY_APIKEY|BINTRAY_API_KEY|BINTRAY_KEY|BINTRAY_TOKEN|BINTRAY_USER|BLUEMIX_ACCOUNT|BLUEMIX_API_KEY|BLUEMIX_AUTH|BLUEMIX_NAMESPACE|BLUEMIX_ORG|BLUEMIX_ORGANIZATION|BLUEMIX_PASS|BLUEMIX_PASS_PROD|BLUEMIX_SPACE|BLUEMIX_USER|BRACKETS_REPO_OAUTH_TOKEN|BROWSERSTACK_ACCESS_KEY|BROWSERSTACK_PROJECT_NAME|BROWSER_STACK_ACCESS_KEY|BUCKETEER_AWS_ACCESS_KEY_ID|BUCKETEER_AWS_SECRET_ACCESS_KEY|BUCKETEER_BUCKET_NAME|BUILT_BRANCH_DEPLOY_KEY|BUNDLESIZE_GITHUB_TOKEN|CACHE_S3_SECRET_KEY|CACHE_URL|CARGO_TOKEN|CATTLE_ACCESS_KEY|CATTLE_AGENT_INSTANCE_AUTH|CATTLE_SECRET_KEY|CC_TEST_REPORTER_ID|CC_TEST_REPOTER_ID|CENSYS_SECRET|CENSYS_UID|CERTIFICATE_OSX_P12|CF_ORGANIZATION|CF_PROXY_HOST|channelId|CHEVERNY_TOKEN|CHROME_CLIENT_ID" pwd_in_variables3="CHROME_CLIENT_SECRET|CHROME_EXTENSION_ID|CHROME_REFRESH_TOKEN|CI_DEPLOY_USER|CI_NAME|CI_PROJECT_NAMESPACE|CI_PROJECT_URL|CI_REGISTRY_USER|CI_SERVER_NAME|CI_USER_TOKEN|CLAIMR_DATABASE|CLAIMR_DB|CLAIMR_SUPERUSER|CLAIMR_TOKEN|CLIENT_ID|CLIENT_SECRET|CLI_E2E_CMA_TOKEN|CLI_E2E_ORG_ID|CLOUDAMQP_URL|CLOUDANT_APPLIANCE_DATABASE|CLOUDANT_ARCHIVED_DATABASE|CLOUDANT_AUDITED_DATABASE|CLOUDANT_DATABASE|CLOUDANT_ORDER_DATABASE|CLOUDANT_PARSED_DATABASE|CLOUDANT_PROCESSED_DATABASE|CLOUDANT_SERVICE_DATABASE|CLOUDFLARE_API_KEY|CLOUDFLARE_AUTH_EMAIL|CLOUDFLARE_AUTH_KEY|CLOUDFLARE_EMAIL|CLOUDFLARE_ZONE_ID|CLOUDINARY_URL|CLOUDINARY_URL_EU|CLOUDINARY_URL_STAGING|CLOUD_API_KEY|CLUSTER_NAME|CLU_REPO_URL|CLU_SSH_PRIVATE_KEY_BASE64|CN_ACCESS_KEY_ID|CN_SECRET_ACCESS_KEY|COCOAPODS_TRUNK_EMAIL|COCOAPODS_TRUNK_TOKEN|CODACY_PROJECT_TOKEN|CODECLIMATE_REPO_TOKEN|CODECOV_TOKEN|coding_token|CONEKTA_APIKEY|CONFIGURATION_PROFILE_SID|CONFIGURATION_PROFILE_SID_P2P|CONFIGURATION_PROFILE_SID_SFU|CONSUMERKEY|CONSUMER_KEY|CONTENTFUL_ACCESS_TOKEN|CONTENTFUL_CMA_TEST_TOKEN|CONTENTFUL_INTEGRATION_MANAGEMENT_TOKEN|CONTENTFUL_INTEGRATION_SOURCE_SPACE|CONTENTFUL_MANAGEMENT_API_ACCESS_TOKEN|CONTENTFUL_MANAGEMENT_API_ACCESS_TOKEN_NEW|CONTENTFUL_ORGANIZATION" @@ -1940,7 +1940,7 @@ if [ "`echo $CHECKS | grep SofI`" ]; then peass{Htpasswd} - peass{PHPCookies} + peass{PHP Sessions} peass{Wordpress} @@ -1965,13 +1965,13 @@ if [ "`echo $CHECKS | grep SofI`" ]; then fi echo "" - peass{Anaconda-ks} + peass{Anaconda ks} peass{VNC} peass{Ldap} - peass{Open_VPN} + peass{OpenVPN} #-- SI) ssh files print_2title "Searching ssl/ssh files" @@ -1980,7 +1980,7 @@ if [ "`echo $CHECKS | grep SofI`" ]; then hostsdenied="`ls /etc/hosts.denied 2>/dev/null`" hostsallow="`ls /etc/hosts.allow 2>/dev/null`" - peass{SSH_FILES} + peass{SSH} grep "PermitRootLogin \|ChallengeResponseAuthentication \|PasswordAuthentication \|UsePAM \|Port\|PermitEmptyPasswords\|PubkeyAuthentication\|ListenAddress\|ForwardAgent\|AllowAgentForwarding\|AuthorizedKeysFiles" /etc/ssh/sshd_config 2>/dev/null | grep -v "#" | sed -${E} "s,PermitRootLogin.*es|PermitEmptyPasswords.*es|ChallengeResponseAuthentication.*es|FordwardAgent.*es,${SED_RED}," @@ -2190,9 +2190,9 @@ if [ "`echo $CHECKS | grep SofI`" ]; then peass{Neo4j} - peass{Cloud_credentials} + peass{Cloud Credentials} - peass{Cloud-Init} + peass{Cloud Init} peass{CloudFlare} @@ -2208,7 +2208,7 @@ if [ "`echo $CHECKS | grep SofI`" ]; then peass{Filezilla} - peass{Backup_Manager} + peass{Backup Manager} ##-- SI) passwd files (splunk) print_2title "Searching uncommon passwd files (splunk)" @@ -2346,11 +2346,11 @@ if [ "`echo $CHECKS | grep SofI`" ]; then peass{EXTRA_SECTIONS} - peass{Interesting_logs} + peass{Interesting logs} - peass{Windows_Files} + peass{Windows Files} - peass{Other_Interesting_Files} + peass{Other Interesting Files} echo "" @@ -2675,7 +2675,7 @@ if [ "`echo $CHECKS | grep IntFiles`" ]; then lastWlogFolder="ImPOsSiBleeElastWlogFolder" logfind=`find / -type f -name "*.log" -o -name "*.log.*" 2>/dev/null | awk -F/ '{line_init=$0; if (!cont){ cont=0 }; $NF=""; act=$0; if (act == pre){(cont += 1)} else {cont=0}; if (cont < 3){ print line_init; }; if (cont == "3"){print "#)You_can_write_more_log_files_inside_last_directory"}; pre=act}' | head -n 100` printf "%s\n" "$logfind" | while read log; do - if ! [ "$IAMROOT" ] && [ -w "$log" ] || ! [ "$IAMROOT" ] && [ `echo "$log" | grep -E "$Wfolders"` ]; then #Only print info if something interesting found + if ! [ "$IAMROOT" ] && [ "$log" ] && [ -w "$log" ] || ! [ "$IAMROOT" ] && [ "`echo \"$log\" | grep -E \"$Wfolders\"`" ]; then #Only print info if something interesting found if [ "`echo \"$log\" | grep \"You_can_write_more_log_files_inside_last_directory\"`" ]; then printf $ITALIC"$log\n"$NC; elif ! [ "$IAMROOT" ] && [ -w "$log" ] && [ "`command -v logrotate 2>/dev/null`" ] && [ "`logrotate --version 2>&1 | grep -E ' 1| 2| 3.1'`" ]; then printf "Writable:$RED $log\n"$NC; #Check vuln version of logrotate is used and print red in that case elif ! [ "$IAMROOT" ] && [ -w "$log" ]; then echo "Writable: $log"; diff --git a/linPEAS/builder/src/fileRecord.py b/linPEAS/builder/src/fileRecord.py index 79b24ec..740c978 100644 --- a/linPEAS/builder/src/fileRecord.py +++ b/linPEAS/builder/src/fileRecord.py @@ -20,7 +20,7 @@ class FileRecord: self.regex = regex self.bad_regex = bad_regex self.check_extra_path = check_extra_path - self.files = [FileRecord(regex=regex,**fr) for regex,fr in files.items()] + self.files = [FileRecord(regex=fr["name"],**fr["value"]) for fr in files] self.good_regex = good_regex self.just_list_file = just_list_file self.line_grep = line_grep diff --git a/linPEAS/builder/src/linpeasBuilder.py b/linPEAS/builder/src/linpeasBuilder.py index 5c29afd..6d51952 100644 --- a/linPEAS/builder/src/linpeasBuilder.py +++ b/linPEAS/builder/src/linpeasBuilder.py @@ -15,7 +15,9 @@ from .yamlGlobals import ( FIND_LINE_MARKUP, STORAGE_LINE_MARKUP, STORAGE_LINE_EXTRA_MARKUP, - EXTRASECTIONS_MARKUP + EXTRASECTIONS_MARKUP, + PEAS_VARIABLES_MARKUP, + YAML_VARIABLES ) @@ -30,6 +32,9 @@ class LinpeasBuilder: self.linpeas_sh = file.read() def build(self): + variables = self.__generate_variables() + self.__replace_mark(PEAS_VARIABLES_MARKUP, variables, "") + find_calls = self.__generate_finds() self.__replace_mark(PEAS_FINDS_MARKUP, find_calls, " ") @@ -68,6 +73,15 @@ class LinpeasBuilder: def __get_peass_marks(self): return re.findall(r'peass\{[\w\-\._ ]*\}', self.linpeas_sh) + + def __generate_variables(self): + """Generate the variables from the yaml to set into linpeas bash script""" + variables_bash = "" + for var in YAML_VARIABLES: + variables_bash += f"{var['name']}=\"{var['value']}\"\n" + + return variables_bash + def __get_files_to_search(self): """Given a PEASLoaded and find the files that need to be searched on each root folder""" @@ -158,7 +172,7 @@ class LinpeasBuilder: for precord in self.ploaded.peasrecords: if precord.auto_check: - section = f' print_2title "Analizing {precord.name.replace("_"," ")} Files (limit 70)"\n' + section = f' print_2title "Analyzing {precord.name.replace("_"," ")} Files (limit 70)"\n' for exec_line in precord.exec: if exec_line: diff --git a/linPEAS/builder/src/peasLoaded.py b/linPEAS/builder/src/peasLoaded.py index 1eedd93..4ad3c26 100644 --- a/linPEAS/builder/src/peasLoaded.py +++ b/linPEAS/builder/src/peasLoaded.py @@ -6,21 +6,26 @@ class PEASLoaded: def __init__(self): to_search = YAML_LOADED["search"] self.peasrecords = [] - for name,peasrecord_json in to_search.items(): + for record in to_search: + record_value = record["value"] + if "linpeas" in str(record_value["config"].get("disable","")).lower(): + continue + filerecords = [] - for regex,fr in peasrecord_json["files"].items(): + for filerecord in record_value["files"]: filerecords.append( FileRecord( - regex=regex, - **fr + regex=filerecord["name"], + **filerecord["value"] ) ) - + + name = record["name"] self.peasrecords.append( PEASRecord( name=name, - auto_check=peasrecord_json["config"]["auto_check"], - exec=peasrecord_json["config"].get("exec", DEFAULTS["exec"]), + auto_check=record_value["config"]["auto_check"], + exec=record_value["config"].get("exec", DEFAULTS["exec"]), filerecords=filerecords ) ) \ No newline at end of file diff --git a/linPEAS/builder/src/yamlGlobals.py b/linPEAS/builder/src/yamlGlobals.py index 5485c3f..c778345 100644 --- a/linPEAS/builder/src/yamlGlobals.py +++ b/linPEAS/builder/src/yamlGlobals.py @@ -27,6 +27,9 @@ STORAGE_LINE_MARKUP = YAML_LOADED["storage_line_markup"] STORAGE_LINE_EXTRA_MARKUP = YAML_LOADED["storage_line_extra_markup"] STORAGE_TEMPLATE = YAML_LOADED["storage_template"] +PEAS_VARIABLES_MARKUP = YAML_LOADED["variables_markup"] +YAML_VARIABLES = YAML_LOADED["variables"] + INT_HIDDEN_FILES_MARKUP = YAML_LOADED["int_hidden_files_markup"] EXTRASECTIONS_MARKUP = YAML_LOADED["peas_extrasections_markup"] diff --git a/linPEAS/linpeas.sh b/linPEAS/linpeas.sh index dc1e692..b8f64c0 100755 --- a/linPEAS/linpeas.sh +++ b/linPEAS/linpeas.sh @@ -401,6 +401,7 @@ Groups="ImPoSSssSiBlEee"`groups "$USER" 2>/dev/null | cut -d ":" -f 2 | tr ' ' ' #This variables are dived in several different ones because NetBSD required it pwd_inside_history="7z|unzip|useradd|linenum|linpeas|mkpasswd|htpasswd|openssl|PASSW|passw|shadow|root|sudo|^su|pkexec|^ftp|mongo|psql|mysql|rdesktop|xfreerdp|^ssh|steghide|@" + pwd_in_variables1="Dgpg.passphrase|Dsonar.login|Dsonar.projectKey|GITHUB_TOKEN|HB_CODESIGN_GPG_PASS|HB_CODESIGN_KEY_PASS|PUSHOVER_TOKEN|PUSHOVER_USER|VIRUSTOTAL_APIKEY|ACCESSKEY|ACCESSKEYID|ACCESS_KEY|ACCESS_KEY_ID|ACCESS_KEY_SECRET|ACCESS_SECRET|ACCESS_TOKEN|ACCOUNT_SID|ADMIN_EMAIL|ADZERK_API_KEY|ALGOLIA_ADMIN_KEY_1|ALGOLIA_ADMIN_KEY_2|ALGOLIA_ADMIN_KEY_MCM|ALGOLIA_API_KEY|ALGOLIA_API_KEY_MCM|ALGOLIA_API_KEY_SEARCH|ALGOLIA_APPLICATION_ID|ALGOLIA_APPLICATION_ID_1|ALGOLIA_APPLICATION_ID_2|ALGOLIA_APPLICATION_ID_MCM|ALGOLIA_APP_ID|ALGOLIA_APP_ID_MCM|ALGOLIA_SEARCH_API_KEY|ALGOLIA_SEARCH_KEY|ALGOLIA_SEARCH_KEY_1|ALIAS_NAME|ALIAS_PASS|ALICLOUD_ACCESS_KEY|ALICLOUD_SECRET_KEY|amazon_bucket_name|AMAZON_SECRET_ACCESS_KEY|ANDROID_DOCS_DEPLOY_TOKEN|android_sdk_license|android_sdk_preview_license|aos_key|aos_sec|APIARY_API_KEY|APIGW_ACCESS_TOKEN|API_KEY|API_KEY_MCM|API_KEY_SECRET|API_KEY_SID|API_SECRET|appClientSecret|APP_BUCKET_PERM|APP_NAME|APP_REPORT_TOKEN_KEY|APP_TOKEN|ARGOS_TOKEN|ARTIFACTORY_KEY|ARTIFACTS_AWS_ACCESS_KEY_ID|ARTIFACTS_AWS_SECRET_ACCESS_KEY|ARTIFACTS_BUCKET|ARTIFACTS_KEY|ARTIFACTS_SECRET|ASSISTANT_IAM_APIKEY|AURORA_STRING_URL|AUTH0_API_CLIENTID|AUTH0_API_CLIENTSECRET|AUTH0_AUDIENCE|AUTH0_CALLBACK_URL|AUTH0_CLIENT_ID" pwd_in_variables2="AUTH0_CLIENT_SECRET|AUTH0_CONNECTION|AUTH0_DOMAIN|AUTHOR_EMAIL_ADDR|AUTHOR_NPM_API_KEY|AUTH_TOKEN|AWS-ACCT-ID|AWS-KEY|AWS-SECRETS|AWS.config.accessKeyId|AWS.config.secretAccessKey|AWSACCESSKEYID|AWSCN_ACCESS_KEY_ID|AWSCN_SECRET_ACCESS_KEY|AWSSECRETKEY|AWS_ACCESS|AWS_ACCESS_KEY|AWS_ACCESS_KEY_ID|AWS_CF_DIST_ID|AWS_DEFAULT|AWS_DEFAULT_REGION|AWS_S3_BUCKET|AWS_SECRET|AWS_SECRET_ACCESS_KEY|AWS_SECRET_KEY|AWS_SES_ACCESS_KEY_ID|AWS_SES_SECRET_ACCESS_KEY|B2_ACCT_ID|B2_APP_KEY|B2_BUCKET|baseUrlTravis|bintrayKey|bintrayUser|BINTRAY_APIKEY|BINTRAY_API_KEY|BINTRAY_KEY|BINTRAY_TOKEN|BINTRAY_USER|BLUEMIX_ACCOUNT|BLUEMIX_API_KEY|BLUEMIX_AUTH|BLUEMIX_NAMESPACE|BLUEMIX_ORG|BLUEMIX_ORGANIZATION|BLUEMIX_PASS|BLUEMIX_PASS_PROD|BLUEMIX_SPACE|BLUEMIX_USER|BRACKETS_REPO_OAUTH_TOKEN|BROWSERSTACK_ACCESS_KEY|BROWSERSTACK_PROJECT_NAME|BROWSER_STACK_ACCESS_KEY|BUCKETEER_AWS_ACCESS_KEY_ID|BUCKETEER_AWS_SECRET_ACCESS_KEY|BUCKETEER_BUCKET_NAME|BUILT_BRANCH_DEPLOY_KEY|BUNDLESIZE_GITHUB_TOKEN|CACHE_S3_SECRET_KEY|CACHE_URL|CARGO_TOKEN|CATTLE_ACCESS_KEY|CATTLE_AGENT_INSTANCE_AUTH|CATTLE_SECRET_KEY|CC_TEST_REPORTER_ID|CC_TEST_REPOTER_ID|CENSYS_SECRET|CENSYS_UID|CERTIFICATE_OSX_P12|CF_ORGANIZATION|CF_PROXY_HOST|channelId|CHEVERNY_TOKEN|CHROME_CLIENT_ID" pwd_in_variables3="CHROME_CLIENT_SECRET|CHROME_EXTENSION_ID|CHROME_REFRESH_TOKEN|CI_DEPLOY_USER|CI_NAME|CI_PROJECT_NAMESPACE|CI_PROJECT_URL|CI_REGISTRY_USER|CI_SERVER_NAME|CI_USER_TOKEN|CLAIMR_DATABASE|CLAIMR_DB|CLAIMR_SUPERUSER|CLAIMR_TOKEN|CLIENT_ID|CLIENT_SECRET|CLI_E2E_CMA_TOKEN|CLI_E2E_ORG_ID|CLOUDAMQP_URL|CLOUDANT_APPLIANCE_DATABASE|CLOUDANT_ARCHIVED_DATABASE|CLOUDANT_AUDITED_DATABASE|CLOUDANT_DATABASE|CLOUDANT_ORDER_DATABASE|CLOUDANT_PARSED_DATABASE|CLOUDANT_PROCESSED_DATABASE|CLOUDANT_SERVICE_DATABASE|CLOUDFLARE_API_KEY|CLOUDFLARE_AUTH_EMAIL|CLOUDFLARE_AUTH_KEY|CLOUDFLARE_EMAIL|CLOUDFLARE_ZONE_ID|CLOUDINARY_URL|CLOUDINARY_URL_EU|CLOUDINARY_URL_STAGING|CLOUD_API_KEY|CLUSTER_NAME|CLU_REPO_URL|CLU_SSH_PRIVATE_KEY_BASE64|CN_ACCESS_KEY_ID|CN_SECRET_ACCESS_KEY|COCOAPODS_TRUNK_EMAIL|COCOAPODS_TRUNK_TOKEN|CODACY_PROJECT_TOKEN|CODECLIMATE_REPO_TOKEN|CODECOV_TOKEN|coding_token|CONEKTA_APIKEY|CONFIGURATION_PROFILE_SID|CONFIGURATION_PROFILE_SID_P2P|CONFIGURATION_PROFILE_SID_SFU|CONSUMERKEY|CONSUMER_KEY|CONTENTFUL_ACCESS_TOKEN|CONTENTFUL_CMA_TEST_TOKEN|CONTENTFUL_INTEGRATION_MANAGEMENT_TOKEN|CONTENTFUL_INTEGRATION_SOURCE_SPACE|CONTENTFUL_MANAGEMENT_API_ACCESS_TOKEN|CONTENTFUL_MANAGEMENT_API_ACCESS_TOKEN_NEW|CONTENTFUL_ORGANIZATION" @@ -488,7 +489,7 @@ GREP_DOCKER_SOCK_INFOS="Architecture|OSType|Name|DockerRootDir|NCPU|OperatingSys GREP_DOCKER_SOCK_INFOS_IGNORE="IndexConfig" GREP_IGNORE_MOUNTS="/ /|/cgroup|/var/lib/docker/|/null | proc proc |/dev/console|docker.sock" -INT_HIDDEN_FILES=".rhosts|.irssi|.keyring|.cer|.jks|.service|.vnc|.p12|.ftpconfig|.crt|.lesshst|.git-credentials|._history|.sudo_as_admin_successful|.timer|.gnupg|.gpg|.sqlite3|.recently-used.xbel|.erlang.cookie|.socket|.pem|.cloudflared|.bashrc|.git|.pypirc|.csr|.plan|.rdg|.ovpn|.pfx|.gitconfig|.svn|.der|.sqlite|.google_authenticator|.viminfo|.bluemix|.htpasswd|.kdbx|.mozilla|.env|.vault-token|.ldaprc|.swp|.msmtprc|.profile|.github|.pgp|.keystore|.db|.k5login|.key" +INT_HIDDEN_FILES=".gpg|.crt|.ovpn|.env|.lesshst|.sudo_as_admin_successful|.k5login|.sqlite3|.google_authenticator|.ftpconfig|.sqlite|.pfx|.keyring|.timer|.svn|.service|.gitconfig|.kdbx|.der|.git|.socket|.swp|.htpasswd|.ldaprc|.profile|.vnc|.git-credentials|.keystore|.pem|.pgp|.pypirc|.rhosts|.jks|.bashrc|.cloudflared|.cer|.msmtprc|.irssi|.mozilla|.github|._history.|.bluemix|.csr|.plan|.recently-used.xbel|.p12|.vault-token|.key|.erlang.cookie|.gnupg|.db|.rdg|.viminfo" ########################################### #---------) Checks before start (---------# @@ -1044,130 +1045,131 @@ if [ "`echo $CHECKS | grep ProCronSrvcsTmrsSocks`" ] || [ "`echo $CHECKS | grep CONT_THREADS=0 # FIND ALL KNOWN INTERESTING SOFTWARE FILES - FIND_DIR_APPLICATIONS=`eval_bckgrd "find /applications -type d -name \"seeddms*\" -o -name \".irssi\" -o -name \"logstash\" -o -name \"filelliza\" -o -name \".svn\" -o -name \"bind\" -o -name \".cloudflared\" -o -name \"couchdb\" -o -name \".vnc\" -o -name \"sites-enabled\" -o -name \"neo4j\" -o -name \"ldap\" -o -name \"keyrings\" -o -name \"mysql\" -o -name \".bluemix\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` - FIND_DIR_BIN=`eval_bckgrd "find /bin -type d -name \"seeddms*\" -o -name \".irssi\" -o -name \"logstash\" -o -name \"filelliza\" -o -name \".svn\" -o -name \"bind\" -o -name \".cloudflared\" -o -name \"couchdb\" -o -name \".vnc\" -o -name \"sites-enabled\" -o -name \"neo4j\" -o -name \"ldap\" -o -name \"keyrings\" -o -name \"mysql\" -o -name \".bluemix\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` - FIND_DIR_CACHE=`eval_bckgrd "find /.cache -type d -name \"seeddms*\" -o -name \".irssi\" -o -name \"logstash\" -o -name \"filelliza\" -o -name \".svn\" -o -name \"bind\" -o -name \".cloudflared\" -o -name \"couchdb\" -o -name \".vnc\" -o -name \"sites-enabled\" -o -name \"neo4j\" -o -name \"ldap\" -o -name \"keyrings\" -o -name \"mysql\" -o -name \".bluemix\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` - FIND_DIR_CDROM=`eval_bckgrd "find /cdrom -type d -name \"seeddms*\" -o -name \".irssi\" -o -name \"logstash\" -o -name \"filelliza\" -o -name \".svn\" -o -name \"bind\" -o -name \".cloudflared\" -o -name \"couchdb\" -o -name \".vnc\" -o -name \"sites-enabled\" -o -name \"neo4j\" -o -name \"ldap\" -o -name \"keyrings\" -o -name \"mysql\" -o -name \".bluemix\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` - FIND_DIR_ETC=`eval_bckgrd "find /etc -type d -name \"seeddms*\" -o -name \".irssi\" -o -name \"logstash\" -o -name \"filelliza\" -o -name \".svn\" -o -name \"bind\" -o -name \".cloudflared\" -o -name \"couchdb\" -o -name \".vnc\" -o -name \"sites-enabled\" -o -name \"neo4j\" -o -name \"ldap\" -o -name \"keyrings\" -o -name \"mysql\" -o -name \"system.d\" -o -name \".bluemix\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` - FIND_DIR_HOMESEARCH=`eval_bckgrd "find $HOMESEARCH -type d -name \"seeddms*\" -o -name \".irssi\" -o -name \"logstash\" -o -name \"filelliza\" -o -name \".svn\" -o -name \"bind\" -o -name \".cloudflared\" -o -name \"couchdb\" -o -name \".vnc\" -o -name \"sites-enabled\" -o -name \"neo4j\" -o -name \"ldap\" -o -name \"keyrings\" -o -name \"mysql\" -o -name \".bluemix\" -o -name \".mozilla\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` - FIND_DIR_MEDIA=`eval_bckgrd "find /media -type d -name \"seeddms*\" -o -name \".irssi\" -o -name \"logstash\" -o -name \"filelliza\" -o -name \".svn\" -o -name \"bind\" -o -name \".cloudflared\" -o -name \"couchdb\" -o -name \".vnc\" -o -name \"sites-enabled\" -o -name \"neo4j\" -o -name \"ldap\" -o -name \"keyrings\" -o -name \"mysql\" -o -name \".bluemix\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` - FIND_DIR_MNT=`eval_bckgrd "find /mnt -type d -name \"seeddms*\" -o -name \".irssi\" -o -name \"logstash\" -o -name \"filelliza\" -o -name \".svn\" -o -name \"bind\" -o -name \".cloudflared\" -o -name \"couchdb\" -o -name \".vnc\" -o -name \"sites-enabled\" -o -name \"neo4j\" -o -name \"ldap\" -o -name \"keyrings\" -o -name \"mysql\" -o -name \".bluemix\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` - FIND_DIR_OPT=`eval_bckgrd "find /opt -type d -name \"seeddms*\" -o -name \".irssi\" -o -name \"logstash\" -o -name \"filelliza\" -o -name \".svn\" -o -name \"bind\" -o -name \".cloudflared\" -o -name \"couchdb\" -o -name \".vnc\" -o -name \"sites-enabled\" -o -name \"neo4j\" -o -name \"ldap\" -o -name \"keyrings\" -o -name \"mysql\" -o -name \".bluemix\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` - FIND_DIR_PRIVATE=`eval_bckgrd "find /private -type d -name \"seeddms*\" -o -name \".irssi\" -o -name \"logstash\" -o -name \"filelliza\" -o -name \".svn\" -o -name \"bind\" -o -name \".cloudflared\" -o -name \"couchdb\" -o -name \".vnc\" -o -name \"sites-enabled\" -o -name \"neo4j\" -o -name \"ldap\" -o -name \"keyrings\" -o -name \"mysql\" -o -name \".bluemix\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` - FIND_DIR_SBIN=`eval_bckgrd "find /sbin -type d -name \"seeddms*\" -o -name \".irssi\" -o -name \"logstash\" -o -name \"filelliza\" -o -name \".svn\" -o -name \"bind\" -o -name \".cloudflared\" -o -name \"couchdb\" -o -name \".vnc\" -o -name \"sites-enabled\" -o -name \"neo4j\" -o -name \"ldap\" -o -name \"keyrings\" -o -name \"mysql\" -o -name \".bluemix\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` - FIND_DIR_SNAP=`eval_bckgrd "find /snap -type d -name \"seeddms*\" -o -name \".irssi\" -o -name \"logstash\" -o -name \"filelliza\" -o -name \".svn\" -o -name \"bind\" -o -name \".cloudflared\" -o -name \"couchdb\" -o -name \".vnc\" -o -name \"sites-enabled\" -o -name \"neo4j\" -o -name \"ldap\" -o -name \"keyrings\" -o -name \"mysql\" -o -name \".bluemix\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` - FIND_DIR_SRV=`eval_bckgrd "find /srv -type d -name \"seeddms*\" -o -name \".irssi\" -o -name \"logstash\" -o -name \"filelliza\" -o -name \".svn\" -o -name \"bind\" -o -name \".cloudflared\" -o -name \"couchdb\" -o -name \".vnc\" -o -name \"sites-enabled\" -o -name \"neo4j\" -o -name \"ldap\" -o -name \"keyrings\" -o -name \"mysql\" -o -name \".bluemix\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` - FIND_DIR_TMP=`eval_bckgrd "find /tmp -type d -name \"seeddms*\" -o -name \".irssi\" -o -name \"logstash\" -o -name \"filelliza\" -o -name \".svn\" -o -name \"bind\" -o -name \".cloudflared\" -o -name \"couchdb\" -o -name \".vnc\" -o -name \"sites-enabled\" -o -name \"neo4j\" -o -name \"ldap\" -o -name \"keyrings\" -o -name \"mysql\" -o -name \".bluemix\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` - FIND_DIR_USR=`eval_bckgrd "find /usr -type d -name \"seeddms*\" -o -name \".irssi\" -o -name \"logstash\" -o -name \"filelliza\" -o -name \".svn\" -o -name \"bind\" -o -name \".cloudflared\" -o -name \"couchdb\" -o -name \".vnc\" -o -name \"sites-enabled\" -o -name \"neo4j\" -o -name \"ldap\" -o -name \"keyrings\" -o -name \"mysql\" -o -name \".bluemix\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` - FIND_DIR_VAR=`eval_bckgrd "find /var -type d -name \"seeddms*\" -o -name \".irssi\" -o -name \"logstash\" -o -name \"filelliza\" -o -name \".svn\" -o -name \"bind\" -o -name \".cloudflared\" -o -name \"couchdb\" -o -name \".vnc\" -o -name \"sites-enabled\" -o -name \"neo4j\" -o -name \"ldap\" -o -name \"keyrings\" -o -name \"mysql\" -o -name \".bluemix\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` - FIND_APPLICATIONS=`eval_bckgrd "find /applications -name \"unattended.xml\" -o -name \"ipsec.secrets\" -o -name \"gitlab.rm\" -o -name \"SAM\" -o -name \"passwd\" -o -name \"docker.sock\" -o -name \"security\" -o -name \"*.sqlite\" -o -name \"gvm-tools.conf\" -o -name \"*vnc*.txt\" -o -name \"unattend.inf\" -o -name \"security.sav\" -o -name \"*.kdbx\" -o -name \"config.php\" -o -name \"KeePass.config*\" -o -name \"SYSTEM\" -o -name \"*.cer\" -o -name \".git\" -o -name \"anaconda-ks.cfg\" -o -name \"sitemanager.xml\" -o -name \"*.gpg\" -o -name \"access_tokens.json\" -o -name \"*.db\" -o -name \"id_rsa*\" -o -name \"*.keystore\" -o -name \"postgresql.conf\" -o -name \"id_dsa*\" -o -name \"*.gnupg\" -o -name \"db.php\" -o -name \"tomcat-users.xml\" -o -name \"*.pgp\" -o -name \"access_tokens.db\" -o -name \"pagefile.sys\" -o -name \"credentials.db\" -o -name \"rsyncd.conf\" -o -name \"fastcgi_params\" -o -name \"https.conf\" -o -name \"*.sqlite3\" -o -name \"wp-config.php\" -o -name \"default.sav\" -o -name \"*.jks\" -o -name \".rhosts\" -o -name \"*vnc*.c*nf*\" -o -name \"*.rdg\" -o -name \"datasources.xml\" -o -name \"backups\" -o -name \"Dockerfile\" -o -name \"krb5.conf\" -o -name \"000-default\" -o -name \"filezilla.xml\" -o -name \"setupinfo\" -o -name \"*vnc*.ini\" -o -name \"web*.config\" -o -name \".lesshst\" -o -name \".sudo_as_admin_successful\" -o -name \"Ntds.dit\" -o -name \"mongod*.conf\" -o -name \"*.timer\" -o -name \"vault-ssh-helper.hcl\" -o -name \"*vnc*.xml\" -o -name \".*_history\" -o -name \".pypirc\" -o -name \"my.cnf\" -o -name \"*.swp\" -o -name \"unattend.txt\" -o -name \"php.ini\" -o -name \".gitconfig\" -o -name \"autologin\" -o -name \"ws_ftp.ini\" -o -name \"recentservers.xml\" -o -name \"*.socket\" -o -name \"scclient.exe\" -o -name \"TokenCache.dat\" -o -name \"storage.php\" -o -name \"*credential*\" -o -name \"AppEvent.Evt\" -o -name \".msmtprc\" -o -name \"iis6.log\" -o -name \"secrets.yml\" -o -name \"system.sav\" -o -name \"software\" -o -name \"unattend.xml\" -o -name \"FreeSSHDservice.ini\" -o -name \"rsyncd.secrets\" -o -name \"RDCMan.settings\" -o -name \"software.sav\" -o -name \"kadm5.acl\" -o -name \"credentials\" -o -name \"wcx_ftp.ini\" -o -name \"ConsoleHost_history.txt\" -o -name \"*.pem\" -o -name \"sysprep.xml\" -o -name \".bashrc\" -o -name \"*.key\" -o -name \"*.ovpn\" -o -name \"authorized_keys\" -o -name \"sites.ini\" -o -name \"docker.socket\" -o -name \"bash.exe\" -o -name \"NetSetup.log\" -o -name \"cloud.cfg\" -o -name \"mosquitto.conf\" -o -name \"KeePass.ini\" -o -name \"ftp.ini\" -o -name \".plan\" -o -name \"wsl.exe\" -o -name \"accessTokens.json\" -o -name \"appcmd.exe\" -o -name \"ftp.config\" -o -name \"printers.xml\" -o -name \"pgsql.conf\" -o -name \"autologin.conf\" -o -name \".htpasswd\" -o -name \"*.viminfo\" -o -name \"settings.php\" -o -name \"database.php\" -o -name \"my.ini\" -o -name \"SecEvent.Evt\" -o -name \"sysprep.inf\" -o -name \".k5login\" -o -name \"*.ftpconfig\" -o -name \"pg_hba.conf\" -o -name \"krb5.keytab\" -o -name \"AzureRMContext.json\" -o -name \"https-xampp.conf\" -o -name \"hosts.equiv\" -o -name \"server.xml\" -o -name \"elasticsearch.y*ml\" -o -name \"services.xml\" -o -name \"*.service\" -o -name \"azureProfile.json\" -o -name \".git-credentials\" -o -name \"*config*.php\" -o -name \"*.p12\" -o -name \".recently-used.xbel\" -o -name \".erlang.cookie\" -o -name \"authorized_hosts\" -o -name \"pgadmin*.db\" -o -name \"error.log\" -o -name \"ntuser.dat\" -o -name \"cesi.conf\" -o -name \"gitlab.yml\" -o -name \"supervisord.conf\" -o -name \"*.der\" -o -name \"redis.conf\" -o -name \"access.log\" -o -name \"snmpd.conf\" -o -name \"backup\" -o -name \"ddclient.conf\" -o -name \"docker-compose.yml\" -o -name \"scheduledtasks.xml\" -o -name \"winscp.ini\" -o -name \"*.pfx\" -o -name \"kibana.y*ml\" -o -name \"hostapd.conf\" -o -name \".google_authenticator\" -o -name \"index.dat\" -o -name \"creds*\" -o -name \"*password*\" -o -name \".env\" -o -name \".profile\" -o -name \".vault-token\" -o -name \".ldaprc\" -o -name \"groups.xml\" -o -name \"legacy_credentials.db\" -o -name \"*.crt\" -o -name \"drives.xml\" -o -name \"httpd.conf\" -o -name \".github\" -o -name \"KeePass.enforced*\" -o -name \"*.csr\" -o -name \"known_hosts\" -o -name \"setupinfo.bak\" -o -name \"*.keyring\" -o -name \"ipsec.conf\" -o -name \"ffftp.ini\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` - FIND_BIN=`eval_bckgrd "find /bin -name \"unattended.xml\" -o -name \"ipsec.secrets\" -o -name \"gitlab.rm\" -o -name \"SAM\" -o -name \"passwd\" -o -name \"docker.sock\" -o -name \"security\" -o -name \"*.sqlite\" -o -name \"gvm-tools.conf\" -o -name \"*vnc*.txt\" -o -name \"unattend.inf\" -o -name \"security.sav\" -o -name \"*.kdbx\" -o -name \"config.php\" -o -name \"KeePass.config*\" -o -name \"SYSTEM\" -o -name \"*.cer\" -o -name \".git\" -o -name \"anaconda-ks.cfg\" -o -name \"sitemanager.xml\" -o -name \"*.gpg\" -o -name \"access_tokens.json\" -o -name \"*.db\" -o -name \"id_rsa*\" -o -name \"*.keystore\" -o -name \"postgresql.conf\" -o -name \"id_dsa*\" -o -name \"*.gnupg\" -o -name \"db.php\" -o -name \"tomcat-users.xml\" -o -name \"*.pgp\" -o -name \"access_tokens.db\" -o -name \"pagefile.sys\" -o -name \"credentials.db\" -o -name \"rsyncd.conf\" -o -name \"fastcgi_params\" -o -name \"https.conf\" -o -name \"*.sqlite3\" -o -name \"wp-config.php\" -o -name \"default.sav\" -o -name \"*.jks\" -o -name \".rhosts\" -o -name \"*vnc*.c*nf*\" -o -name \"*.rdg\" -o -name \"datasources.xml\" -o -name \"backups\" -o -name \"Dockerfile\" -o -name \"krb5.conf\" -o -name \"000-default\" -o -name \"filezilla.xml\" -o -name \"setupinfo\" -o -name \"*vnc*.ini\" -o -name \"web*.config\" -o -name \".lesshst\" -o -name \".sudo_as_admin_successful\" -o -name \"Ntds.dit\" -o -name \"mongod*.conf\" -o -name \"*.timer\" -o -name \"vault-ssh-helper.hcl\" -o -name \"*vnc*.xml\" -o -name \".*_history\" -o -name \".pypirc\" -o -name \"my.cnf\" -o -name \"*.swp\" -o -name \"unattend.txt\" -o -name \"php.ini\" -o -name \".gitconfig\" -o -name \"autologin\" -o -name \"ws_ftp.ini\" -o -name \"recentservers.xml\" -o -name \"*.socket\" -o -name \"scclient.exe\" -o -name \"TokenCache.dat\" -o -name \"storage.php\" -o -name \"*credential*\" -o -name \"AppEvent.Evt\" -o -name \".msmtprc\" -o -name \"iis6.log\" -o -name \"secrets.yml\" -o -name \"system.sav\" -o -name \"software\" -o -name \"unattend.xml\" -o -name \"FreeSSHDservice.ini\" -o -name \"rsyncd.secrets\" -o -name \"RDCMan.settings\" -o -name \"software.sav\" -o -name \"kadm5.acl\" -o -name \"credentials\" -o -name \"wcx_ftp.ini\" -o -name \"ConsoleHost_history.txt\" -o -name \"*.pem\" -o -name \"sysprep.xml\" -o -name \".bashrc\" -o -name \"*.key\" -o -name \"*.ovpn\" -o -name \"authorized_keys\" -o -name \"sites.ini\" -o -name \"docker.socket\" -o -name \"bash.exe\" -o -name \"NetSetup.log\" -o -name \"cloud.cfg\" -o -name \"mosquitto.conf\" -o -name \"KeePass.ini\" -o -name \"ftp.ini\" -o -name \".plan\" -o -name \"wsl.exe\" -o -name \"accessTokens.json\" -o -name \"appcmd.exe\" -o -name \"ftp.config\" -o -name \"printers.xml\" -o -name \"pgsql.conf\" -o -name \"autologin.conf\" -o -name \".htpasswd\" -o -name \"*.viminfo\" -o -name \"settings.php\" -o -name \"database.php\" -o -name \"my.ini\" -o -name \"SecEvent.Evt\" -o -name \"sysprep.inf\" -o -name \".k5login\" -o -name \"*.ftpconfig\" -o -name \"pg_hba.conf\" -o -name \"krb5.keytab\" -o -name \"AzureRMContext.json\" -o -name \"https-xampp.conf\" -o -name \"hosts.equiv\" -o -name \"server.xml\" -o -name \"elasticsearch.y*ml\" -o -name \"services.xml\" -o -name \"*.service\" -o -name \"azureProfile.json\" -o -name \".git-credentials\" -o -name \"*config*.php\" -o -name \"*.p12\" -o -name \".recently-used.xbel\" -o -name \".erlang.cookie\" -o -name \"authorized_hosts\" -o -name \"pgadmin*.db\" -o -name \"error.log\" -o -name \"ntuser.dat\" -o -name \"cesi.conf\" -o -name \"gitlab.yml\" -o -name \"supervisord.conf\" -o -name \"*.der\" -o -name \"redis.conf\" -o -name \"access.log\" -o -name \"snmpd.conf\" -o -name \"backup\" -o -name \"ddclient.conf\" -o -name \"docker-compose.yml\" -o -name \"scheduledtasks.xml\" -o -name \"winscp.ini\" -o -name \"*.pfx\" -o -name \"kibana.y*ml\" -o -name \"hostapd.conf\" -o -name \".google_authenticator\" -o -name \"index.dat\" -o -name \"creds*\" -o -name \"*password*\" -o -name \".env\" -o -name \".profile\" -o -name \".vault-token\" -o -name \".ldaprc\" -o -name \"groups.xml\" -o -name \"legacy_credentials.db\" -o -name \"*.crt\" -o -name \"drives.xml\" -o -name \"httpd.conf\" -o -name \".github\" -o -name \"KeePass.enforced*\" -o -name \"*.csr\" -o -name \"known_hosts\" -o -name \"setupinfo.bak\" -o -name \"*.keyring\" -o -name \"ipsec.conf\" -o -name \"ffftp.ini\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` - FIND_CACHE=`eval_bckgrd "find /.cache -name \"unattended.xml\" -o -name \"ipsec.secrets\" -o -name \"gitlab.rm\" -o -name \"SAM\" -o -name \"passwd\" -o -name \"docker.sock\" -o -name \"security\" -o -name \"*.sqlite\" -o -name \"gvm-tools.conf\" -o -name \"*vnc*.txt\" -o -name \"unattend.inf\" -o -name \"security.sav\" -o -name \"*.kdbx\" -o -name \"config.php\" -o -name \"KeePass.config*\" -o -name \"SYSTEM\" -o -name \"*.cer\" -o -name \".git\" -o -name \"anaconda-ks.cfg\" -o -name \"sitemanager.xml\" -o -name \"*.gpg\" -o -name \"access_tokens.json\" -o -name \"*.db\" -o -name \"id_rsa*\" -o -name \"*.keystore\" -o -name \"postgresql.conf\" -o -name \"id_dsa*\" -o -name \"*.gnupg\" -o -name \"db.php\" -o -name \"tomcat-users.xml\" -o -name \"*.pgp\" -o -name \"access_tokens.db\" -o -name \"pagefile.sys\" -o -name \"credentials.db\" -o -name \"rsyncd.conf\" -o -name \"fastcgi_params\" -o -name \"https.conf\" -o -name \"*.sqlite3\" -o -name \"wp-config.php\" -o -name \"default.sav\" -o -name \"*.jks\" -o -name \".rhosts\" -o -name \"*vnc*.c*nf*\" -o -name \"*.rdg\" -o -name \"datasources.xml\" -o -name \"backups\" -o -name \"Dockerfile\" -o -name \"krb5.conf\" -o -name \"000-default\" -o -name \"filezilla.xml\" -o -name \"setupinfo\" -o -name \"*vnc*.ini\" -o -name \"web*.config\" -o -name \".lesshst\" -o -name \".sudo_as_admin_successful\" -o -name \"Ntds.dit\" -o -name \"mongod*.conf\" -o -name \"*.timer\" -o -name \"vault-ssh-helper.hcl\" -o -name \"*vnc*.xml\" -o -name \".*_history\" -o -name \".pypirc\" -o -name \"my.cnf\" -o -name \"*.swp\" -o -name \"unattend.txt\" -o -name \"php.ini\" -o -name \".gitconfig\" -o -name \"autologin\" -o -name \"ws_ftp.ini\" -o -name \"recentservers.xml\" -o -name \"*.socket\" -o -name \"scclient.exe\" -o -name \"TokenCache.dat\" -o -name \"storage.php\" -o -name \"*credential*\" -o -name \"AppEvent.Evt\" -o -name \".msmtprc\" -o -name \"iis6.log\" -o -name \"secrets.yml\" -o -name \"system.sav\" -o -name \"software\" -o -name \"unattend.xml\" -o -name \"FreeSSHDservice.ini\" -o -name \"rsyncd.secrets\" -o -name \"RDCMan.settings\" -o -name \"software.sav\" -o -name \"kadm5.acl\" -o -name \"credentials\" -o -name \"wcx_ftp.ini\" -o -name \"ConsoleHost_history.txt\" -o -name \"*.pem\" -o -name \"sysprep.xml\" -o -name \".bashrc\" -o -name \"*.key\" -o -name \"*.ovpn\" -o -name \"authorized_keys\" -o -name \"sites.ini\" -o -name \"docker.socket\" -o -name \"bash.exe\" -o -name \"NetSetup.log\" -o -name \"cloud.cfg\" -o -name \"mosquitto.conf\" -o -name \"KeePass.ini\" -o -name \"ftp.ini\" -o -name \".plan\" -o -name \"wsl.exe\" -o -name \"accessTokens.json\" -o -name \"appcmd.exe\" -o -name \"ftp.config\" -o -name \"printers.xml\" -o -name \"pgsql.conf\" -o -name \"autologin.conf\" -o -name \".htpasswd\" -o -name \"*.viminfo\" -o -name \"settings.php\" -o -name \"database.php\" -o -name \"my.ini\" -o -name \"SecEvent.Evt\" -o -name \"sysprep.inf\" -o -name \".k5login\" -o -name \"*.ftpconfig\" -o -name \"pg_hba.conf\" -o -name \"krb5.keytab\" -o -name \"AzureRMContext.json\" -o -name \"https-xampp.conf\" -o -name \"hosts.equiv\" -o -name \"server.xml\" -o -name \"elasticsearch.y*ml\" -o -name \"services.xml\" -o -name \"*.service\" -o -name \"azureProfile.json\" -o -name \".git-credentials\" -o -name \"*config*.php\" -o -name \"*.p12\" -o -name \".recently-used.xbel\" -o -name \".erlang.cookie\" -o -name \"authorized_hosts\" -o -name \"pgadmin*.db\" -o -name \"error.log\" -o -name \"ntuser.dat\" -o -name \"cesi.conf\" -o -name \"gitlab.yml\" -o -name \"supervisord.conf\" -o -name \"*.der\" -o -name \"redis.conf\" -o -name \"access.log\" -o -name \"snmpd.conf\" -o -name \"backup\" -o -name \"ddclient.conf\" -o -name \"docker-compose.yml\" -o -name \"scheduledtasks.xml\" -o -name \"winscp.ini\" -o -name \"*.pfx\" -o -name \"kibana.y*ml\" -o -name \"hostapd.conf\" -o -name \".google_authenticator\" -o -name \"index.dat\" -o -name \"creds*\" -o -name \"*password*\" -o -name \".env\" -o -name \".profile\" -o -name \".vault-token\" -o -name \".ldaprc\" -o -name \"groups.xml\" -o -name \"legacy_credentials.db\" -o -name \"*.crt\" -o -name \"drives.xml\" -o -name \"httpd.conf\" -o -name \".github\" -o -name \"KeePass.enforced*\" -o -name \"*.csr\" -o -name \"known_hosts\" -o -name \"setupinfo.bak\" -o -name \"*.keyring\" -o -name \"ipsec.conf\" -o -name \"ffftp.ini\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` - FIND_CDROM=`eval_bckgrd "find /cdrom -name \"unattended.xml\" -o -name \"ipsec.secrets\" -o -name \"gitlab.rm\" -o -name \"SAM\" -o -name \"passwd\" -o -name \"docker.sock\" -o -name \"security\" -o -name \"*.sqlite\" -o -name \"gvm-tools.conf\" -o -name \"*vnc*.txt\" -o -name \"unattend.inf\" -o -name \"security.sav\" -o -name \"*.kdbx\" -o -name \"config.php\" -o -name \"KeePass.config*\" -o -name \"SYSTEM\" -o -name \"*.cer\" -o -name \".git\" -o -name \"anaconda-ks.cfg\" -o -name \"sitemanager.xml\" -o -name \"*.gpg\" -o -name \"access_tokens.json\" -o -name \"*.db\" -o -name \"id_rsa*\" -o -name \"*.keystore\" -o -name \"postgresql.conf\" -o -name \"id_dsa*\" -o -name \"*.gnupg\" -o -name \"db.php\" -o -name \"tomcat-users.xml\" -o -name \"*.pgp\" -o -name \"access_tokens.db\" -o -name \"pagefile.sys\" -o -name \"credentials.db\" -o -name \"rsyncd.conf\" -o -name \"fastcgi_params\" -o -name \"https.conf\" -o -name \"*.sqlite3\" -o -name \"wp-config.php\" -o -name \"default.sav\" -o -name \"*.jks\" -o -name \".rhosts\" -o -name \"*vnc*.c*nf*\" -o -name \"*.rdg\" -o -name \"datasources.xml\" -o -name \"backups\" -o -name \"Dockerfile\" -o -name \"krb5.conf\" -o -name \"000-default\" -o -name \"filezilla.xml\" -o -name \"setupinfo\" -o -name \"*vnc*.ini\" -o -name \"web*.config\" -o -name \".lesshst\" -o -name \".sudo_as_admin_successful\" -o -name \"Ntds.dit\" -o -name \"mongod*.conf\" -o -name \"*.timer\" -o -name \"vault-ssh-helper.hcl\" -o -name \"*vnc*.xml\" -o -name \".*_history\" -o -name \".pypirc\" -o -name \"my.cnf\" -o -name \"*.swp\" -o -name \"unattend.txt\" -o -name \"php.ini\" -o -name \".gitconfig\" -o -name \"autologin\" -o -name \"ws_ftp.ini\" -o -name \"recentservers.xml\" -o -name \"*.socket\" -o -name \"scclient.exe\" -o -name \"TokenCache.dat\" -o -name \"storage.php\" -o -name \"*credential*\" -o -name \"AppEvent.Evt\" -o -name \".msmtprc\" -o -name \"iis6.log\" -o -name \"secrets.yml\" -o -name \"system.sav\" -o -name \"software\" -o -name \"unattend.xml\" -o -name \"FreeSSHDservice.ini\" -o -name \"rsyncd.secrets\" -o -name \"RDCMan.settings\" -o -name \"software.sav\" -o -name \"kadm5.acl\" -o -name \"credentials\" -o -name \"wcx_ftp.ini\" -o -name \"ConsoleHost_history.txt\" -o -name \"*.pem\" -o -name \"sysprep.xml\" -o -name \".bashrc\" -o -name \"*.key\" -o -name \"*.ovpn\" -o -name \"authorized_keys\" -o -name \"sites.ini\" -o -name \"docker.socket\" -o -name \"bash.exe\" -o -name \"NetSetup.log\" -o -name \"cloud.cfg\" -o -name \"mosquitto.conf\" -o -name \"KeePass.ini\" -o -name \"ftp.ini\" -o -name \".plan\" -o -name \"wsl.exe\" -o -name \"accessTokens.json\" -o -name \"appcmd.exe\" -o -name \"ftp.config\" -o -name \"printers.xml\" -o -name \"pgsql.conf\" -o -name \"autologin.conf\" -o -name \".htpasswd\" -o -name \"*.viminfo\" -o -name \"settings.php\" -o -name \"database.php\" -o -name \"my.ini\" -o -name \"SecEvent.Evt\" -o -name \"sysprep.inf\" -o -name \".k5login\" -o -name \"*.ftpconfig\" -o -name \"pg_hba.conf\" -o -name \"krb5.keytab\" -o -name \"AzureRMContext.json\" -o -name \"https-xampp.conf\" -o -name \"hosts.equiv\" -o -name \"server.xml\" -o -name \"elasticsearch.y*ml\" -o -name \"services.xml\" -o -name \"*.service\" -o -name \"azureProfile.json\" -o -name \".git-credentials\" -o -name \"*config*.php\" -o -name \"*.p12\" -o -name \".recently-used.xbel\" -o -name \".erlang.cookie\" -o -name \"authorized_hosts\" -o -name \"pgadmin*.db\" -o -name \"error.log\" -o -name \"ntuser.dat\" -o -name \"cesi.conf\" -o -name \"gitlab.yml\" -o -name \"supervisord.conf\" -o -name \"*.der\" -o -name \"redis.conf\" -o -name \"access.log\" -o -name \"snmpd.conf\" -o -name \"backup\" -o -name \"ddclient.conf\" -o -name \"docker-compose.yml\" -o -name \"scheduledtasks.xml\" -o -name \"winscp.ini\" -o -name \"*.pfx\" -o -name \"kibana.y*ml\" -o -name \"hostapd.conf\" -o -name \".google_authenticator\" -o -name \"index.dat\" -o -name \"creds*\" -o -name \"*password*\" -o -name \".env\" -o -name \".profile\" -o -name \".vault-token\" -o -name \".ldaprc\" -o -name \"groups.xml\" -o -name \"legacy_credentials.db\" -o -name \"*.crt\" -o -name \"drives.xml\" -o -name \"httpd.conf\" -o -name \".github\" -o -name \"KeePass.enforced*\" -o -name \"*.csr\" -o -name \"known_hosts\" -o -name \"setupinfo.bak\" -o -name \"*.keyring\" -o -name \"ipsec.conf\" -o -name \"ffftp.ini\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` - FIND_ETC=`eval_bckgrd "find /etc -name \"unattended.xml\" -o -name \"ipsec.secrets\" -o -name \"gitlab.rm\" -o -name \"SAM\" -o -name \"passwd\" -o -name \"docker.sock\" -o -name \"security\" -o -name \"*.sqlite\" -o -name \"gvm-tools.conf\" -o -name \"*vnc*.txt\" -o -name \"unattend.inf\" -o -name \"security.sav\" -o -name \"*.kdbx\" -o -name \"config.php\" -o -name \"KeePass.config*\" -o -name \"SYSTEM\" -o -name \"*.cer\" -o -name \".git\" -o -name \"anaconda-ks.cfg\" -o -name \"sitemanager.xml\" -o -name \"*.gpg\" -o -name \"access_tokens.json\" -o -name \"*.db\" -o -name \"id_rsa*\" -o -name \"*.keystore\" -o -name \"postgresql.conf\" -o -name \"id_dsa*\" -o -name \"*.gnupg\" -o -name \"db.php\" -o -name \"tomcat-users.xml\" -o -name \"*.pgp\" -o -name \"access_tokens.db\" -o -name \"pagefile.sys\" -o -name \"credentials.db\" -o -name \"rsyncd.conf\" -o -name \"fastcgi_params\" -o -name \"https.conf\" -o -name \"*.sqlite3\" -o -name \"wp-config.php\" -o -name \"default.sav\" -o -name \"*.jks\" -o -name \".rhosts\" -o -name \"*vnc*.c*nf*\" -o -name \"*.rdg\" -o -name \"datasources.xml\" -o -name \"backups\" -o -name \"Dockerfile\" -o -name \"krb5.conf\" -o -name \"000-default\" -o -name \"filezilla.xml\" -o -name \"setupinfo\" -o -name \"*vnc*.ini\" -o -name \"web*.config\" -o -name \".lesshst\" -o -name \".sudo_as_admin_successful\" -o -name \"Ntds.dit\" -o -name \"mongod*.conf\" -o -name \"*.timer\" -o -name \"vault-ssh-helper.hcl\" -o -name \"*vnc*.xml\" -o -name \".*_history\" -o -name \".pypirc\" -o -name \"my.cnf\" -o -name \"*.swp\" -o -name \"unattend.txt\" -o -name \"php.ini\" -o -name \".gitconfig\" -o -name \"autologin\" -o -name \"ws_ftp.ini\" -o -name \"recentservers.xml\" -o -name \"*.socket\" -o -name \"scclient.exe\" -o -name \"TokenCache.dat\" -o -name \"storage.php\" -o -name \"*credential*\" -o -name \"AppEvent.Evt\" -o -name \".msmtprc\" -o -name \"iis6.log\" -o -name \"secrets.yml\" -o -name \"system.sav\" -o -name \"software\" -o -name \"unattend.xml\" -o -name \"FreeSSHDservice.ini\" -o -name \"rsyncd.secrets\" -o -name \"RDCMan.settings\" -o -name \"*knockd*\" -o -name \"software.sav\" -o -name \"kadm5.acl\" -o -name \"credentials\" -o -name \"wcx_ftp.ini\" -o -name \"ConsoleHost_history.txt\" -o -name \"*.pem\" -o -name \"sysprep.xml\" -o -name \".bashrc\" -o -name \"*.key\" -o -name \"*.ovpn\" -o -name \"authorized_keys\" -o -name \"sites.ini\" -o -name \"docker.socket\" -o -name \"bash.exe\" -o -name \"NetSetup.log\" -o -name \"cloud.cfg\" -o -name \"mosquitto.conf\" -o -name \"KeePass.ini\" -o -name \"ftp.ini\" -o -name \".plan\" -o -name \"wsl.exe\" -o -name \"accessTokens.json\" -o -name \"appcmd.exe\" -o -name \"ftp.config\" -o -name \"printers.xml\" -o -name \"pgsql.conf\" -o -name \"autologin.conf\" -o -name \".htpasswd\" -o -name \"*.viminfo\" -o -name \"settings.php\" -o -name \"database.php\" -o -name \"my.ini\" -o -name \"SecEvent.Evt\" -o -name \"sysprep.inf\" -o -name \".k5login\" -o -name \"*.ftpconfig\" -o -name \"pg_hba.conf\" -o -name \"krb5.keytab\" -o -name \"AzureRMContext.json\" -o -name \"https-xampp.conf\" -o -name \"hosts.equiv\" -o -name \"server.xml\" -o -name \"elasticsearch.y*ml\" -o -name \"services.xml\" -o -name \"*.service\" -o -name \"azureProfile.json\" -o -name \".git-credentials\" -o -name \"*config*.php\" -o -name \"*.p12\" -o -name \".recently-used.xbel\" -o -name \".erlang.cookie\" -o -name \"authorized_hosts\" -o -name \"pgadmin*.db\" -o -name \"error.log\" -o -name \"ntuser.dat\" -o -name \"cesi.conf\" -o -name \"gitlab.yml\" -o -name \"supervisord.conf\" -o -name \"*.der\" -o -name \"redis.conf\" -o -name \"access.log\" -o -name \"snmpd.conf\" -o -name \"backup\" -o -name \"ddclient.conf\" -o -name \"docker-compose.yml\" -o -name \"scheduledtasks.xml\" -o -name \"winscp.ini\" -o -name \"*.pfx\" -o -name \"kibana.y*ml\" -o -name \"hostapd.conf\" -o -name \".google_authenticator\" -o -name \"index.dat\" -o -name \"creds*\" -o -name \"*password*\" -o -name \".env\" -o -name \".profile\" -o -name \".vault-token\" -o -name \".ldaprc\" -o -name \"groups.xml\" -o -name \"legacy_credentials.db\" -o -name \"*.crt\" -o -name \"drives.xml\" -o -name \"httpd.conf\" -o -name \".github\" -o -name \"KeePass.enforced*\" -o -name \"*.csr\" -o -name \"known_hosts\" -o -name \"setupinfo.bak\" -o -name \"*.keyring\" -o -name \"ipsec.conf\" -o -name \"ffftp.ini\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` - FIND_HOMESEARCH=`eval_bckgrd "find $HOMESEARCH -name \"unattended.xml\" -o -name \"ipsec.secrets\" -o -name \"gitlab.rm\" -o -name \"SAM\" -o -name \"passwd\" -o -name \"docker.sock\" -o -name \"security\" -o -name \"*.sqlite\" -o -name \"gvm-tools.conf\" -o -name \"*vnc*.txt\" -o -name \"unattend.inf\" -o -name \"security.sav\" -o -name \"ssh*config\" -o -name \"config.php\" -o -name \"*.kdbx\" -o -name \"KeePass.config*\" -o -name \"SYSTEM\" -o -name \"*.cer\" -o -name \".git\" -o -name \"anaconda-ks.cfg\" -o -name \"sitemanager.xml\" -o -name \"*.gpg\" -o -name \"access_tokens.json\" -o -name \"*.db\" -o -name \"id_rsa*\" -o -name \"*.keystore\" -o -name \"postgresql.conf\" -o -name \"id_dsa*\" -o -name \"*.gnupg\" -o -name \"db.php\" -o -name \"tomcat-users.xml\" -o -name \"*.pgp\" -o -name \"access_tokens.db\" -o -name \"pagefile.sys\" -o -name \"credentials.db\" -o -name \"rsyncd.conf\" -o -name \"google-chrome\" -o -name \"fastcgi_params\" -o -name \"https.conf\" -o -name \"*.sqlite3\" -o -name \"wp-config.php\" -o -name \"default.sav\" -o -name \"*.jks\" -o -name \".rhosts\" -o -name \"*vnc*.c*nf*\" -o -name \"*.rdg\" -o -name \"datasources.xml\" -o -name \"backups\" -o -name \"Dockerfile\" -o -name \"krb5.conf\" -o -name \"000-default\" -o -name \"filezilla.xml\" -o -name \"setupinfo\" -o -name \"*vnc*.ini\" -o -name \"web*.config\" -o -name \".lesshst\" -o -name \".sudo_as_admin_successful\" -o -name \"Ntds.dit\" -o -name \"mongod*.conf\" -o -name \"*.timer\" -o -name \"vault-ssh-helper.hcl\" -o -name \"*vnc*.xml\" -o -name \".*_history\" -o -name \".pypirc\" -o -name \"my.cnf\" -o -name \"*.swp\" -o -name \"unattend.txt\" -o -name \"php.ini\" -o -name \".gitconfig\" -o -name \"autologin\" -o -name \"ws_ftp.ini\" -o -name \"recentservers.xml\" -o -name \"*.socket\" -o -name \"scclient.exe\" -o -name \"TokenCache.dat\" -o -name \"storage.php\" -o -name \"*credential*\" -o -name \"AppEvent.Evt\" -o -name \".msmtprc\" -o -name \"iis6.log\" -o -name \"secrets.yml\" -o -name \"system.sav\" -o -name \"software\" -o -name \"unattend.xml\" -o -name \"FreeSSHDservice.ini\" -o -name \"rsyncd.secrets\" -o -name \"RDCMan.settings\" -o -name \"software.sav\" -o -name \"kadm5.acl\" -o -name \"credentials\" -o -name \"wcx_ftp.ini\" -o -name \"ConsoleHost_history.txt\" -o -name \"*.pem\" -o -name \"sysprep.xml\" -o -name \".bashrc\" -o -name \"*.key\" -o -name \"*.ovpn\" -o -name \"authorized_keys\" -o -name \"sites.ini\" -o -name \"docker.socket\" -o -name \"bash.exe\" -o -name \"NetSetup.log\" -o -name \"cloud.cfg\" -o -name \"mosquitto.conf\" -o -name \"KeePass.ini\" -o -name \"ftp.ini\" -o -name \".plan\" -o -name \"wsl.exe\" -o -name \"accessTokens.json\" -o -name \"appcmd.exe\" -o -name \"ftp.config\" -o -name \"printers.xml\" -o -name \"pgsql.conf\" -o -name \"autologin.conf\" -o -name \".htpasswd\" -o -name \"*.viminfo\" -o -name \"settings.php\" -o -name \"database.php\" -o -name \"my.ini\" -o -name \"SecEvent.Evt\" -o -name \"sysprep.inf\" -o -name \".k5login\" -o -name \"*.ftpconfig\" -o -name \"pg_hba.conf\" -o -name \"krb5.keytab\" -o -name \"AzureRMContext.json\" -o -name \"https-xampp.conf\" -o -name \"hosts.equiv\" -o -name \"server.xml\" -o -name \"elasticsearch.y*ml\" -o -name \"services.xml\" -o -name \"*.service\" -o -name \"azureProfile.json\" -o -name \".git-credentials\" -o -name \"*config*.php\" -o -name \"*.p12\" -o -name \".recently-used.xbel\" -o -name \".erlang.cookie\" -o -name \"authorized_hosts\" -o -name \"pgadmin*.db\" -o -name \"error.log\" -o -name \"ntuser.dat\" -o -name \"cesi.conf\" -o -name \"gitlab.yml\" -o -name \"supervisord.conf\" -o -name \"*.der\" -o -name \"redis.conf\" -o -name \"access.log\" -o -name \"snmpd.conf\" -o -name \"backup\" -o -name \"ddclient.conf\" -o -name \"docker-compose.yml\" -o -name \"scheduledtasks.xml\" -o -name \"winscp.ini\" -o -name \"*.pfx\" -o -name \"kibana.y*ml\" -o -name \"hostapd.conf\" -o -name \".google_authenticator\" -o -name \"index.dat\" -o -name \"creds*\" -o -name \"*password*\" -o -name \".env\" -o -name \".profile\" -o -name \".vault-token\" -o -name \".ldaprc\" -o -name \"groups.xml\" -o -name \"legacy_credentials.db\" -o -name \"*.crt\" -o -name \"drives.xml\" -o -name \"httpd.conf\" -o -name \".github\" -o -name \"KeePass.enforced*\" -o -name \"*.csr\" -o -name \"known_hosts\" -o -name \"setupinfo.bak\" -o -name \"*.keyring\" -o -name \"ipsec.conf\" -o -name \"ffftp.ini\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` - FIND_LIB=`eval_bckgrd "find /lib -name \"*.service\" -o -name \"*.socket\" -o -name \"*.timer\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` - FIND_LIB32=`eval_bckgrd "find /lib32 -name \"*.service\" -o -name \"*.socket\" -o -name \"*.timer\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` - FIND_LIB64=`eval_bckgrd "find /lib64 -name \"*.service\" -o -name \"*.socket\" -o -name \"*.timer\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` - FIND_MEDIA=`eval_bckgrd "find /media -name \"unattended.xml\" -o -name \"ipsec.secrets\" -o -name \"gitlab.rm\" -o -name \"SAM\" -o -name \"passwd\" -o -name \"docker.sock\" -o -name \"security\" -o -name \"*.sqlite\" -o -name \"gvm-tools.conf\" -o -name \"*vnc*.txt\" -o -name \"unattend.inf\" -o -name \"security.sav\" -o -name \"*.kdbx\" -o -name \"config.php\" -o -name \"KeePass.config*\" -o -name \"SYSTEM\" -o -name \"*.cer\" -o -name \".git\" -o -name \"anaconda-ks.cfg\" -o -name \"sitemanager.xml\" -o -name \"*.gpg\" -o -name \"access_tokens.json\" -o -name \"*.db\" -o -name \"id_rsa*\" -o -name \"*.keystore\" -o -name \"postgresql.conf\" -o -name \"id_dsa*\" -o -name \"*.gnupg\" -o -name \"db.php\" -o -name \"tomcat-users.xml\" -o -name \"*.pgp\" -o -name \"access_tokens.db\" -o -name \"pagefile.sys\" -o -name \"credentials.db\" -o -name \"rsyncd.conf\" -o -name \"fastcgi_params\" -o -name \"https.conf\" -o -name \"*.sqlite3\" -o -name \"wp-config.php\" -o -name \"default.sav\" -o -name \"*.jks\" -o -name \".rhosts\" -o -name \"*vnc*.c*nf*\" -o -name \"*.rdg\" -o -name \"datasources.xml\" -o -name \"backups\" -o -name \"Dockerfile\" -o -name \"krb5.conf\" -o -name \"000-default\" -o -name \"filezilla.xml\" -o -name \"setupinfo\" -o -name \"*vnc*.ini\" -o -name \"web*.config\" -o -name \".lesshst\" -o -name \".sudo_as_admin_successful\" -o -name \"Ntds.dit\" -o -name \"mongod*.conf\" -o -name \"*.timer\" -o -name \"vault-ssh-helper.hcl\" -o -name \"*vnc*.xml\" -o -name \".*_history\" -o -name \".pypirc\" -o -name \"my.cnf\" -o -name \"*.swp\" -o -name \"unattend.txt\" -o -name \"php.ini\" -o -name \".gitconfig\" -o -name \"autologin\" -o -name \"ws_ftp.ini\" -o -name \"recentservers.xml\" -o -name \"*.socket\" -o -name \"scclient.exe\" -o -name \"TokenCache.dat\" -o -name \"storage.php\" -o -name \"*credential*\" -o -name \"AppEvent.Evt\" -o -name \".msmtprc\" -o -name \"iis6.log\" -o -name \"secrets.yml\" -o -name \"system.sav\" -o -name \"software\" -o -name \"unattend.xml\" -o -name \"FreeSSHDservice.ini\" -o -name \"rsyncd.secrets\" -o -name \"RDCMan.settings\" -o -name \"software.sav\" -o -name \"kadm5.acl\" -o -name \"credentials\" -o -name \"wcx_ftp.ini\" -o -name \"ConsoleHost_history.txt\" -o -name \"*.pem\" -o -name \"sysprep.xml\" -o -name \".bashrc\" -o -name \"*.key\" -o -name \"*.ovpn\" -o -name \"authorized_keys\" -o -name \"sites.ini\" -o -name \"docker.socket\" -o -name \"bash.exe\" -o -name \"NetSetup.log\" -o -name \"cloud.cfg\" -o -name \"mosquitto.conf\" -o -name \"KeePass.ini\" -o -name \"ftp.ini\" -o -name \".plan\" -o -name \"wsl.exe\" -o -name \"accessTokens.json\" -o -name \"appcmd.exe\" -o -name \"ftp.config\" -o -name \"printers.xml\" -o -name \"pgsql.conf\" -o -name \"autologin.conf\" -o -name \".htpasswd\" -o -name \"*.viminfo\" -o -name \"settings.php\" -o -name \"database.php\" -o -name \"my.ini\" -o -name \"SecEvent.Evt\" -o -name \"sysprep.inf\" -o -name \".k5login\" -o -name \"*.ftpconfig\" -o -name \"pg_hba.conf\" -o -name \"krb5.keytab\" -o -name \"AzureRMContext.json\" -o -name \"https-xampp.conf\" -o -name \"hosts.equiv\" -o -name \"server.xml\" -o -name \"elasticsearch.y*ml\" -o -name \"services.xml\" -o -name \"*.service\" -o -name \"azureProfile.json\" -o -name \".git-credentials\" -o -name \"*config*.php\" -o -name \"*.p12\" -o -name \".recently-used.xbel\" -o -name \".erlang.cookie\" -o -name \"authorized_hosts\" -o -name \"pgadmin*.db\" -o -name \"error.log\" -o -name \"ntuser.dat\" -o -name \"cesi.conf\" -o -name \"gitlab.yml\" -o -name \"supervisord.conf\" -o -name \"*.der\" -o -name \"redis.conf\" -o -name \"access.log\" -o -name \"snmpd.conf\" -o -name \"backup\" -o -name \"ddclient.conf\" -o -name \"docker-compose.yml\" -o -name \"scheduledtasks.xml\" -o -name \"winscp.ini\" -o -name \"*.pfx\" -o -name \"kibana.y*ml\" -o -name \"hostapd.conf\" -o -name \".google_authenticator\" -o -name \"index.dat\" -o -name \"creds*\" -o -name \"*password*\" -o -name \".env\" -o -name \".profile\" -o -name \".vault-token\" -o -name \".ldaprc\" -o -name \"groups.xml\" -o -name \"legacy_credentials.db\" -o -name \"*.crt\" -o -name \"drives.xml\" -o -name \"httpd.conf\" -o -name \".github\" -o -name \"KeePass.enforced*\" -o -name \"*.csr\" -o -name \"known_hosts\" -o -name \"setupinfo.bak\" -o -name \"*.keyring\" -o -name \"ipsec.conf\" -o -name \"ffftp.ini\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` - FIND_MNT=`eval_bckgrd "find /mnt -name \"unattended.xml\" -o -name \"ipsec.secrets\" -o -name \"gitlab.rm\" -o -name \"SAM\" -o -name \"passwd\" -o -name \"docker.sock\" -o -name \"security\" -o -name \"*.sqlite\" -o -name \"gvm-tools.conf\" -o -name \"*vnc*.txt\" -o -name \"unattend.inf\" -o -name \"security.sav\" -o -name \"*.kdbx\" -o -name \"config.php\" -o -name \"KeePass.config*\" -o -name \"SYSTEM\" -o -name \"*.cer\" -o -name \".git\" -o -name \"anaconda-ks.cfg\" -o -name \"sitemanager.xml\" -o -name \"*.gpg\" -o -name \"access_tokens.json\" -o -name \"*.db\" -o -name \"id_rsa*\" -o -name \"*.keystore\" -o -name \"postgresql.conf\" -o -name \"id_dsa*\" -o -name \"*.gnupg\" -o -name \"db.php\" -o -name \"tomcat-users.xml\" -o -name \"*.pgp\" -o -name \"access_tokens.db\" -o -name \"pagefile.sys\" -o -name \"credentials.db\" -o -name \"rsyncd.conf\" -o -name \"fastcgi_params\" -o -name \"https.conf\" -o -name \"*.sqlite3\" -o -name \"wp-config.php\" -o -name \"default.sav\" -o -name \"*.jks\" -o -name \".rhosts\" -o -name \"*vnc*.c*nf*\" -o -name \"*.rdg\" -o -name \"datasources.xml\" -o -name \"backups\" -o -name \"Dockerfile\" -o -name \"krb5.conf\" -o -name \"000-default\" -o -name \"filezilla.xml\" -o -name \"setupinfo\" -o -name \"*vnc*.ini\" -o -name \"web*.config\" -o -name \".lesshst\" -o -name \".sudo_as_admin_successful\" -o -name \"Ntds.dit\" -o -name \"mongod*.conf\" -o -name \"*.timer\" -o -name \"vault-ssh-helper.hcl\" -o -name \"*vnc*.xml\" -o -name \".*_history\" -o -name \".pypirc\" -o -name \"my.cnf\" -o -name \"*.swp\" -o -name \"unattend.txt\" -o -name \"php.ini\" -o -name \".gitconfig\" -o -name \"autologin\" -o -name \"ws_ftp.ini\" -o -name \"recentservers.xml\" -o -name \"*.socket\" -o -name \"scclient.exe\" -o -name \"TokenCache.dat\" -o -name \"storage.php\" -o -name \"*credential*\" -o -name \"AppEvent.Evt\" -o -name \".msmtprc\" -o -name \"iis6.log\" -o -name \"secrets.yml\" -o -name \"system.sav\" -o -name \"software\" -o -name \"unattend.xml\" -o -name \"FreeSSHDservice.ini\" -o -name \"rsyncd.secrets\" -o -name \"RDCMan.settings\" -o -name \"sess_*\" -o -name \"software.sav\" -o -name \"kadm5.acl\" -o -name \"credentials\" -o -name \"wcx_ftp.ini\" -o -name \"ConsoleHost_history.txt\" -o -name \"*.pem\" -o -name \"sysprep.xml\" -o -name \".bashrc\" -o -name \"*.key\" -o -name \"*.ovpn\" -o -name \"authorized_keys\" -o -name \"sites.ini\" -o -name \"docker.socket\" -o -name \"bash.exe\" -o -name \"NetSetup.log\" -o -name \"cloud.cfg\" -o -name \"mosquitto.conf\" -o -name \"KeePass.ini\" -o -name \"ftp.ini\" -o -name \".plan\" -o -name \"wsl.exe\" -o -name \"accessTokens.json\" -o -name \"appcmd.exe\" -o -name \"ftp.config\" -o -name \"printers.xml\" -o -name \"pgsql.conf\" -o -name \"autologin.conf\" -o -name \".htpasswd\" -o -name \"*.viminfo\" -o -name \"settings.php\" -o -name \"database.php\" -o -name \"my.ini\" -o -name \"SecEvent.Evt\" -o -name \"sysprep.inf\" -o -name \".k5login\" -o -name \"*.ftpconfig\" -o -name \"pg_hba.conf\" -o -name \"krb5.keytab\" -o -name \"AzureRMContext.json\" -o -name \"https-xampp.conf\" -o -name \"hosts.equiv\" -o -name \"server.xml\" -o -name \"elasticsearch.y*ml\" -o -name \"services.xml\" -o -name \"*.service\" -o -name \"azureProfile.json\" -o -name \".git-credentials\" -o -name \"*config*.php\" -o -name \"*.p12\" -o -name \".recently-used.xbel\" -o -name \".erlang.cookie\" -o -name \"authorized_hosts\" -o -name \"pgadmin*.db\" -o -name \"error.log\" -o -name \"ntuser.dat\" -o -name \"cesi.conf\" -o -name \"gitlab.yml\" -o -name \"supervisord.conf\" -o -name \"*.der\" -o -name \"redis.conf\" -o -name \"access.log\" -o -name \"snmpd.conf\" -o -name \"backup\" -o -name \"ddclient.conf\" -o -name \"docker-compose.yml\" -o -name \"scheduledtasks.xml\" -o -name \"winscp.ini\" -o -name \"*.pfx\" -o -name \"kibana.y*ml\" -o -name \"hostapd.conf\" -o -name \".google_authenticator\" -o -name \"index.dat\" -o -name \"creds*\" -o -name \"*password*\" -o -name \".env\" -o -name \".profile\" -o -name \".vault-token\" -o -name \".ldaprc\" -o -name \"groups.xml\" -o -name \"legacy_credentials.db\" -o -name \"*.crt\" -o -name \"drives.xml\" -o -name \"httpd.conf\" -o -name \".github\" -o -name \"KeePass.enforced*\" -o -name \"*.csr\" -o -name \"known_hosts\" -o -name \"setupinfo.bak\" -o -name \"*.keyring\" -o -name \"ipsec.conf\" -o -name \"ffftp.ini\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` - FIND_OPT=`eval_bckgrd "find /opt -name \"unattended.xml\" -o -name \"ipsec.secrets\" -o -name \"gitlab.rm\" -o -name \"SAM\" -o -name \"passwd\" -o -name \"docker.sock\" -o -name \"security\" -o -name \"*.sqlite\" -o -name \"gvm-tools.conf\" -o -name \"*vnc*.txt\" -o -name \"unattend.inf\" -o -name \"security.sav\" -o -name \"*.kdbx\" -o -name \"config.php\" -o -name \"KeePass.config*\" -o -name \"SYSTEM\" -o -name \"*.cer\" -o -name \".git\" -o -name \"anaconda-ks.cfg\" -o -name \"sitemanager.xml\" -o -name \"*.gpg\" -o -name \"access_tokens.json\" -o -name \"*.db\" -o -name \"id_rsa*\" -o -name \"*.keystore\" -o -name \"postgresql.conf\" -o -name \"id_dsa*\" -o -name \"*.gnupg\" -o -name \"db.php\" -o -name \"tomcat-users.xml\" -o -name \"*.pgp\" -o -name \"access_tokens.db\" -o -name \"pagefile.sys\" -o -name \"credentials.db\" -o -name \"rsyncd.conf\" -o -name \"fastcgi_params\" -o -name \"https.conf\" -o -name \"*.sqlite3\" -o -name \"wp-config.php\" -o -name \"default.sav\" -o -name \"*.jks\" -o -name \".rhosts\" -o -name \"*vnc*.c*nf*\" -o -name \"*.rdg\" -o -name \"datasources.xml\" -o -name \"backups\" -o -name \"Dockerfile\" -o -name \"krb5.conf\" -o -name \"000-default\" -o -name \"filezilla.xml\" -o -name \"setupinfo\" -o -name \"*vnc*.ini\" -o -name \"web*.config\" -o -name \".lesshst\" -o -name \".sudo_as_admin_successful\" -o -name \"Ntds.dit\" -o -name \"mongod*.conf\" -o -name \"*.timer\" -o -name \"vault-ssh-helper.hcl\" -o -name \"*vnc*.xml\" -o -name \".*_history\" -o -name \".pypirc\" -o -name \"my.cnf\" -o -name \"*.swp\" -o -name \"unattend.txt\" -o -name \"php.ini\" -o -name \".gitconfig\" -o -name \"autologin\" -o -name \"ws_ftp.ini\" -o -name \"recentservers.xml\" -o -name \"*.socket\" -o -name \"scclient.exe\" -o -name \"TokenCache.dat\" -o -name \"storage.php\" -o -name \"*credential*\" -o -name \"AppEvent.Evt\" -o -name \".msmtprc\" -o -name \"iis6.log\" -o -name \"secrets.yml\" -o -name \"system.sav\" -o -name \"software\" -o -name \"unattend.xml\" -o -name \"FreeSSHDservice.ini\" -o -name \"rsyncd.secrets\" -o -name \"RDCMan.settings\" -o -name \"software.sav\" -o -name \"kadm5.acl\" -o -name \"credentials\" -o -name \"wcx_ftp.ini\" -o -name \"ConsoleHost_history.txt\" -o -name \"*.pem\" -o -name \"sysprep.xml\" -o -name \".bashrc\" -o -name \"*.key\" -o -name \"*.ovpn\" -o -name \"authorized_keys\" -o -name \"sites.ini\" -o -name \"docker.socket\" -o -name \"bash.exe\" -o -name \"NetSetup.log\" -o -name \"cloud.cfg\" -o -name \"mosquitto.conf\" -o -name \"KeePass.ini\" -o -name \"ftp.ini\" -o -name \".plan\" -o -name \"wsl.exe\" -o -name \"accessTokens.json\" -o -name \"appcmd.exe\" -o -name \"ftp.config\" -o -name \"printers.xml\" -o -name \"pgsql.conf\" -o -name \"autologin.conf\" -o -name \".htpasswd\" -o -name \"*.viminfo\" -o -name \"settings.php\" -o -name \"database.php\" -o -name \"my.ini\" -o -name \"SecEvent.Evt\" -o -name \"sysprep.inf\" -o -name \".k5login\" -o -name \"*.ftpconfig\" -o -name \"pg_hba.conf\" -o -name \"krb5.keytab\" -o -name \"AzureRMContext.json\" -o -name \"https-xampp.conf\" -o -name \"hosts.equiv\" -o -name \"server.xml\" -o -name \"elasticsearch.y*ml\" -o -name \"services.xml\" -o -name \"*.service\" -o -name \"azureProfile.json\" -o -name \".git-credentials\" -o -name \"*config*.php\" -o -name \"*.p12\" -o -name \".recently-used.xbel\" -o -name \".erlang.cookie\" -o -name \"authorized_hosts\" -o -name \"pgadmin*.db\" -o -name \"error.log\" -o -name \"ntuser.dat\" -o -name \"cesi.conf\" -o -name \"gitlab.yml\" -o -name \"supervisord.conf\" -o -name \"*.der\" -o -name \"redis.conf\" -o -name \"access.log\" -o -name \"snmpd.conf\" -o -name \"backup\" -o -name \"ddclient.conf\" -o -name \"docker-compose.yml\" -o -name \"scheduledtasks.xml\" -o -name \"winscp.ini\" -o -name \"*.pfx\" -o -name \"kibana.y*ml\" -o -name \"hostapd.conf\" -o -name \".google_authenticator\" -o -name \"index.dat\" -o -name \"creds*\" -o -name \"*password*\" -o -name \".env\" -o -name \".profile\" -o -name \".vault-token\" -o -name \".ldaprc\" -o -name \"groups.xml\" -o -name \"legacy_credentials.db\" -o -name \"*.crt\" -o -name \"drives.xml\" -o -name \"httpd.conf\" -o -name \".github\" -o -name \"KeePass.enforced*\" -o -name \"*.csr\" -o -name \"known_hosts\" -o -name \"setupinfo.bak\" -o -name \"*.keyring\" -o -name \"ipsec.conf\" -o -name \"ffftp.ini\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` - FIND_PRIVATE=`eval_bckgrd "find /private -name \"unattended.xml\" -o -name \"ipsec.secrets\" -o -name \"gitlab.rm\" -o -name \"SAM\" -o -name \"passwd\" -o -name \"docker.sock\" -o -name \"security\" -o -name \"*.sqlite\" -o -name \"gvm-tools.conf\" -o -name \"*vnc*.txt\" -o -name \"unattend.inf\" -o -name \"security.sav\" -o -name \"*.kdbx\" -o -name \"config.php\" -o -name \"KeePass.config*\" -o -name \"SYSTEM\" -o -name \"*.cer\" -o -name \".git\" -o -name \"anaconda-ks.cfg\" -o -name \"sitemanager.xml\" -o -name \"*.gpg\" -o -name \"access_tokens.json\" -o -name \"*.db\" -o -name \"id_rsa*\" -o -name \"*.keystore\" -o -name \"postgresql.conf\" -o -name \"id_dsa*\" -o -name \"*.gnupg\" -o -name \"db.php\" -o -name \"tomcat-users.xml\" -o -name \"*.pgp\" -o -name \"access_tokens.db\" -o -name \"pagefile.sys\" -o -name \"credentials.db\" -o -name \"rsyncd.conf\" -o -name \"fastcgi_params\" -o -name \"https.conf\" -o -name \"*.sqlite3\" -o -name \"wp-config.php\" -o -name \"default.sav\" -o -name \"*.jks\" -o -name \".rhosts\" -o -name \"*vnc*.c*nf*\" -o -name \"*.rdg\" -o -name \"datasources.xml\" -o -name \"backups\" -o -name \"Dockerfile\" -o -name \"krb5.conf\" -o -name \"000-default\" -o -name \"filezilla.xml\" -o -name \"setupinfo\" -o -name \"*vnc*.ini\" -o -name \"web*.config\" -o -name \".lesshst\" -o -name \".sudo_as_admin_successful\" -o -name \"Ntds.dit\" -o -name \"mongod*.conf\" -o -name \"*.timer\" -o -name \"vault-ssh-helper.hcl\" -o -name \"*vnc*.xml\" -o -name \".*_history\" -o -name \".pypirc\" -o -name \"my.cnf\" -o -name \"*.swp\" -o -name \"unattend.txt\" -o -name \"php.ini\" -o -name \".gitconfig\" -o -name \"autologin\" -o -name \"ws_ftp.ini\" -o -name \"recentservers.xml\" -o -name \"*.socket\" -o -name \"scclient.exe\" -o -name \"TokenCache.dat\" -o -name \"storage.php\" -o -name \"*credential*\" -o -name \"AppEvent.Evt\" -o -name \".msmtprc\" -o -name \"iis6.log\" -o -name \"secrets.yml\" -o -name \"system.sav\" -o -name \"software\" -o -name \"unattend.xml\" -o -name \"FreeSSHDservice.ini\" -o -name \"rsyncd.secrets\" -o -name \"RDCMan.settings\" -o -name \"software.sav\" -o -name \"kadm5.acl\" -o -name \"credentials\" -o -name \"wcx_ftp.ini\" -o -name \"ConsoleHost_history.txt\" -o -name \"*.pem\" -o -name \"sysprep.xml\" -o -name \".bashrc\" -o -name \"*.key\" -o -name \"*.ovpn\" -o -name \"authorized_keys\" -o -name \"sites.ini\" -o -name \"docker.socket\" -o -name \"bash.exe\" -o -name \"NetSetup.log\" -o -name \"cloud.cfg\" -o -name \"mosquitto.conf\" -o -name \"KeePass.ini\" -o -name \"ftp.ini\" -o -name \".plan\" -o -name \"wsl.exe\" -o -name \"accessTokens.json\" -o -name \"appcmd.exe\" -o -name \"ftp.config\" -o -name \"printers.xml\" -o -name \"pgsql.conf\" -o -name \"autologin.conf\" -o -name \".htpasswd\" -o -name \"*.viminfo\" -o -name \"settings.php\" -o -name \"database.php\" -o -name \"my.ini\" -o -name \"SecEvent.Evt\" -o -name \"sysprep.inf\" -o -name \".k5login\" -o -name \"*.ftpconfig\" -o -name \"pg_hba.conf\" -o -name \"krb5.keytab\" -o -name \"AzureRMContext.json\" -o -name \"https-xampp.conf\" -o -name \"hosts.equiv\" -o -name \"server.xml\" -o -name \"elasticsearch.y*ml\" -o -name \"services.xml\" -o -name \"*.service\" -o -name \"azureProfile.json\" -o -name \".git-credentials\" -o -name \"*config*.php\" -o -name \"*.p12\" -o -name \".recently-used.xbel\" -o -name \".erlang.cookie\" -o -name \"authorized_hosts\" -o -name \"pgadmin*.db\" -o -name \"error.log\" -o -name \"ntuser.dat\" -o -name \"cesi.conf\" -o -name \"gitlab.yml\" -o -name \"supervisord.conf\" -o -name \"*.der\" -o -name \"redis.conf\" -o -name \"access.log\" -o -name \"snmpd.conf\" -o -name \"backup\" -o -name \"ddclient.conf\" -o -name \"docker-compose.yml\" -o -name \"scheduledtasks.xml\" -o -name \"winscp.ini\" -o -name \"*.pfx\" -o -name \"kibana.y*ml\" -o -name \"hostapd.conf\" -o -name \".google_authenticator\" -o -name \"index.dat\" -o -name \"creds*\" -o -name \"*password*\" -o -name \".env\" -o -name \".profile\" -o -name \".vault-token\" -o -name \".ldaprc\" -o -name \"groups.xml\" -o -name \"legacy_credentials.db\" -o -name \"*.crt\" -o -name \"drives.xml\" -o -name \"httpd.conf\" -o -name \".github\" -o -name \"KeePass.enforced*\" -o -name \"*.csr\" -o -name \"known_hosts\" -o -name \"setupinfo.bak\" -o -name \"*.keyring\" -o -name \"ipsec.conf\" -o -name \"ffftp.ini\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` - FIND_RUN=`eval_bckgrd "find /run -name \"*.service\" -o -name \"*.socket\" -o -name \"*.timer\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` - FIND_SBIN=`eval_bckgrd "find /sbin -name \"unattended.xml\" -o -name \"ipsec.secrets\" -o -name \"gitlab.rm\" -o -name \"SAM\" -o -name \"passwd\" -o -name \"docker.sock\" -o -name \"security\" -o -name \"*.sqlite\" -o -name \"gvm-tools.conf\" -o -name \"*vnc*.txt\" -o -name \"unattend.inf\" -o -name \"security.sav\" -o -name \"*.kdbx\" -o -name \"config.php\" -o -name \"KeePass.config*\" -o -name \"SYSTEM\" -o -name \"*.cer\" -o -name \".git\" -o -name \"anaconda-ks.cfg\" -o -name \"sitemanager.xml\" -o -name \"*.gpg\" -o -name \"access_tokens.json\" -o -name \"*.db\" -o -name \"id_rsa*\" -o -name \"*.keystore\" -o -name \"postgresql.conf\" -o -name \"id_dsa*\" -o -name \"*.gnupg\" -o -name \"db.php\" -o -name \"tomcat-users.xml\" -o -name \"*.pgp\" -o -name \"access_tokens.db\" -o -name \"pagefile.sys\" -o -name \"credentials.db\" -o -name \"rsyncd.conf\" -o -name \"fastcgi_params\" -o -name \"https.conf\" -o -name \"*.sqlite3\" -o -name \"wp-config.php\" -o -name \"default.sav\" -o -name \"*.jks\" -o -name \".rhosts\" -o -name \"*vnc*.c*nf*\" -o -name \"*.rdg\" -o -name \"datasources.xml\" -o -name \"backups\" -o -name \"Dockerfile\" -o -name \"krb5.conf\" -o -name \"000-default\" -o -name \"filezilla.xml\" -o -name \"setupinfo\" -o -name \"*vnc*.ini\" -o -name \"web*.config\" -o -name \".lesshst\" -o -name \".sudo_as_admin_successful\" -o -name \"Ntds.dit\" -o -name \"mongod*.conf\" -o -name \"*.timer\" -o -name \"vault-ssh-helper.hcl\" -o -name \"*vnc*.xml\" -o -name \".*_history\" -o -name \".pypirc\" -o -name \"my.cnf\" -o -name \"*.swp\" -o -name \"unattend.txt\" -o -name \"php.ini\" -o -name \".gitconfig\" -o -name \"autologin\" -o -name \"ws_ftp.ini\" -o -name \"recentservers.xml\" -o -name \"*.socket\" -o -name \"scclient.exe\" -o -name \"TokenCache.dat\" -o -name \"storage.php\" -o -name \"*credential*\" -o -name \"AppEvent.Evt\" -o -name \".msmtprc\" -o -name \"iis6.log\" -o -name \"secrets.yml\" -o -name \"system.sav\" -o -name \"software\" -o -name \"unattend.xml\" -o -name \"FreeSSHDservice.ini\" -o -name \"rsyncd.secrets\" -o -name \"RDCMan.settings\" -o -name \"software.sav\" -o -name \"kadm5.acl\" -o -name \"credentials\" -o -name \"wcx_ftp.ini\" -o -name \"ConsoleHost_history.txt\" -o -name \"*.pem\" -o -name \"sysprep.xml\" -o -name \".bashrc\" -o -name \"*.key\" -o -name \"*.ovpn\" -o -name \"authorized_keys\" -o -name \"sites.ini\" -o -name \"docker.socket\" -o -name \"bash.exe\" -o -name \"NetSetup.log\" -o -name \"cloud.cfg\" -o -name \"mosquitto.conf\" -o -name \"KeePass.ini\" -o -name \"ftp.ini\" -o -name \".plan\" -o -name \"wsl.exe\" -o -name \"accessTokens.json\" -o -name \"appcmd.exe\" -o -name \"ftp.config\" -o -name \"printers.xml\" -o -name \"pgsql.conf\" -o -name \"autologin.conf\" -o -name \".htpasswd\" -o -name \"*.viminfo\" -o -name \"settings.php\" -o -name \"database.php\" -o -name \"my.ini\" -o -name \"SecEvent.Evt\" -o -name \"sysprep.inf\" -o -name \".k5login\" -o -name \"*.ftpconfig\" -o -name \"pg_hba.conf\" -o -name \"krb5.keytab\" -o -name \"AzureRMContext.json\" -o -name \"https-xampp.conf\" -o -name \"hosts.equiv\" -o -name \"server.xml\" -o -name \"elasticsearch.y*ml\" -o -name \"services.xml\" -o -name \"*.service\" -o -name \"azureProfile.json\" -o -name \".git-credentials\" -o -name \"*config*.php\" -o -name \"*.p12\" -o -name \".recently-used.xbel\" -o -name \".erlang.cookie\" -o -name \"authorized_hosts\" -o -name \"pgadmin*.db\" -o -name \"error.log\" -o -name \"ntuser.dat\" -o -name \"cesi.conf\" -o -name \"gitlab.yml\" -o -name \"supervisord.conf\" -o -name \"*.der\" -o -name \"redis.conf\" -o -name \"access.log\" -o -name \"snmpd.conf\" -o -name \"backup\" -o -name \"ddclient.conf\" -o -name \"docker-compose.yml\" -o -name \"scheduledtasks.xml\" -o -name \"winscp.ini\" -o -name \"*.pfx\" -o -name \"kibana.y*ml\" -o -name \"hostapd.conf\" -o -name \".google_authenticator\" -o -name \"index.dat\" -o -name \"creds*\" -o -name \"*password*\" -o -name \".env\" -o -name \".profile\" -o -name \".vault-token\" -o -name \".ldaprc\" -o -name \"groups.xml\" -o -name \"legacy_credentials.db\" -o -name \"*.crt\" -o -name \"drives.xml\" -o -name \"httpd.conf\" -o -name \".github\" -o -name \"KeePass.enforced*\" -o -name \"*.csr\" -o -name \"known_hosts\" -o -name \"setupinfo.bak\" -o -name \"*.keyring\" -o -name \"ipsec.conf\" -o -name \"ffftp.ini\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` - FIND_SNAP=`eval_bckgrd "find /snap -name \"unattended.xml\" -o -name \"ipsec.secrets\" -o -name \"gitlab.rm\" -o -name \"SAM\" -o -name \"passwd\" -o -name \"docker.sock\" -o -name \"security\" -o -name \"*.sqlite\" -o -name \"gvm-tools.conf\" -o -name \"*vnc*.txt\" -o -name \"unattend.inf\" -o -name \"security.sav\" -o -name \"*.kdbx\" -o -name \"config.php\" -o -name \"KeePass.config*\" -o -name \"SYSTEM\" -o -name \"*.cer\" -o -name \".git\" -o -name \"anaconda-ks.cfg\" -o -name \"sitemanager.xml\" -o -name \"*.gpg\" -o -name \"access_tokens.json\" -o -name \"*.db\" -o -name \"id_rsa*\" -o -name \"*.keystore\" -o -name \"postgresql.conf\" -o -name \"id_dsa*\" -o -name \"*.gnupg\" -o -name \"db.php\" -o -name \"tomcat-users.xml\" -o -name \"*.pgp\" -o -name \"access_tokens.db\" -o -name \"pagefile.sys\" -o -name \"credentials.db\" -o -name \"rsyncd.conf\" -o -name \"fastcgi_params\" -o -name \"https.conf\" -o -name \"*.sqlite3\" -o -name \"wp-config.php\" -o -name \"default.sav\" -o -name \"*.jks\" -o -name \".rhosts\" -o -name \"*vnc*.c*nf*\" -o -name \"*.rdg\" -o -name \"datasources.xml\" -o -name \"backups\" -o -name \"Dockerfile\" -o -name \"krb5.conf\" -o -name \"000-default\" -o -name \"filezilla.xml\" -o -name \"setupinfo\" -o -name \"*vnc*.ini\" -o -name \"web*.config\" -o -name \".lesshst\" -o -name \".sudo_as_admin_successful\" -o -name \"Ntds.dit\" -o -name \"mongod*.conf\" -o -name \"*.timer\" -o -name \"vault-ssh-helper.hcl\" -o -name \"*vnc*.xml\" -o -name \".*_history\" -o -name \".pypirc\" -o -name \"my.cnf\" -o -name \"*.swp\" -o -name \"unattend.txt\" -o -name \"php.ini\" -o -name \".gitconfig\" -o -name \"autologin\" -o -name \"ws_ftp.ini\" -o -name \"recentservers.xml\" -o -name \"*.socket\" -o -name \"scclient.exe\" -o -name \"TokenCache.dat\" -o -name \"storage.php\" -o -name \"*credential*\" -o -name \"AppEvent.Evt\" -o -name \".msmtprc\" -o -name \"iis6.log\" -o -name \"secrets.yml\" -o -name \"system.sav\" -o -name \"software\" -o -name \"unattend.xml\" -o -name \"FreeSSHDservice.ini\" -o -name \"rsyncd.secrets\" -o -name \"RDCMan.settings\" -o -name \"software.sav\" -o -name \"kadm5.acl\" -o -name \"credentials\" -o -name \"wcx_ftp.ini\" -o -name \"ConsoleHost_history.txt\" -o -name \"*.pem\" -o -name \"sysprep.xml\" -o -name \".bashrc\" -o -name \"*.key\" -o -name \"*.ovpn\" -o -name \"authorized_keys\" -o -name \"sites.ini\" -o -name \"docker.socket\" -o -name \"bash.exe\" -o -name \"NetSetup.log\" -o -name \"cloud.cfg\" -o -name \"mosquitto.conf\" -o -name \"KeePass.ini\" -o -name \"ftp.ini\" -o -name \".plan\" -o -name \"wsl.exe\" -o -name \"accessTokens.json\" -o -name \"appcmd.exe\" -o -name \"ftp.config\" -o -name \"printers.xml\" -o -name \"pgsql.conf\" -o -name \"autologin.conf\" -o -name \".htpasswd\" -o -name \"*.viminfo\" -o -name \"settings.php\" -o -name \"database.php\" -o -name \"my.ini\" -o -name \"SecEvent.Evt\" -o -name \"sysprep.inf\" -o -name \".k5login\" -o -name \"*.ftpconfig\" -o -name \"pg_hba.conf\" -o -name \"krb5.keytab\" -o -name \"AzureRMContext.json\" -o -name \"https-xampp.conf\" -o -name \"hosts.equiv\" -o -name \"server.xml\" -o -name \"elasticsearch.y*ml\" -o -name \"services.xml\" -o -name \"*.service\" -o -name \"azureProfile.json\" -o -name \".git-credentials\" -o -name \"*config*.php\" -o -name \"*.p12\" -o -name \".recently-used.xbel\" -o -name \".erlang.cookie\" -o -name \"authorized_hosts\" -o -name \"pgadmin*.db\" -o -name \"error.log\" -o -name \"ntuser.dat\" -o -name \"cesi.conf\" -o -name \"gitlab.yml\" -o -name \"supervisord.conf\" -o -name \"*.der\" -o -name \"redis.conf\" -o -name \"access.log\" -o -name \"snmpd.conf\" -o -name \"backup\" -o -name \"ddclient.conf\" -o -name \"docker-compose.yml\" -o -name \"scheduledtasks.xml\" -o -name \"winscp.ini\" -o -name \"*.pfx\" -o -name \"kibana.y*ml\" -o -name \"hostapd.conf\" -o -name \".google_authenticator\" -o -name \"index.dat\" -o -name \"creds*\" -o -name \"*password*\" -o -name \".env\" -o -name \".profile\" -o -name \".vault-token\" -o -name \".ldaprc\" -o -name \"groups.xml\" -o -name \"legacy_credentials.db\" -o -name \"*.crt\" -o -name \"drives.xml\" -o -name \"httpd.conf\" -o -name \".github\" -o -name \"KeePass.enforced*\" -o -name \"*.csr\" -o -name \"known_hosts\" -o -name \"setupinfo.bak\" -o -name \"*.keyring\" -o -name \"ipsec.conf\" -o -name \"ffftp.ini\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` - FIND_SRV=`eval_bckgrd "find /srv -name \"unattended.xml\" -o -name \"ipsec.secrets\" -o -name \"gitlab.rm\" -o -name \"SAM\" -o -name \"passwd\" -o -name \"docker.sock\" -o -name \"security\" -o -name \"*.sqlite\" -o -name \"gvm-tools.conf\" -o -name \"*vnc*.txt\" -o -name \"unattend.inf\" -o -name \"security.sav\" -o -name \"*.kdbx\" -o -name \"config.php\" -o -name \"KeePass.config*\" -o -name \"SYSTEM\" -o -name \"*.cer\" -o -name \".git\" -o -name \"anaconda-ks.cfg\" -o -name \"sitemanager.xml\" -o -name \"*.gpg\" -o -name \"access_tokens.json\" -o -name \"*.db\" -o -name \"id_rsa*\" -o -name \"*.keystore\" -o -name \"postgresql.conf\" -o -name \"id_dsa*\" -o -name \"*.gnupg\" -o -name \"db.php\" -o -name \"tomcat-users.xml\" -o -name \"*.pgp\" -o -name \"access_tokens.db\" -o -name \"pagefile.sys\" -o -name \"credentials.db\" -o -name \"rsyncd.conf\" -o -name \"fastcgi_params\" -o -name \"https.conf\" -o -name \"*.sqlite3\" -o -name \"wp-config.php\" -o -name \"default.sav\" -o -name \"*.jks\" -o -name \".rhosts\" -o -name \"*vnc*.c*nf*\" -o -name \"*.rdg\" -o -name \"datasources.xml\" -o -name \"backups\" -o -name \"Dockerfile\" -o -name \"krb5.conf\" -o -name \"000-default\" -o -name \"filezilla.xml\" -o -name \"setupinfo\" -o -name \"*vnc*.ini\" -o -name \"web*.config\" -o -name \".lesshst\" -o -name \".sudo_as_admin_successful\" -o -name \"Ntds.dit\" -o -name \"mongod*.conf\" -o -name \"*.timer\" -o -name \"vault-ssh-helper.hcl\" -o -name \"*vnc*.xml\" -o -name \".*_history\" -o -name \".pypirc\" -o -name \"my.cnf\" -o -name \"*.swp\" -o -name \"unattend.txt\" -o -name \"php.ini\" -o -name \".gitconfig\" -o -name \"autologin\" -o -name \"ws_ftp.ini\" -o -name \"recentservers.xml\" -o -name \"*.socket\" -o -name \"scclient.exe\" -o -name \"TokenCache.dat\" -o -name \"storage.php\" -o -name \"*credential*\" -o -name \"AppEvent.Evt\" -o -name \".msmtprc\" -o -name \"iis6.log\" -o -name \"secrets.yml\" -o -name \"system.sav\" -o -name \"software\" -o -name \"unattend.xml\" -o -name \"FreeSSHDservice.ini\" -o -name \"rsyncd.secrets\" -o -name \"RDCMan.settings\" -o -name \"software.sav\" -o -name \"kadm5.acl\" -o -name \"credentials\" -o -name \"wcx_ftp.ini\" -o -name \"ConsoleHost_history.txt\" -o -name \"*.pem\" -o -name \"sysprep.xml\" -o -name \".bashrc\" -o -name \"*.key\" -o -name \"*.ovpn\" -o -name \"authorized_keys\" -o -name \"sites.ini\" -o -name \"docker.socket\" -o -name \"bash.exe\" -o -name \"NetSetup.log\" -o -name \"cloud.cfg\" -o -name \"mosquitto.conf\" -o -name \"KeePass.ini\" -o -name \"ftp.ini\" -o -name \".plan\" -o -name \"wsl.exe\" -o -name \"accessTokens.json\" -o -name \"appcmd.exe\" -o -name \"ftp.config\" -o -name \"printers.xml\" -o -name \"pgsql.conf\" -o -name \"autologin.conf\" -o -name \".htpasswd\" -o -name \"*.viminfo\" -o -name \"settings.php\" -o -name \"database.php\" -o -name \"my.ini\" -o -name \"SecEvent.Evt\" -o -name \"sysprep.inf\" -o -name \".k5login\" -o -name \"*.ftpconfig\" -o -name \"pg_hba.conf\" -o -name \"krb5.keytab\" -o -name \"AzureRMContext.json\" -o -name \"https-xampp.conf\" -o -name \"hosts.equiv\" -o -name \"server.xml\" -o -name \"elasticsearch.y*ml\" -o -name \"services.xml\" -o -name \"*.service\" -o -name \"azureProfile.json\" -o -name \".git-credentials\" -o -name \"*config*.php\" -o -name \"*.p12\" -o -name \".recently-used.xbel\" -o -name \".erlang.cookie\" -o -name \"authorized_hosts\" -o -name \"pgadmin*.db\" -o -name \"error.log\" -o -name \"ntuser.dat\" -o -name \"cesi.conf\" -o -name \"gitlab.yml\" -o -name \"supervisord.conf\" -o -name \"*.der\" -o -name \"redis.conf\" -o -name \"access.log\" -o -name \"snmpd.conf\" -o -name \"backup\" -o -name \"ddclient.conf\" -o -name \"docker-compose.yml\" -o -name \"scheduledtasks.xml\" -o -name \"winscp.ini\" -o -name \"*.pfx\" -o -name \"kibana.y*ml\" -o -name \"hostapd.conf\" -o -name \".google_authenticator\" -o -name \"index.dat\" -o -name \"creds*\" -o -name \"*password*\" -o -name \".env\" -o -name \".profile\" -o -name \".vault-token\" -o -name \".ldaprc\" -o -name \"groups.xml\" -o -name \"legacy_credentials.db\" -o -name \"*.crt\" -o -name \"drives.xml\" -o -name \"httpd.conf\" -o -name \".github\" -o -name \"KeePass.enforced*\" -o -name \"*.csr\" -o -name \"known_hosts\" -o -name \"setupinfo.bak\" -o -name \"*.keyring\" -o -name \"ipsec.conf\" -o -name \"ffftp.ini\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` - FIND_SYS=`eval_bckgrd "find /sys -name \"*.service\" -o -name \"*.socket\" -o -name \"*.timer\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` - FIND_SYSTEM=`eval_bckgrd "find /system -name \"*.service\" -o -name \"*.socket\" -o -name \"*.timer\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` - FIND_SYSTEMD=`eval_bckgrd "find /systemd -name \"*.service\" -o -name \"*.socket\" -o -name \"*.timer\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` - FIND_TMP=`eval_bckgrd "find /tmp -name \"unattended.xml\" -o -name \"ipsec.secrets\" -o -name \"gitlab.rm\" -o -name \"SAM\" -o -name \"passwd\" -o -name \"docker.sock\" -o -name \"security\" -o -name \"*.sqlite\" -o -name \"gvm-tools.conf\" -o -name \"*vnc*.txt\" -o -name \"unattend.inf\" -o -name \"security.sav\" -o -name \"*.kdbx\" -o -name \"config.php\" -o -name \"KeePass.config*\" -o -name \"SYSTEM\" -o -name \"*.cer\" -o -name \".git\" -o -name \"anaconda-ks.cfg\" -o -name \"sitemanager.xml\" -o -name \"*.gpg\" -o -name \"access_tokens.json\" -o -name \"*.db\" -o -name \"id_rsa*\" -o -name \"*.keystore\" -o -name \"postgresql.conf\" -o -name \"id_dsa*\" -o -name \"*.gnupg\" -o -name \"db.php\" -o -name \"tomcat-users.xml\" -o -name \"*.pgp\" -o -name \"access_tokens.db\" -o -name \"pagefile.sys\" -o -name \"credentials.db\" -o -name \"rsyncd.conf\" -o -name \"agent*\" -o -name \"fastcgi_params\" -o -name \"https.conf\" -o -name \"*.sqlite3\" -o -name \"wp-config.php\" -o -name \"default.sav\" -o -name \"*.jks\" -o -name \".rhosts\" -o -name \"*vnc*.c*nf*\" -o -name \"*.rdg\" -o -name \"datasources.xml\" -o -name \"backups\" -o -name \"Dockerfile\" -o -name \"krb5.conf\" -o -name \"000-default\" -o -name \"filezilla.xml\" -o -name \"setupinfo\" -o -name \"*vnc*.ini\" -o -name \"web*.config\" -o -name \".lesshst\" -o -name \".sudo_as_admin_successful\" -o -name \"Ntds.dit\" -o -name \"mongod*.conf\" -o -name \"*.timer\" -o -name \"vault-ssh-helper.hcl\" -o -name \"*vnc*.xml\" -o -name \".*_history\" -o -name \".pypirc\" -o -name \"my.cnf\" -o -name \"*.swp\" -o -name \"unattend.txt\" -o -name \"php.ini\" -o -name \".gitconfig\" -o -name \"autologin\" -o -name \"ws_ftp.ini\" -o -name \"recentservers.xml\" -o -name \"*.socket\" -o -name \"scclient.exe\" -o -name \"TokenCache.dat\" -o -name \"storage.php\" -o -name \"*credential*\" -o -name \"AppEvent.Evt\" -o -name \".msmtprc\" -o -name \"iis6.log\" -o -name \"secrets.yml\" -o -name \"system.sav\" -o -name \"software\" -o -name \"unattend.xml\" -o -name \"FreeSSHDservice.ini\" -o -name \"rsyncd.secrets\" -o -name \"RDCMan.settings\" -o -name \"sess_*\" -o -name \"software.sav\" -o -name \"kadm5.acl\" -o -name \"credentials\" -o -name \"wcx_ftp.ini\" -o -name \"ConsoleHost_history.txt\" -o -name \"*.pem\" -o -name \"sysprep.xml\" -o -name \".bashrc\" -o -name \"*.key\" -o -name \"*.ovpn\" -o -name \"authorized_keys\" -o -name \"sites.ini\" -o -name \"docker.socket\" -o -name \"bash.exe\" -o -name \"NetSetup.log\" -o -name \"cloud.cfg\" -o -name \"mosquitto.conf\" -o -name \"KeePass.ini\" -o -name \"ftp.ini\" -o -name \".plan\" -o -name \"wsl.exe\" -o -name \"accessTokens.json\" -o -name \"appcmd.exe\" -o -name \"ftp.config\" -o -name \"printers.xml\" -o -name \"pgsql.conf\" -o -name \"autologin.conf\" -o -name \".htpasswd\" -o -name \"*.viminfo\" -o -name \"settings.php\" -o -name \"database.php\" -o -name \"my.ini\" -o -name \"SecEvent.Evt\" -o -name \"sysprep.inf\" -o -name \".k5login\" -o -name \"*.ftpconfig\" -o -name \"pg_hba.conf\" -o -name \"krb5.keytab\" -o -name \"AzureRMContext.json\" -o -name \"https-xampp.conf\" -o -name \"hosts.equiv\" -o -name \"server.xml\" -o -name \"elasticsearch.y*ml\" -o -name \"services.xml\" -o -name \"*.service\" -o -name \"azureProfile.json\" -o -name \".git-credentials\" -o -name \"*config*.php\" -o -name \"*.p12\" -o -name \".recently-used.xbel\" -o -name \".erlang.cookie\" -o -name \"authorized_hosts\" -o -name \"pgadmin*.db\" -o -name \"error.log\" -o -name \"ntuser.dat\" -o -name \"cesi.conf\" -o -name \"gitlab.yml\" -o -name \"supervisord.conf\" -o -name \"*.der\" -o -name \"redis.conf\" -o -name \"access.log\" -o -name \"snmpd.conf\" -o -name \"backup\" -o -name \"ddclient.conf\" -o -name \"docker-compose.yml\" -o -name \"scheduledtasks.xml\" -o -name \"winscp.ini\" -o -name \"*.pfx\" -o -name \"kibana.y*ml\" -o -name \"hostapd.conf\" -o -name \".google_authenticator\" -o -name \"index.dat\" -o -name \"creds*\" -o -name \"*password*\" -o -name \".env\" -o -name \".profile\" -o -name \".vault-token\" -o -name \".ldaprc\" -o -name \"groups.xml\" -o -name \"legacy_credentials.db\" -o -name \"*.crt\" -o -name \"drives.xml\" -o -name \"httpd.conf\" -o -name \".github\" -o -name \"KeePass.enforced*\" -o -name \"*.csr\" -o -name \"known_hosts\" -o -name \"setupinfo.bak\" -o -name \"*.keyring\" -o -name \"ipsec.conf\" -o -name \"ffftp.ini\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` - FIND_USR=`eval_bckgrd "find /usr -name \"unattended.xml\" -o -name \"ipsec.secrets\" -o -name \"gitlab.rm\" -o -name \"SAM\" -o -name \"passwd\" -o -name \"docker.sock\" -o -name \"security\" -o -name \"*.sqlite\" -o -name \"gvm-tools.conf\" -o -name \"*vnc*.txt\" -o -name \"unattend.inf\" -o -name \"security.sav\" -o -name \"ssh*config\" -o -name \"config.php\" -o -name \"*.kdbx\" -o -name \"KeePass.config*\" -o -name \"SYSTEM\" -o -name \"*.cer\" -o -name \".git\" -o -name \"anaconda-ks.cfg\" -o -name \"sitemanager.xml\" -o -name \"*.gpg\" -o -name \"access_tokens.json\" -o -name \"*.db\" -o -name \"id_rsa*\" -o -name \"*.keystore\" -o -name \"postgresql.conf\" -o -name \"id_dsa*\" -o -name \"*.gnupg\" -o -name \"db.php\" -o -name \"tomcat-users.xml\" -o -name \"*.pgp\" -o -name \"access_tokens.db\" -o -name \"pagefile.sys\" -o -name \"credentials.db\" -o -name \"rsyncd.conf\" -o -name \"fastcgi_params\" -o -name \"https.conf\" -o -name \"*.sqlite3\" -o -name \"wp-config.php\" -o -name \"default.sav\" -o -name \"*.jks\" -o -name \".rhosts\" -o -name \"*vnc*.c*nf*\" -o -name \"*.rdg\" -o -name \"datasources.xml\" -o -name \"backups\" -o -name \"Dockerfile\" -o -name \"krb5.conf\" -o -name \"000-default\" -o -name \"filezilla.xml\" -o -name \"setupinfo\" -o -name \"*vnc*.ini\" -o -name \"web*.config\" -o -name \".lesshst\" -o -name \".sudo_as_admin_successful\" -o -name \"Ntds.dit\" -o -name \"mongod*.conf\" -o -name \"*.timer\" -o -name \"vault-ssh-helper.hcl\" -o -name \"*vnc*.xml\" -o -name \".*_history\" -o -name \".pypirc\" -o -name \"my.cnf\" -o -name \"*.swp\" -o -name \"unattend.txt\" -o -name \"php.ini\" -o -name \".gitconfig\" -o -name \"autologin\" -o -name \"ws_ftp.ini\" -o -name \"recentservers.xml\" -o -name \"*.socket\" -o -name \"scclient.exe\" -o -name \"TokenCache.dat\" -o -name \"storage.php\" -o -name \"*credential*\" -o -name \"AppEvent.Evt\" -o -name \".msmtprc\" -o -name \"iis6.log\" -o -name \"secrets.yml\" -o -name \"system.sav\" -o -name \"software\" -o -name \"unattend.xml\" -o -name \"FreeSSHDservice.ini\" -o -name \"rsyncd.secrets\" -o -name \"RDCMan.settings\" -o -name \"software.sav\" -o -name \"kadm5.acl\" -o -name \"credentials\" -o -name \"wcx_ftp.ini\" -o -name \"ConsoleHost_history.txt\" -o -name \"*.pem\" -o -name \"sysprep.xml\" -o -name \".bashrc\" -o -name \"*.key\" -o -name \"*.ovpn\" -o -name \"authorized_keys\" -o -name \"sites.ini\" -o -name \"docker.socket\" -o -name \"bash.exe\" -o -name \"NetSetup.log\" -o -name \"cloud.cfg\" -o -name \"mosquitto.conf\" -o -name \"KeePass.ini\" -o -name \"ftp.ini\" -o -name \".plan\" -o -name \"wsl.exe\" -o -name \"accessTokens.json\" -o -name \"appcmd.exe\" -o -name \"ftp.config\" -o -name \"printers.xml\" -o -name \"pgsql.conf\" -o -name \"autologin.conf\" -o -name \".htpasswd\" -o -name \"*.viminfo\" -o -name \"settings.php\" -o -name \"database.php\" -o -name \"my.ini\" -o -name \"SecEvent.Evt\" -o -name \"sysprep.inf\" -o -name \".k5login\" -o -name \"*.ftpconfig\" -o -name \"pg_hba.conf\" -o -name \"krb5.keytab\" -o -name \"AzureRMContext.json\" -o -name \"https-xampp.conf\" -o -name \"hosts.equiv\" -o -name \"server.xml\" -o -name \"elasticsearch.y*ml\" -o -name \"services.xml\" -o -name \"*.service\" -o -name \"azureProfile.json\" -o -name \".git-credentials\" -o -name \"*config*.php\" -o -name \"*.p12\" -o -name \".recently-used.xbel\" -o -name \".erlang.cookie\" -o -name \"authorized_hosts\" -o -name \"pgadmin*.db\" -o -name \"error.log\" -o -name \"ntuser.dat\" -o -name \"cesi.conf\" -o -name \"gitlab.yml\" -o -name \"supervisord.conf\" -o -name \"*.der\" -o -name \"redis.conf\" -o -name \"access.log\" -o -name \"snmpd.conf\" -o -name \"backup\" -o -name \"ddclient.conf\" -o -name \"docker-compose.yml\" -o -name \"scheduledtasks.xml\" -o -name \"winscp.ini\" -o -name \"*.pfx\" -o -name \"kibana.y*ml\" -o -name \"hostapd.conf\" -o -name \".google_authenticator\" -o -name \"index.dat\" -o -name \"creds*\" -o -name \"*password*\" -o -name \".env\" -o -name \".profile\" -o -name \".vault-token\" -o -name \".ldaprc\" -o -name \"groups.xml\" -o -name \"legacy_credentials.db\" -o -name \"*.crt\" -o -name \"drives.xml\" -o -name \"httpd.conf\" -o -name \".github\" -o -name \"KeePass.enforced*\" -o -name \"*.csr\" -o -name \"known_hosts\" -o -name \"setupinfo.bak\" -o -name \"*.keyring\" -o -name \"ipsec.conf\" -o -name \"ffftp.ini\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` - FIND_VAR=`eval_bckgrd "find /var -name \"unattended.xml\" -o -name \"ipsec.secrets\" -o -name \"gitlab.rm\" -o -name \"SAM\" -o -name \"passwd\" -o -name \"docker.sock\" -o -name \"security\" -o -name \"*.sqlite\" -o -name \"gvm-tools.conf\" -o -name \"*vnc*.txt\" -o -name \"unattend.inf\" -o -name \"security.sav\" -o -name \"*.kdbx\" -o -name \"config.php\" -o -name \"KeePass.config*\" -o -name \"SYSTEM\" -o -name \"*.cer\" -o -name \".git\" -o -name \"anaconda-ks.cfg\" -o -name \"sitemanager.xml\" -o -name \"*.gpg\" -o -name \"access_tokens.json\" -o -name \"*.db\" -o -name \"id_rsa*\" -o -name \"*.keystore\" -o -name \"postgresql.conf\" -o -name \"id_dsa*\" -o -name \"*.gnupg\" -o -name \"db.php\" -o -name \"tomcat-users.xml\" -o -name \"*.pgp\" -o -name \"access_tokens.db\" -o -name \"pagefile.sys\" -o -name \"credentials.db\" -o -name \"rsyncd.conf\" -o -name \"fastcgi_params\" -o -name \"https.conf\" -o -name \"*.sqlite3\" -o -name \"wp-config.php\" -o -name \"default.sav\" -o -name \"*.jks\" -o -name \".rhosts\" -o -name \"*vnc*.c*nf*\" -o -name \"*.rdg\" -o -name \"datasources.xml\" -o -name \"backups\" -o -name \"Dockerfile\" -o -name \"krb5.conf\" -o -name \"000-default\" -o -name \"filezilla.xml\" -o -name \"setupinfo\" -o -name \"*vnc*.ini\" -o -name \"web*.config\" -o -name \".lesshst\" -o -name \".sudo_as_admin_successful\" -o -name \"Ntds.dit\" -o -name \"mongod*.conf\" -o -name \"*.timer\" -o -name \"vault-ssh-helper.hcl\" -o -name \"*vnc*.xml\" -o -name \".*_history\" -o -name \".pypirc\" -o -name \"my.cnf\" -o -name \"*.swp\" -o -name \"unattend.txt\" -o -name \"php.ini\" -o -name \".gitconfig\" -o -name \"autologin\" -o -name \"ws_ftp.ini\" -o -name \"recentservers.xml\" -o -name \"*.socket\" -o -name \"scclient.exe\" -o -name \"TokenCache.dat\" -o -name \"storage.php\" -o -name \"*credential*\" -o -name \"AppEvent.Evt\" -o -name \".msmtprc\" -o -name \"iis6.log\" -o -name \"secrets.yml\" -o -name \"system.sav\" -o -name \"software\" -o -name \"unattend.xml\" -o -name \"FreeSSHDservice.ini\" -o -name \"rsyncd.secrets\" -o -name \"RDCMan.settings\" -o -name \"sess_*\" -o -name \"software.sav\" -o -name \"kadm5.acl\" -o -name \"credentials\" -o -name \"wcx_ftp.ini\" -o -name \"ConsoleHost_history.txt\" -o -name \"*.pem\" -o -name \"sysprep.xml\" -o -name \".bashrc\" -o -name \"*.key\" -o -name \"*.ovpn\" -o -name \"authorized_keys\" -o -name \"sites.ini\" -o -name \"docker.socket\" -o -name \"bash.exe\" -o -name \"NetSetup.log\" -o -name \"cloud.cfg\" -o -name \"mosquitto.conf\" -o -name \"KeePass.ini\" -o -name \"ftp.ini\" -o -name \".plan\" -o -name \"wsl.exe\" -o -name \"accessTokens.json\" -o -name \"appcmd.exe\" -o -name \"ftp.config\" -o -name \"printers.xml\" -o -name \"pgsql.conf\" -o -name \"autologin.conf\" -o -name \".htpasswd\" -o -name \"*.viminfo\" -o -name \"settings.php\" -o -name \"database.php\" -o -name \"my.ini\" -o -name \"SecEvent.Evt\" -o -name \"sysprep.inf\" -o -name \".k5login\" -o -name \"*.ftpconfig\" -o -name \"pg_hba.conf\" -o -name \"krb5.keytab\" -o -name \"AzureRMContext.json\" -o -name \"https-xampp.conf\" -o -name \"hosts.equiv\" -o -name \"server.xml\" -o -name \"elasticsearch.y*ml\" -o -name \"services.xml\" -o -name \"*.service\" -o -name \"azureProfile.json\" -o -name \".git-credentials\" -o -name \"*config*.php\" -o -name \"*.p12\" -o -name \".recently-used.xbel\" -o -name \".erlang.cookie\" -o -name \"authorized_hosts\" -o -name \"pgadmin*.db\" -o -name \"error.log\" -o -name \"ntuser.dat\" -o -name \"cesi.conf\" -o -name \"gitlab.yml\" -o -name \"supervisord.conf\" -o -name \"*.der\" -o -name \"redis.conf\" -o -name \"access.log\" -o -name \"snmpd.conf\" -o -name \"backup\" -o -name \"ddclient.conf\" -o -name \"docker-compose.yml\" -o -name \"scheduledtasks.xml\" -o -name \"winscp.ini\" -o -name \"*.pfx\" -o -name \"kibana.y*ml\" -o -name \"hostapd.conf\" -o -name \".google_authenticator\" -o -name \"index.dat\" -o -name \"creds*\" -o -name \"*password*\" -o -name \".env\" -o -name \".profile\" -o -name \".vault-token\" -o -name \".ldaprc\" -o -name \"groups.xml\" -o -name \"legacy_credentials.db\" -o -name \"*.crt\" -o -name \"drives.xml\" -o -name \"httpd.conf\" -o -name \".github\" -o -name \"KeePass.enforced*\" -o -name \"*.csr\" -o -name \"known_hosts\" -o -name \"setupinfo.bak\" -o -name \"*.keyring\" -o -name \"ipsec.conf\" -o -name \"ffftp.ini\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` + FIND_DIR_APPLICATIONS=`eval_bckgrd "find /applications -type d -name \"couchdb\" -o -name \"bind\" -o -name \"logstash\" -o -name \".cloudflared\" -o -name \"sites-enabled\" -o -name \"ldap\" -o -name \".irssi\" -o -name \"filezilla\" -o -name \"seeddms*\" -o -name \".vnc\" -o -name \"cacti\" -o -name \"neo4j\" -o -name \"mysql\" -o -name \"keyrings\" -o -name \".svn\" -o -name \".bluemix\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` + FIND_DIR_BIN=`eval_bckgrd "find /bin -type d -name \"couchdb\" -o -name \"bind\" -o -name \"logstash\" -o -name \".cloudflared\" -o -name \"sites-enabled\" -o -name \"ldap\" -o -name \".irssi\" -o -name \"filezilla\" -o -name \"seeddms*\" -o -name \".vnc\" -o -name \"cacti\" -o -name \"neo4j\" -o -name \"mysql\" -o -name \"keyrings\" -o -name \".svn\" -o -name \".bluemix\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` + FIND_DIR_CACHE=`eval_bckgrd "find /.cache -type d -name \"couchdb\" -o -name \"bind\" -o -name \"logstash\" -o -name \".cloudflared\" -o -name \"sites-enabled\" -o -name \"ldap\" -o -name \".irssi\" -o -name \"filezilla\" -o -name \"seeddms*\" -o -name \".vnc\" -o -name \"cacti\" -o -name \"neo4j\" -o -name \"mysql\" -o -name \"keyrings\" -o -name \".svn\" -o -name \".bluemix\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` + FIND_DIR_CDROM=`eval_bckgrd "find /cdrom -type d -name \"couchdb\" -o -name \"bind\" -o -name \"logstash\" -o -name \".cloudflared\" -o -name \"sites-enabled\" -o -name \"ldap\" -o -name \".irssi\" -o -name \"filezilla\" -o -name \"seeddms*\" -o -name \".vnc\" -o -name \"cacti\" -o -name \"neo4j\" -o -name \"mysql\" -o -name \"keyrings\" -o -name \".svn\" -o -name \".bluemix\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` + FIND_DIR_ETC=`eval_bckgrd "find /etc -type d -name \"couchdb\" -o -name \"bind\" -o -name \"system.d\" -o -name \"logstash\" -o -name \"sites-enabled\" -o -name \".cloudflared\" -o -name \"ldap\" -o -name \".irssi\" -o -name \"filezilla\" -o -name \"seeddms*\" -o -name \".vnc\" -o -name \"cacti\" -o -name \"neo4j\" -o -name \"mysql\" -o -name \"keyrings\" -o -name \".svn\" -o -name \".bluemix\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` + FIND_DIR_HOMESEARCH=`eval_bckgrd "find $HOMESEARCH -type d -name \"couchdb\" -o -name \"bind\" -o -name \"logstash\" -o -name \".cloudflared\" -o -name \"sites-enabled\" -o -name \"ldap\" -o -name \".irssi\" -o -name \"filezilla\" -o -name \"seeddms*\" -o -name \".vnc\" -o -name \"cacti\" -o -name \"neo4j\" -o -name \"mysql\" -o -name \"keyrings\" -o -name \".svn\" -o -name \".bluemix\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` + FIND_DIR_MEDIA=`eval_bckgrd "find /media -type d -name \"couchdb\" -o -name \"bind\" -o -name \"logstash\" -o -name \".cloudflared\" -o -name \"sites-enabled\" -o -name \"ldap\" -o -name \".irssi\" -o -name \"filezilla\" -o -name \"seeddms*\" -o -name \".vnc\" -o -name \"cacti\" -o -name \"neo4j\" -o -name \"mysql\" -o -name \"keyrings\" -o -name \".svn\" -o -name \".bluemix\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` + FIND_DIR_MNT=`eval_bckgrd "find /mnt -type d -name \"couchdb\" -o -name \"bind\" -o -name \"logstash\" -o -name \".cloudflared\" -o -name \"sites-enabled\" -o -name \"ldap\" -o -name \".irssi\" -o -name \"filezilla\" -o -name \"seeddms*\" -o -name \".vnc\" -o -name \"cacti\" -o -name \"neo4j\" -o -name \"mysql\" -o -name \"keyrings\" -o -name \".svn\" -o -name \".bluemix\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` + FIND_DIR_OPT=`eval_bckgrd "find /opt -type d -name \"couchdb\" -o -name \"bind\" -o -name \"logstash\" -o -name \".cloudflared\" -o -name \"sites-enabled\" -o -name \"ldap\" -o -name \".irssi\" -o -name \"filezilla\" -o -name \"seeddms*\" -o -name \".vnc\" -o -name \"cacti\" -o -name \"neo4j\" -o -name \"mysql\" -o -name \"keyrings\" -o -name \".svn\" -o -name \".bluemix\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` + FIND_DIR_PRIVATE=`eval_bckgrd "find /private -type d -name \"couchdb\" -o -name \"bind\" -o -name \"logstash\" -o -name \".cloudflared\" -o -name \"sites-enabled\" -o -name \"ldap\" -o -name \".irssi\" -o -name \"filezilla\" -o -name \"seeddms*\" -o -name \".vnc\" -o -name \"cacti\" -o -name \"neo4j\" -o -name \"mysql\" -o -name \"keyrings\" -o -name \".svn\" -o -name \".bluemix\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` + FIND_DIR_SBIN=`eval_bckgrd "find /sbin -type d -name \"couchdb\" -o -name \"bind\" -o -name \"logstash\" -o -name \".cloudflared\" -o -name \"sites-enabled\" -o -name \"ldap\" -o -name \".irssi\" -o -name \"filezilla\" -o -name \"seeddms*\" -o -name \".vnc\" -o -name \"cacti\" -o -name \"neo4j\" -o -name \"mysql\" -o -name \"keyrings\" -o -name \".svn\" -o -name \".bluemix\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` + FIND_DIR_SNAP=`eval_bckgrd "find /snap -type d -name \"couchdb\" -o -name \"bind\" -o -name \"logstash\" -o -name \".cloudflared\" -o -name \"sites-enabled\" -o -name \"ldap\" -o -name \".irssi\" -o -name \"filezilla\" -o -name \"seeddms*\" -o -name \".vnc\" -o -name \"cacti\" -o -name \"neo4j\" -o -name \"mysql\" -o -name \"keyrings\" -o -name \".svn\" -o -name \".bluemix\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` + FIND_DIR_SRV=`eval_bckgrd "find /srv -type d -name \"couchdb\" -o -name \"bind\" -o -name \"logstash\" -o -name \".cloudflared\" -o -name \"sites-enabled\" -o -name \"ldap\" -o -name \".irssi\" -o -name \"filezilla\" -o -name \"seeddms*\" -o -name \".vnc\" -o -name \"cacti\" -o -name \"neo4j\" -o -name \"mysql\" -o -name \"keyrings\" -o -name \".svn\" -o -name \".bluemix\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` + FIND_DIR_TMP=`eval_bckgrd "find /tmp -type d -name \"couchdb\" -o -name \"bind\" -o -name \"logstash\" -o -name \".cloudflared\" -o -name \"sites-enabled\" -o -name \"ldap\" -o -name \".irssi\" -o -name \"filezilla\" -o -name \"seeddms*\" -o -name \".vnc\" -o -name \"cacti\" -o -name \"neo4j\" -o -name \"mysql\" -o -name \"keyrings\" -o -name \".svn\" -o -name \".bluemix\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` + FIND_DIR_USR=`eval_bckgrd "find /usr -type d -name \"couchdb\" -o -name \"bind\" -o -name \"logstash\" -o -name \".cloudflared\" -o -name \"sites-enabled\" -o -name \"ldap\" -o -name \".irssi\" -o -name \"filezilla\" -o -name \"seeddms*\" -o -name \".vnc\" -o -name \"cacti\" -o -name \"neo4j\" -o -name \"mysql\" -o -name \"keyrings\" -o -name \".svn\" -o -name \".bluemix\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` + FIND_DIR_VAR=`eval_bckgrd "find /var -type d -name \"couchdb\" -o -name \"bind\" -o -name \"logstash\" -o -name \".cloudflared\" -o -name \"sites-enabled\" -o -name \"ldap\" -o -name \".irssi\" -o -name \"filezilla\" -o -name \"seeddms*\" -o -name \".vnc\" -o -name \"cacti\" -o -name \"neo4j\" -o -name \"mysql\" -o -name \"keyrings\" -o -name \".svn\" -o -name \".bluemix\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` + FIND_APPLICATIONS=`eval_bckgrd "find /applications -name \"mosquitto.conf\" -o -name \"debian.cnf\" -o -name \"ConsoleHost_history.txt\" -o -name \".env\" -o -name \"krb5.conf\" -o -name \"authorized_keys\" -o -name \"fastcgi_params\" -o -name \"sites.ini\" -o -name \"rsyncd.secrets\" -o -name \"credentials\" -o -name \"printers.xml\" -o -name \"db.php\" -o -name \".git\" -o -name \"protecteduserkey.bin\" -o -name \"*vnc*.ini\" -o -name \"secrets.yml\" -o -name \"docker.socket\" -o -name \"cesi.conf\" -o -name \"iis6.log\" -o -name \"*vnc*.c*nf*\" -o -name \"access.log\" -o -name \"datasources.xml\" -o -name \"gitlab.yml\" -o -name \"autologin.conf\" -o -name \"winscp.ini\" -o -name \"*.viminfo\" -o -name \"error.log\" -o -name \"backup\" -o -name \"access_tokens.json\" -o -name \"gitlab.rm\" -o -name \"Ntds.dit\" -o -name \"php.ini\" -o -name \"setupinfo.bak\" -o -name \"KeePass.enforced*\" -o -name \".plan\" -o -name \"software.sav\" -o -name \"azureProfile.json\" -o -name \".vault-token\" -o -name \"pgsql.conf\" -o -name \"postgresql.conf\" -o -name \"ffftp.ini\" -o -name \"FreeSSHDservice.ini\" -o -name \"*.gpg\" -o -name \"sysprep.inf\" -o -name \"setupinfo\" -o -name \"*.key\" -o -name \"snmpd.conf\" -o -name \"kibana.y*ml\" -o -name \"pg_hba.conf\" -o -name \"*.ftpconfig\" -o -name \"*.csr\" -o -name \"sitemanager.xml\" -o -name \"server.xml\" -o -name \".htpasswd\" -o -name \"*.der\" -o -name \"ntuser.dat\" -o -name \"AppEvent.Evt\" -o -name \"scheduledtasks.xml\" -o -name \"authorized_hosts\" -o -name \"*.crt\" -o -name \"AzureRMContext.json\" -o -name \"my.cnf\" -o -name \"docker.sock\" -o -name \".bashrc\" -o -name \"*.sqlite3\" -o -name \"credentials.db\" -o -name \"database.php\" -o -name \".msmtprc\" -o -name \"unattend.txt\" -o -name \"kadm5.acl\" -o -name \"tomcat-users.xml\" -o -name \"krb5.keytab\" -o -name \"*.pgp\" -o -name \"software\" -o -name \"supervisord.conf\" -o -name \"KeePass.config*\" -o -name \"*.pem\" -o -name \"pgadmin*.db\" -o -name \"*.cer\" -o -name \"*.pfx\" -o -name \"gvm-tools.conf\" -o -name \"ipsec.conf\" -o -name \"security.sav\" -o -name \"TokenCache.dat\" -o -name \"https.conf\" -o -name \"accessTokens.json\" -o -name \"anaconda-ks.cfg\" -o -name \"vault-ssh-helper.hcl\" -o -name \"system.sav\" -o -name \"storage.php\" -o -name \".erlang.cookie\" -o -name \"redis.conf\" -o -name \".google_authenticator\" -o -name \"ftp.ini\" -o -name \"unattended.xml\" -o -name \".lesshst\" -o -name \"*.gnupg\" -o -name \".sudo_as_admin_successful\" -o -name \"scclient.exe\" -o -name \"sysprep.xml\" -o -name \"system\" -o -name \"appcmd.exe\" -o -name \"drives.xml\" -o -name \"*.sqlite\" -o -name \".gitconfig\" -o -name \"httpd.conf\" -o -name \"unattend.xml\" -o -name \"unattend.inf\" -o -name \"access_tokens.db\" -o -name \".ldaprc\" -o -name \"settings.php\" -o -name \".profile\" -o -name \"SecEvent.Evt\" -o -name \"NetSetup.log\" -o -name \".git-credentials\" -o -name \"KeePass.ini\" -o -name \"wp-config.php\" -o -name \"000-default.conf\" -o -name \"recentservers.xml\" -o -name \".pypirc\" -o -name \"wcx_ftp.ini\" -o -name \"hosts.equiv\" -o -name \"known_hosts\" -o -name \"mongod*.conf\" -o -name \"*.keyring\" -o -name \"bash.exe\" -o -name \"cloud.cfg\" -o -name \"id_rsa*\" -o -name \"*.rdg\" -o -name \"pagefile.sys\" -o -name \"backups\" -o -name \".*_history.*\" -o -name \"*.jks\" -o -name \"autologin\" -o -name \"my.ini\" -o -name \"web*.config\" -o -name \"*.ovpn\" -o -name \"ftp.config\" -o -name \"*.db\" -o -name \"SYSTEM\" -o -name \"*.service\" -o -name \"filezilla.xml\" -o -name \"config.php\" -o -name \"*.timer\" -o -name \".k5login\" -o -name \"*config*.php\" -o -name \"https-xampp.conf\" -o -name \"*.socket\" -o -name \"ddclient.conf\" -o -name \"*vnc*.xml\" -o -name \"wsl.exe\" -o -name \".rhosts\" -o -name \"default.sav\" -o -name \"ipsec.secrets\" -o -name \"RDCMan.settings\" -o -name \"*credential*\" -o -name \"id_dsa*\" -o -name \"*password*\" -o -name \".github\" -o -name \"SAM\" -o -name \"docker-compose.yml\" -o -name \"Dockerfile\" -o -name \"elasticsearch.y*ml\" -o -name \"ws_ftp.ini\" -o -name \"passwd\" -o -name \"index.dat\" -o -name \"*.keystore\" -o -name \"hostapd.conf\" -o -name \"*.p12\" -o -name \".recently-used.xbel\" -o -name \"groups.xml\" -o -name \"legacy_credentials.db\" -o -name \"*vnc*.txt\" -o -name \"*.swp\" -o -name \"*.kdbx\" -o -name \"creds*\" -o -name \"rsyncd.conf\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` + FIND_BIN=`eval_bckgrd "find /bin -name \"mosquitto.conf\" -o -name \"debian.cnf\" -o -name \"ConsoleHost_history.txt\" -o -name \".env\" -o -name \"krb5.conf\" -o -name \"authorized_keys\" -o -name \"fastcgi_params\" -o -name \"sites.ini\" -o -name \"rsyncd.secrets\" -o -name \"credentials\" -o -name \"printers.xml\" -o -name \"db.php\" -o -name \".git\" -o -name \"protecteduserkey.bin\" -o -name \"*vnc*.ini\" -o -name \"secrets.yml\" -o -name \"docker.socket\" -o -name \"cesi.conf\" -o -name \"iis6.log\" -o -name \"*vnc*.c*nf*\" -o -name \"access.log\" -o -name \"datasources.xml\" -o -name \"gitlab.yml\" -o -name \"autologin.conf\" -o -name \"winscp.ini\" -o -name \"*.viminfo\" -o -name \"error.log\" -o -name \"backup\" -o -name \"access_tokens.json\" -o -name \"gitlab.rm\" -o -name \"Ntds.dit\" -o -name \"php.ini\" -o -name \"setupinfo.bak\" -o -name \"KeePass.enforced*\" -o -name \".plan\" -o -name \"software.sav\" -o -name \"azureProfile.json\" -o -name \".vault-token\" -o -name \"pgsql.conf\" -o -name \"postgresql.conf\" -o -name \"ffftp.ini\" -o -name \"FreeSSHDservice.ini\" -o -name \"*.gpg\" -o -name \"sysprep.inf\" -o -name \"setupinfo\" -o -name \"*.key\" -o -name \"snmpd.conf\" -o -name \"kibana.y*ml\" -o -name \"pg_hba.conf\" -o -name \"*.ftpconfig\" -o -name \"*.csr\" -o -name \"sitemanager.xml\" -o -name \"server.xml\" -o -name \".htpasswd\" -o -name \"*.der\" -o -name \"ntuser.dat\" -o -name \"AppEvent.Evt\" -o -name \"scheduledtasks.xml\" -o -name \"authorized_hosts\" -o -name \"*.crt\" -o -name \"AzureRMContext.json\" -o -name \"my.cnf\" -o -name \"docker.sock\" -o -name \".bashrc\" -o -name \"*.sqlite3\" -o -name \"credentials.db\" -o -name \"database.php\" -o -name \".msmtprc\" -o -name \"unattend.txt\" -o -name \"kadm5.acl\" -o -name \"tomcat-users.xml\" -o -name \"krb5.keytab\" -o -name \"*.pgp\" -o -name \"software\" -o -name \"supervisord.conf\" -o -name \"KeePass.config*\" -o -name \"*.pem\" -o -name \"pgadmin*.db\" -o -name \"*.cer\" -o -name \"*.pfx\" -o -name \"gvm-tools.conf\" -o -name \"ipsec.conf\" -o -name \"security.sav\" -o -name \"TokenCache.dat\" -o -name \"https.conf\" -o -name \"accessTokens.json\" -o -name \"anaconda-ks.cfg\" -o -name \"vault-ssh-helper.hcl\" -o -name \"system.sav\" -o -name \"storage.php\" -o -name \".erlang.cookie\" -o -name \"redis.conf\" -o -name \".google_authenticator\" -o -name \"ftp.ini\" -o -name \"unattended.xml\" -o -name \".lesshst\" -o -name \"*.gnupg\" -o -name \".sudo_as_admin_successful\" -o -name \"scclient.exe\" -o -name \"sysprep.xml\" -o -name \"system\" -o -name \"appcmd.exe\" -o -name \"drives.xml\" -o -name \"*.sqlite\" -o -name \".gitconfig\" -o -name \"httpd.conf\" -o -name \"unattend.xml\" -o -name \"unattend.inf\" -o -name \"access_tokens.db\" -o -name \".ldaprc\" -o -name \"settings.php\" -o -name \".profile\" -o -name \"SecEvent.Evt\" -o -name \"NetSetup.log\" -o -name \".git-credentials\" -o -name \"KeePass.ini\" -o -name \"wp-config.php\" -o -name \"000-default.conf\" -o -name \"recentservers.xml\" -o -name \".pypirc\" -o -name \"wcx_ftp.ini\" -o -name \"hosts.equiv\" -o -name \"known_hosts\" -o -name \"mongod*.conf\" -o -name \"*.keyring\" -o -name \"bash.exe\" -o -name \"cloud.cfg\" -o -name \"id_rsa*\" -o -name \"*.rdg\" -o -name \"pagefile.sys\" -o -name \"backups\" -o -name \".*_history.*\" -o -name \"*.jks\" -o -name \"autologin\" -o -name \"my.ini\" -o -name \"web*.config\" -o -name \"*.ovpn\" -o -name \"ftp.config\" -o -name \"*.db\" -o -name \"SYSTEM\" -o -name \"*.service\" -o -name \"filezilla.xml\" -o -name \"config.php\" -o -name \"*.timer\" -o -name \".k5login\" -o -name \"*config*.php\" -o -name \"https-xampp.conf\" -o -name \"*.socket\" -o -name \"ddclient.conf\" -o -name \"*vnc*.xml\" -o -name \"wsl.exe\" -o -name \".rhosts\" -o -name \"default.sav\" -o -name \"ipsec.secrets\" -o -name \"RDCMan.settings\" -o -name \"*credential*\" -o -name \"id_dsa*\" -o -name \"*password*\" -o -name \".github\" -o -name \"SAM\" -o -name \"docker-compose.yml\" -o -name \"Dockerfile\" -o -name \"elasticsearch.y*ml\" -o -name \"ws_ftp.ini\" -o -name \"passwd\" -o -name \"index.dat\" -o -name \"*.keystore\" -o -name \"hostapd.conf\" -o -name \"*.p12\" -o -name \".recently-used.xbel\" -o -name \"groups.xml\" -o -name \"legacy_credentials.db\" -o -name \"*vnc*.txt\" -o -name \"*.swp\" -o -name \"*.kdbx\" -o -name \"creds*\" -o -name \"rsyncd.conf\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` + FIND_CACHE=`eval_bckgrd "find /.cache -name \"mosquitto.conf\" -o -name \"debian.cnf\" -o -name \"ConsoleHost_history.txt\" -o -name \".env\" -o -name \"krb5.conf\" -o -name \"authorized_keys\" -o -name \"fastcgi_params\" -o -name \"sites.ini\" -o -name \"rsyncd.secrets\" -o -name \"credentials\" -o -name \"printers.xml\" -o -name \"db.php\" -o -name \".git\" -o -name \"protecteduserkey.bin\" -o -name \"*vnc*.ini\" -o -name \"secrets.yml\" -o -name \"docker.socket\" -o -name \"cesi.conf\" -o -name \"iis6.log\" -o -name \"*vnc*.c*nf*\" -o -name \"access.log\" -o -name \"datasources.xml\" -o -name \"gitlab.yml\" -o -name \"autologin.conf\" -o -name \"winscp.ini\" -o -name \"*.viminfo\" -o -name \"error.log\" -o -name \"backup\" -o -name \"access_tokens.json\" -o -name \"gitlab.rm\" -o -name \"Ntds.dit\" -o -name \"php.ini\" -o -name \"setupinfo.bak\" -o -name \"KeePass.enforced*\" -o -name \".plan\" -o -name \"software.sav\" -o -name \"azureProfile.json\" -o -name \".vault-token\" -o -name \"pgsql.conf\" -o -name \"postgresql.conf\" -o -name \"ffftp.ini\" -o -name \"FreeSSHDservice.ini\" -o -name \"*.gpg\" -o -name \"sysprep.inf\" -o -name \"setupinfo\" -o -name \"*.key\" -o -name \"snmpd.conf\" -o -name \"kibana.y*ml\" -o -name \"pg_hba.conf\" -o -name \"*.ftpconfig\" -o -name \"*.csr\" -o -name \"sitemanager.xml\" -o -name \"server.xml\" -o -name \".htpasswd\" -o -name \"*.der\" -o -name \"ntuser.dat\" -o -name \"AppEvent.Evt\" -o -name \"scheduledtasks.xml\" -o -name \"authorized_hosts\" -o -name \"*.crt\" -o -name \"AzureRMContext.json\" -o -name \"my.cnf\" -o -name \"docker.sock\" -o -name \".bashrc\" -o -name \"*.sqlite3\" -o -name \"credentials.db\" -o -name \"database.php\" -o -name \".msmtprc\" -o -name \"unattend.txt\" -o -name \"kadm5.acl\" -o -name \"tomcat-users.xml\" -o -name \"krb5.keytab\" -o -name \"*.pgp\" -o -name \"software\" -o -name \"supervisord.conf\" -o -name \"KeePass.config*\" -o -name \"*.pem\" -o -name \"pgadmin*.db\" -o -name \"*.cer\" -o -name \"*.pfx\" -o -name \"gvm-tools.conf\" -o -name \"ipsec.conf\" -o -name \"security.sav\" -o -name \"TokenCache.dat\" -o -name \"https.conf\" -o -name \"accessTokens.json\" -o -name \"anaconda-ks.cfg\" -o -name \"vault-ssh-helper.hcl\" -o -name \"system.sav\" -o -name \"storage.php\" -o -name \".erlang.cookie\" -o -name \"redis.conf\" -o -name \".google_authenticator\" -o -name \"ftp.ini\" -o -name \"unattended.xml\" -o -name \".lesshst\" -o -name \"*.gnupg\" -o -name \".sudo_as_admin_successful\" -o -name \"scclient.exe\" -o -name \"sysprep.xml\" -o -name \"system\" -o -name \"appcmd.exe\" -o -name \"drives.xml\" -o -name \"*.sqlite\" -o -name \".gitconfig\" -o -name \"httpd.conf\" -o -name \"unattend.xml\" -o -name \"unattend.inf\" -o -name \"access_tokens.db\" -o -name \".ldaprc\" -o -name \"settings.php\" -o -name \".profile\" -o -name \"SecEvent.Evt\" -o -name \"NetSetup.log\" -o -name \".git-credentials\" -o -name \"KeePass.ini\" -o -name \"wp-config.php\" -o -name \"000-default.conf\" -o -name \"recentservers.xml\" -o -name \".pypirc\" -o -name \"wcx_ftp.ini\" -o -name \"hosts.equiv\" -o -name \"known_hosts\" -o -name \"mongod*.conf\" -o -name \"*.keyring\" -o -name \"bash.exe\" -o -name \"cloud.cfg\" -o -name \"id_rsa*\" -o -name \"*.rdg\" -o -name \"pagefile.sys\" -o -name \"backups\" -o -name \".*_history.*\" -o -name \"*.jks\" -o -name \"autologin\" -o -name \"my.ini\" -o -name \"web*.config\" -o -name \"*.ovpn\" -o -name \"ftp.config\" -o -name \"*.db\" -o -name \"SYSTEM\" -o -name \"*.service\" -o -name \"filezilla.xml\" -o -name \"config.php\" -o -name \"*.timer\" -o -name \".k5login\" -o -name \"*config*.php\" -o -name \"https-xampp.conf\" -o -name \"*.socket\" -o -name \"ddclient.conf\" -o -name \"*vnc*.xml\" -o -name \"wsl.exe\" -o -name \".rhosts\" -o -name \"default.sav\" -o -name \"ipsec.secrets\" -o -name \"RDCMan.settings\" -o -name \"*credential*\" -o -name \"id_dsa*\" -o -name \"*password*\" -o -name \".github\" -o -name \"SAM\" -o -name \"docker-compose.yml\" -o -name \"Dockerfile\" -o -name \"elasticsearch.y*ml\" -o -name \"ws_ftp.ini\" -o -name \"passwd\" -o -name \"index.dat\" -o -name \"*.keystore\" -o -name \"hostapd.conf\" -o -name \"*.p12\" -o -name \".recently-used.xbel\" -o -name \"groups.xml\" -o -name \"legacy_credentials.db\" -o -name \"*vnc*.txt\" -o -name \"*.swp\" -o -name \"*.kdbx\" -o -name \"creds*\" -o -name \"rsyncd.conf\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` + FIND_CDROM=`eval_bckgrd "find /cdrom -name \"mosquitto.conf\" -o -name \"debian.cnf\" -o -name \"ConsoleHost_history.txt\" -o -name \".env\" -o -name \"krb5.conf\" -o -name \"authorized_keys\" -o -name \"fastcgi_params\" -o -name \"sites.ini\" -o -name \"rsyncd.secrets\" -o -name \"credentials\" -o -name \"printers.xml\" -o -name \"db.php\" -o -name \".git\" -o -name \"protecteduserkey.bin\" -o -name \"*vnc*.ini\" -o -name \"secrets.yml\" -o -name \"docker.socket\" -o -name \"cesi.conf\" -o -name \"iis6.log\" -o -name \"*vnc*.c*nf*\" -o -name \"access.log\" -o -name \"datasources.xml\" -o -name \"gitlab.yml\" -o -name \"autologin.conf\" -o -name \"winscp.ini\" -o -name \"*.viminfo\" -o -name \"error.log\" -o -name \"backup\" -o -name \"access_tokens.json\" -o -name \"gitlab.rm\" -o -name \"Ntds.dit\" -o -name \"php.ini\" -o -name \"setupinfo.bak\" -o -name \"KeePass.enforced*\" -o -name \".plan\" -o -name \"software.sav\" -o -name \"azureProfile.json\" -o -name \".vault-token\" -o -name \"pgsql.conf\" -o -name \"postgresql.conf\" -o -name \"ffftp.ini\" -o -name \"FreeSSHDservice.ini\" -o -name \"*.gpg\" -o -name \"sysprep.inf\" -o -name \"setupinfo\" -o -name \"*.key\" -o -name \"snmpd.conf\" -o -name \"kibana.y*ml\" -o -name \"pg_hba.conf\" -o -name \"*.ftpconfig\" -o -name \"*.csr\" -o -name \"sitemanager.xml\" -o -name \"server.xml\" -o -name \".htpasswd\" -o -name \"*.der\" -o -name \"ntuser.dat\" -o -name \"AppEvent.Evt\" -o -name \"scheduledtasks.xml\" -o -name \"authorized_hosts\" -o -name \"*.crt\" -o -name \"AzureRMContext.json\" -o -name \"my.cnf\" -o -name \"docker.sock\" -o -name \".bashrc\" -o -name \"*.sqlite3\" -o -name \"credentials.db\" -o -name \"database.php\" -o -name \".msmtprc\" -o -name \"unattend.txt\" -o -name \"kadm5.acl\" -o -name \"tomcat-users.xml\" -o -name \"krb5.keytab\" -o -name \"*.pgp\" -o -name \"software\" -o -name \"supervisord.conf\" -o -name \"KeePass.config*\" -o -name \"*.pem\" -o -name \"pgadmin*.db\" -o -name \"*.cer\" -o -name \"*.pfx\" -o -name \"gvm-tools.conf\" -o -name \"ipsec.conf\" -o -name \"security.sav\" -o -name \"TokenCache.dat\" -o -name \"https.conf\" -o -name \"accessTokens.json\" -o -name \"anaconda-ks.cfg\" -o -name \"vault-ssh-helper.hcl\" -o -name \"system.sav\" -o -name \"storage.php\" -o -name \".erlang.cookie\" -o -name \"redis.conf\" -o -name \".google_authenticator\" -o -name \"ftp.ini\" -o -name \"unattended.xml\" -o -name \".lesshst\" -o -name \"*.gnupg\" -o -name \".sudo_as_admin_successful\" -o -name \"scclient.exe\" -o -name \"sysprep.xml\" -o -name \"system\" -o -name \"appcmd.exe\" -o -name \"drives.xml\" -o -name \"*.sqlite\" -o -name \".gitconfig\" -o -name \"httpd.conf\" -o -name \"unattend.xml\" -o -name \"unattend.inf\" -o -name \"access_tokens.db\" -o -name \".ldaprc\" -o -name \"settings.php\" -o -name \".profile\" -o -name \"SecEvent.Evt\" -o -name \"NetSetup.log\" -o -name \".git-credentials\" -o -name \"KeePass.ini\" -o -name \"wp-config.php\" -o -name \"000-default.conf\" -o -name \"recentservers.xml\" -o -name \".pypirc\" -o -name \"wcx_ftp.ini\" -o -name \"hosts.equiv\" -o -name \"known_hosts\" -o -name \"mongod*.conf\" -o -name \"*.keyring\" -o -name \"bash.exe\" -o -name \"cloud.cfg\" -o -name \"id_rsa*\" -o -name \"*.rdg\" -o -name \"pagefile.sys\" -o -name \"backups\" -o -name \".*_history.*\" -o -name \"*.jks\" -o -name \"autologin\" -o -name \"my.ini\" -o -name \"web*.config\" -o -name \"*.ovpn\" -o -name \"ftp.config\" -o -name \"*.db\" -o -name \"SYSTEM\" -o -name \"*.service\" -o -name \"filezilla.xml\" -o -name \"config.php\" -o -name \"*.timer\" -o -name \".k5login\" -o -name \"*config*.php\" -o -name \"https-xampp.conf\" -o -name \"*.socket\" -o -name \"ddclient.conf\" -o -name \"*vnc*.xml\" -o -name \"wsl.exe\" -o -name \".rhosts\" -o -name \"default.sav\" -o -name \"ipsec.secrets\" -o -name \"RDCMan.settings\" -o -name \"*credential*\" -o -name \"id_dsa*\" -o -name \"*password*\" -o -name \".github\" -o -name \"SAM\" -o -name \"docker-compose.yml\" -o -name \"Dockerfile\" -o -name \"elasticsearch.y*ml\" -o -name \"ws_ftp.ini\" -o -name \"passwd\" -o -name \"index.dat\" -o -name \"*.keystore\" -o -name \"hostapd.conf\" -o -name \"*.p12\" -o -name \".recently-used.xbel\" -o -name \"groups.xml\" -o -name \"legacy_credentials.db\" -o -name \"*vnc*.txt\" -o -name \"*.swp\" -o -name \"*.kdbx\" -o -name \"creds*\" -o -name \"rsyncd.conf\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` + FIND_ETC=`eval_bckgrd "find /etc -name \"mosquitto.conf\" -o -name \"debian.cnf\" -o -name \"ConsoleHost_history.txt\" -o -name \".env\" -o -name \"krb5.conf\" -o -name \"authorized_keys\" -o -name \"fastcgi_params\" -o -name \"sites.ini\" -o -name \"rsyncd.secrets\" -o -name \"credentials\" -o -name \"printers.xml\" -o -name \"db.php\" -o -name \".git\" -o -name \"protecteduserkey.bin\" -o -name \"*vnc*.ini\" -o -name \"secrets.yml\" -o -name \"docker.socket\" -o -name \"cesi.conf\" -o -name \"iis6.log\" -o -name \"*vnc*.c*nf*\" -o -name \"access.log\" -o -name \"datasources.xml\" -o -name \"gitlab.yml\" -o -name \"autologin.conf\" -o -name \"winscp.ini\" -o -name \"*.viminfo\" -o -name \"error.log\" -o -name \"backup\" -o -name \"access_tokens.json\" -o -name \"gitlab.rm\" -o -name \"Ntds.dit\" -o -name \"php.ini\" -o -name \"setupinfo.bak\" -o -name \"KeePass.enforced*\" -o -name \".plan\" -o -name \"software.sav\" -o -name \"azureProfile.json\" -o -name \".vault-token\" -o -name \"pgsql.conf\" -o -name \"postgresql.conf\" -o -name \"ffftp.ini\" -o -name \"FreeSSHDservice.ini\" -o -name \"*.gpg\" -o -name \"sysprep.inf\" -o -name \"setupinfo\" -o -name \"*.key\" -o -name \"snmpd.conf\" -o -name \"kibana.y*ml\" -o -name \"pg_hba.conf\" -o -name \"*.ftpconfig\" -o -name \"*.csr\" -o -name \"sitemanager.xml\" -o -name \"server.xml\" -o -name \".htpasswd\" -o -name \"*.der\" -o -name \"ntuser.dat\" -o -name \"AppEvent.Evt\" -o -name \"scheduledtasks.xml\" -o -name \"authorized_hosts\" -o -name \"*.crt\" -o -name \"AzureRMContext.json\" -o -name \"my.cnf\" -o -name \"docker.sock\" -o -name \".bashrc\" -o -name \"*.sqlite3\" -o -name \"credentials.db\" -o -name \"database.php\" -o -name \".msmtprc\" -o -name \"unattend.txt\" -o -name \"kadm5.acl\" -o -name \"tomcat-users.xml\" -o -name \"krb5.keytab\" -o -name \"*.pgp\" -o -name \"software\" -o -name \"supervisord.conf\" -o -name \"KeePass.config*\" -o -name \"*.pem\" -o -name \"pgadmin*.db\" -o -name \"*.cer\" -o -name \"*.pfx\" -o -name \"gvm-tools.conf\" -o -name \"ipsec.conf\" -o -name \"security.sav\" -o -name \"TokenCache.dat\" -o -name \"https.conf\" -o -name \"accessTokens.json\" -o -name \"anaconda-ks.cfg\" -o -name \"vault-ssh-helper.hcl\" -o -name \"system.sav\" -o -name \"storage.php\" -o -name \".erlang.cookie\" -o -name \"redis.conf\" -o -name \".google_authenticator\" -o -name \"*knockd*\" -o -name \"ftp.ini\" -o -name \"unattended.xml\" -o -name \".lesshst\" -o -name \"*.gnupg\" -o -name \".sudo_as_admin_successful\" -o -name \"scclient.exe\" -o -name \"sysprep.xml\" -o -name \"system\" -o -name \"appcmd.exe\" -o -name \"drives.xml\" -o -name \"*.sqlite\" -o -name \".gitconfig\" -o -name \"httpd.conf\" -o -name \"unattend.xml\" -o -name \"unattend.inf\" -o -name \"access_tokens.db\" -o -name \".ldaprc\" -o -name \"settings.php\" -o -name \".profile\" -o -name \"SecEvent.Evt\" -o -name \"NetSetup.log\" -o -name \".git-credentials\" -o -name \"KeePass.ini\" -o -name \"wp-config.php\" -o -name \"000-default.conf\" -o -name \"recentservers.xml\" -o -name \".pypirc\" -o -name \"wcx_ftp.ini\" -o -name \"hosts.equiv\" -o -name \"known_hosts\" -o -name \"mongod*.conf\" -o -name \"*.keyring\" -o -name \"bash.exe\" -o -name \"cloud.cfg\" -o -name \"id_rsa*\" -o -name \"*.rdg\" -o -name \"pagefile.sys\" -o -name \"backups\" -o -name \".*_history.*\" -o -name \"*.jks\" -o -name \"autologin\" -o -name \"my.ini\" -o -name \"web*.config\" -o -name \"*.ovpn\" -o -name \"ftp.config\" -o -name \"*.db\" -o -name \"SYSTEM\" -o -name \"*.service\" -o -name \"filezilla.xml\" -o -name \"config.php\" -o -name \"*.timer\" -o -name \".k5login\" -o -name \"*config*.php\" -o -name \"https-xampp.conf\" -o -name \"*.socket\" -o -name \"ddclient.conf\" -o -name \"*vnc*.xml\" -o -name \"wsl.exe\" -o -name \".rhosts\" -o -name \"default.sav\" -o -name \"ipsec.secrets\" -o -name \"RDCMan.settings\" -o -name \"*credential*\" -o -name \"id_dsa*\" -o -name \"*password*\" -o -name \".github\" -o -name \"SAM\" -o -name \"docker-compose.yml\" -o -name \"Dockerfile\" -o -name \"elasticsearch.y*ml\" -o -name \"ws_ftp.ini\" -o -name \"passwd\" -o -name \"index.dat\" -o -name \"*.keystore\" -o -name \"hostapd.conf\" -o -name \"*.p12\" -o -name \".recently-used.xbel\" -o -name \"groups.xml\" -o -name \"legacy_credentials.db\" -o -name \"*vnc*.txt\" -o -name \"*.swp\" -o -name \"*.kdbx\" -o -name \"creds*\" -o -name \"rsyncd.conf\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` + FIND_HOMESEARCH=`eval_bckgrd "find $HOMESEARCH -name \"mosquitto.conf\" -o -name \"debian.cnf\" -o -name \"ConsoleHost_history.txt\" -o -name \".env\" -o -name \"krb5.conf\" -o -name \"authorized_keys\" -o -name \"fastcgi_params\" -o -name \"sites.ini\" -o -name \"rsyncd.secrets\" -o -name \"credentials\" -o -name \"printers.xml\" -o -name \"db.php\" -o -name \".git\" -o -name \"protecteduserkey.bin\" -o -name \"*vnc*.ini\" -o -name \"secrets.yml\" -o -name \"docker.socket\" -o -name \"cesi.conf\" -o -name \"iis6.log\" -o -name \"*vnc*.c*nf*\" -o -name \"access.log\" -o -name \"datasources.xml\" -o -name \"gitlab.yml\" -o -name \"autologin.conf\" -o -name \"winscp.ini\" -o -name \"*.viminfo\" -o -name \"error.log\" -o -name \"backup\" -o -name \"access_tokens.json\" -o -name \"gitlab.rm\" -o -name \"Ntds.dit\" -o -name \"php.ini\" -o -name \"setupinfo.bak\" -o -name \"KeePass.enforced*\" -o -name \".plan\" -o -name \"software.sav\" -o -name \"azureProfile.json\" -o -name \".vault-token\" -o -name \"pgsql.conf\" -o -name \"postgresql.conf\" -o -name \"ffftp.ini\" -o -name \"FreeSSHDservice.ini\" -o -name \"*.gpg\" -o -name \"sysprep.inf\" -o -name \"setupinfo\" -o -name \"*.key\" -o -name \"snmpd.conf\" -o -name \"kibana.y*ml\" -o -name \"pg_hba.conf\" -o -name \"*.ftpconfig\" -o -name \"*.csr\" -o -name \"sitemanager.xml\" -o -name \"server.xml\" -o -name \".htpasswd\" -o -name \"*.der\" -o -name \"ntuser.dat\" -o -name \"AppEvent.Evt\" -o -name \"scheduledtasks.xml\" -o -name \"authorized_hosts\" -o -name \"*.crt\" -o -name \"AzureRMContext.json\" -o -name \"my.cnf\" -o -name \"docker.sock\" -o -name \".bashrc\" -o -name \"*.sqlite3\" -o -name \"credentials.db\" -o -name \"database.php\" -o -name \".msmtprc\" -o -name \"unattend.txt\" -o -name \"kadm5.acl\" -o -name \"tomcat-users.xml\" -o -name \"krb5.keytab\" -o -name \"*.pgp\" -o -name \"software\" -o -name \"supervisord.conf\" -o -name \"KeePass.config*\" -o -name \"*.pem\" -o -name \"pgadmin*.db\" -o -name \"*.cer\" -o -name \"*.pfx\" -o -name \"gvm-tools.conf\" -o -name \"ipsec.conf\" -o -name \"security.sav\" -o -name \"TokenCache.dat\" -o -name \"https.conf\" -o -name \"accessTokens.json\" -o -name \"anaconda-ks.cfg\" -o -name \"vault-ssh-helper.hcl\" -o -name \"system.sav\" -o -name \"storage.php\" -o -name \".erlang.cookie\" -o -name \"redis.conf\" -o -name \".google_authenticator\" -o -name \"ftp.ini\" -o -name \"unattended.xml\" -o -name \".lesshst\" -o -name \"*.gnupg\" -o -name \".sudo_as_admin_successful\" -o -name \"scclient.exe\" -o -name \"sysprep.xml\" -o -name \"system\" -o -name \"appcmd.exe\" -o -name \"drives.xml\" -o -name \"*.sqlite\" -o -name \".gitconfig\" -o -name \"httpd.conf\" -o -name \"unattend.xml\" -o -name \"unattend.inf\" -o -name \"access_tokens.db\" -o -name \".ldaprc\" -o -name \"settings.php\" -o -name \".profile\" -o -name \"SecEvent.Evt\" -o -name \"NetSetup.log\" -o -name \".git-credentials\" -o -name \"KeePass.ini\" -o -name \"wp-config.php\" -o -name \"000-default.conf\" -o -name \"recentservers.xml\" -o -name \".pypirc\" -o -name \"wcx_ftp.ini\" -o -name \"hosts.equiv\" -o -name \"known_hosts\" -o -name \"mongod*.conf\" -o -name \"*.keyring\" -o -name \"bash.exe\" -o -name \"cloud.cfg\" -o -name \"id_rsa*\" -o -name \"*.rdg\" -o -name \"pagefile.sys\" -o -name \"backups\" -o -name \".*_history.*\" -o -name \"*.jks\" -o -name \"autologin\" -o -name \"my.ini\" -o -name \"web*.config\" -o -name \"*.ovpn\" -o -name \"ftp.config\" -o -name \"*.db\" -o -name \"SYSTEM\" -o -name \"*.service\" -o -name \"filezilla.xml\" -o -name \"config.php\" -o -name \"*.timer\" -o -name \".k5login\" -o -name \"*config*.php\" -o -name \"https-xampp.conf\" -o -name \"*.socket\" -o -name \"ddclient.conf\" -o -name \"*vnc*.xml\" -o -name \"wsl.exe\" -o -name \".rhosts\" -o -name \"default.sav\" -o -name \"ipsec.secrets\" -o -name \"RDCMan.settings\" -o -name \"*credential*\" -o -name \"id_dsa*\" -o -name \"ssh*config\" -o -name \"*password*\" -o -name \".github\" -o -name \"SAM\" -o -name \"docker-compose.yml\" -o -name \"Dockerfile\" -o -name \"elasticsearch.y*ml\" -o -name \"ws_ftp.ini\" -o -name \"passwd\" -o -name \"index.dat\" -o -name \"*.keystore\" -o -name \"hostapd.conf\" -o -name \"*.p12\" -o -name \".recently-used.xbel\" -o -name \"groups.xml\" -o -name \"legacy_credentials.db\" -o -name \"*vnc*.txt\" -o -name \"*.swp\" -o -name \"*.kdbx\" -o -name \"creds*\" -o -name \"rsyncd.conf\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` + FIND_LIB=`eval_bckgrd "find /lib -name \"*.timer\" -o -name \"*.service\" -o -name \"*.socket\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` + FIND_LIB32=`eval_bckgrd "find /lib32 -name \"*.timer\" -o -name \"*.service\" -o -name \"*.socket\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` + FIND_LIB64=`eval_bckgrd "find /lib64 -name \"*.timer\" -o -name \"*.service\" -o -name \"*.socket\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` + FIND_MEDIA=`eval_bckgrd "find /media -name \"mosquitto.conf\" -o -name \"debian.cnf\" -o -name \"ConsoleHost_history.txt\" -o -name \".env\" -o -name \"krb5.conf\" -o -name \"authorized_keys\" -o -name \"fastcgi_params\" -o -name \"sites.ini\" -o -name \"rsyncd.secrets\" -o -name \"credentials\" -o -name \"printers.xml\" -o -name \"db.php\" -o -name \".git\" -o -name \"protecteduserkey.bin\" -o -name \"*vnc*.ini\" -o -name \"secrets.yml\" -o -name \"docker.socket\" -o -name \"cesi.conf\" -o -name \"iis6.log\" -o -name \"*vnc*.c*nf*\" -o -name \"access.log\" -o -name \"datasources.xml\" -o -name \"gitlab.yml\" -o -name \"autologin.conf\" -o -name \"winscp.ini\" -o -name \"*.viminfo\" -o -name \"error.log\" -o -name \"backup\" -o -name \"access_tokens.json\" -o -name \"gitlab.rm\" -o -name \"Ntds.dit\" -o -name \"php.ini\" -o -name \"setupinfo.bak\" -o -name \"KeePass.enforced*\" -o -name \".plan\" -o -name \"software.sav\" -o -name \"azureProfile.json\" -o -name \".vault-token\" -o -name \"pgsql.conf\" -o -name \"postgresql.conf\" -o -name \"ffftp.ini\" -o -name \"FreeSSHDservice.ini\" -o -name \"*.gpg\" -o -name \"sysprep.inf\" -o -name \"setupinfo\" -o -name \"*.key\" -o -name \"snmpd.conf\" -o -name \"kibana.y*ml\" -o -name \"pg_hba.conf\" -o -name \"*.ftpconfig\" -o -name \"*.csr\" -o -name \"sitemanager.xml\" -o -name \"server.xml\" -o -name \".htpasswd\" -o -name \"*.der\" -o -name \"ntuser.dat\" -o -name \"AppEvent.Evt\" -o -name \"scheduledtasks.xml\" -o -name \"authorized_hosts\" -o -name \"*.crt\" -o -name \"AzureRMContext.json\" -o -name \"my.cnf\" -o -name \"docker.sock\" -o -name \".bashrc\" -o -name \"*.sqlite3\" -o -name \"credentials.db\" -o -name \"database.php\" -o -name \".msmtprc\" -o -name \"unattend.txt\" -o -name \"kadm5.acl\" -o -name \"tomcat-users.xml\" -o -name \"krb5.keytab\" -o -name \"*.pgp\" -o -name \"software\" -o -name \"supervisord.conf\" -o -name \"KeePass.config*\" -o -name \"*.pem\" -o -name \"pgadmin*.db\" -o -name \"*.cer\" -o -name \"*.pfx\" -o -name \"gvm-tools.conf\" -o -name \"ipsec.conf\" -o -name \"security.sav\" -o -name \"TokenCache.dat\" -o -name \"https.conf\" -o -name \"accessTokens.json\" -o -name \"anaconda-ks.cfg\" -o -name \"vault-ssh-helper.hcl\" -o -name \"system.sav\" -o -name \"storage.php\" -o -name \".erlang.cookie\" -o -name \"redis.conf\" -o -name \".google_authenticator\" -o -name \"ftp.ini\" -o -name \"unattended.xml\" -o -name \".lesshst\" -o -name \"*.gnupg\" -o -name \".sudo_as_admin_successful\" -o -name \"scclient.exe\" -o -name \"sysprep.xml\" -o -name \"system\" -o -name \"appcmd.exe\" -o -name \"drives.xml\" -o -name \"*.sqlite\" -o -name \".gitconfig\" -o -name \"httpd.conf\" -o -name \"unattend.xml\" -o -name \"unattend.inf\" -o -name \"access_tokens.db\" -o -name \".ldaprc\" -o -name \"settings.php\" -o -name \".profile\" -o -name \"SecEvent.Evt\" -o -name \"NetSetup.log\" -o -name \".git-credentials\" -o -name \"KeePass.ini\" -o -name \"wp-config.php\" -o -name \"000-default.conf\" -o -name \"recentservers.xml\" -o -name \".pypirc\" -o -name \"wcx_ftp.ini\" -o -name \"hosts.equiv\" -o -name \"known_hosts\" -o -name \"mongod*.conf\" -o -name \"*.keyring\" -o -name \"bash.exe\" -o -name \"cloud.cfg\" -o -name \"id_rsa*\" -o -name \"*.rdg\" -o -name \"pagefile.sys\" -o -name \"backups\" -o -name \".*_history.*\" -o -name \"*.jks\" -o -name \"autologin\" -o -name \"my.ini\" -o -name \"web*.config\" -o -name \"*.ovpn\" -o -name \"ftp.config\" -o -name \"*.db\" -o -name \"SYSTEM\" -o -name \"*.service\" -o -name \"filezilla.xml\" -o -name \"config.php\" -o -name \"*.timer\" -o -name \".k5login\" -o -name \"*config*.php\" -o -name \"https-xampp.conf\" -o -name \"*.socket\" -o -name \"ddclient.conf\" -o -name \"*vnc*.xml\" -o -name \"wsl.exe\" -o -name \".rhosts\" -o -name \"default.sav\" -o -name \"ipsec.secrets\" -o -name \"RDCMan.settings\" -o -name \"*credential*\" -o -name \"id_dsa*\" -o -name \"*password*\" -o -name \".github\" -o -name \"SAM\" -o -name \"docker-compose.yml\" -o -name \"Dockerfile\" -o -name \"elasticsearch.y*ml\" -o -name \"ws_ftp.ini\" -o -name \"passwd\" -o -name \"index.dat\" -o -name \"*.keystore\" -o -name \"hostapd.conf\" -o -name \"*.p12\" -o -name \".recently-used.xbel\" -o -name \"groups.xml\" -o -name \"legacy_credentials.db\" -o -name \"*vnc*.txt\" -o -name \"*.swp\" -o -name \"*.kdbx\" -o -name \"creds*\" -o -name \"rsyncd.conf\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` + FIND_MNT=`eval_bckgrd "find /mnt -name \"mosquitto.conf\" -o -name \"debian.cnf\" -o -name \"ConsoleHost_history.txt\" -o -name \".env\" -o -name \"krb5.conf\" -o -name \"authorized_keys\" -o -name \"fastcgi_params\" -o -name \"sites.ini\" -o -name \"rsyncd.secrets\" -o -name \"credentials\" -o -name \"printers.xml\" -o -name \"db.php\" -o -name \".git\" -o -name \"protecteduserkey.bin\" -o -name \"*vnc*.ini\" -o -name \"secrets.yml\" -o -name \"docker.socket\" -o -name \"cesi.conf\" -o -name \"iis6.log\" -o -name \"*vnc*.c*nf*\" -o -name \"sess_*\" -o -name \"access.log\" -o -name \"datasources.xml\" -o -name \"gitlab.yml\" -o -name \"autologin.conf\" -o -name \"winscp.ini\" -o -name \"*.viminfo\" -o -name \"error.log\" -o -name \"backup\" -o -name \"access_tokens.json\" -o -name \"gitlab.rm\" -o -name \"Ntds.dit\" -o -name \"php.ini\" -o -name \"setupinfo.bak\" -o -name \"KeePass.enforced*\" -o -name \".plan\" -o -name \"software.sav\" -o -name \"azureProfile.json\" -o -name \".vault-token\" -o -name \"pgsql.conf\" -o -name \"postgresql.conf\" -o -name \"ffftp.ini\" -o -name \"FreeSSHDservice.ini\" -o -name \"*.gpg\" -o -name \"sysprep.inf\" -o -name \"setupinfo\" -o -name \"*.key\" -o -name \"snmpd.conf\" -o -name \"kibana.y*ml\" -o -name \"pg_hba.conf\" -o -name \"*.ftpconfig\" -o -name \"*.csr\" -o -name \"sitemanager.xml\" -o -name \"server.xml\" -o -name \".htpasswd\" -o -name \"*.der\" -o -name \"ntuser.dat\" -o -name \"AppEvent.Evt\" -o -name \"scheduledtasks.xml\" -o -name \"authorized_hosts\" -o -name \"*.crt\" -o -name \"AzureRMContext.json\" -o -name \"my.cnf\" -o -name \"docker.sock\" -o -name \".bashrc\" -o -name \"*.sqlite3\" -o -name \"credentials.db\" -o -name \"database.php\" -o -name \".msmtprc\" -o -name \"unattend.txt\" -o -name \"kadm5.acl\" -o -name \"tomcat-users.xml\" -o -name \"krb5.keytab\" -o -name \"*.pgp\" -o -name \"software\" -o -name \"supervisord.conf\" -o -name \"KeePass.config*\" -o -name \"*.pem\" -o -name \"pgadmin*.db\" -o -name \"*.cer\" -o -name \"*.pfx\" -o -name \"gvm-tools.conf\" -o -name \"ipsec.conf\" -o -name \"security.sav\" -o -name \"TokenCache.dat\" -o -name \"https.conf\" -o -name \"accessTokens.json\" -o -name \"anaconda-ks.cfg\" -o -name \"vault-ssh-helper.hcl\" -o -name \"system.sav\" -o -name \"storage.php\" -o -name \".erlang.cookie\" -o -name \"redis.conf\" -o -name \".google_authenticator\" -o -name \"ftp.ini\" -o -name \"unattended.xml\" -o -name \".lesshst\" -o -name \"*.gnupg\" -o -name \".sudo_as_admin_successful\" -o -name \"scclient.exe\" -o -name \"sysprep.xml\" -o -name \"system\" -o -name \"appcmd.exe\" -o -name \"drives.xml\" -o -name \"*.sqlite\" -o -name \".gitconfig\" -o -name \"httpd.conf\" -o -name \"unattend.xml\" -o -name \"unattend.inf\" -o -name \"access_tokens.db\" -o -name \".ldaprc\" -o -name \"settings.php\" -o -name \".profile\" -o -name \"SecEvent.Evt\" -o -name \"NetSetup.log\" -o -name \".git-credentials\" -o -name \"KeePass.ini\" -o -name \"wp-config.php\" -o -name \"000-default.conf\" -o -name \"recentservers.xml\" -o -name \".pypirc\" -o -name \"wcx_ftp.ini\" -o -name \"hosts.equiv\" -o -name \"known_hosts\" -o -name \"mongod*.conf\" -o -name \"*.keyring\" -o -name \"bash.exe\" -o -name \"cloud.cfg\" -o -name \"id_rsa*\" -o -name \"*.rdg\" -o -name \"pagefile.sys\" -o -name \"backups\" -o -name \".*_history.*\" -o -name \"*.jks\" -o -name \"autologin\" -o -name \"my.ini\" -o -name \"web*.config\" -o -name \"*.ovpn\" -o -name \"ftp.config\" -o -name \"*.db\" -o -name \"SYSTEM\" -o -name \"*.service\" -o -name \"filezilla.xml\" -o -name \"config.php\" -o -name \"*.timer\" -o -name \".k5login\" -o -name \"*config*.php\" -o -name \"https-xampp.conf\" -o -name \"*.socket\" -o -name \"ddclient.conf\" -o -name \"*vnc*.xml\" -o -name \"wsl.exe\" -o -name \".rhosts\" -o -name \"default.sav\" -o -name \"ipsec.secrets\" -o -name \"RDCMan.settings\" -o -name \"*credential*\" -o -name \"id_dsa*\" -o -name \"*password*\" -o -name \".github\" -o -name \"SAM\" -o -name \"docker-compose.yml\" -o -name \"Dockerfile\" -o -name \"elasticsearch.y*ml\" -o -name \"ws_ftp.ini\" -o -name \"passwd\" -o -name \"index.dat\" -o -name \"*.keystore\" -o -name \"hostapd.conf\" -o -name \"*.p12\" -o -name \".recently-used.xbel\" -o -name \"groups.xml\" -o -name \"legacy_credentials.db\" -o -name \"*vnc*.txt\" -o -name \"*.swp\" -o -name \"*.kdbx\" -o -name \"creds*\" -o -name \"rsyncd.conf\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` + FIND_OPT=`eval_bckgrd "find /opt -name \"mosquitto.conf\" -o -name \"debian.cnf\" -o -name \"ConsoleHost_history.txt\" -o -name \".env\" -o -name \"krb5.conf\" -o -name \"authorized_keys\" -o -name \"fastcgi_params\" -o -name \"sites.ini\" -o -name \"rsyncd.secrets\" -o -name \"credentials\" -o -name \"printers.xml\" -o -name \"db.php\" -o -name \".git\" -o -name \"protecteduserkey.bin\" -o -name \"*vnc*.ini\" -o -name \"secrets.yml\" -o -name \"docker.socket\" -o -name \"cesi.conf\" -o -name \"iis6.log\" -o -name \"*vnc*.c*nf*\" -o -name \"access.log\" -o -name \"datasources.xml\" -o -name \"gitlab.yml\" -o -name \"autologin.conf\" -o -name \"winscp.ini\" -o -name \"*.viminfo\" -o -name \"error.log\" -o -name \"backup\" -o -name \"access_tokens.json\" -o -name \"gitlab.rm\" -o -name \"Ntds.dit\" -o -name \"php.ini\" -o -name \"setupinfo.bak\" -o -name \"KeePass.enforced*\" -o -name \".plan\" -o -name \"software.sav\" -o -name \"azureProfile.json\" -o -name \".vault-token\" -o -name \"pgsql.conf\" -o -name \"postgresql.conf\" -o -name \"ffftp.ini\" -o -name \"FreeSSHDservice.ini\" -o -name \"*.gpg\" -o -name \"sysprep.inf\" -o -name \"setupinfo\" -o -name \"*.key\" -o -name \"snmpd.conf\" -o -name \"kibana.y*ml\" -o -name \"pg_hba.conf\" -o -name \"*.ftpconfig\" -o -name \"*.csr\" -o -name \"sitemanager.xml\" -o -name \"server.xml\" -o -name \".htpasswd\" -o -name \"*.der\" -o -name \"ntuser.dat\" -o -name \"AppEvent.Evt\" -o -name \"scheduledtasks.xml\" -o -name \"authorized_hosts\" -o -name \"*.crt\" -o -name \"AzureRMContext.json\" -o -name \"my.cnf\" -o -name \"docker.sock\" -o -name \".bashrc\" -o -name \"*.sqlite3\" -o -name \"credentials.db\" -o -name \"database.php\" -o -name \".msmtprc\" -o -name \"unattend.txt\" -o -name \"kadm5.acl\" -o -name \"tomcat-users.xml\" -o -name \"krb5.keytab\" -o -name \"*.pgp\" -o -name \"software\" -o -name \"supervisord.conf\" -o -name \"KeePass.config*\" -o -name \"*.pem\" -o -name \"pgadmin*.db\" -o -name \"*.cer\" -o -name \"*.pfx\" -o -name \"gvm-tools.conf\" -o -name \"ipsec.conf\" -o -name \"security.sav\" -o -name \"TokenCache.dat\" -o -name \"https.conf\" -o -name \"accessTokens.json\" -o -name \"anaconda-ks.cfg\" -o -name \"vault-ssh-helper.hcl\" -o -name \"system.sav\" -o -name \"storage.php\" -o -name \".erlang.cookie\" -o -name \"redis.conf\" -o -name \".google_authenticator\" -o -name \"ftp.ini\" -o -name \"unattended.xml\" -o -name \".lesshst\" -o -name \"*.gnupg\" -o -name \".sudo_as_admin_successful\" -o -name \"scclient.exe\" -o -name \"sysprep.xml\" -o -name \"system\" -o -name \"appcmd.exe\" -o -name \"drives.xml\" -o -name \"*.sqlite\" -o -name \".gitconfig\" -o -name \"httpd.conf\" -o -name \"unattend.xml\" -o -name \"unattend.inf\" -o -name \"access_tokens.db\" -o -name \".ldaprc\" -o -name \"settings.php\" -o -name \".profile\" -o -name \"SecEvent.Evt\" -o -name \"NetSetup.log\" -o -name \".git-credentials\" -o -name \"KeePass.ini\" -o -name \"wp-config.php\" -o -name \"000-default.conf\" -o -name \"recentservers.xml\" -o -name \".pypirc\" -o -name \"wcx_ftp.ini\" -o -name \"hosts.equiv\" -o -name \"known_hosts\" -o -name \"mongod*.conf\" -o -name \"*.keyring\" -o -name \"bash.exe\" -o -name \"cloud.cfg\" -o -name \"id_rsa*\" -o -name \"*.rdg\" -o -name \"pagefile.sys\" -o -name \"backups\" -o -name \".*_history.*\" -o -name \"*.jks\" -o -name \"autologin\" -o -name \"my.ini\" -o -name \"web*.config\" -o -name \"*.ovpn\" -o -name \"ftp.config\" -o -name \"*.db\" -o -name \"SYSTEM\" -o -name \"*.service\" -o -name \"filezilla.xml\" -o -name \"config.php\" -o -name \"*.timer\" -o -name \".k5login\" -o -name \"*config*.php\" -o -name \"https-xampp.conf\" -o -name \"*.socket\" -o -name \"ddclient.conf\" -o -name \"*vnc*.xml\" -o -name \"wsl.exe\" -o -name \".rhosts\" -o -name \"default.sav\" -o -name \"ipsec.secrets\" -o -name \"RDCMan.settings\" -o -name \"*credential*\" -o -name \"id_dsa*\" -o -name \"*password*\" -o -name \".github\" -o -name \"SAM\" -o -name \"docker-compose.yml\" -o -name \"Dockerfile\" -o -name \"elasticsearch.y*ml\" -o -name \"ws_ftp.ini\" -o -name \"passwd\" -o -name \"index.dat\" -o -name \"*.keystore\" -o -name \"hostapd.conf\" -o -name \"*.p12\" -o -name \".recently-used.xbel\" -o -name \"groups.xml\" -o -name \"legacy_credentials.db\" -o -name \"*vnc*.txt\" -o -name \"*.swp\" -o -name \"*.kdbx\" -o -name \"creds*\" -o -name \"rsyncd.conf\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` + FIND_PRIVATE=`eval_bckgrd "find /private -name \"mosquitto.conf\" -o -name \"debian.cnf\" -o -name \"ConsoleHost_history.txt\" -o -name \".env\" -o -name \"krb5.conf\" -o -name \"authorized_keys\" -o -name \"fastcgi_params\" -o -name \"sites.ini\" -o -name \"rsyncd.secrets\" -o -name \"credentials\" -o -name \"printers.xml\" -o -name \"db.php\" -o -name \".git\" -o -name \"protecteduserkey.bin\" -o -name \"*vnc*.ini\" -o -name \"secrets.yml\" -o -name \"docker.socket\" -o -name \"cesi.conf\" -o -name \"iis6.log\" -o -name \"*vnc*.c*nf*\" -o -name \"access.log\" -o -name \"datasources.xml\" -o -name \"gitlab.yml\" -o -name \"autologin.conf\" -o -name \"winscp.ini\" -o -name \"*.viminfo\" -o -name \"error.log\" -o -name \"backup\" -o -name \"access_tokens.json\" -o -name \"gitlab.rm\" -o -name \"Ntds.dit\" -o -name \"php.ini\" -o -name \"setupinfo.bak\" -o -name \"KeePass.enforced*\" -o -name \".plan\" -o -name \"software.sav\" -o -name \"azureProfile.json\" -o -name \".vault-token\" -o -name \"pgsql.conf\" -o -name \"postgresql.conf\" -o -name \"ffftp.ini\" -o -name \"FreeSSHDservice.ini\" -o -name \"*.gpg\" -o -name \"sysprep.inf\" -o -name \"setupinfo\" -o -name \"*.key\" -o -name \"snmpd.conf\" -o -name \"kibana.y*ml\" -o -name \"pg_hba.conf\" -o -name \"*.ftpconfig\" -o -name \"*.csr\" -o -name \"sitemanager.xml\" -o -name \"server.xml\" -o -name \".htpasswd\" -o -name \"*.der\" -o -name \"ntuser.dat\" -o -name \"AppEvent.Evt\" -o -name \"scheduledtasks.xml\" -o -name \"authorized_hosts\" -o -name \"*.crt\" -o -name \"AzureRMContext.json\" -o -name \"my.cnf\" -o -name \"docker.sock\" -o -name \".bashrc\" -o -name \"*.sqlite3\" -o -name \"credentials.db\" -o -name \"database.php\" -o -name \".msmtprc\" -o -name \"unattend.txt\" -o -name \"kadm5.acl\" -o -name \"tomcat-users.xml\" -o -name \"krb5.keytab\" -o -name \"*.pgp\" -o -name \"software\" -o -name \"supervisord.conf\" -o -name \"KeePass.config*\" -o -name \"*.pem\" -o -name \"pgadmin*.db\" -o -name \"*.cer\" -o -name \"*.pfx\" -o -name \"gvm-tools.conf\" -o -name \"ipsec.conf\" -o -name \"security.sav\" -o -name \"TokenCache.dat\" -o -name \"https.conf\" -o -name \"accessTokens.json\" -o -name \"anaconda-ks.cfg\" -o -name \"vault-ssh-helper.hcl\" -o -name \"system.sav\" -o -name \"storage.php\" -o -name \".erlang.cookie\" -o -name \"redis.conf\" -o -name \".google_authenticator\" -o -name \"ftp.ini\" -o -name \"unattended.xml\" -o -name \".lesshst\" -o -name \"*.gnupg\" -o -name \".sudo_as_admin_successful\" -o -name \"scclient.exe\" -o -name \"sysprep.xml\" -o -name \"system\" -o -name \"appcmd.exe\" -o -name \"drives.xml\" -o -name \"*.sqlite\" -o -name \".gitconfig\" -o -name \"httpd.conf\" -o -name \"unattend.xml\" -o -name \"unattend.inf\" -o -name \"access_tokens.db\" -o -name \".ldaprc\" -o -name \"settings.php\" -o -name \".profile\" -o -name \"SecEvent.Evt\" -o -name \"NetSetup.log\" -o -name \".git-credentials\" -o -name \"KeePass.ini\" -o -name \"wp-config.php\" -o -name \"000-default.conf\" -o -name \"recentservers.xml\" -o -name \".pypirc\" -o -name \"wcx_ftp.ini\" -o -name \"hosts.equiv\" -o -name \"known_hosts\" -o -name \"mongod*.conf\" -o -name \"*.keyring\" -o -name \"bash.exe\" -o -name \"cloud.cfg\" -o -name \"id_rsa*\" -o -name \"*.rdg\" -o -name \"pagefile.sys\" -o -name \"backups\" -o -name \".*_history.*\" -o -name \"*.jks\" -o -name \"autologin\" -o -name \"my.ini\" -o -name \"web*.config\" -o -name \"*.ovpn\" -o -name \"ftp.config\" -o -name \"*.db\" -o -name \"SYSTEM\" -o -name \"*.service\" -o -name \"filezilla.xml\" -o -name \"config.php\" -o -name \"*.timer\" -o -name \".k5login\" -o -name \"*config*.php\" -o -name \"https-xampp.conf\" -o -name \"*.socket\" -o -name \"ddclient.conf\" -o -name \"*vnc*.xml\" -o -name \"wsl.exe\" -o -name \".rhosts\" -o -name \"default.sav\" -o -name \"ipsec.secrets\" -o -name \"RDCMan.settings\" -o -name \"*credential*\" -o -name \"id_dsa*\" -o -name \"*password*\" -o -name \".github\" -o -name \"SAM\" -o -name \"docker-compose.yml\" -o -name \"Dockerfile\" -o -name \"elasticsearch.y*ml\" -o -name \"ws_ftp.ini\" -o -name \"passwd\" -o -name \"index.dat\" -o -name \"*.keystore\" -o -name \"hostapd.conf\" -o -name \"*.p12\" -o -name \".recently-used.xbel\" -o -name \"groups.xml\" -o -name \"legacy_credentials.db\" -o -name \"*vnc*.txt\" -o -name \"*.swp\" -o -name \"*.kdbx\" -o -name \"creds*\" -o -name \"rsyncd.conf\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` + FIND_RUN=`eval_bckgrd "find /run -name \"*.timer\" -o -name \"*.service\" -o -name \"*.socket\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` + FIND_SBIN=`eval_bckgrd "find /sbin -name \"mosquitto.conf\" -o -name \"debian.cnf\" -o -name \"ConsoleHost_history.txt\" -o -name \".env\" -o -name \"krb5.conf\" -o -name \"authorized_keys\" -o -name \"fastcgi_params\" -o -name \"sites.ini\" -o -name \"rsyncd.secrets\" -o -name \"credentials\" -o -name \"printers.xml\" -o -name \"db.php\" -o -name \".git\" -o -name \"protecteduserkey.bin\" -o -name \"*vnc*.ini\" -o -name \"secrets.yml\" -o -name \"docker.socket\" -o -name \"cesi.conf\" -o -name \"iis6.log\" -o -name \"*vnc*.c*nf*\" -o -name \"access.log\" -o -name \"datasources.xml\" -o -name \"gitlab.yml\" -o -name \"autologin.conf\" -o -name \"winscp.ini\" -o -name \"*.viminfo\" -o -name \"error.log\" -o -name \"backup\" -o -name \"access_tokens.json\" -o -name \"gitlab.rm\" -o -name \"Ntds.dit\" -o -name \"php.ini\" -o -name \"setupinfo.bak\" -o -name \"KeePass.enforced*\" -o -name \".plan\" -o -name \"software.sav\" -o -name \"azureProfile.json\" -o -name \".vault-token\" -o -name \"pgsql.conf\" -o -name \"postgresql.conf\" -o -name \"ffftp.ini\" -o -name \"FreeSSHDservice.ini\" -o -name \"*.gpg\" -o -name \"sysprep.inf\" -o -name \"setupinfo\" -o -name \"*.key\" -o -name \"snmpd.conf\" -o -name \"kibana.y*ml\" -o -name \"pg_hba.conf\" -o -name \"*.ftpconfig\" -o -name \"*.csr\" -o -name \"sitemanager.xml\" -o -name \"server.xml\" -o -name \".htpasswd\" -o -name \"*.der\" -o -name \"ntuser.dat\" -o -name \"AppEvent.Evt\" -o -name \"scheduledtasks.xml\" -o -name \"authorized_hosts\" -o -name \"*.crt\" -o -name \"AzureRMContext.json\" -o -name \"my.cnf\" -o -name \"docker.sock\" -o -name \".bashrc\" -o -name \"*.sqlite3\" -o -name \"credentials.db\" -o -name \"database.php\" -o -name \".msmtprc\" -o -name \"unattend.txt\" -o -name \"kadm5.acl\" -o -name \"tomcat-users.xml\" -o -name \"krb5.keytab\" -o -name \"*.pgp\" -o -name \"software\" -o -name \"supervisord.conf\" -o -name \"KeePass.config*\" -o -name \"*.pem\" -o -name \"pgadmin*.db\" -o -name \"*.cer\" -o -name \"*.pfx\" -o -name \"gvm-tools.conf\" -o -name \"ipsec.conf\" -o -name \"security.sav\" -o -name \"TokenCache.dat\" -o -name \"https.conf\" -o -name \"accessTokens.json\" -o -name \"anaconda-ks.cfg\" -o -name \"vault-ssh-helper.hcl\" -o -name \"system.sav\" -o -name \"storage.php\" -o -name \".erlang.cookie\" -o -name \"redis.conf\" -o -name \".google_authenticator\" -o -name \"ftp.ini\" -o -name \"unattended.xml\" -o -name \".lesshst\" -o -name \"*.gnupg\" -o -name \".sudo_as_admin_successful\" -o -name \"scclient.exe\" -o -name \"sysprep.xml\" -o -name \"system\" -o -name \"appcmd.exe\" -o -name \"drives.xml\" -o -name \"*.sqlite\" -o -name \".gitconfig\" -o -name \"httpd.conf\" -o -name \"unattend.xml\" -o -name \"unattend.inf\" -o -name \"access_tokens.db\" -o -name \".ldaprc\" -o -name \"settings.php\" -o -name \".profile\" -o -name \"SecEvent.Evt\" -o -name \"NetSetup.log\" -o -name \".git-credentials\" -o -name \"KeePass.ini\" -o -name \"wp-config.php\" -o -name \"000-default.conf\" -o -name \"recentservers.xml\" -o -name \".pypirc\" -o -name \"wcx_ftp.ini\" -o -name \"hosts.equiv\" -o -name \"known_hosts\" -o -name \"mongod*.conf\" -o -name \"*.keyring\" -o -name \"bash.exe\" -o -name \"cloud.cfg\" -o -name \"id_rsa*\" -o -name \"*.rdg\" -o -name \"pagefile.sys\" -o -name \"backups\" -o -name \".*_history.*\" -o -name \"*.jks\" -o -name \"autologin\" -o -name \"my.ini\" -o -name \"web*.config\" -o -name \"*.ovpn\" -o -name \"ftp.config\" -o -name \"*.db\" -o -name \"SYSTEM\" -o -name \"*.service\" -o -name \"filezilla.xml\" -o -name \"config.php\" -o -name \"*.timer\" -o -name \".k5login\" -o -name \"*config*.php\" -o -name \"https-xampp.conf\" -o -name \"*.socket\" -o -name \"ddclient.conf\" -o -name \"*vnc*.xml\" -o -name \"wsl.exe\" -o -name \".rhosts\" -o -name \"default.sav\" -o -name \"ipsec.secrets\" -o -name \"RDCMan.settings\" -o -name \"*credential*\" -o -name \"id_dsa*\" -o -name \"*password*\" -o -name \".github\" -o -name \"SAM\" -o -name \"docker-compose.yml\" -o -name \"Dockerfile\" -o -name \"elasticsearch.y*ml\" -o -name \"ws_ftp.ini\" -o -name \"passwd\" -o -name \"index.dat\" -o -name \"*.keystore\" -o -name \"hostapd.conf\" -o -name \"*.p12\" -o -name \".recently-used.xbel\" -o -name \"groups.xml\" -o -name \"legacy_credentials.db\" -o -name \"*vnc*.txt\" -o -name \"*.swp\" -o -name \"*.kdbx\" -o -name \"creds*\" -o -name \"rsyncd.conf\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` + FIND_SNAP=`eval_bckgrd "find /snap -name \"mosquitto.conf\" -o -name \"debian.cnf\" -o -name \"ConsoleHost_history.txt\" -o -name \".env\" -o -name \"krb5.conf\" -o -name \"authorized_keys\" -o -name \"fastcgi_params\" -o -name \"sites.ini\" -o -name \"rsyncd.secrets\" -o -name \"credentials\" -o -name \"printers.xml\" -o -name \"db.php\" -o -name \".git\" -o -name \"protecteduserkey.bin\" -o -name \"*vnc*.ini\" -o -name \"secrets.yml\" -o -name \"docker.socket\" -o -name \"cesi.conf\" -o -name \"iis6.log\" -o -name \"*vnc*.c*nf*\" -o -name \"access.log\" -o -name \"datasources.xml\" -o -name \"gitlab.yml\" -o -name \"autologin.conf\" -o -name \"winscp.ini\" -o -name \"*.viminfo\" -o -name \"error.log\" -o -name \"backup\" -o -name \"access_tokens.json\" -o -name \"gitlab.rm\" -o -name \"Ntds.dit\" -o -name \"php.ini\" -o -name \"setupinfo.bak\" -o -name \"KeePass.enforced*\" -o -name \".plan\" -o -name \"software.sav\" -o -name \"azureProfile.json\" -o -name \".vault-token\" -o -name \"pgsql.conf\" -o -name \"postgresql.conf\" -o -name \"ffftp.ini\" -o -name \"FreeSSHDservice.ini\" -o -name \"*.gpg\" -o -name \"sysprep.inf\" -o -name \"setupinfo\" -o -name \"*.key\" -o -name \"snmpd.conf\" -o -name \"kibana.y*ml\" -o -name \"pg_hba.conf\" -o -name \"*.ftpconfig\" -o -name \"*.csr\" -o -name \"sitemanager.xml\" -o -name \"server.xml\" -o -name \".htpasswd\" -o -name \"*.der\" -o -name \"ntuser.dat\" -o -name \"AppEvent.Evt\" -o -name \"scheduledtasks.xml\" -o -name \"authorized_hosts\" -o -name \"*.crt\" -o -name \"AzureRMContext.json\" -o -name \"my.cnf\" -o -name \"docker.sock\" -o -name \".bashrc\" -o -name \"*.sqlite3\" -o -name \"credentials.db\" -o -name \"database.php\" -o -name \".msmtprc\" -o -name \"unattend.txt\" -o -name \"kadm5.acl\" -o -name \"tomcat-users.xml\" -o -name \"krb5.keytab\" -o -name \"*.pgp\" -o -name \"software\" -o -name \"supervisord.conf\" -o -name \"KeePass.config*\" -o -name \"*.pem\" -o -name \"pgadmin*.db\" -o -name \"*.cer\" -o -name \"*.pfx\" -o -name \"gvm-tools.conf\" -o -name \"ipsec.conf\" -o -name \"security.sav\" -o -name \"TokenCache.dat\" -o -name \"https.conf\" -o -name \"accessTokens.json\" -o -name \"anaconda-ks.cfg\" -o -name \"vault-ssh-helper.hcl\" -o -name \"system.sav\" -o -name \"storage.php\" -o -name \".erlang.cookie\" -o -name \"redis.conf\" -o -name \".google_authenticator\" -o -name \"ftp.ini\" -o -name \"unattended.xml\" -o -name \".lesshst\" -o -name \"*.gnupg\" -o -name \".sudo_as_admin_successful\" -o -name \"scclient.exe\" -o -name \"sysprep.xml\" -o -name \"system\" -o -name \"appcmd.exe\" -o -name \"drives.xml\" -o -name \"*.sqlite\" -o -name \".gitconfig\" -o -name \"httpd.conf\" -o -name \"unattend.xml\" -o -name \"unattend.inf\" -o -name \"access_tokens.db\" -o -name \".ldaprc\" -o -name \"settings.php\" -o -name \".profile\" -o -name \"SecEvent.Evt\" -o -name \"NetSetup.log\" -o -name \".git-credentials\" -o -name \"KeePass.ini\" -o -name \"wp-config.php\" -o -name \"000-default.conf\" -o -name \"recentservers.xml\" -o -name \".pypirc\" -o -name \"wcx_ftp.ini\" -o -name \"hosts.equiv\" -o -name \"known_hosts\" -o -name \"mongod*.conf\" -o -name \"*.keyring\" -o -name \"bash.exe\" -o -name \"cloud.cfg\" -o -name \"id_rsa*\" -o -name \"*.rdg\" -o -name \"pagefile.sys\" -o -name \"backups\" -o -name \".*_history.*\" -o -name \"*.jks\" -o -name \"autologin\" -o -name \"my.ini\" -o -name \"web*.config\" -o -name \"*.ovpn\" -o -name \"ftp.config\" -o -name \"*.db\" -o -name \"SYSTEM\" -o -name \"*.service\" -o -name \"filezilla.xml\" -o -name \"config.php\" -o -name \"*.timer\" -o -name \".k5login\" -o -name \"*config*.php\" -o -name \"https-xampp.conf\" -o -name \"*.socket\" -o -name \"ddclient.conf\" -o -name \"*vnc*.xml\" -o -name \"wsl.exe\" -o -name \".rhosts\" -o -name \"default.sav\" -o -name \"ipsec.secrets\" -o -name \"RDCMan.settings\" -o -name \"*credential*\" -o -name \"id_dsa*\" -o -name \"*password*\" -o -name \".github\" -o -name \"SAM\" -o -name \"docker-compose.yml\" -o -name \"Dockerfile\" -o -name \"elasticsearch.y*ml\" -o -name \"ws_ftp.ini\" -o -name \"passwd\" -o -name \"index.dat\" -o -name \"*.keystore\" -o -name \"hostapd.conf\" -o -name \"*.p12\" -o -name \".recently-used.xbel\" -o -name \"groups.xml\" -o -name \"legacy_credentials.db\" -o -name \"*vnc*.txt\" -o -name \"*.swp\" -o -name \"*.kdbx\" -o -name \"creds*\" -o -name \"rsyncd.conf\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` + FIND_SRV=`eval_bckgrd "find /srv -name \"mosquitto.conf\" -o -name \"debian.cnf\" -o -name \"ConsoleHost_history.txt\" -o -name \".env\" -o -name \"krb5.conf\" -o -name \"authorized_keys\" -o -name \"fastcgi_params\" -o -name \"sites.ini\" -o -name \"rsyncd.secrets\" -o -name \"credentials\" -o -name \"printers.xml\" -o -name \"db.php\" -o -name \".git\" -o -name \"protecteduserkey.bin\" -o -name \"*vnc*.ini\" -o -name \"secrets.yml\" -o -name \"docker.socket\" -o -name \"cesi.conf\" -o -name \"iis6.log\" -o -name \"*vnc*.c*nf*\" -o -name \"access.log\" -o -name \"datasources.xml\" -o -name \"gitlab.yml\" -o -name \"autologin.conf\" -o -name \"winscp.ini\" -o -name \"*.viminfo\" -o -name \"error.log\" -o -name \"backup\" -o -name \"access_tokens.json\" -o -name \"gitlab.rm\" -o -name \"Ntds.dit\" -o -name \"php.ini\" -o -name \"setupinfo.bak\" -o -name \"KeePass.enforced*\" -o -name \".plan\" -o -name \"software.sav\" -o -name \"azureProfile.json\" -o -name \".vault-token\" -o -name \"pgsql.conf\" -o -name \"postgresql.conf\" -o -name \"ffftp.ini\" -o -name \"FreeSSHDservice.ini\" -o -name \"*.gpg\" -o -name \"sysprep.inf\" -o -name \"setupinfo\" -o -name \"*.key\" -o -name \"snmpd.conf\" -o -name \"kibana.y*ml\" -o -name \"pg_hba.conf\" -o -name \"*.ftpconfig\" -o -name \"*.csr\" -o -name \"sitemanager.xml\" -o -name \"server.xml\" -o -name \".htpasswd\" -o -name \"*.der\" -o -name \"ntuser.dat\" -o -name \"AppEvent.Evt\" -o -name \"scheduledtasks.xml\" -o -name \"authorized_hosts\" -o -name \"*.crt\" -o -name \"AzureRMContext.json\" -o -name \"my.cnf\" -o -name \"docker.sock\" -o -name \".bashrc\" -o -name \"*.sqlite3\" -o -name \"credentials.db\" -o -name \"database.php\" -o -name \".msmtprc\" -o -name \"unattend.txt\" -o -name \"kadm5.acl\" -o -name \"tomcat-users.xml\" -o -name \"krb5.keytab\" -o -name \"*.pgp\" -o -name \"software\" -o -name \"supervisord.conf\" -o -name \"KeePass.config*\" -o -name \"*.pem\" -o -name \"pgadmin*.db\" -o -name \"*.cer\" -o -name \"*.pfx\" -o -name \"gvm-tools.conf\" -o -name \"ipsec.conf\" -o -name \"security.sav\" -o -name \"TokenCache.dat\" -o -name \"https.conf\" -o -name \"accessTokens.json\" -o -name \"anaconda-ks.cfg\" -o -name \"vault-ssh-helper.hcl\" -o -name \"system.sav\" -o -name \"storage.php\" -o -name \".erlang.cookie\" -o -name \"redis.conf\" -o -name \".google_authenticator\" -o -name \"ftp.ini\" -o -name \"unattended.xml\" -o -name \".lesshst\" -o -name \"*.gnupg\" -o -name \".sudo_as_admin_successful\" -o -name \"scclient.exe\" -o -name \"sysprep.xml\" -o -name \"system\" -o -name \"appcmd.exe\" -o -name \"drives.xml\" -o -name \"*.sqlite\" -o -name \".gitconfig\" -o -name \"httpd.conf\" -o -name \"unattend.xml\" -o -name \"unattend.inf\" -o -name \"access_tokens.db\" -o -name \".ldaprc\" -o -name \"settings.php\" -o -name \".profile\" -o -name \"SecEvent.Evt\" -o -name \"NetSetup.log\" -o -name \".git-credentials\" -o -name \"KeePass.ini\" -o -name \"wp-config.php\" -o -name \"000-default.conf\" -o -name \"recentservers.xml\" -o -name \".pypirc\" -o -name \"wcx_ftp.ini\" -o -name \"hosts.equiv\" -o -name \"known_hosts\" -o -name \"mongod*.conf\" -o -name \"*.keyring\" -o -name \"bash.exe\" -o -name \"cloud.cfg\" -o -name \"id_rsa*\" -o -name \"*.rdg\" -o -name \"pagefile.sys\" -o -name \"backups\" -o -name \".*_history.*\" -o -name \"*.jks\" -o -name \"autologin\" -o -name \"my.ini\" -o -name \"web*.config\" -o -name \"*.ovpn\" -o -name \"ftp.config\" -o -name \"*.db\" -o -name \"SYSTEM\" -o -name \"*.service\" -o -name \"filezilla.xml\" -o -name \"config.php\" -o -name \"*.timer\" -o -name \".k5login\" -o -name \"*config*.php\" -o -name \"https-xampp.conf\" -o -name \"*.socket\" -o -name \"ddclient.conf\" -o -name \"*vnc*.xml\" -o -name \"wsl.exe\" -o -name \".rhosts\" -o -name \"default.sav\" -o -name \"ipsec.secrets\" -o -name \"RDCMan.settings\" -o -name \"*credential*\" -o -name \"id_dsa*\" -o -name \"*password*\" -o -name \".github\" -o -name \"SAM\" -o -name \"docker-compose.yml\" -o -name \"Dockerfile\" -o -name \"elasticsearch.y*ml\" -o -name \"ws_ftp.ini\" -o -name \"passwd\" -o -name \"index.dat\" -o -name \"*.keystore\" -o -name \"hostapd.conf\" -o -name \"*.p12\" -o -name \".recently-used.xbel\" -o -name \"groups.xml\" -o -name \"legacy_credentials.db\" -o -name \"*vnc*.txt\" -o -name \"*.swp\" -o -name \"*.kdbx\" -o -name \"creds*\" -o -name \"rsyncd.conf\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` + FIND_SYS=`eval_bckgrd "find /sys -name \"*.timer\" -o -name \"*.service\" -o -name \"*.socket\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` + FIND_SYSTEM=`eval_bckgrd "find /system -name \"*.timer\" -o -name \"*.service\" -o -name \"*.socket\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` + FIND_SYSTEMD=`eval_bckgrd "find /systemd -name \"*.timer\" -o -name \"*.service\" -o -name \"*.socket\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` + FIND_TMP=`eval_bckgrd "find /tmp -name \"mosquitto.conf\" -o -name \"debian.cnf\" -o -name \"ConsoleHost_history.txt\" -o -name \".env\" -o -name \"krb5.conf\" -o -name \"authorized_keys\" -o -name \"fastcgi_params\" -o -name \"sites.ini\" -o -name \"rsyncd.secrets\" -o -name \"credentials\" -o -name \"printers.xml\" -o -name \"db.php\" -o -name \".git\" -o -name \"protecteduserkey.bin\" -o -name \"*vnc*.ini\" -o -name \"secrets.yml\" -o -name \"docker.socket\" -o -name \"cesi.conf\" -o -name \"iis6.log\" -o -name \"*vnc*.c*nf*\" -o -name \"sess_*\" -o -name \"access.log\" -o -name \"datasources.xml\" -o -name \"gitlab.yml\" -o -name \"autologin.conf\" -o -name \"winscp.ini\" -o -name \"*.viminfo\" -o -name \"error.log\" -o -name \"backup\" -o -name \"access_tokens.json\" -o -name \"gitlab.rm\" -o -name \"Ntds.dit\" -o -name \"php.ini\" -o -name \"setupinfo.bak\" -o -name \"KeePass.enforced*\" -o -name \".plan\" -o -name \"software.sav\" -o -name \"azureProfile.json\" -o -name \".vault-token\" -o -name \"pgsql.conf\" -o -name \"postgresql.conf\" -o -name \"ffftp.ini\" -o -name \"FreeSSHDservice.ini\" -o -name \"*.gpg\" -o -name \"sysprep.inf\" -o -name \"setupinfo\" -o -name \"*.key\" -o -name \"snmpd.conf\" -o -name \"kibana.y*ml\" -o -name \"pg_hba.conf\" -o -name \"*.ftpconfig\" -o -name \"*.csr\" -o -name \"sitemanager.xml\" -o -name \"server.xml\" -o -name \".htpasswd\" -o -name \"*.der\" -o -name \"ntuser.dat\" -o -name \"AppEvent.Evt\" -o -name \"scheduledtasks.xml\" -o -name \"authorized_hosts\" -o -name \"*.crt\" -o -name \"AzureRMContext.json\" -o -name \"my.cnf\" -o -name \"docker.sock\" -o -name \".bashrc\" -o -name \"*.sqlite3\" -o -name \"credentials.db\" -o -name \"database.php\" -o -name \".msmtprc\" -o -name \"unattend.txt\" -o -name \"kadm5.acl\" -o -name \"tomcat-users.xml\" -o -name \"krb5.keytab\" -o -name \"*.pgp\" -o -name \"software\" -o -name \"supervisord.conf\" -o -name \"KeePass.config*\" -o -name \"*.pem\" -o -name \"pgadmin*.db\" -o -name \"*.cer\" -o -name \"*.pfx\" -o -name \"gvm-tools.conf\" -o -name \"ipsec.conf\" -o -name \"security.sav\" -o -name \"TokenCache.dat\" -o -name \"https.conf\" -o -name \"accessTokens.json\" -o -name \"anaconda-ks.cfg\" -o -name \"vault-ssh-helper.hcl\" -o -name \"system.sav\" -o -name \"storage.php\" -o -name \"agent*\" -o -name \".erlang.cookie\" -o -name \"redis.conf\" -o -name \".google_authenticator\" -o -name \"ftp.ini\" -o -name \"unattended.xml\" -o -name \".lesshst\" -o -name \"*.gnupg\" -o -name \".sudo_as_admin_successful\" -o -name \"scclient.exe\" -o -name \"sysprep.xml\" -o -name \"system\" -o -name \"appcmd.exe\" -o -name \"drives.xml\" -o -name \"*.sqlite\" -o -name \".gitconfig\" -o -name \"httpd.conf\" -o -name \"unattend.xml\" -o -name \"unattend.inf\" -o -name \"access_tokens.db\" -o -name \".ldaprc\" -o -name \"settings.php\" -o -name \".profile\" -o -name \"SecEvent.Evt\" -o -name \"NetSetup.log\" -o -name \".git-credentials\" -o -name \"KeePass.ini\" -o -name \"wp-config.php\" -o -name \"000-default.conf\" -o -name \"recentservers.xml\" -o -name \".pypirc\" -o -name \"wcx_ftp.ini\" -o -name \"hosts.equiv\" -o -name \"known_hosts\" -o -name \"mongod*.conf\" -o -name \"*.keyring\" -o -name \"bash.exe\" -o -name \"cloud.cfg\" -o -name \"id_rsa*\" -o -name \"*.rdg\" -o -name \"pagefile.sys\" -o -name \"backups\" -o -name \".*_history.*\" -o -name \"*.jks\" -o -name \"autologin\" -o -name \"my.ini\" -o -name \"web*.config\" -o -name \"*.ovpn\" -o -name \"ftp.config\" -o -name \"*.db\" -o -name \"SYSTEM\" -o -name \"*.service\" -o -name \"filezilla.xml\" -o -name \"config.php\" -o -name \"*.timer\" -o -name \".k5login\" -o -name \"*config*.php\" -o -name \"https-xampp.conf\" -o -name \"*.socket\" -o -name \"ddclient.conf\" -o -name \"*vnc*.xml\" -o -name \"wsl.exe\" -o -name \".rhosts\" -o -name \"default.sav\" -o -name \"ipsec.secrets\" -o -name \"RDCMan.settings\" -o -name \"*credential*\" -o -name \"id_dsa*\" -o -name \"*password*\" -o -name \".github\" -o -name \"SAM\" -o -name \"docker-compose.yml\" -o -name \"Dockerfile\" -o -name \"elasticsearch.y*ml\" -o -name \"ws_ftp.ini\" -o -name \"passwd\" -o -name \"index.dat\" -o -name \"*.keystore\" -o -name \"hostapd.conf\" -o -name \"*.p12\" -o -name \".recently-used.xbel\" -o -name \"groups.xml\" -o -name \"legacy_credentials.db\" -o -name \"*vnc*.txt\" -o -name \"*.swp\" -o -name \"*.kdbx\" -o -name \"creds*\" -o -name \"rsyncd.conf\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` + FIND_USR=`eval_bckgrd "find /usr -name \"mosquitto.conf\" -o -name \"debian.cnf\" -o -name \"ConsoleHost_history.txt\" -o -name \".env\" -o -name \"krb5.conf\" -o -name \"authorized_keys\" -o -name \"fastcgi_params\" -o -name \"sites.ini\" -o -name \"rsyncd.secrets\" -o -name \"credentials\" -o -name \"printers.xml\" -o -name \"db.php\" -o -name \".git\" -o -name \"protecteduserkey.bin\" -o -name \"*vnc*.ini\" -o -name \"secrets.yml\" -o -name \"docker.socket\" -o -name \"cesi.conf\" -o -name \"iis6.log\" -o -name \"*vnc*.c*nf*\" -o -name \"access.log\" -o -name \"datasources.xml\" -o -name \"gitlab.yml\" -o -name \"autologin.conf\" -o -name \"winscp.ini\" -o -name \"*.viminfo\" -o -name \"error.log\" -o -name \"backup\" -o -name \"access_tokens.json\" -o -name \"gitlab.rm\" -o -name \"Ntds.dit\" -o -name \"php.ini\" -o -name \"setupinfo.bak\" -o -name \"KeePass.enforced*\" -o -name \".plan\" -o -name \"software.sav\" -o -name \"azureProfile.json\" -o -name \".vault-token\" -o -name \"pgsql.conf\" -o -name \"postgresql.conf\" -o -name \"ffftp.ini\" -o -name \"FreeSSHDservice.ini\" -o -name \"*.gpg\" -o -name \"sysprep.inf\" -o -name \"setupinfo\" -o -name \"*.key\" -o -name \"snmpd.conf\" -o -name \"kibana.y*ml\" -o -name \"pg_hba.conf\" -o -name \"*.ftpconfig\" -o -name \"*.csr\" -o -name \"sitemanager.xml\" -o -name \"server.xml\" -o -name \".htpasswd\" -o -name \"*.der\" -o -name \"ntuser.dat\" -o -name \"AppEvent.Evt\" -o -name \"scheduledtasks.xml\" -o -name \"authorized_hosts\" -o -name \"*.crt\" -o -name \"AzureRMContext.json\" -o -name \"my.cnf\" -o -name \"docker.sock\" -o -name \".bashrc\" -o -name \"*.sqlite3\" -o -name \"credentials.db\" -o -name \"database.php\" -o -name \".msmtprc\" -o -name \"unattend.txt\" -o -name \"kadm5.acl\" -o -name \"tomcat-users.xml\" -o -name \"krb5.keytab\" -o -name \"*.pgp\" -o -name \"software\" -o -name \"supervisord.conf\" -o -name \"KeePass.config*\" -o -name \"*.pem\" -o -name \"pgadmin*.db\" -o -name \"*.cer\" -o -name \"*.pfx\" -o -name \"gvm-tools.conf\" -o -name \"ipsec.conf\" -o -name \"security.sav\" -o -name \"TokenCache.dat\" -o -name \"https.conf\" -o -name \"accessTokens.json\" -o -name \"anaconda-ks.cfg\" -o -name \"vault-ssh-helper.hcl\" -o -name \"system.sav\" -o -name \"storage.php\" -o -name \".erlang.cookie\" -o -name \"redis.conf\" -o -name \".google_authenticator\" -o -name \"ftp.ini\" -o -name \"unattended.xml\" -o -name \".lesshst\" -o -name \"*.gnupg\" -o -name \".sudo_as_admin_successful\" -o -name \"scclient.exe\" -o -name \"sysprep.xml\" -o -name \"system\" -o -name \"appcmd.exe\" -o -name \"drives.xml\" -o -name \"*.sqlite\" -o -name \".gitconfig\" -o -name \"httpd.conf\" -o -name \"unattend.xml\" -o -name \"unattend.inf\" -o -name \"access_tokens.db\" -o -name \".ldaprc\" -o -name \"settings.php\" -o -name \".profile\" -o -name \"SecEvent.Evt\" -o -name \"NetSetup.log\" -o -name \".git-credentials\" -o -name \"KeePass.ini\" -o -name \"wp-config.php\" -o -name \"000-default.conf\" -o -name \"recentservers.xml\" -o -name \".pypirc\" -o -name \"wcx_ftp.ini\" -o -name \"hosts.equiv\" -o -name \"known_hosts\" -o -name \"mongod*.conf\" -o -name \"*.keyring\" -o -name \"bash.exe\" -o -name \"cloud.cfg\" -o -name \"id_rsa*\" -o -name \"*.rdg\" -o -name \"pagefile.sys\" -o -name \"backups\" -o -name \".*_history.*\" -o -name \"*.jks\" -o -name \"autologin\" -o -name \"my.ini\" -o -name \"web*.config\" -o -name \"*.ovpn\" -o -name \"ftp.config\" -o -name \"*.db\" -o -name \"SYSTEM\" -o -name \"*.service\" -o -name \"filezilla.xml\" -o -name \"config.php\" -o -name \"*.timer\" -o -name \".k5login\" -o -name \"*config*.php\" -o -name \"https-xampp.conf\" -o -name \"*.socket\" -o -name \"ddclient.conf\" -o -name \"*vnc*.xml\" -o -name \"wsl.exe\" -o -name \".rhosts\" -o -name \"default.sav\" -o -name \"ipsec.secrets\" -o -name \"RDCMan.settings\" -o -name \"*credential*\" -o -name \"id_dsa*\" -o -name \"ssh*config\" -o -name \"*password*\" -o -name \".github\" -o -name \"SAM\" -o -name \"docker-compose.yml\" -o -name \"Dockerfile\" -o -name \"elasticsearch.y*ml\" -o -name \"ws_ftp.ini\" -o -name \"passwd\" -o -name \"index.dat\" -o -name \"*.keystore\" -o -name \"hostapd.conf\" -o -name \"*.p12\" -o -name \".recently-used.xbel\" -o -name \"groups.xml\" -o -name \"legacy_credentials.db\" -o -name \"*vnc*.txt\" -o -name \"*.swp\" -o -name \"*.kdbx\" -o -name \"creds*\" -o -name \"rsyncd.conf\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` + FIND_VAR=`eval_bckgrd "find /var -name \"mosquitto.conf\" -o -name \"debian.cnf\" -o -name \"ConsoleHost_history.txt\" -o -name \".env\" -o -name \"krb5.conf\" -o -name \"authorized_keys\" -o -name \"fastcgi_params\" -o -name \"sites.ini\" -o -name \"rsyncd.secrets\" -o -name \"credentials\" -o -name \"printers.xml\" -o -name \"db.php\" -o -name \".git\" -o -name \"protecteduserkey.bin\" -o -name \"*vnc*.ini\" -o -name \"secrets.yml\" -o -name \"docker.socket\" -o -name \"cesi.conf\" -o -name \"iis6.log\" -o -name \"*vnc*.c*nf*\" -o -name \"sess_*\" -o -name \"access.log\" -o -name \"datasources.xml\" -o -name \"gitlab.yml\" -o -name \"autologin.conf\" -o -name \"winscp.ini\" -o -name \"*.viminfo\" -o -name \"error.log\" -o -name \"backup\" -o -name \"access_tokens.json\" -o -name \"gitlab.rm\" -o -name \"Ntds.dit\" -o -name \"php.ini\" -o -name \"setupinfo.bak\" -o -name \"KeePass.enforced*\" -o -name \".plan\" -o -name \"software.sav\" -o -name \"azureProfile.json\" -o -name \".vault-token\" -o -name \"pgsql.conf\" -o -name \"postgresql.conf\" -o -name \"ffftp.ini\" -o -name \"FreeSSHDservice.ini\" -o -name \"*.gpg\" -o -name \"sysprep.inf\" -o -name \"setupinfo\" -o -name \"*.key\" -o -name \"snmpd.conf\" -o -name \"kibana.y*ml\" -o -name \"pg_hba.conf\" -o -name \"*.ftpconfig\" -o -name \"*.csr\" -o -name \"sitemanager.xml\" -o -name \"server.xml\" -o -name \".htpasswd\" -o -name \"*.der\" -o -name \"ntuser.dat\" -o -name \"AppEvent.Evt\" -o -name \"scheduledtasks.xml\" -o -name \"authorized_hosts\" -o -name \"*.crt\" -o -name \"AzureRMContext.json\" -o -name \"my.cnf\" -o -name \"docker.sock\" -o -name \".bashrc\" -o -name \"*.sqlite3\" -o -name \"credentials.db\" -o -name \"database.php\" -o -name \".msmtprc\" -o -name \"unattend.txt\" -o -name \"kadm5.acl\" -o -name \"tomcat-users.xml\" -o -name \"krb5.keytab\" -o -name \"*.pgp\" -o -name \"software\" -o -name \"supervisord.conf\" -o -name \"KeePass.config*\" -o -name \"*.pem\" -o -name \"pgadmin*.db\" -o -name \"*.cer\" -o -name \"*.pfx\" -o -name \"gvm-tools.conf\" -o -name \"ipsec.conf\" -o -name \"security.sav\" -o -name \"TokenCache.dat\" -o -name \"https.conf\" -o -name \"accessTokens.json\" -o -name \"anaconda-ks.cfg\" -o -name \"vault-ssh-helper.hcl\" -o -name \"system.sav\" -o -name \"storage.php\" -o -name \".erlang.cookie\" -o -name \"redis.conf\" -o -name \".google_authenticator\" -o -name \"ftp.ini\" -o -name \"unattended.xml\" -o -name \".lesshst\" -o -name \"*.gnupg\" -o -name \".sudo_as_admin_successful\" -o -name \"scclient.exe\" -o -name \"sysprep.xml\" -o -name \"system\" -o -name \"appcmd.exe\" -o -name \"drives.xml\" -o -name \"*.sqlite\" -o -name \".gitconfig\" -o -name \"httpd.conf\" -o -name \"unattend.xml\" -o -name \"unattend.inf\" -o -name \"access_tokens.db\" -o -name \".ldaprc\" -o -name \"settings.php\" -o -name \".profile\" -o -name \"SecEvent.Evt\" -o -name \"NetSetup.log\" -o -name \".git-credentials\" -o -name \"KeePass.ini\" -o -name \"wp-config.php\" -o -name \"000-default.conf\" -o -name \"recentservers.xml\" -o -name \".pypirc\" -o -name \"wcx_ftp.ini\" -o -name \"hosts.equiv\" -o -name \"known_hosts\" -o -name \"mongod*.conf\" -o -name \"*.keyring\" -o -name \"bash.exe\" -o -name \"cloud.cfg\" -o -name \"id_rsa*\" -o -name \"*.rdg\" -o -name \"pagefile.sys\" -o -name \"backups\" -o -name \".*_history.*\" -o -name \"*.jks\" -o -name \"autologin\" -o -name \"my.ini\" -o -name \"web*.config\" -o -name \"*.ovpn\" -o -name \"ftp.config\" -o -name \"*.db\" -o -name \"SYSTEM\" -o -name \"*.service\" -o -name \"filezilla.xml\" -o -name \"config.php\" -o -name \"*.timer\" -o -name \".k5login\" -o -name \"*config*.php\" -o -name \"https-xampp.conf\" -o -name \"*.socket\" -o -name \"ddclient.conf\" -o -name \"*vnc*.xml\" -o -name \"wsl.exe\" -o -name \".rhosts\" -o -name \"default.sav\" -o -name \"ipsec.secrets\" -o -name \"RDCMan.settings\" -o -name \"*credential*\" -o -name \"id_dsa*\" -o -name \"*password*\" -o -name \".github\" -o -name \"SAM\" -o -name \"docker-compose.yml\" -o -name \"Dockerfile\" -o -name \"elasticsearch.y*ml\" -o -name \"ws_ftp.ini\" -o -name \"passwd\" -o -name \"index.dat\" -o -name \"*.keystore\" -o -name \"hostapd.conf\" -o -name \"*.p12\" -o -name \".recently-used.xbel\" -o -name \"groups.xml\" -o -name \"legacy_credentials.db\" -o -name \"*vnc*.txt\" -o -name \"*.swp\" -o -name \"*.kdbx\" -o -name \"creds*\" -o -name \"rsyncd.conf\" 2>/dev/null | sort; printf \\\$YELLOW'. '\\\$NC 1>&2;"` wait # Always wait at the end CONT_THREADS=0 #Reset the threads counter #GENERATE THE STORAGES OF THE FOUND FILES - PSTORAGE_SYSTEMD=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/lib64|^/.cache|^/bin|^/var|^/etc|^/mnt|^/private|^/usr|^/cdrom|^/opt|^/system|^/snap|^/lib32|^/lib|^/srv|^/run|^/applications|^/tmp|^/sys|^/media|^/systemd|^/sbin|^$GREPHOMESEARCH" | grep -E ".*\.service$" | sort | uniq | head -n 70) - PSTORAGE_TIMER=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/lib64|^/.cache|^/bin|^/var|^/etc|^/mnt|^/private|^/usr|^/cdrom|^/opt|^/system|^/snap|^/lib32|^/lib|^/srv|^/run|^/applications|^/tmp|^/sys|^/media|^/systemd|^/sbin|^$GREPHOMESEARCH" | grep -E ".*\.timer$" | sort | uniq | head -n 70) - PSTORAGE_SOCKET=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/lib64|^/.cache|^/bin|^/var|^/etc|^/mnt|^/private|^/usr|^/cdrom|^/opt|^/system|^/snap|^/lib32|^/lib|^/srv|^/run|^/applications|^/tmp|^/sys|^/media|^/systemd|^/sbin|^$GREPHOMESEARCH" | grep -E ".*\.socket$" | sort | uniq | head -n 70) - PSTORAGE_DBUS=$(echo -e "$FIND_DIR_BIN\n$FIND_DIR_CACHE\n$FIND_DIR_SRV\n$FIND_DIR_PRIVATE\n$FIND_DIR_MNT\n$FIND_DIR_TMP\n$FIND_DIR_HOMESEARCH\n$FIND_DIR_VAR\n$FIND_DIR_APPLICATIONS\n$FIND_DIR_MEDIA\n$FIND_DIR_ETC\n$FIND_DIR_OPT\n$FIND_DIR_USR\n$FIND_DIR_SBIN\n$FIND_DIR_CDROM\n$FIND_DIR_SNAP" | grep -E "^/etc" | grep -E "system\.d$" | sort | uniq | head -n 70) - PSTORAGE_MYSQL=$(echo -e "$FIND_DIR_BIN\n$FIND_DIR_CACHE\n$FIND_DIR_SRV\n$FIND_DIR_PRIVATE\n$FIND_DIR_MNT\n$FIND_DIR_TMP\n$FIND_DIR_HOMESEARCH\n$FIND_DIR_VAR\n$FIND_DIR_APPLICATIONS\n$FIND_DIR_MEDIA\n$FIND_DIR_ETC\n$FIND_DIR_OPT\n$FIND_DIR_USR\n$FIND_DIR_SBIN\n$FIND_DIR_CDROM\n$FIND_DIR_SNAP" | grep -v -E 'mysql/mysql' | grep -E '^/etc/.*mysql|/usr/var/lib/.*mysql|/var/lib/.*mysql' | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "mysql$" | sort | uniq | head -n 70) - PSTORAGE_POSTGRESQL=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "pgadmin.*\.db$|pg_hba\.conf$|postgresql\.conf$|pgsql\.conf$" | sort | uniq | head -n 70) - PSTORAGE_APACHE=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM\n$FIND_DIR_BIN\n$FIND_DIR_CACHE\n$FIND_DIR_SRV\n$FIND_DIR_PRIVATE\n$FIND_DIR_MNT\n$FIND_DIR_TMP\n$FIND_DIR_HOMESEARCH\n$FIND_DIR_VAR\n$FIND_DIR_APPLICATIONS\n$FIND_DIR_MEDIA\n$FIND_DIR_ETC\n$FIND_DIR_OPT\n$FIND_DIR_USR\n$FIND_DIR_SBIN\n$FIND_DIR_CDROM\n$FIND_DIR_SNAP" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "sites-enabled$|000-default$" | sort | uniq | head -n 70) - PSTORAGE_PHPCOOKIES=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E '/tmp/.*sess_.*|/var/tmp/.*sess_.*' | grep -E "^/tmp|^/var|^/mnt" | grep -E "sess_.*$" | sort | uniq | head -n 70) - PSTORAGE_PHP_FILES=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E ".*config.*\.php$|database\.php$|db\.php$|storage\.php$|settings\.php$" | sort | uniq | head -n 70) - PSTORAGE_WORDPRESS=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "wp-config\.php$" | sort | uniq | head -n 70) - PSTORAGE_DRUPAL=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E '/default/settings.php' | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "settings\.php$" | sort | uniq | head -n 70) - PSTORAGE_MOODLE=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E 'moodle/config.php' | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "config\.php$" | sort | uniq | head -n 70) - PSTORAGE_TOMCAT=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "tomcat-users\.xml$" | sort | uniq | head -n 70) - PSTORAGE_MONGO=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "mongod.*\.conf$" | sort | uniq | head -n 70) - PSTORAGE_SUPERVISORD=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "supervisord\.conf$" | sort | uniq | head -n 70) - PSTORAGE_CESI=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "cesi\.conf$" | sort | uniq | head -n 70) - PSTORAGE_RSYNC=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "rsyncd\.conf$|rsyncd\.secrets$" | sort | uniq | head -n 70) - PSTORAGE_HOSTAPD=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "hostapd\.conf$" | sort | uniq | head -n 70) - PSTORAGE_ANACONDA_KS=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "anaconda-ks\.cfg$" | sort | uniq | head -n 70) - PSTORAGE_VNC=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM\n$FIND_DIR_BIN\n$FIND_DIR_CACHE\n$FIND_DIR_SRV\n$FIND_DIR_PRIVATE\n$FIND_DIR_MNT\n$FIND_DIR_TMP\n$FIND_DIR_HOMESEARCH\n$FIND_DIR_VAR\n$FIND_DIR_APPLICATIONS\n$FIND_DIR_MEDIA\n$FIND_DIR_ETC\n$FIND_DIR_OPT\n$FIND_DIR_USR\n$FIND_DIR_SBIN\n$FIND_DIR_CDROM\n$FIND_DIR_SNAP" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "\.vnc$|.*vnc.*\.c.*nf.*$|.*vnc.*\.ini$|.*vnc.*\.txt$|.*vnc.*\.xml$" | sort | uniq | head -n 70) - PSTORAGE_LDAP=$(echo -e "$FIND_DIR_BIN\n$FIND_DIR_CACHE\n$FIND_DIR_SRV\n$FIND_DIR_PRIVATE\n$FIND_DIR_MNT\n$FIND_DIR_TMP\n$FIND_DIR_HOMESEARCH\n$FIND_DIR_VAR\n$FIND_DIR_APPLICATIONS\n$FIND_DIR_MEDIA\n$FIND_DIR_ETC\n$FIND_DIR_OPT\n$FIND_DIR_USR\n$FIND_DIR_SBIN\n$FIND_DIR_CDROM\n$FIND_DIR_SNAP" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "ldap$" | sort | uniq | head -n 70) - PSTORAGE_OPEN_VPN=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E ".*\.ovpn$" | sort | uniq | head -n 70) - PSTORAGE_SSH_FILES=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "id_dsa.*$|id_rsa.*$|known_hosts$|authorized_hosts$|authorized_keys$" | sort | uniq | head -n 70) - PSTORAGE_CERTSB4=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -v -E '^/usr/share/|^/etc/ssl/|^/usr/local/lib/|^/usr/lib.*' | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E ".*\.pem$|.*\.cer$|.*\.crt$" | sort | uniq | head -n 70) - PSTORAGE_CERTSBIN=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -v -E '^/usr/share/|^/etc/ssl/|^/usr/local/lib/|^/usr/lib/.*' | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E ".*\.csr$|.*\.der$" | sort | uniq | head -n 70) - PSTORAGE_CERTSCLIENT=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -v -E '^/usr/share/|^/etc/ssl/|^/usr/local/lib/|^/usr/lib/.*' | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E ".*\.pfx$|.*\.p12$" | sort | uniq | head -n 70) - PSTORAGE_SSH_AGENTS=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/tmp" | grep -E "agent.*$" | sort | uniq | head -n 70) - PSTORAGE_SSH_CONFIG=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^$GREPHOMESEARCH|^/usr" | grep -E "ssh.*config$" | sort | uniq | head -n 70) - PSTORAGE_CLOUD_CREDENTIALS=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM\n$FIND_DIR_BIN\n$FIND_DIR_CACHE\n$FIND_DIR_SRV\n$FIND_DIR_PRIVATE\n$FIND_DIR_MNT\n$FIND_DIR_TMP\n$FIND_DIR_HOMESEARCH\n$FIND_DIR_VAR\n$FIND_DIR_APPLICATIONS\n$FIND_DIR_MEDIA\n$FIND_DIR_ETC\n$FIND_DIR_OPT\n$FIND_DIR_USR\n$FIND_DIR_SBIN\n$FIND_DIR_CDROM\n$FIND_DIR_SNAP" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "credentials$|credentials\.db$|legacy_credentials\.db$|access_tokens\.db$|access_tokens\.json$|accessTokens\.json$|azureProfile\.json$|TokenCache\.dat$|AzureRMContext\.json$|\.bluemix$" | sort | uniq | head -n 70) - PSTORAGE_KERBEROS=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "krb5\.conf$|krb5\.keytab$|\.k5login$|kadm5\.acl$" | sort | uniq | head -n 70) - PSTORAGE_KIBANA=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "kibana\.y.*ml$" | sort | uniq | head -n 70) - PSTORAGE_KNOCKD=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E '/etc/init.d/' | grep -E "^/etc" | grep -E ".*knockd.*$" | sort | uniq | head -n 70) - PSTORAGE_LOGSTASH=$(echo -e "$FIND_DIR_BIN\n$FIND_DIR_CACHE\n$FIND_DIR_SRV\n$FIND_DIR_PRIVATE\n$FIND_DIR_MNT\n$FIND_DIR_TMP\n$FIND_DIR_HOMESEARCH\n$FIND_DIR_VAR\n$FIND_DIR_APPLICATIONS\n$FIND_DIR_MEDIA\n$FIND_DIR_ETC\n$FIND_DIR_OPT\n$FIND_DIR_USR\n$FIND_DIR_SBIN\n$FIND_DIR_CDROM\n$FIND_DIR_SNAP" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "logstash$" | sort | uniq | head -n 70) - PSTORAGE_ELASTICSEARCH=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "elasticsearch\.y.*ml$" | sort | uniq | head -n 70) - PSTORAGE_VAULT_SSH_HELPER=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "vault-ssh-helper\.hcl$" | sort | uniq | head -n 70) - PSTORAGE_VAULT_SSH_TOKEN=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "\.vault-token$" | sort | uniq | head -n 70) - PSTORAGE_COUCHDB=$(echo -e "$FIND_DIR_BIN\n$FIND_DIR_CACHE\n$FIND_DIR_SRV\n$FIND_DIR_PRIVATE\n$FIND_DIR_MNT\n$FIND_DIR_TMP\n$FIND_DIR_HOMESEARCH\n$FIND_DIR_VAR\n$FIND_DIR_APPLICATIONS\n$FIND_DIR_MEDIA\n$FIND_DIR_ETC\n$FIND_DIR_OPT\n$FIND_DIR_USR\n$FIND_DIR_SBIN\n$FIND_DIR_CDROM\n$FIND_DIR_SNAP" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "couchdb$" | sort | uniq | head -n 70) - PSTORAGE_REDIS=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "redis\.conf$" | sort | uniq | head -n 70) - PSTORAGE_MOSQUITTO=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "mosquitto\.conf$" | sort | uniq | head -n 70) - PSTORAGE_NEO4J=$(echo -e "$FIND_DIR_BIN\n$FIND_DIR_CACHE\n$FIND_DIR_SRV\n$FIND_DIR_PRIVATE\n$FIND_DIR_MNT\n$FIND_DIR_TMP\n$FIND_DIR_HOMESEARCH\n$FIND_DIR_VAR\n$FIND_DIR_APPLICATIONS\n$FIND_DIR_MEDIA\n$FIND_DIR_ETC\n$FIND_DIR_OPT\n$FIND_DIR_USR\n$FIND_DIR_SBIN\n$FIND_DIR_CDROM\n$FIND_DIR_SNAP" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "neo4j$" | sort | uniq | head -n 70) - PSTORAGE_CLOUD_INIT=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "cloud\.cfg$" | sort | uniq | head -n 70) - PSTORAGE_ERLANG=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "\.erlang\.cookie$" | sort | uniq | head -n 70) - PSTORAGE_GMV_AUTH=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "gvm-tools\.conf$" | sort | uniq | head -n 70) - PSTORAGE_IPSEC=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "ipsec\.secrets$|ipsec\.conf$" | sort | uniq | head -n 70) - PSTORAGE_IRSSI=$(echo -e "$FIND_DIR_BIN\n$FIND_DIR_CACHE\n$FIND_DIR_SRV\n$FIND_DIR_PRIVATE\n$FIND_DIR_MNT\n$FIND_DIR_TMP\n$FIND_DIR_HOMESEARCH\n$FIND_DIR_VAR\n$FIND_DIR_APPLICATIONS\n$FIND_DIR_MEDIA\n$FIND_DIR_ETC\n$FIND_DIR_OPT\n$FIND_DIR_USR\n$FIND_DIR_SBIN\n$FIND_DIR_CDROM\n$FIND_DIR_SNAP" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "\.irssi$" | sort | uniq | head -n 70) - PSTORAGE_KEYRING=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM\n$FIND_DIR_BIN\n$FIND_DIR_CACHE\n$FIND_DIR_SRV\n$FIND_DIR_PRIVATE\n$FIND_DIR_MNT\n$FIND_DIR_TMP\n$FIND_DIR_HOMESEARCH\n$FIND_DIR_VAR\n$FIND_DIR_APPLICATIONS\n$FIND_DIR_MEDIA\n$FIND_DIR_ETC\n$FIND_DIR_OPT\n$FIND_DIR_USR\n$FIND_DIR_SBIN\n$FIND_DIR_CDROM\n$FIND_DIR_SNAP" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "keyrings$|.*\.keyring$|.*\.keystore$|.*\.jks$" | sort | uniq | head -n 70) - PSTORAGE_FILEZILLA=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM\n$FIND_DIR_BIN\n$FIND_DIR_CACHE\n$FIND_DIR_SRV\n$FIND_DIR_PRIVATE\n$FIND_DIR_MNT\n$FIND_DIR_TMP\n$FIND_DIR_HOMESEARCH\n$FIND_DIR_VAR\n$FIND_DIR_APPLICATIONS\n$FIND_DIR_MEDIA\n$FIND_DIR_ETC\n$FIND_DIR_OPT\n$FIND_DIR_USR\n$FIND_DIR_SBIN\n$FIND_DIR_CDROM\n$FIND_DIR_SNAP" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "filelliza$|filezilla\.xml$" | sort | uniq | head -n 70) - PSTORAGE_BACKUP_MANAGER=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "storage\.php$|database\.php$" | sort | uniq | head -n 70) - PSTORAGE_SPLUNK=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "passwd$" | sort | uniq | head -n 70) - PSTORAGE_GITLAB=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -v -E '/lib' | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "secrets\.yml$|gitlab\.yml$|gitlab\.rm$" | sort | uniq | head -n 70) - PSTORAGE_PGP_GPG=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -v -E 'README.gnupg' | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E ".*\.pgp$|.*\.gpg$|.*\.gnupg$" | sort | uniq | head -n 70) - PSTORAGE_CACHE_VI=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E ".*\.swp$|.*\.viminfo$" | sort | uniq | head -n 70) - PSTORAGE_DOCKER=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "docker\.socket$|docker\.sock$|Dockerfile$|docker-compose\.yml$" | sort | uniq | head -n 70) - PSTORAGE_FIREFOX=$(echo -e "$FIND_DIR_BIN\n$FIND_DIR_CACHE\n$FIND_DIR_SRV\n$FIND_DIR_PRIVATE\n$FIND_DIR_MNT\n$FIND_DIR_TMP\n$FIND_DIR_HOMESEARCH\n$FIND_DIR_VAR\n$FIND_DIR_APPLICATIONS\n$FIND_DIR_MEDIA\n$FIND_DIR_ETC\n$FIND_DIR_OPT\n$FIND_DIR_USR\n$FIND_DIR_SBIN\n$FIND_DIR_CDROM\n$FIND_DIR_SNAP" | grep -E "^$GREPHOMESEARCH" | grep -E "\.mozilla$" | sort | uniq | head -n 70) - PSTORAGE_CHROME=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^$GREPHOMESEARCH" | grep -E "google-chrome$" | sort | uniq | head -n 70) - PSTORAGE_AUTOLOGIN=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "autologin$|autologin\.conf$" | sort | uniq | head -n 70) - PSTORAGE_FASTCGI=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "fastcgi_params$" | sort | uniq | head -n 70) - PSTORAGE_SNMP=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "snmpd\.conf$" | sort | uniq | head -n 70) - PSTORAGE_PYPIRC=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "\.pypirc$" | sort | uniq | head -n 70) - PSTORAGE_CLOUDFLARE=$(echo -e "$FIND_DIR_BIN\n$FIND_DIR_CACHE\n$FIND_DIR_SRV\n$FIND_DIR_PRIVATE\n$FIND_DIR_MNT\n$FIND_DIR_TMP\n$FIND_DIR_HOMESEARCH\n$FIND_DIR_VAR\n$FIND_DIR_APPLICATIONS\n$FIND_DIR_MEDIA\n$FIND_DIR_ETC\n$FIND_DIR_OPT\n$FIND_DIR_USR\n$FIND_DIR_SBIN\n$FIND_DIR_CDROM\n$FIND_DIR_SNAP" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "\.cloudflared$" | sort | uniq | head -n 70) - PSTORAGE_HISTORY=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "\..*_history$" | sort | uniq | head -n 70) - PSTORAGE_HTTP_CONF=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "httpd\.conf$" | sort | uniq | head -n 70) - PSTORAGE_HTPASSWD=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "\.htpasswd$" | sort | uniq | head -n 70) - PSTORAGE_LDAPRC=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "\.ldaprc$" | sort | uniq | head -n 70) - PSTORAGE_ENV=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "\.env$" | sort | uniq | head -n 70) - PSTORAGE_MSMTPRC=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "\.msmtprc$" | sort | uniq | head -n 70) - PSTORAGE_GITHUB=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "\.github$|\.gitconfig$|\.git-credentials$|\.git$" | sort | uniq | head -n 70) - PSTORAGE_SVN=$(echo -e "$FIND_DIR_BIN\n$FIND_DIR_CACHE\n$FIND_DIR_SRV\n$FIND_DIR_PRIVATE\n$FIND_DIR_MNT\n$FIND_DIR_TMP\n$FIND_DIR_HOMESEARCH\n$FIND_DIR_VAR\n$FIND_DIR_APPLICATIONS\n$FIND_DIR_MEDIA\n$FIND_DIR_ETC\n$FIND_DIR_OPT\n$FIND_DIR_USR\n$FIND_DIR_SBIN\n$FIND_DIR_CDROM\n$FIND_DIR_SNAP" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "\.svn$" | sort | uniq | head -n 70) - PSTORAGE_KEEPASS=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E ".*\.kdbx$|KeePass\.config.*$|KeePass\.ini$|KeePass\.enforced.*$" | sort | uniq | head -n 70) - PSTORAGE_FTP=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E ".*\.ftpconfig$|ffftp\.ini$|ftp\.ini$|ftp\.config$|ws_ftp\.ini$" | sort | uniq | head -n 70) - PSTORAGE_BIND=$(echo -e "$FIND_DIR_BIN\n$FIND_DIR_CACHE\n$FIND_DIR_SRV\n$FIND_DIR_PRIVATE\n$FIND_DIR_MNT\n$FIND_DIR_TMP\n$FIND_DIR_HOMESEARCH\n$FIND_DIR_VAR\n$FIND_DIR_APPLICATIONS\n$FIND_DIR_MEDIA\n$FIND_DIR_ETC\n$FIND_DIR_OPT\n$FIND_DIR_USR\n$FIND_DIR_SBIN\n$FIND_DIR_CDROM\n$FIND_DIR_SNAP" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "bind$" | sort | uniq | head -n 70) - PSTORAGE_SEEDDMS=$(echo -e "$FIND_DIR_BIN\n$FIND_DIR_CACHE\n$FIND_DIR_SRV\n$FIND_DIR_PRIVATE\n$FIND_DIR_MNT\n$FIND_DIR_TMP\n$FIND_DIR_HOMESEARCH\n$FIND_DIR_VAR\n$FIND_DIR_APPLICATIONS\n$FIND_DIR_MEDIA\n$FIND_DIR_ETC\n$FIND_DIR_OPT\n$FIND_DIR_USR\n$FIND_DIR_SBIN\n$FIND_DIR_CDROM\n$FIND_DIR_SNAP" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "seeddms.*$" | sort | uniq | head -n 70) - PSTORAGE_DDCLIENT=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "ddclient\.conf$" | sort | uniq | head -n 70) - PSTORAGE_INTERESTING_LOGS=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "access\.log$|error\.log$" | sort | uniq | head -n 70) - PSTORAGE_OTHER_INTERESTING_FILES=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "\.bashrc$|\.google_authenticator$|hosts\.equiv$|\.lesshst$|\.plan$|\.profile$|\.recently-used\.xbel$|\.rhosts$|\.sudo_as_admin_successful$" | sort | uniq | head -n 70) - PSTORAGE_WINDOWS_FILES=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "unattend\.inf$|.*\.rdg$|AppEvent\.Evt$|ConsoleHost_history\.txt$|FreeSSHDservice\.ini$|NetSetup\.log$|Ntds\.dit$|RDCMan\.settings$|SAM$|SYSTEM$|SecEvent\.Evt$|appcmd\.exe$|bash\.exe$|datasources\.xml$|default\.sav$|drives\.xml$|groups\.xml$|https-xampp\.conf$|https\.conf$|iis6\.log$|index\.dat$|my\.cnf$|my\.ini$|ntuser\.dat$|pagefile\.sys$|php\.ini$|printers\.xml$|recentservers\.xml$|scclient\.exe$|scheduledtasks\.xml$|security$|security\.sav$|server\.xml$|services\.xml$|setupinfo$|setupinfo\.bak$|sitemanager\.xml$|sites\.ini$|software$|software\.sav$|sysprep\.inf$|sysprep\.xml$|system\.sav$|unattend\.txt$|unattend\.xml$|unattended\.xml$|wcx_ftp\.ini$|web.*\.config$|winscp\.ini$|wsl\.exe$" | sort | uniq | head -n 70) - PSTORAGE_DATABASE=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -v -E '/man/|/usr/|/var/cache/' | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E ".*\.db$|.*\.sqlite$|.*\.sqlite3$" | sort | uniq | head -n 70) - PSTORAGE_BACKUPS=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E "backup$|backups$" | sort | uniq | head -n 70) - PSTORAGE_PASSWORD_FILES=$(echo -e "$FIND_SRV\n$FIND_SYSTEM\n$FIND_LIB\n$FIND_SYS\n$FIND_BIN\n$FIND_ETC\n$FIND_RUN\n$FIND_VAR\n$FIND_APPLICATIONS\n$FIND_PRIVATE\n$FIND_LIB32\n$FIND_USR\n$FIND_OPT\n$FIND_MEDIA\n$FIND_LIB64\n$FIND_SNAP\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_TMP\n$FIND_CACHE\n$FIND_HOMESEARCH\n$FIND_MNT\n$FIND_CDROM" | grep -E "^/applications|^/.cache|^/private|^/usr|^/tmp|^/bin|^/cdrom|^/var|^/opt|^/media|^/etc|^/sbin|^/srv|^/mnt|^$GREPHOMESEARCH|^/snap" | grep -E ".*password.*$|.*credential.*$|creds.*$|.*\.key$" | sort | uniq | head -n 70) + PSTORAGE_SYSTEMD=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^$GREPHOMESEARCH|^/systemd|^/etc|^/sys|^/opt|^/lib32|^/bin|^/applications|^/run|^/srv|^/sbin|^/system|^/snap|^/usr|^/lib|^/mnt|^/var|^/media|^/tmp|^/lib64|^/private|^/.cache" | grep -E ".*\.service$" | sort | uniq | head -n 70) + PSTORAGE_TIMER=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^$GREPHOMESEARCH|^/systemd|^/etc|^/sys|^/opt|^/lib32|^/bin|^/applications|^/run|^/srv|^/sbin|^/system|^/snap|^/usr|^/lib|^/mnt|^/var|^/media|^/tmp|^/lib64|^/private|^/.cache" | grep -E ".*\.timer$" | sort | uniq | head -n 70) + PSTORAGE_SOCKET=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^$GREPHOMESEARCH|^/systemd|^/etc|^/sys|^/opt|^/lib32|^/bin|^/applications|^/run|^/srv|^/sbin|^/system|^/snap|^/usr|^/lib|^/mnt|^/var|^/media|^/tmp|^/lib64|^/private|^/.cache" | grep -E ".*\.socket$" | sort | uniq | head -n 70) + PSTORAGE_DBUS=$(echo -e "$FIND_DIR_HOMESEARCH\n$FIND_DIR_ETC\n$FIND_DIR_VAR\n$FIND_DIR_USR\n$FIND_DIR_MNT\n$FIND_DIR_OPT\n$FIND_DIR_SBIN\n$FIND_DIR_MEDIA\n$FIND_DIR_PRIVATE\n$FIND_DIR_SNAP\n$FIND_DIR_SRV\n$FIND_DIR_TMP\n$FIND_DIR_CDROM\n$FIND_DIR_CACHE\n$FIND_DIR_APPLICATIONS\n$FIND_DIR_BIN" | grep -E "^/etc" | grep -E "system\.d$" | sort | uniq | head -n 70) + PSTORAGE_MYSQL=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_DIR_HOMESEARCH\n$FIND_DIR_ETC\n$FIND_DIR_VAR\n$FIND_DIR_USR\n$FIND_DIR_MNT\n$FIND_DIR_OPT\n$FIND_DIR_SBIN\n$FIND_DIR_MEDIA\n$FIND_DIR_PRIVATE\n$FIND_DIR_SNAP\n$FIND_DIR_SRV\n$FIND_DIR_TMP\n$FIND_DIR_CDROM\n$FIND_DIR_CACHE\n$FIND_DIR_APPLICATIONS\n$FIND_DIR_BIN" | grep -v -E 'mysql/mysql' | grep -E '^/etc/.*mysql|/usr/var/lib/.*mysql|/var/lib/.*mysql' | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "mysql$|debian\.cnf$" | sort | uniq | head -n 70) + PSTORAGE_POSTGRESQL=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "pgadmin.*\.db$|pg_hba\.conf$|postgresql\.conf$|pgsql\.conf$" | sort | uniq | head -n 70) + PSTORAGE_APACHE=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_DIR_HOMESEARCH\n$FIND_DIR_ETC\n$FIND_DIR_VAR\n$FIND_DIR_USR\n$FIND_DIR_MNT\n$FIND_DIR_OPT\n$FIND_DIR_SBIN\n$FIND_DIR_MEDIA\n$FIND_DIR_PRIVATE\n$FIND_DIR_SNAP\n$FIND_DIR_SRV\n$FIND_DIR_TMP\n$FIND_DIR_CDROM\n$FIND_DIR_CACHE\n$FIND_DIR_APPLICATIONS\n$FIND_DIR_BIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "sites-enabled$|000-default\.conf$" | sort | uniq | head -n 70) + PSTORAGE_PHP_SESSIONS=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E '/tmp/.*sess_.*|/var/tmp/.*sess_.*' | grep -E "^/var|^/mnt|^/tmp" | grep -E "sess_.*$" | sort | uniq | head -n 70) + PSTORAGE_PHP_FILES=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E ".*config.*\.php$|database\.php$|db\.php$|storage\.php$|settings\.php$" | sort | uniq | head -n 70) + PSTORAGE_WORDPRESS=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "wp-config\.php$" | sort | uniq | head -n 70) + PSTORAGE_DRUPAL=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E '/default/settings.php' | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "settings\.php$" | sort | uniq | head -n 70) + PSTORAGE_MOODLE=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E 'moodle/config.php' | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "config\.php$" | sort | uniq | head -n 70) + PSTORAGE_TOMCAT=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "tomcat-users\.xml$" | sort | uniq | head -n 70) + PSTORAGE_MONGO=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "mongod.*\.conf$" | sort | uniq | head -n 70) + PSTORAGE_SUPERVISORD=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "supervisord\.conf$" | sort | uniq | head -n 70) + PSTORAGE_CESI=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "cesi\.conf$" | sort | uniq | head -n 70) + PSTORAGE_RSYNC=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "rsyncd\.conf$|rsyncd\.secrets$" | sort | uniq | head -n 70) + PSTORAGE_HOSTAPD=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "hostapd\.conf$" | sort | uniq | head -n 70) + PSTORAGE_ANACONDA_KS=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "anaconda-ks\.cfg$" | sort | uniq | head -n 70) + PSTORAGE_VNC=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_DIR_HOMESEARCH\n$FIND_DIR_ETC\n$FIND_DIR_VAR\n$FIND_DIR_USR\n$FIND_DIR_MNT\n$FIND_DIR_OPT\n$FIND_DIR_SBIN\n$FIND_DIR_MEDIA\n$FIND_DIR_PRIVATE\n$FIND_DIR_SNAP\n$FIND_DIR_SRV\n$FIND_DIR_TMP\n$FIND_DIR_CDROM\n$FIND_DIR_CACHE\n$FIND_DIR_APPLICATIONS\n$FIND_DIR_BIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "\.vnc$|.*vnc.*\.c.*nf.*$|.*vnc.*\.ini$|.*vnc.*\.txt$|.*vnc.*\.xml$" | sort | uniq | head -n 70) + PSTORAGE_LDAP=$(echo -e "$FIND_DIR_HOMESEARCH\n$FIND_DIR_ETC\n$FIND_DIR_VAR\n$FIND_DIR_USR\n$FIND_DIR_MNT\n$FIND_DIR_OPT\n$FIND_DIR_SBIN\n$FIND_DIR_MEDIA\n$FIND_DIR_PRIVATE\n$FIND_DIR_SNAP\n$FIND_DIR_SRV\n$FIND_DIR_TMP\n$FIND_DIR_CDROM\n$FIND_DIR_CACHE\n$FIND_DIR_APPLICATIONS\n$FIND_DIR_BIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "ldap$" | sort | uniq | head -n 70) + PSTORAGE_OPENVPN=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E ".*\.ovpn$" | sort | uniq | head -n 70) + PSTORAGE_SSH=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "id_dsa.*$|id_rsa.*$|known_hosts$|authorized_hosts$|authorized_keys$" | sort | uniq | head -n 70) + PSTORAGE_CERTSB4=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -v -E '^/usr/share/|^/etc/ssl/|^/usr/local/lib/|^/usr/lib.*' | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E ".*\.pem$|.*\.cer$|.*\.crt$" | sort | uniq | head -n 70) + PSTORAGE_CERTSBIN=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -v -E '^/usr/share/|^/etc/ssl/|^/usr/local/lib/|^/usr/lib/.*' | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E ".*\.csr$|.*\.der$" | sort | uniq | head -n 70) + PSTORAGE_CERTSCLIENT=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -v -E '^/usr/share/|^/etc/ssl/|^/usr/local/lib/|^/usr/lib/.*' | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E ".*\.pfx$|.*\.p12$" | sort | uniq | head -n 70) + PSTORAGE_SSH_AGENTS=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/tmp" | grep -E "agent.*$" | sort | uniq | head -n 70) + PSTORAGE_SSH_CONFIG=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/usr|^$GREPHOMESEARCH" | grep -E "ssh.*config$" | sort | uniq | head -n 70) + PSTORAGE_CLOUD_CREDENTIALS=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_DIR_HOMESEARCH\n$FIND_DIR_ETC\n$FIND_DIR_VAR\n$FIND_DIR_USR\n$FIND_DIR_MNT\n$FIND_DIR_OPT\n$FIND_DIR_SBIN\n$FIND_DIR_MEDIA\n$FIND_DIR_PRIVATE\n$FIND_DIR_SNAP\n$FIND_DIR_SRV\n$FIND_DIR_TMP\n$FIND_DIR_CDROM\n$FIND_DIR_CACHE\n$FIND_DIR_APPLICATIONS\n$FIND_DIR_BIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "credentials$|credentials\.db$|legacy_credentials\.db$|access_tokens\.db$|access_tokens\.json$|accessTokens\.json$|azureProfile\.json$|TokenCache\.dat$|AzureRMContext\.json$|\.bluemix$" | sort | uniq | head -n 70) + PSTORAGE_KERBEROS=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "krb5\.conf$|krb5\.keytab$|\.k5login$|kadm5\.acl$" | sort | uniq | head -n 70) + PSTORAGE_KIBANA=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "kibana\.y.*ml$" | sort | uniq | head -n 70) + PSTORAGE_KNOCKD=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E '/etc/init.d/' | grep -E "^/etc" | grep -E ".*knockd.*$" | sort | uniq | head -n 70) + PSTORAGE_LOGSTASH=$(echo -e "$FIND_DIR_HOMESEARCH\n$FIND_DIR_ETC\n$FIND_DIR_VAR\n$FIND_DIR_USR\n$FIND_DIR_MNT\n$FIND_DIR_OPT\n$FIND_DIR_SBIN\n$FIND_DIR_MEDIA\n$FIND_DIR_PRIVATE\n$FIND_DIR_SNAP\n$FIND_DIR_SRV\n$FIND_DIR_TMP\n$FIND_DIR_CDROM\n$FIND_DIR_CACHE\n$FIND_DIR_APPLICATIONS\n$FIND_DIR_BIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "logstash$" | sort | uniq | head -n 70) + PSTORAGE_ELASTICSEARCH=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "elasticsearch\.y.*ml$" | sort | uniq | head -n 70) + PSTORAGE_VAULT_SSH_HELPER=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "vault-ssh-helper\.hcl$" | sort | uniq | head -n 70) + PSTORAGE_VAULT_SSH_TOKEN=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "\.vault-token$" | sort | uniq | head -n 70) + PSTORAGE_COUCHDB=$(echo -e "$FIND_DIR_HOMESEARCH\n$FIND_DIR_ETC\n$FIND_DIR_VAR\n$FIND_DIR_USR\n$FIND_DIR_MNT\n$FIND_DIR_OPT\n$FIND_DIR_SBIN\n$FIND_DIR_MEDIA\n$FIND_DIR_PRIVATE\n$FIND_DIR_SNAP\n$FIND_DIR_SRV\n$FIND_DIR_TMP\n$FIND_DIR_CDROM\n$FIND_DIR_CACHE\n$FIND_DIR_APPLICATIONS\n$FIND_DIR_BIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "couchdb$" | sort | uniq | head -n 70) + PSTORAGE_REDIS=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "redis\.conf$" | sort | uniq | head -n 70) + PSTORAGE_MOSQUITTO=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "mosquitto\.conf$" | sort | uniq | head -n 70) + PSTORAGE_NEO4J=$(echo -e "$FIND_DIR_HOMESEARCH\n$FIND_DIR_ETC\n$FIND_DIR_VAR\n$FIND_DIR_USR\n$FIND_DIR_MNT\n$FIND_DIR_OPT\n$FIND_DIR_SBIN\n$FIND_DIR_MEDIA\n$FIND_DIR_PRIVATE\n$FIND_DIR_SNAP\n$FIND_DIR_SRV\n$FIND_DIR_TMP\n$FIND_DIR_CDROM\n$FIND_DIR_CACHE\n$FIND_DIR_APPLICATIONS\n$FIND_DIR_BIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "neo4j$" | sort | uniq | head -n 70) + PSTORAGE_CLOUD_INIT=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "cloud\.cfg$" | sort | uniq | head -n 70) + PSTORAGE_ERLANG=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "\.erlang\.cookie$" | sort | uniq | head -n 70) + PSTORAGE_GMV_AUTH=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "gvm-tools\.conf$" | sort | uniq | head -n 70) + PSTORAGE_IPSEC=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "ipsec\.secrets$|ipsec\.conf$" | sort | uniq | head -n 70) + PSTORAGE_IRSSI=$(echo -e "$FIND_DIR_HOMESEARCH\n$FIND_DIR_ETC\n$FIND_DIR_VAR\n$FIND_DIR_USR\n$FIND_DIR_MNT\n$FIND_DIR_OPT\n$FIND_DIR_SBIN\n$FIND_DIR_MEDIA\n$FIND_DIR_PRIVATE\n$FIND_DIR_SNAP\n$FIND_DIR_SRV\n$FIND_DIR_TMP\n$FIND_DIR_CDROM\n$FIND_DIR_CACHE\n$FIND_DIR_APPLICATIONS\n$FIND_DIR_BIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "\.irssi$" | sort | uniq | head -n 70) + PSTORAGE_KEYRING=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_DIR_HOMESEARCH\n$FIND_DIR_ETC\n$FIND_DIR_VAR\n$FIND_DIR_USR\n$FIND_DIR_MNT\n$FIND_DIR_OPT\n$FIND_DIR_SBIN\n$FIND_DIR_MEDIA\n$FIND_DIR_PRIVATE\n$FIND_DIR_SNAP\n$FIND_DIR_SRV\n$FIND_DIR_TMP\n$FIND_DIR_CDROM\n$FIND_DIR_CACHE\n$FIND_DIR_APPLICATIONS\n$FIND_DIR_BIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "keyrings$|.*\.keyring$|.*\.keystore$|.*\.jks$" | sort | uniq | head -n 70) + PSTORAGE_FILEZILLA=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN\n$FIND_DIR_HOMESEARCH\n$FIND_DIR_ETC\n$FIND_DIR_VAR\n$FIND_DIR_USR\n$FIND_DIR_MNT\n$FIND_DIR_OPT\n$FIND_DIR_SBIN\n$FIND_DIR_MEDIA\n$FIND_DIR_PRIVATE\n$FIND_DIR_SNAP\n$FIND_DIR_SRV\n$FIND_DIR_TMP\n$FIND_DIR_CDROM\n$FIND_DIR_CACHE\n$FIND_DIR_APPLICATIONS\n$FIND_DIR_BIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "filezilla$|filezilla\.xml$|recentservers\.xml$" | sort | uniq | head -n 70) + PSTORAGE_BACKUP_MANAGER=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "storage\.php$|database\.php$" | sort | uniq | head -n 70) + PSTORAGE_SPLUNK=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "passwd$" | sort | uniq | head -n 70) + PSTORAGE_GITLAB=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -v -E '/lib' | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "secrets\.yml$|gitlab\.yml$|gitlab\.rm$" | sort | uniq | head -n 70) + PSTORAGE_PGP_GPG=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -v -E 'README.gnupg' | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E ".*\.pgp$|.*\.gpg$|.*\.gnupg$" | sort | uniq | head -n 70) + PSTORAGE_CACHE_VI=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E ".*\.swp$|.*\.viminfo$" | sort | uniq | head -n 70) + PSTORAGE_DOCKER=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "docker\.socket$|docker\.sock$|Dockerfile$|docker-compose\.yml$" | sort | uniq | head -n 70) + PSTORAGE_FIREFOX=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^" | grep -E "\.mozilla$" | sort | uniq | head -n 70) + PSTORAGE_CHROME=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^" | grep -E "google-chrome$" | sort | uniq | head -n 70) + PSTORAGE_AUTOLOGIN=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "autologin$|autologin\.conf$" | sort | uniq | head -n 70) + PSTORAGE_FASTCGI=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "fastcgi_params$" | sort | uniq | head -n 70) + PSTORAGE_SNMP=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "snmpd\.conf$" | sort | uniq | head -n 70) + PSTORAGE_PYPIRC=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "\.pypirc$" | sort | uniq | head -n 70) + PSTORAGE_CLOUDFLARE=$(echo -e "$FIND_DIR_HOMESEARCH\n$FIND_DIR_ETC\n$FIND_DIR_VAR\n$FIND_DIR_USR\n$FIND_DIR_MNT\n$FIND_DIR_OPT\n$FIND_DIR_SBIN\n$FIND_DIR_MEDIA\n$FIND_DIR_PRIVATE\n$FIND_DIR_SNAP\n$FIND_DIR_SRV\n$FIND_DIR_TMP\n$FIND_DIR_CDROM\n$FIND_DIR_CACHE\n$FIND_DIR_APPLICATIONS\n$FIND_DIR_BIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "\.cloudflared$" | sort | uniq | head -n 70) + PSTORAGE_HISTORY=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "\..*_history\..*$" | sort | uniq | head -n 70) + PSTORAGE_HTTP_CONF=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "httpd\.conf$" | sort | uniq | head -n 70) + PSTORAGE_HTPASSWD=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "\.htpasswd$" | sort | uniq | head -n 70) + PSTORAGE_LDAPRC=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "\.ldaprc$" | sort | uniq | head -n 70) + PSTORAGE_ENV=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "\.env$" | sort | uniq | head -n 70) + PSTORAGE_MSMTPRC=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "\.msmtprc$" | sort | uniq | head -n 70) + PSTORAGE_GITHUB=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "\.github$|\.gitconfig$|\.git-credentials$|\.git$" | sort | uniq | head -n 70) + PSTORAGE_SVN=$(echo -e "$FIND_DIR_HOMESEARCH\n$FIND_DIR_ETC\n$FIND_DIR_VAR\n$FIND_DIR_USR\n$FIND_DIR_MNT\n$FIND_DIR_OPT\n$FIND_DIR_SBIN\n$FIND_DIR_MEDIA\n$FIND_DIR_PRIVATE\n$FIND_DIR_SNAP\n$FIND_DIR_SRV\n$FIND_DIR_TMP\n$FIND_DIR_CDROM\n$FIND_DIR_CACHE\n$FIND_DIR_APPLICATIONS\n$FIND_DIR_BIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "\.svn$" | sort | uniq | head -n 70) + PSTORAGE_KEEPASS=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E ".*\.kdbx$|KeePass\.config.*$|KeePass\.ini$|KeePass\.enforced.*$" | sort | uniq | head -n 70) + PSTORAGE_FTP=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E ".*\.ftpconfig$|ffftp\.ini$|ftp\.ini$|ftp\.config$|sites\.ini$|wcx_ftp\.ini$|winscp\.ini$|ws_ftp\.ini$" | sort | uniq | head -n 70) + PSTORAGE_BIND=$(echo -e "$FIND_DIR_HOMESEARCH\n$FIND_DIR_ETC\n$FIND_DIR_VAR\n$FIND_DIR_USR\n$FIND_DIR_MNT\n$FIND_DIR_OPT\n$FIND_DIR_SBIN\n$FIND_DIR_MEDIA\n$FIND_DIR_PRIVATE\n$FIND_DIR_SNAP\n$FIND_DIR_SRV\n$FIND_DIR_TMP\n$FIND_DIR_CDROM\n$FIND_DIR_CACHE\n$FIND_DIR_APPLICATIONS\n$FIND_DIR_BIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "bind$" | sort | uniq | head -n 70) + PSTORAGE_SEEDDMS=$(echo -e "$FIND_DIR_HOMESEARCH\n$FIND_DIR_ETC\n$FIND_DIR_VAR\n$FIND_DIR_USR\n$FIND_DIR_MNT\n$FIND_DIR_OPT\n$FIND_DIR_SBIN\n$FIND_DIR_MEDIA\n$FIND_DIR_PRIVATE\n$FIND_DIR_SNAP\n$FIND_DIR_SRV\n$FIND_DIR_TMP\n$FIND_DIR_CDROM\n$FIND_DIR_CACHE\n$FIND_DIR_APPLICATIONS\n$FIND_DIR_BIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "seeddms.*$" | sort | uniq | head -n 70) + PSTORAGE_DDCLIENT=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "ddclient\.conf$" | sort | uniq | head -n 70) + PSTORAGE_CACTI=$(echo -e "$FIND_DIR_HOMESEARCH\n$FIND_DIR_ETC\n$FIND_DIR_VAR\n$FIND_DIR_USR\n$FIND_DIR_MNT\n$FIND_DIR_OPT\n$FIND_DIR_SBIN\n$FIND_DIR_MEDIA\n$FIND_DIR_PRIVATE\n$FIND_DIR_SNAP\n$FIND_DIR_SRV\n$FIND_DIR_TMP\n$FIND_DIR_CDROM\n$FIND_DIR_CACHE\n$FIND_DIR_APPLICATIONS\n$FIND_DIR_BIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "cacti$" | sort | uniq | head -n 70) + PSTORAGE_INTERESTING_LOGS=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "access\.log$|error\.log$" | sort | uniq | head -n 70) + PSTORAGE_OTHER_INTERESTING_FILES=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "\.bashrc$|\.google_authenticator$|hosts\.equiv$|\.lesshst$|\.plan$|\.profile$|\.recently-used\.xbel$|\.rhosts$|\.sudo_as_admin_successful$" | sort | uniq | head -n 70) + PSTORAGE_WINDOWS_FILES=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "unattend\.inf$|.*\.rdg$|AppEvent\.Evt$|ConsoleHost_history\.txt$|FreeSSHDservice\.ini$|NetSetup\.log$|Ntds\.dit$|protecteduserkey\.bin$|RDCMan\.settings$|SAM$|SYSTEM$|SecEvent\.Evt$|appcmd\.exe$|bash\.exe$|datasources\.xml$|default\.sav$|drives\.xml$|groups\.xml$|https-xampp\.conf$|https\.conf$|iis6\.log$|index\.dat$|my\.cnf$|my\.ini$|ntuser\.dat$|pagefile\.sys$|php\.ini$|printers\.xml$|recentservers\.xml$|scclient\.exe$|scheduledtasks\.xml$|security\.sav$|server\.xml$|setupinfo$|setupinfo\.bak$|sitemanager\.xml$|sites\.ini$|software$|software\.sav$|sysprep\.inf$|sysprep\.xml$|system$|system\.sav$|unattend\.txt$|unattend\.xml$|unattended\.xml$|wcx_ftp\.ini$|ws_ftp\.ini$|web.*\.config$|winscp\.ini$|wsl\.exe$" | sort | uniq | head -n 70) + PSTORAGE_DATABASE=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -v -E '/man/|/usr/|/var/cache/' | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E ".*\.db$|.*\.sqlite$|.*\.sqlite3$" | sort | uniq | head -n 70) + PSTORAGE_BACKUPS=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E "backup$|backups$" | sort | uniq | head -n 70) + PSTORAGE_PASSWORD_FILES=$(echo -e "$FIND_PRIVATE\n$FIND_BIN\n$FIND_SNAP\n$FIND_SYSTEM\n$FIND_OPT\n$FIND_ETC\n$FIND_APPLICATIONS\n$FIND_RUN\n$FIND_LIB32\n$FIND_SYS\n$FIND_TMP\n$FIND_LIB\n$FIND_SRV\n$FIND_MNT\n$FIND_HOMESEARCH\n$FIND_CACHE\n$FIND_LIB64\n$FIND_USR\n$FIND_VAR\n$FIND_CDROM\n$FIND_MEDIA\n$FIND_SYSTEMD\n$FIND_SBIN" | grep -E "^/cdrom|^/srv|^/tmp|^/opt|^/usr|^/private|^/.cache|^/sbin|^$GREPHOMESEARCH|^/snap|^/applications|^/etc|^/mnt|^/var|^/bin|^/media" | grep -E ".*password.*$|.*credential.*$|creds.*$|.*\.key$" | sort | uniq | head -n 70) ##### POST SERACH VARIABLES ##### @@ -2021,7 +2023,7 @@ if [ "`echo $CHECKS | grep SofI`" ]; then fi echo "" - print_2title "Analizing PostgreSQL Files (limit 70)" + print_2title "Analyzing PostgreSQL Files (limit 70)" echo "Version: $(warn_exec psql -V 2>/dev/null)" if ! [ "`echo \"$PSTORAGE_POSTGRESQL\" | grep -E \"pgadmin.*\.db$\"`" ]; then echo_not_found "pgadmin*.db"; fi; printf "%s" "$PSTORAGE_POSTGRESQL" | grep -E "pgadmin.*\.db$" | while read f; do ls -ld "$f" | sed -${E} "s,pgadmin.*\.db$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_POSTGRESQL\" | grep -E \"pg_hba\.conf$\"`" ]; then echo_not_found "pg_hba.conf"; fi; printf "%s" "$PSTORAGE_POSTGRESQL" | grep -E "pg_hba\.conf$" | while read f; do ls -ld "$f" | sed -${E} "s,pg_hba\.conf$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | grep -Ev "\W+\#|^#" | sed -${E} "s,auth|password|md5|user=|pass=|trust,${SED_RED},g"; done; echo ""; @@ -2054,66 +2056,66 @@ if [ "`echo $CHECKS | grep SofI`" ]; then echo "" fi - print_2title "Analizing Mongo Files (limit 70)" + print_2title "Analyzing Mongo Files (limit 70)" echo "Version: $(warn_exec mongo --version 2>/dev/null; warn_exec mongod --version 2>/dev/null)" if ! [ "`echo \"$PSTORAGE_MONGO\" | grep -E \"mongod.*\.conf$\"`" ]; then echo_not_found "mongod*.conf"; fi; printf "%s" "$PSTORAGE_MONGO" | grep -E "mongod.*\.conf$" | while read f; do ls -ld "$f" | sed -${E} "s,mongod.*\.conf$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | grep -Ev "\W+\#|^#"; done; echo ""; - print_2title "Analizing Apache Files (limit 70)" + print_2title "Analyzing Apache Files (limit 70)" echo "Version: $(warn_exec apache2 -v 2>/dev/null; warn_exec httpd -v 2>/dev/null)" print_3title 'PHP exec extensions' grep -R -B1 "httpd-php" /etc/apache2 2>/dev/null if ! [ "`echo \"$PSTORAGE_APACHE\" | grep -E \"sites-enabled$\"`" ]; then echo_not_found "sites-enabled"; fi; printf "%s" "$PSTORAGE_APACHE" | grep -E "sites-enabled$" | while read f; do ls -ld "$f" | sed -${E} "s,sites-enabled$,${SED_RED},"; for ff in $(find "$f" -name "*"); do ls -ld "$ff" | sed -${E} "s,,${SED_RED},"; cat "$ff" 2>/dev/null | grep -IEv "^$" | grep -E "AuthType|AuthName|AuthUserFile|ServerName|ServerAlias" | grep -Ev "^#" | sed -${E} "s,AuthType|AuthName|AuthUserFile|ServerName|ServerAlias,${SED_RED},g"; done; echo "";done; echo ""; - if ! [ "`echo \"$PSTORAGE_APACHE\" | grep -E \"000-default$\"`" ]; then echo_not_found "000-default"; fi; printf "%s" "$PSTORAGE_APACHE" | grep -E "000-default$" | while read f; do ls -ld "$f" | sed -${E} "s,000-default$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | sed -${E} "s,AuthType|AuthName|AuthUserFile|ServerName|ServerAlias,${SED_RED},g"; done; echo ""; + if ! [ "`echo \"$PSTORAGE_APACHE\" | grep -E \"000-default\.conf$\"`" ]; then echo_not_found "000-default.conf"; fi; printf "%s" "$PSTORAGE_APACHE" | grep -E "000-default\.conf$" | while read f; do ls -ld "$f" | sed -${E} "s,000-default\.conf$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | sed -${E} "s,AuthType|AuthName|AuthUserFile|ServerName|ServerAlias,${SED_RED},g"; done; echo ""; - print_2title "Analizing Tomcat Files (limit 70)" + print_2title "Analyzing Tomcat Files (limit 70)" if ! [ "`echo \"$PSTORAGE_TOMCAT\" | grep -E \"tomcat-users\.xml$\"`" ]; then echo_not_found "tomcat-users.xml"; fi; printf "%s" "$PSTORAGE_TOMCAT" | grep -E "tomcat-users\.xml$" | while read f; do ls -ld "$f" | sed -${E} "s,tomcat-users\.xml$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | grep -E "username=|password=" | sed -${E} "s,dbtype|dbhost|dbuser|dbhost|dbpass|dbport,${SED_RED},g"; done; echo ""; - print_2title "Analizing FastCGI Files (limit 70)" + print_2title "Analyzing FastCGI Files (limit 70)" if ! [ "`echo \"$PSTORAGE_FASTCGI\" | grep -E \"fastcgi_params$\"`" ]; then echo_not_found "fastcgi_params"; fi; printf "%s" "$PSTORAGE_FASTCGI" | grep -E "fastcgi_params$" | while read f; do ls -ld "$f" | sed -${E} "s,fastcgi_params$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | grep -E "DB_NAME|DB_USER|DB_PASS" | sed -${E} "s,DB_NAME|DB_USER|DB_PASS,${SED_RED},g"; done; echo ""; - print_2title "Analizing Http conf Files (limit 70)" + print_2title "Analyzing Http conf Files (limit 70)" if ! [ "`echo \"$PSTORAGE_HTTP_CONF\" | grep -E \"httpd\.conf$\"`" ]; then echo_not_found "httpd.conf"; fi; printf "%s" "$PSTORAGE_HTTP_CONF" | grep -E "httpd\.conf$" | while read f; do ls -ld "$f" | sed -${E} "s,httpd\.conf$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | grep -E "htaccess.*|htpasswd.*" | grep -Ev "\W+\#|^#" | sed -${E} "s,htaccess.*|htpasswd.*,${SED_RED},g"; done; echo ""; - print_2title "Analizing Htpasswd Files (limit 70)" + print_2title "Analyzing Htpasswd Files (limit 70)" if ! [ "`echo \"$PSTORAGE_HTPASSWD\" | grep -E \"\.htpasswd$\"`" ]; then echo_not_found ".htpasswd"; fi; printf "%s" "$PSTORAGE_HTPASSWD" | grep -E "\.htpasswd$" | while read f; do ls -ld "$f" | sed -${E} "s,\.htpasswd$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | grep -Ev "^#" | sed -${E} "s,.*,${SED_RED},g"; done; echo ""; - print_2title "Analizing PHPCookies Files (limit 70)" + print_2title "Analyzing PHP Sessions Files (limit 70)" ls /var/lib/php/sessions 2>/dev/null || echo_not_found /var/lib/php/sessions - if ! [ "`echo \"$PSTORAGE_PHPCOOKIES\" | grep -E \"sess_.*$\"`" ]; then echo_not_found "sess_*"; fi; printf "%s" "$PSTORAGE_PHPCOOKIES" | grep -E "sess_.*$" | while read f; do ls -ld "$f" | sed -${E} "s,sess_.*$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$"; done; echo ""; + if ! [ "`echo \"$PSTORAGE_PHP_SESSIONS\" | grep -E \"sess_.*$\"`" ]; then echo_not_found "sess_*"; fi; printf "%s" "$PSTORAGE_PHP_SESSIONS" | grep -E "sess_.*$" | while read f; do ls -ld "$f" | sed -${E} "s,sess_.*$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$"; done; echo ""; - print_2title "Analizing Wordpress Files (limit 70)" + print_2title "Analyzing Wordpress Files (limit 70)" if ! [ "`echo \"$PSTORAGE_WORDPRESS\" | grep -E \"wp-config\.php$\"`" ]; then echo_not_found "wp-config.php"; fi; printf "%s" "$PSTORAGE_WORDPRESS" | grep -E "wp-config\.php$" | while read f; do ls -ld "$f" | sed -${E} "s,wp-config\.php$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | grep -E "PASSWORD|USER|NAME|HOST" | sed -${E} "s,PASSWORD|USER|NAME|HOST,${SED_RED},g"; done; echo ""; - print_2title "Analizing Drupal Files (limit 70)" + print_2title "Analyzing Drupal Files (limit 70)" if ! [ "`echo \"$PSTORAGE_DRUPAL\" | grep -E \"settings\.php$\"`" ]; then echo_not_found "settings.php"; fi; printf "%s" "$PSTORAGE_DRUPAL" | grep -E "settings\.php$" | while read f; do ls -ld "$f" | sed -${E} "s,settings\.php$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | grep -E "drupal_hash_salt|'database'|'username'|'password'|'host'|'port'|'driver'|'prefix'" | sed -${E} "s,drupal_hash_salt|'database'|'username'|'password'|'host'|'port'|'driver'|'prefix',${SED_RED},g"; done; echo ""; - print_2title "Analizing Moodle Files (limit 70)" + print_2title "Analyzing Moodle Files (limit 70)" if ! [ "`echo \"$PSTORAGE_MOODLE\" | grep -E \"config\.php$\"`" ]; then echo_not_found "config.php"; fi; printf "%s" "$PSTORAGE_MOODLE" | grep -E "config\.php$" | while read f; do ls -ld "$f" | sed -${E} "s,config\.php$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | grep -E "dbtype|dbhost|dbuser|dbhost|dbpass|dbport" | sed -${E} "s,dbtype|dbhost|dbuser|dbhost|dbpass|dbport,${SED_RED},g"; done; echo ""; - print_2title "Analizing Supervisord Files (limit 70)" + print_2title "Analyzing Supervisord Files (limit 70)" if ! [ "`echo \"$PSTORAGE_SUPERVISORD\" | grep -E \"supervisord\.conf$\"`" ]; then echo_not_found "supervisord.conf"; fi; printf "%s" "$PSTORAGE_SUPERVISORD" | grep -E "supervisord\.conf$" | while read f; do ls -ld "$f" | sed -${E} "s,supervisord\.conf$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | grep -E "port.*=|username.*=|password.*=" | sed -${E} "s,port.*=|username.*=|password.*=,${SED_RED},g"; done; echo ""; - print_2title "Analizing Cesi Files (limit 70)" + print_2title "Analyzing Cesi Files (limit 70)" if ! [ "`echo \"$PSTORAGE_CESI\" | grep -E \"cesi\.conf$\"`" ]; then echo_not_found "cesi.conf"; fi; printf "%s" "$PSTORAGE_CESI" | grep -E "cesi\.conf$" | while read f; do ls -ld "$f" | sed -${E} "s,cesi\.conf$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | grep -E "username.*=|password.*=|host.*=|port.*=|database.*=" | sed -${E} "s,username.*=|password.*=|host.*=|port.*=|database.*=,${SED_RED},g"; done; echo ""; - print_2title "Analizing Rsync Files (limit 70)" + print_2title "Analyzing Rsync Files (limit 70)" if ! [ "`echo \"$PSTORAGE_RSYNC\" | grep -E \"rsyncd\.conf$\"`" ]; then echo_not_found "rsyncd.conf"; fi; printf "%s" "$PSTORAGE_RSYNC" | grep -E "rsyncd\.conf$" | while read f; do ls -ld "$f" | sed -${E} "s,rsyncd\.conf$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | grep -Ev "\W+\#|^#" | sed -${E} "s,secrets.*|auth.*users.*=,${SED_RED},g"; done; echo ""; if ! [ "`echo \"$PSTORAGE_RSYNC\" | grep -E \"rsyncd\.secrets$\"`" ]; then echo_not_found "rsyncd.secrets"; fi; printf "%s" "$PSTORAGE_RSYNC" | grep -E "rsyncd\.secrets$" | while read f; do ls -ld "$f" | sed -${E} "s,rsyncd\.secrets$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | sed -${E} "s,.*,${SED_RED},g"; done; echo ""; - print_2title "Analizing Hostapd Files (limit 70)" + print_2title "Analyzing Hostapd Files (limit 70)" if ! [ "`echo \"$PSTORAGE_HOSTAPD\" | grep -E \"hostapd\.conf$\"`" ]; then echo_not_found "hostapd.conf"; fi; printf "%s" "$PSTORAGE_HOSTAPD" | grep -E "hostapd\.conf$" | while read f; do ls -ld "$f" | sed -${E} "s,hostapd\.conf$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | sed -${E} "s,passphrase.*,${SED_RED},g"; done; echo ""; @@ -2126,11 +2128,11 @@ if [ "`echo $CHECKS | grep SofI`" ]; then fi echo "" - print_2title "Analizing Anaconda-ks Files (limit 70)" + print_2title "Analyzing Anaconda ks Files (limit 70)" if ! [ "`echo \"$PSTORAGE_ANACONDA_KS\" | grep -E \"anaconda-ks\.cfg$\"`" ]; then echo_not_found "anaconda-ks.cfg"; fi; printf "%s" "$PSTORAGE_ANACONDA_KS" | grep -E "anaconda-ks\.cfg$" | while read f; do ls -ld "$f" | sed -${E} "s,anaconda-ks\.cfg$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | grep -E "rootpw.*" | sed -${E} "s,rootpw.*,${SED_RED},g"; done; echo ""; - print_2title "Analizing VNC Files (limit 70)" + print_2title "Analyzing VNC Files (limit 70)" if ! [ "`echo \"$PSTORAGE_VNC\" | grep -E \"\.vnc$\"`" ]; then echo_not_found ".vnc"; fi; printf "%s" "$PSTORAGE_VNC" | grep -E "\.vnc$" | while read f; do ls -ld "$f" | sed -${E} "s,\.vnc$,${SED_RED},"; for ff in $(find "$f" -name "passwd"); do ls -ld "$ff" | sed -${E} "s,passwd,${SED_RED},"; done; echo "";done; echo ""; if ! [ "`echo \"$PSTORAGE_VNC\" | grep -E \"vnc.*\.c.*nf.*$\"`" ]; then echo_not_found "*vnc*.c*nf*"; fi; printf "%s" "$PSTORAGE_VNC" | grep -E "vnc.*\.c.*nf.*$" | while read f; do ls -ld "$f" | sed -${E} "s,vnc.*\.c.*nf.*$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | sed -${E} "s,.*,${SED_RED},g"; done; echo ""; if ! [ "`echo \"$PSTORAGE_VNC\" | grep -E \"vnc.*\.ini$\"`" ]; then echo_not_found "*vnc*.ini"; fi; printf "%s" "$PSTORAGE_VNC" | grep -E "vnc.*\.ini$" | while read f; do ls -ld "$f" | sed -${E} "s,vnc.*\.ini$,${SED_RED},"; done; echo ""; @@ -2138,13 +2140,13 @@ if [ "`echo $CHECKS | grep SofI`" ]; then if ! [ "`echo \"$PSTORAGE_VNC\" | grep -E \"vnc.*\.xml$\"`" ]; then echo_not_found "*vnc*.xml"; fi; printf "%s" "$PSTORAGE_VNC" | grep -E "vnc.*\.xml$" | while read f; do ls -ld "$f" | sed -${E} "s,vnc.*\.xml$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | sed -${E} "s,.*,${SED_RED},g"; done; echo ""; - print_2title "Analizing Ldap Files (limit 70)" + print_2title "Analyzing Ldap Files (limit 70)" echo "The password hash is from the {SSHA} to 'structural'" if ! [ "`echo \"$PSTORAGE_LDAP\" | grep -E \"ldap$\"`" ]; then echo_not_found "ldap"; fi; printf "%s" "$PSTORAGE_LDAP" | grep -E "ldap$" | while read f; do ls -ld "$f" | sed -${E} "s,ldap$,${SED_RED},"; for ff in $(find "$f" -name "*.bdb"); do ls -ld "$ff" | sed -${E} "s,.bdb,${SED_RED},"; cat "$ff" 2>/dev/null | grep -IEv "^$" | grep -E -i -a -o "description.*" | sort | uniq | sed -${E} "s,administrator|password|ADMINISTRATOR|PASSWORD|Password|Administrator,${SED_RED},g"; done; echo "";done; echo ""; - print_2title "Analizing Open VPN Files (limit 70)" - if ! [ "`echo \"$PSTORAGE_OPEN_VPN\" | grep -E \"\.ovpn$\"`" ]; then echo_not_found "*.ovpn"; fi; printf "%s" "$PSTORAGE_OPEN_VPN" | grep -E "\.ovpn$" | while read f; do ls -ld "$f" | sed -${E} "s,\.ovpn$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | grep -E "auth-user-pass.+" | sed -${E} "s,auth-user-pass.+,${SED_RED},g"; done; echo ""; + print_2title "Analyzing OpenVPN Files (limit 70)" + if ! [ "`echo \"$PSTORAGE_OPENVPN\" | grep -E \"\.ovpn$\"`" ]; then echo_not_found "*.ovpn"; fi; printf "%s" "$PSTORAGE_OPENVPN" | grep -E "\.ovpn$" | while read f; do ls -ld "$f" | sed -${E} "s,\.ovpn$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | grep -E "auth-user-pass.+" | sed -${E} "s,auth-user-pass.+,${SED_RED},g"; done; echo ""; #-- SI) ssh files @@ -2154,12 +2156,12 @@ if [ "`echo $CHECKS | grep SofI`" ]; then hostsdenied="`ls /etc/hosts.denied 2>/dev/null`" hostsallow="`ls /etc/hosts.allow 2>/dev/null`" - print_2title "Analizing SSH FILES Files (limit 70)" - if ! [ "`echo \"$PSTORAGE_SSH_FILES\" | grep -E \"id_dsa.*$\"`" ]; then echo_not_found "id_dsa*"; fi; printf "%s" "$PSTORAGE_SSH_FILES" | grep -E "id_dsa.*$" | while read f; do ls -ld "$f" | sed -${E} "s,id_dsa.*$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$"; done; echo ""; - if ! [ "`echo \"$PSTORAGE_SSH_FILES\" | grep -E \"id_rsa.*$\"`" ]; then echo_not_found "id_rsa*"; fi; printf "%s" "$PSTORAGE_SSH_FILES" | grep -E "id_rsa.*$" | while read f; do ls -ld "$f" | sed -${E} "s,id_rsa.*$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$"; done; echo ""; - if ! [ "`echo \"$PSTORAGE_SSH_FILES\" | grep -E \"known_hosts$\"`" ]; then echo_not_found "known_hosts"; fi; printf "%s" "$PSTORAGE_SSH_FILES" | grep -E "known_hosts$" | while read f; do ls -ld "$f" | sed -${E} "s,known_hosts$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$"; done; echo ""; - if ! [ "`echo \"$PSTORAGE_SSH_FILES\" | grep -E \"authorized_hosts$\"`" ]; then echo_not_found "authorized_hosts"; fi; printf "%s" "$PSTORAGE_SSH_FILES" | grep -E "authorized_hosts$" | while read f; do ls -ld "$f" | sed -${E} "s,authorized_hosts$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$"; done; echo ""; - if ! [ "`echo \"$PSTORAGE_SSH_FILES\" | grep -E \"authorized_keys$\"`" ]; then echo_not_found "authorized_keys"; fi; printf "%s" "$PSTORAGE_SSH_FILES" | grep -E "authorized_keys$" | while read f; do ls -ld "$f" | sed -${E} "s,authorized_keys$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | sed -${E} "s,from=[\w\._\-]+,${SED_GOOD},g"; done; echo ""; + print_2title "Analyzing SSH Files (limit 70)" + if ! [ "`echo \"$PSTORAGE_SSH\" | grep -E \"id_dsa.*$\"`" ]; then echo_not_found "id_dsa*"; fi; printf "%s" "$PSTORAGE_SSH" | grep -E "id_dsa.*$" | while read f; do ls -ld "$f" | sed -${E} "s,id_dsa.*$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$"; done; echo ""; + if ! [ "`echo \"$PSTORAGE_SSH\" | grep -E \"id_rsa.*$\"`" ]; then echo_not_found "id_rsa*"; fi; printf "%s" "$PSTORAGE_SSH" | grep -E "id_rsa.*$" | while read f; do ls -ld "$f" | sed -${E} "s,id_rsa.*$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$"; done; echo ""; + if ! [ "`echo \"$PSTORAGE_SSH\" | grep -E \"known_hosts$\"`" ]; then echo_not_found "known_hosts"; fi; printf "%s" "$PSTORAGE_SSH" | grep -E "known_hosts$" | while read f; do ls -ld "$f" | sed -${E} "s,known_hosts$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$"; done; echo ""; + if ! [ "`echo \"$PSTORAGE_SSH\" | grep -E \"authorized_hosts$\"`" ]; then echo_not_found "authorized_hosts"; fi; printf "%s" "$PSTORAGE_SSH" | grep -E "authorized_hosts$" | while read f; do ls -ld "$f" | sed -${E} "s,authorized_hosts$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$"; done; echo ""; + if ! [ "`echo \"$PSTORAGE_SSH\" | grep -E \"authorized_keys$\"`" ]; then echo_not_found "authorized_keys"; fi; printf "%s" "$PSTORAGE_SSH" | grep -E "authorized_keys$" | while read f; do ls -ld "$f" | sed -${E} "s,authorized_keys$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | sed -${E} "s,from=[\w\._\-]+,${SED_GOOD},g"; done; echo ""; grep "PermitRootLogin \|ChallengeResponseAuthentication \|PasswordAuthentication \|UsePAM \|Port\|PermitEmptyPasswords\|PubkeyAuthentication\|ListenAddress\|ForwardAgent\|AllowAgentForwarding\|AuthorizedKeysFiles" /etc/ssh/sshd_config 2>/dev/null | grep -v "#" | sed -${E} "s,PermitRootLogin.*es|PermitEmptyPasswords.*es|ChallengeResponseAuthentication.*es|FordwardAgent.*es,${SED_RED}," @@ -2282,15 +2284,15 @@ if [ "`echo $CHECKS | grep SofI`" ]; then klist 2>/dev/null || echo_not_found "klist" echo "" - print_2title "Analizing Knockd Files (limit 70)" + print_2title "Analyzing Knockd Files (limit 70)" if ! [ "`echo \"$PSTORAGE_KNOCKD\" | grep -E \"knockd.*$\"`" ]; then echo_not_found "*knockd*"; fi; printf "%s" "$PSTORAGE_KNOCKD" | grep -E "knockd.*$" | while read f; do ls -ld "$f" | sed -${E} "s,knockd.*$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$"; done; echo ""; - print_2title "Analizing Kibana Files (limit 70)" + print_2title "Analyzing Kibana Files (limit 70)" if ! [ "`echo \"$PSTORAGE_KIBANA\" | grep -E \"kibana\.y.*ml$\"`" ]; then echo_not_found "kibana.y*ml"; fi; printf "%s" "$PSTORAGE_KIBANA" | grep -E "kibana\.y.*ml$" | while read f; do ls -ld "$f" | sed -${E} "s,kibana\.y.*ml$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | grep -Ev "\W+\#|^#|^[[:space:]]*$" | sed -${E} "s,username|password|host|port|elasticsearch|ssl,${SED_RED},g"; done; echo ""; - print_2title "Analizing Elasticsearch Files (limit 70)" + print_2title "Analyzing Elasticsearch Files (limit 70)" echo "The version is $(curl -X GET '127.0.0.1:9200' 2>/dev/null | grep number | cut -d ':' -f 2)" if ! [ "`echo \"$PSTORAGE_ELASTICSEARCH\" | grep -E \"elasticsearch\.y.*ml$\"`" ]; then echo_not_found "elasticsearch.y*ml"; fi; printf "%s" "$PSTORAGE_ELASTICSEARCH" | grep -E "elasticsearch\.y.*ml$" | while read f; do ls -ld "$f" | sed -${E} "s,elasticsearch\.y.*ml$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | grep -E "path.data|path.logs|cluster.name|node.name|network.host|discovery.zen.ping.unicast.hosts" | grep -Ev "\W+\#|^#"; done; echo ""; @@ -2353,11 +2355,11 @@ if [ "`echo $CHECKS | grep SofI`" ]; then fi echo "" - print_2title "Analizing CouchDB Files (limit 70)" + print_2title "Analyzing CouchDB Files (limit 70)" if ! [ "`echo \"$PSTORAGE_COUCHDB\" | grep -E \"couchdb$\"`" ]; then echo_not_found "couchdb"; fi; printf "%s" "$PSTORAGE_COUCHDB" | grep -E "couchdb$" | while read f; do ls -ld "$f" | sed -${E} "s,couchdb$,${SED_RED},"; for ff in $(find "$f" -name "local.ini"); do ls -ld "$ff" | sed -${E} "s,local.ini,${SED_RED},"; cat "$ff" 2>/dev/null | grep -IEv "^$" | grep -Ev "^;" | sed -${E} "s,admin.*|password.*|cert_file.*|key_file.*|hashed.*|pbkdf2.*,${SED_RED},g"; done; echo "";done; echo ""; - print_2title "Analizing Redis Files (limit 70)" + print_2title "Analyzing Redis Files (limit 70)" if ! [ "`echo \"$PSTORAGE_REDIS\" | grep -E \"redis\.conf$\"`" ]; then echo_not_found "redis.conf"; fi; printf "%s" "$PSTORAGE_REDIS" | grep -E "redis\.conf$" | while read f; do ls -ld "$f" | sed -${E} "s,redis\.conf$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | grep -Ev "\W+\#|^#" | sed -${E} "s,masterauth.*|requirepass.*,${SED_RED},g"; done; echo ""; @@ -2377,15 +2379,15 @@ if [ "`echo $CHECKS | grep SofI`" ]; then fi echo "" - print_2title "Analizing Mosquitto Files (limit 70)" + print_2title "Analyzing Mosquitto Files (limit 70)" if ! [ "`echo \"$PSTORAGE_MOSQUITTO\" | grep -E \"mosquitto\.conf$\"`" ]; then echo_not_found "mosquitto.conf"; fi; printf "%s" "$PSTORAGE_MOSQUITTO" | grep -E "mosquitto\.conf$" | while read f; do ls -ld "$f" | sed -${E} "s,mosquitto\.conf$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | grep -Ev "\W+\#|^#" | sed -${E} "s,password_file.*|psk_file.*|allow_anonymous.*true|auth,${SED_RED},g"; done; echo ""; - print_2title "Analizing Neo4j Files (limit 70)" + print_2title "Analyzing Neo4j Files (limit 70)" if ! [ "`echo \"$PSTORAGE_NEO4J\" | grep -E \"neo4j$\"`" ]; then echo_not_found "neo4j"; fi; printf "%s" "$PSTORAGE_NEO4J" | grep -E "neo4j$" | while read f; do ls -ld "$f" | sed -${E} "s,neo4j$,${SED_RED},"; for ff in $(find "$f" -name "auth"); do ls -ld "$ff" | sed -${E} "s,auth,${SED_RED},"; cat "$ff" 2>/dev/null | grep -IEv "^$" | sed -${E} "s,.*,${SED_RED},g"; done; echo "";done; echo ""; - print_2title "Analizing Cloud credentials Files (limit 70)" + print_2title "Analyzing Cloud Credentials Files (limit 70)" if ! [ "`echo \"$PSTORAGE_CLOUD_CREDENTIALS\" | grep -E \"credentials$\"`" ]; then echo_not_found "credentials"; fi; printf "%s" "$PSTORAGE_CLOUD_CREDENTIALS" | grep -E "credentials$" | while read f; do ls -ld "$f" | sed -${E} "s,credentials$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | sed -${E} "s,.*,${SED_RED},g"; done; echo ""; if ! [ "`echo \"$PSTORAGE_CLOUD_CREDENTIALS\" | grep -E \"credentials\.db$\"`" ]; then echo_not_found "credentials.db"; fi; printf "%s" "$PSTORAGE_CLOUD_CREDENTIALS" | grep -E "credentials\.db$" | while read f; do ls -ld "$f" | sed -${E} "s,credentials\.db$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | sed -${E} "s,.*,${SED_RED},g"; done; echo ""; if ! [ "`echo \"$PSTORAGE_CLOUD_CREDENTIALS\" | grep -E \"legacy_credentials\.db$\"`" ]; then echo_not_found "legacy_credentials.db"; fi; printf "%s" "$PSTORAGE_CLOUD_CREDENTIALS" | grep -E "legacy_credentials\.db$" | while read f; do ls -ld "$f" | sed -${E} "s,legacy_credentials\.db$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | sed -${E} "s,.*,${SED_RED},g"; done; echo ""; @@ -2398,44 +2400,45 @@ if [ "`echo $CHECKS | grep SofI`" ]; then if ! [ "`echo \"$PSTORAGE_CLOUD_CREDENTIALS\" | grep -E \"\.bluemix$\"`" ]; then echo_not_found ".bluemix"; fi; printf "%s" "$PSTORAGE_CLOUD_CREDENTIALS" | grep -E "\.bluemix$" | while read f; do ls -ld "$f" | sed -${E} "s,\.bluemix$,${SED_RED},"; for ff in $(find "$f" -name "config.json"); do ls -ld "$ff" | sed -${E} "s,config.json,${SED_RED},"; cat "$ff" 2>/dev/null | grep -IEv "^$" | sed -${E} "s,.*,${SED_RED},g"; done; echo "";done; echo ""; - print_2title "Analizing Cloud-Init Files (limit 70)" + print_2title "Analyzing Cloud Init Files (limit 70)" if ! [ "`echo \"$PSTORAGE_CLOUD_INIT\" | grep -E \"cloud\.cfg$\"`" ]; then echo_not_found "cloud.cfg"; fi; printf "%s" "$PSTORAGE_CLOUD_INIT" | grep -E "cloud\.cfg$" | while read f; do ls -ld "$f" | sed -${E} "s,cloud\.cfg$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | grep -E "consumer_key|token_key|token_secret|metadata_url|password:|passwd:|PRIVATE KEY|PRIVATE KEY|encrypted_data_bag_secret|_proxy" | grep -Ev "\W+\#|^#" | sed -${E} "s,consumer_key|token_key|token_secret|metadata_url|password:|passwd:|PRIVATE KEY|PRIVATE KEY|encrypted_data_bag_secret|_proxy,${SED_RED},g"; done; echo ""; - print_2title "Analizing CloudFlare Files (limit 70)" - if ! [ "`echo \"$PSTORAGE_CLOUDFLARE\" | grep -E \"\.cloudflared$\"`" ]; then echo_not_found ".cloudflared"; fi; printf "%s" "$PSTORAGE_CLOUDFLARE" | grep -E "\.cloudflared$" | while read f; do ls -ld "$f" | sed -${E} "s,\.cloudflared$,${SED_RED},"; done; echo ""; + print_2title "Analyzing CloudFlare Files (limit 70)" + if ! [ "`echo \"$PSTORAGE_CLOUDFLARE\" | grep -E \"\.cloudflared$\"`" ]; then echo_not_found ".cloudflared"; fi; printf "%s" "$PSTORAGE_CLOUDFLARE" | grep -E "\.cloudflared$" | while read f; do ls -ld "$f" | sed -${E} "s,\.cloudflared$,${SED_RED},"; ls -lRA "$f";done; echo ""; - print_2title "Analizing Erlang Files (limit 70)" + print_2title "Analyzing Erlang Files (limit 70)" if ! [ "`echo \"$PSTORAGE_ERLANG\" | grep -E \"\.erlang\.cookie$\"`" ]; then echo_not_found ".erlang.cookie"; fi; printf "%s" "$PSTORAGE_ERLANG" | grep -E "\.erlang\.cookie$" | while read f; do ls -ld "$f" | sed -${E} "s,\.erlang\.cookie$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | sed -${E} "s,.*,${SED_RED},g"; done; echo ""; - print_2title "Analizing GMV Auth Files (limit 70)" + print_2title "Analyzing GMV Auth Files (limit 70)" if ! [ "`echo \"$PSTORAGE_GMV_AUTH\" | grep -E \"gvm-tools\.conf$\"`" ]; then echo_not_found "gvm-tools.conf"; fi; printf "%s" "$PSTORAGE_GMV_AUTH" | grep -E "gvm-tools\.conf$" | while read f; do ls -ld "$f" | sed -${E} "s,gvm-tools\.conf$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | sed -${E} "s,username.*|password.*,${SED_RED},g"; done; echo ""; - print_2title "Analizing IPSec Files (limit 70)" + print_2title "Analyzing IPSec Files (limit 70)" if ! [ "`echo \"$PSTORAGE_IPSEC\" | grep -E \"ipsec\.secrets$\"`" ]; then echo_not_found "ipsec.secrets"; fi; printf "%s" "$PSTORAGE_IPSEC" | grep -E "ipsec\.secrets$" | while read f; do ls -ld "$f" | sed -${E} "s,ipsec\.secrets$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | sed -${E} "s,.*PSK.*|.*RSA.*|.*EAP =.*|.*XAUTH.*,${SED_RED},g"; done; echo ""; if ! [ "`echo \"$PSTORAGE_IPSEC\" | grep -E \"ipsec\.conf$\"`" ]; then echo_not_found "ipsec.conf"; fi; printf "%s" "$PSTORAGE_IPSEC" | grep -E "ipsec\.conf$" | while read f; do ls -ld "$f" | sed -${E} "s,ipsec\.conf$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | sed -${E} "s,.*PSK.*|.*RSA.*|.*EAP =.*|.*XAUTH.*,${SED_RED},g"; done; echo ""; - print_2title "Analizing IRSSI Files (limit 70)" + print_2title "Analyzing IRSSI Files (limit 70)" if ! [ "`echo \"$PSTORAGE_IRSSI\" | grep -E \"\.irssi$\"`" ]; then echo_not_found ".irssi"; fi; printf "%s" "$PSTORAGE_IRSSI" | grep -E "\.irssi$" | while read f; do ls -ld "$f" | sed -${E} "s,\.irssi$,${SED_RED},"; for ff in $(find "$f" -name "config"); do ls -ld "$ff" | sed -${E} "s,config,${SED_RED},"; cat "$ff" 2>/dev/null | grep -IEv "^$" | sed -${E} "s,password.*,${SED_RED},g"; done; echo "";done; echo ""; - print_2title "Analizing Keyring Files (limit 70)" + print_2title "Analyzing Keyring Files (limit 70)" if ! [ "`echo \"$PSTORAGE_KEYRING\" | grep -E \"keyrings$\"`" ]; then echo_not_found "keyrings"; fi; printf "%s" "$PSTORAGE_KEYRING" | grep -E "keyrings$" | while read f; do ls -ld "$f" | sed -${E} "s,keyrings$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_KEYRING\" | grep -E \"\.keyring$\"`" ]; then echo_not_found "*.keyring"; fi; printf "%s" "$PSTORAGE_KEYRING" | grep -E "\.keyring$" | while read f; do ls -ld "$f" | sed -${E} "s,\.keyring$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_KEYRING\" | grep -E \"\.keystore$\"`" ]; then echo_not_found "*.keystore"; fi; printf "%s" "$PSTORAGE_KEYRING" | grep -E "\.keystore$" | while read f; do ls -ld "$f" | sed -${E} "s,\.keystore$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_KEYRING\" | grep -E \"\.jks$\"`" ]; then echo_not_found "*.jks"; fi; printf "%s" "$PSTORAGE_KEYRING" | grep -E "\.jks$" | while read f; do ls -ld "$f" | sed -${E} "s,\.jks$,${SED_RED},"; done; echo ""; - print_2title "Analizing Filezilla Files (limit 70)" - if ! [ "`echo \"$PSTORAGE_FILEZILLA\" | grep -E \"filelliza$\"`" ]; then echo_not_found "filelliza"; fi; printf "%s" "$PSTORAGE_FILEZILLA" | grep -E "filelliza$" | while read f; do ls -ld "$f" | sed -${E} "s,filelliza$,${SED_RED},"; for ff in $(find "$f" -name "sitemanager.xml"); do ls -ld "$ff" | sed -${E} "s,sitemanager.xml,${SED_RED},"; cat "$ff" 2>/dev/null | grep -IEv "^$" | grep -Ev "^;" | sed -${E} "s,Host.*|Port.*|Protocol.*|User.*|Pass.*,${SED_RED},g"; done; echo "";done; echo ""; + print_2title "Analyzing Filezilla Files (limit 70)" + if ! [ "`echo \"$PSTORAGE_FILEZILLA\" | grep -E \"filezilla$\"`" ]; then echo_not_found "filezilla"; fi; printf "%s" "$PSTORAGE_FILEZILLA" | grep -E "filezilla$" | while read f; do ls -ld "$f" | sed -${E} "s,filezilla$,${SED_RED},"; for ff in $(find "$f" -name "sitemanager.xml"); do ls -ld "$ff" | sed -${E} "s,sitemanager.xml,${SED_RED},"; cat "$ff" 2>/dev/null | grep -IEv "^$" | grep -Ev "^;" | sed -${E} "s,Host.*|Port.*|Protocol.*|User.*|Pass.*,${SED_RED},g"; done; echo "";done; echo ""; if ! [ "`echo \"$PSTORAGE_FILEZILLA\" | grep -E \"filezilla\.xml$\"`" ]; then echo_not_found "filezilla.xml"; fi; printf "%s" "$PSTORAGE_FILEZILLA" | grep -E "filezilla\.xml$" | while read f; do ls -ld "$f" | sed -${E} "s,filezilla\.xml$,${SED_RED},"; done; echo ""; + if ! [ "`echo \"$PSTORAGE_FILEZILLA\" | grep -E \"recentservers\.xml$\"`" ]; then echo_not_found "recentservers.xml"; fi; printf "%s" "$PSTORAGE_FILEZILLA" | grep -E "recentservers\.xml$" | while read f; do ls -ld "$f" | sed -${E} "s,recentservers\.xml$,${SED_RED},"; done; echo ""; - print_2title "Analizing Backup Manager Files (limit 70)" + print_2title "Analyzing Backup Manager Files (limit 70)" if ! [ "`echo \"$PSTORAGE_BACKUP_MANAGER\" | grep -E \"storage\.php$\"`" ]; then echo_not_found "storage.php"; fi; printf "%s" "$PSTORAGE_BACKUP_MANAGER" | grep -E "storage\.php$" | while read f; do ls -ld "$f" | sed -${E} "s,storage\.php$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | grep -E "'pass'|'password'|'user'|'database'|'host'" | sed -${E} "s,password|pass|user|database|host,${SED_RED},g"; done; echo ""; if ! [ "`echo \"$PSTORAGE_BACKUP_MANAGER\" | grep -E \"database\.php$\"`" ]; then echo_not_found "database.php"; fi; printf "%s" "$PSTORAGE_BACKUP_MANAGER" | grep -E "database\.php$" | while read f; do ls -ld "$f" | sed -${E} "s,database\.php$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | grep -E "'pass'|'password'|'user'|'database'|'host'" | sed -${E} "s,password|pass|user|database|host,${SED_RED},g"; done; echo ""; @@ -2483,18 +2486,18 @@ if [ "`echo $CHECKS | grep SofI`" ]; then done echo "" - print_2title "Analizing Github Files (limit 70)" + print_2title "Analyzing Github Files (limit 70)" if ! [ "`echo \"$PSTORAGE_GITHUB\" | grep -E \"\.github$\"`" ]; then echo_not_found ".github"; fi; printf "%s" "$PSTORAGE_GITHUB" | grep -E "\.github$" | while read f; do ls -ld "$f" | sed -${E} "s,\.github$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_GITHUB\" | grep -E \"\.gitconfig$\"`" ]; then echo_not_found ".gitconfig"; fi; printf "%s" "$PSTORAGE_GITHUB" | grep -E "\.gitconfig$" | while read f; do ls -ld "$f" | sed -${E} "s,\.gitconfig$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_GITHUB\" | grep -E \"\.git-credentials$\"`" ]; then echo_not_found ".git-credentials"; fi; printf "%s" "$PSTORAGE_GITHUB" | grep -E "\.git-credentials$" | while read f; do ls -ld "$f" | sed -${E} "s,\.git-credentials$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_GITHUB\" | grep -E \"\.git$\"`" ]; then echo_not_found ".git"; fi; printf "%s" "$PSTORAGE_GITHUB" | grep -E "\.git$" | while read f; do ls -ld "$f" | sed -${E} "s,\.git$,${SED_RED},"; done; echo ""; - print_2title "Analizing Svn Files (limit 70)" + print_2title "Analyzing Svn Files (limit 70)" if ! [ "`echo \"$PSTORAGE_SVN\" | grep -E \"\.svn$\"`" ]; then echo_not_found ".svn"; fi; printf "%s" "$PSTORAGE_SVN" | grep -E "\.svn$" | while read f; do ls -ld "$f" | sed -${E} "s,\.svn$,${SED_RED},"; ls -lRA "$f";done; echo ""; - print_2title "Analizing PGP-GPG Files (limit 70)" + print_2title "Analyzing PGP-GPG Files (limit 70)" ((command -v gpg && gpg --list-keys) || echo_not_found "gpg") 2>/dev/null ((command -v netpgpkeys && netpgpkeys --list-keys) || echo_not_found "netpgpkeys") 2>/dev/null (command -v netpgp || echo_not_found "netpgp") 2>/dev/null @@ -2503,7 +2506,7 @@ if [ "`echo $CHECKS | grep SofI`" ]; then if ! [ "`echo \"$PSTORAGE_PGP_GPG\" | grep -E \"\.gnupg$\"`" ]; then echo_not_found "*.gnupg"; fi; printf "%s" "$PSTORAGE_PGP_GPG" | grep -E "\.gnupg$" | while read f; do ls -ld "$f" | sed -${E} "s,\.gnupg$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$"; done; echo ""; - print_2title "Analizing Cache Vi Files (limit 70)" + print_2title "Analyzing Cache Vi Files (limit 70)" if ! [ "`echo \"$PSTORAGE_CACHE_VI\" | grep -E \"\.swp$\"`" ]; then echo_not_found "*.swp"; fi; printf "%s" "$PSTORAGE_CACHE_VI" | grep -E "\.swp$" | while read f; do ls -ld "$f" | sed -${E} "s,\.swp$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_CACHE_VI\" | grep -E \"\.viminfo$\"`" ]; then echo_not_found "*.viminfo"; fi; printf "%s" "$PSTORAGE_CACHE_VI" | grep -E "\.viminfo$" | while read f; do ls -ld "$f" | sed -${E} "s,\.viminfo$,${SED_RED},"; done; echo ""; @@ -2538,15 +2541,15 @@ if [ "`echo $CHECKS | grep SofI`" ]; then done echo "" - print_2title "Analizing Firefox Files (limit 70)" - if ! [ "`echo \"$PSTORAGE_FIREFOX\" | grep -E \"\.mozilla$\"`" ]; then echo_not_found ".mozilla"; fi; printf "%s" "$PSTORAGE_FIREFOX" | grep -E "\.mozilla$" | while read f; do ls -ld "$f" | sed -${E} "s,\.mozilla$,${SED_RED},"; for ff in $(find "$f" -name "places.sqlite"); do ls -ld "$ff" | sed -${E} "s,places.sqlite,${SED_RED},"; done; echo "";for ff in $(find "$f" -name "bookmarkbackups"); do ls -ld "$ff" | sed -${E} "s,bookmarkbackups,${SED_RED},"; done; echo "";for ff in $(find "$f" -name "formhistory.sqlite"); do ls -ld "$ff" | sed -${E} "s,formhistory.sqlite,${SED_RED},"; done; echo "";for ff in $(find "$f" -name "handlers.json"); do ls -ld "$ff" | sed -${E} "s,handlers.json,${SED_RED},"; done; echo "";for ff in $(find "$f" -name "persdict.dat"); do ls -ld "$ff" | sed -${E} "s,persdict.dat,${SED_RED},"; done; echo "";for ff in $(find "$f" -name "addons.json"); do ls -ld "$ff" | sed -${E} "s,addons.json,${SED_RED},"; done; echo "";for ff in $(find "$f" -name "cookies.sqlite"); do ls -ld "$ff" | sed -${E} "s,cookies.sqlite,${SED_RED},"; done; echo "";for ff in $(find "$f" -name "cache2"); do ls -ld "$ff" | sed -${E} "s,cache2,${SED_RED},"; done; echo "";for ff in $(find "$f" -name "startupCache"); do ls -ld "$ff" | sed -${E} "s,startupCache,${SED_RED},"; done; echo "";for ff in $(find "$f" -name "favicons.sqlite"); do ls -ld "$ff" | sed -${E} "s,favicons.sqlite,${SED_RED},"; done; echo "";for ff in $(find "$f" -name "prefs.js"); do ls -ld "$ff" | sed -${E} "s,prefs.js,${SED_RED},"; done; echo "";for ff in $(find "$f" -name "downloads.sqlite"); do ls -ld "$ff" | sed -${E} "s,downloads.sqlite,${SED_RED},"; done; echo "";for ff in $(find "$f" -name "thumbnails"); do ls -ld "$ff" | sed -${E} "s,thumbnails,${SED_RED},"; done; echo "";for ff in $(find "$f" -name "logins.json"); do ls -ld "$ff" | sed -${E} "s,logins.json,${SED_RED},"; done; echo "";for ff in $(find "$f" -name "key4.db"); do ls -ld "$ff" | sed -${E} "s,key4.db,${SED_RED},"; done; echo "";for ff in $(find "$f" -name "key3.db"); do ls -ld "$ff" | sed -${E} "s,key3.db,${SED_RED},"; done; echo "";done; echo ""; + print_2title "Analyzing Firefox Files (limit 70)" + if ! [ "`echo \"$PSTORAGE_FIREFOX\" | grep -E \"\.mozilla$\"`" ]; then echo_not_found ".mozilla"; fi; printf "%s" "$PSTORAGE_FIREFOX" | grep -E "\.mozilla$" | while read f; do ls -ld "$f" | sed -${E} "s,\.mozilla$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$"; done; echo ""; - print_2title "Analizing Chrome Files (limit 70)" + print_2title "Analyzing Chrome Files (limit 70)" if ! [ "`echo \"$PSTORAGE_CHROME\" | grep -E \"google-chrome$\"`" ]; then echo_not_found "google-chrome"; fi; printf "%s" "$PSTORAGE_CHROME" | grep -E "google-chrome$" | while read f; do ls -ld "$f" | sed -${E} "s,google-chrome$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$"; done; echo ""; - print_2title "Analizing Autologin Files (limit 70)" + print_2title "Analyzing Autologin Files (limit 70)" if ! [ "`echo \"$PSTORAGE_AUTOLOGIN\" | grep -E \"autologin$\"`" ]; then echo_not_found "autologin"; fi; printf "%s" "$PSTORAGE_AUTOLOGIN" | grep -E "autologin$" | while read f; do ls -ld "$f" | sed -${E} "s,autologin$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | sed -${E} "s,passwd,${SED_RED},g"; done; echo ""; if ! [ "`echo \"$PSTORAGE_AUTOLOGIN\" | grep -E \"autologin\.conf$\"`" ]; then echo_not_found "autologin.conf"; fi; printf "%s" "$PSTORAGE_AUTOLOGIN" | grep -E "autologin\.conf$" | while read f; do ls -ld "$f" | sed -${E} "s,autologin\.conf$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | sed -${E} "s,passwd,${SED_RED},g"; done; echo ""; @@ -2584,61 +2587,68 @@ if [ "`echo $CHECKS | grep SofI`" ]; then grep -Ri "passwd" /etc/pam.d/ 2>/dev/null | grep -v ":#" | sed "s,passwd,${SED_RED}," echo "" - print_2title "Analizing SNMP Files (limit 70)" + print_2title "Analyzing SNMP Files (limit 70)" if ! [ "`echo \"$PSTORAGE_SNMP\" | grep -E \"snmpd\.conf$\"`" ]; then echo_not_found "snmpd.conf"; fi; printf "%s" "$PSTORAGE_SNMP" | grep -E "snmpd\.conf$" | while read f; do ls -ld "$f" | sed -${E} "s,snmpd\.conf$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | grep -E "rocommunity|rwcommunity|extend.*" | sed -${E} "s,rocommunity|rwcommunity|extend.*,${SED_RED},g"; done; echo ""; - print_2title "Analizing Pypirc Files (limit 70)" + print_2title "Analyzing Pypirc Files (limit 70)" if ! [ "`echo \"$PSTORAGE_PYPIRC\" | grep -E \"\.pypirc$\"`" ]; then echo_not_found ".pypirc"; fi; printf "%s" "$PSTORAGE_PYPIRC" | grep -E "\.pypirc$" | while read f; do ls -ld "$f" | sed -${E} "s,\.pypirc$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | sed -${E} "s,username|password,${SED_RED},g"; done; echo ""; - print_2title "Analizing Ldaprc Files (limit 70)" + print_2title "Analyzing Ldaprc Files (limit 70)" if ! [ "`echo \"$PSTORAGE_LDAPRC\" | grep -E \"\.ldaprc$\"`" ]; then echo_not_found ".ldaprc"; fi; printf "%s" "$PSTORAGE_LDAPRC" | grep -E "\.ldaprc$" | while read f; do ls -ld "$f" | sed -${E} "s,\.ldaprc$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | grep -Ev "^#" | sed -${E} "s,.*,${SED_RED},g"; done; echo ""; - print_2title "Analizing Env Files (limit 70)" + print_2title "Analyzing Env Files (limit 70)" if ! [ "`echo \"$PSTORAGE_ENV\" | grep -E \"\.env$\"`" ]; then echo_not_found ".env"; fi; printf "%s" "$PSTORAGE_ENV" | grep -E "\.env$" | while read f; do ls -ld "$f" | sed -${E} "s,\.env$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | grep -Ev "^#" | sed -${E} "s,[pP][aA][sS][sS].*,${SED_RED},g"; done; echo ""; - print_2title "Analizing Msmtprc Files (limit 70)" + print_2title "Analyzing Msmtprc Files (limit 70)" if ! [ "`echo \"$PSTORAGE_MSMTPRC\" | grep -E \"\.msmtprc$\"`" ]; then echo_not_found ".msmtprc"; fi; printf "%s" "$PSTORAGE_MSMTPRC" | grep -E "\.msmtprc$" | while read f; do ls -ld "$f" | sed -${E} "s,\.msmtprc$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | grep -Ev "^#" | sed -${E} "s,user.*|password.*,${SED_RED},g"; done; echo ""; - print_2title "Analizing Keepass Files (limit 70)" + print_2title "Analyzing Keepass Files (limit 70)" if ! [ "`echo \"$PSTORAGE_KEEPASS\" | grep -E \"\.kdbx$\"`" ]; then echo_not_found "*.kdbx"; fi; printf "%s" "$PSTORAGE_KEEPASS" | grep -E "\.kdbx$" | while read f; do ls -ld "$f" | sed -${E} "s,\.kdbx$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_KEEPASS\" | grep -E \"KeePass\.config.*$\"`" ]; then echo_not_found "KeePass.config*"; fi; printf "%s" "$PSTORAGE_KEEPASS" | grep -E "KeePass\.config.*$" | while read f; do ls -ld "$f" | sed -${E} "s,KeePass\.config.*$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_KEEPASS\" | grep -E \"KeePass\.ini$\"`" ]; then echo_not_found "KeePass.ini"; fi; printf "%s" "$PSTORAGE_KEEPASS" | grep -E "KeePass\.ini$" | while read f; do ls -ld "$f" | sed -${E} "s,KeePass\.ini$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_KEEPASS\" | grep -E \"KeePass\.enforced.*$\"`" ]; then echo_not_found "KeePass.enforced*"; fi; printf "%s" "$PSTORAGE_KEEPASS" | grep -E "KeePass\.enforced.*$" | while read f; do ls -ld "$f" | sed -${E} "s,KeePass\.enforced.*$,${SED_RED},"; done; echo ""; - print_2title "Analizing FTP Files (limit 70)" + print_2title "Analyzing FTP Files (limit 70)" if ! [ "`echo \"$PSTORAGE_FTP\" | grep -E \"\.ftpconfig$\"`" ]; then echo_not_found "*.ftpconfig"; fi; printf "%s" "$PSTORAGE_FTP" | grep -E "\.ftpconfig$" | while read f; do ls -ld "$f" | sed -${E} "s,\.ftpconfig$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_FTP\" | grep -E \"ffftp\.ini$\"`" ]; then echo_not_found "ffftp.ini"; fi; printf "%s" "$PSTORAGE_FTP" | grep -E "ffftp\.ini$" | while read f; do ls -ld "$f" | sed -${E} "s,ffftp\.ini$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_FTP\" | grep -E \"ftp\.ini$\"`" ]; then echo_not_found "ftp.ini"; fi; printf "%s" "$PSTORAGE_FTP" | grep -E "ftp\.ini$" | while read f; do ls -ld "$f" | sed -${E} "s,ftp\.ini$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_FTP\" | grep -E \"ftp\.config$\"`" ]; then echo_not_found "ftp.config"; fi; printf "%s" "$PSTORAGE_FTP" | grep -E "ftp\.config$" | while read f; do ls -ld "$f" | sed -${E} "s,ftp\.config$,${SED_RED},"; done; echo ""; + if ! [ "`echo \"$PSTORAGE_FTP\" | grep -E \"sites\.ini$\"`" ]; then echo_not_found "sites.ini"; fi; printf "%s" "$PSTORAGE_FTP" | grep -E "sites\.ini$" | while read f; do ls -ld "$f" | sed -${E} "s,sites\.ini$,${SED_RED},"; done; echo ""; + if ! [ "`echo \"$PSTORAGE_FTP\" | grep -E \"wcx_ftp\.ini$\"`" ]; then echo_not_found "wcx_ftp.ini"; fi; printf "%s" "$PSTORAGE_FTP" | grep -E "wcx_ftp\.ini$" | while read f; do ls -ld "$f" | sed -${E} "s,wcx_ftp\.ini$,${SED_RED},"; done; echo ""; + if ! [ "`echo \"$PSTORAGE_FTP\" | grep -E \"winscp\.ini$\"`" ]; then echo_not_found "winscp.ini"; fi; printf "%s" "$PSTORAGE_FTP" | grep -E "winscp\.ini$" | while read f; do ls -ld "$f" | sed -${E} "s,winscp\.ini$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_FTP\" | grep -E \"ws_ftp\.ini$\"`" ]; then echo_not_found "ws_ftp.ini"; fi; printf "%s" "$PSTORAGE_FTP" | grep -E "ws_ftp\.ini$" | while read f; do ls -ld "$f" | sed -${E} "s,ws_ftp\.ini$,${SED_RED},"; done; echo ""; - print_2title "Analizing Bind Files (limit 70)" + print_2title "Analyzing Bind Files (limit 70)" if ! [ "`echo \"$PSTORAGE_BIND\" | grep -E \"bind$\"`" ]; then echo_not_found "bind"; fi; printf "%s" "$PSTORAGE_BIND" | grep -E "bind$" | while read f; do ls -ld "$f" | sed -${E} "s,bind$,${SED_RED},"; for ff in $(find "$f" -name "*"); do ls -ld "$ff" | sed -${E} "s,,${SED_RED},"; done; echo "";for ff in $(find "$f" -name "*.key"); do ls -ld "$ff" | sed -${E} "s,.key,${SED_RED},"; cat "$ff" 2>/dev/null | grep -IEv "^$" | grep -Ev "^#" | sed -${E} "s,.*,${SED_RED},g"; done; echo "";done; echo ""; - print_2title "Analizing SeedDMS Files (limit 70)" + print_2title "Analyzing SeedDMS Files (limit 70)" if ! [ "`echo \"$PSTORAGE_SEEDDMS\" | grep -E \"seeddms.*$\"`" ]; then echo_not_found "seeddms*"; fi; printf "%s" "$PSTORAGE_SEEDDMS" | grep -E "seeddms.*$" | while read f; do ls -ld "$f" | sed -${E} "s,seeddms.*$,${SED_RED},"; for ff in $(find "$f" -name "settings.xml"); do ls -ld "$ff" | sed -${E} "s,settings.xml,${SED_RED},"; cat "$ff" 2>/dev/null | grep -IEv "^$" | grep -E "=" | sed -${E} "s,[pP][aA][sS][sS],${SED_RED},g"; done; echo "";done; echo ""; - print_2title "Analizing Ddclient Files (limit 70)" + print_2title "Analyzing Ddclient Files (limit 70)" if ! [ "`echo \"$PSTORAGE_DDCLIENT\" | grep -E \"ddclient\.conf$\"`" ]; then echo_not_found "ddclient.conf"; fi; printf "%s" "$PSTORAGE_DDCLIENT" | grep -E "ddclient\.conf$" | while read f; do ls -ld "$f" | sed -${E} "s,ddclient\.conf$,${SED_RED},"; cat "$f" 2>/dev/null | grep -IEv "^$" | sed -${E} "s,.*password.*,${SED_RED},g"; done; echo ""; + print_2title "Analyzing Cacti Files (limit 70)" + if ! [ "`echo \"$PSTORAGE_CACTI\" | grep -E \"cacti$\"`" ]; then echo_not_found "cacti"; fi; printf "%s" "$PSTORAGE_CACTI" | grep -E "cacti$" | while read f; do ls -ld "$f" | sed -${E} "s,cacti$,${SED_RED},"; for ff in $(find "$f" -name "config.php"); do ls -ld "$ff" | sed -${E} "s,config.php,${SED_RED},"; cat "$ff" 2>/dev/null | grep -IEv "^$" | grep -E "database_pw|database_user|database_pass|database_type|database_default|detabase_hostname|database_port|database_ssl" | sed -${E} "s,database_pw.*|database_user.*|database_pass.*,${SED_RED},g"; done; echo "";for ff in $(find "$f" -name "config.php.dist"); do ls -ld "$ff" | sed -${E} "s,config.php.dist,${SED_RED},"; cat "$ff" 2>/dev/null | grep -IEv "^$" | grep -E "database_pw|database_user|database_pass|database_type|database_default|detabase_hostname|database_port|database_ssl" | sed -${E} "s,database_pw.*|database_user.*|database_pass.*,${SED_RED},g"; done; echo "";for ff in $(find "$f" -name "installer.php"); do ls -ld "$ff" | sed -${E} "s,installer.php,${SED_RED},"; cat "$ff" 2>/dev/null | grep -IEv "^$" | grep -E "database_pw|database_user|database_pass|database_type|database_default|detabase_hostname|database_port|database_ssl" | sed -${E} "s,database_pw.*|database_user.*|database_pass.*,${SED_RED},g"; done; echo "";for ff in $(find "$f" -name "check_all_pages"); do ls -ld "$ff" | sed -${E} "s,check_all_pages,${SED_RED},"; cat "$ff" 2>/dev/null | grep -IEv "^$" | grep -E "database_pw|database_user|database_pass|database_type|database_default|detabase_hostname|database_port|database_ssl" | sed -${E} "s,database_pw.*|database_user.*|database_pass.*,${SED_RED},g"; done; echo "";done; echo ""; - print_2title "Analizing Interesting logs Files (limit 70)" + + + print_2title "Analyzing Interesting logs Files (limit 70)" if ! [ "`echo \"$PSTORAGE_INTERESTING_LOGS\" | grep -E \"access\.log$\"`" ]; then echo_not_found "access.log"; fi; printf "%s" "$PSTORAGE_INTERESTING_LOGS" | grep -E "access\.log$" | while read f; do ls -ld "$f" | sed -${E} "s,access\.log$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_INTERESTING_LOGS\" | grep -E \"error\.log$\"`" ]; then echo_not_found "error.log"; fi; printf "%s" "$PSTORAGE_INTERESTING_LOGS" | grep -E "error\.log$" | while read f; do ls -ld "$f" | sed -${E} "s,error\.log$,${SED_RED},"; done; echo ""; - print_2title "Analizing Windows Files Files (limit 70)" + print_2title "Analyzing Windows Files Files (limit 70)" if ! [ "`echo \"$PSTORAGE_WINDOWS_FILES\" | grep -E \"unattend\.inf$\"`" ]; then echo_not_found "unattend.inf"; fi; printf "%s" "$PSTORAGE_WINDOWS_FILES" | grep -E "unattend\.inf$" | while read f; do ls -ld "$f" | sed -${E} "s,unattend\.inf$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_WINDOWS_FILES\" | grep -E \"\.rdg$\"`" ]; then echo_not_found "*.rdg"; fi; printf "%s" "$PSTORAGE_WINDOWS_FILES" | grep -E "\.rdg$" | while read f; do ls -ld "$f" | sed -${E} "s,\.rdg$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_WINDOWS_FILES\" | grep -E \"AppEvent\.Evt$\"`" ]; then echo_not_found "AppEvent.Evt"; fi; printf "%s" "$PSTORAGE_WINDOWS_FILES" | grep -E "AppEvent\.Evt$" | while read f; do ls -ld "$f" | sed -${E} "s,AppEvent\.Evt$,${SED_RED},"; done; echo ""; @@ -2646,6 +2656,7 @@ if [ "`echo $CHECKS | grep SofI`" ]; then if ! [ "`echo \"$PSTORAGE_WINDOWS_FILES\" | grep -E \"FreeSSHDservice\.ini$\"`" ]; then echo_not_found "FreeSSHDservice.ini"; fi; printf "%s" "$PSTORAGE_WINDOWS_FILES" | grep -E "FreeSSHDservice\.ini$" | while read f; do ls -ld "$f" | sed -${E} "s,FreeSSHDservice\.ini$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_WINDOWS_FILES\" | grep -E \"NetSetup\.log$\"`" ]; then echo_not_found "NetSetup.log"; fi; printf "%s" "$PSTORAGE_WINDOWS_FILES" | grep -E "NetSetup\.log$" | while read f; do ls -ld "$f" | sed -${E} "s,NetSetup\.log$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_WINDOWS_FILES\" | grep -E \"Ntds\.dit$\"`" ]; then echo_not_found "Ntds.dit"; fi; printf "%s" "$PSTORAGE_WINDOWS_FILES" | grep -E "Ntds\.dit$" | while read f; do ls -ld "$f" | sed -${E} "s,Ntds\.dit$,${SED_RED},"; done; echo ""; + if ! [ "`echo \"$PSTORAGE_WINDOWS_FILES\" | grep -E \"protecteduserkey\.bin$\"`" ]; then echo_not_found "protecteduserkey.bin"; fi; printf "%s" "$PSTORAGE_WINDOWS_FILES" | grep -E "protecteduserkey\.bin$" | while read f; do ls -ld "$f" | sed -${E} "s,protecteduserkey\.bin$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_WINDOWS_FILES\" | grep -E \"RDCMan\.settings$\"`" ]; then echo_not_found "RDCMan.settings"; fi; printf "%s" "$PSTORAGE_WINDOWS_FILES" | grep -E "RDCMan\.settings$" | while read f; do ls -ld "$f" | sed -${E} "s,RDCMan\.settings$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_WINDOWS_FILES\" | grep -E \"SAM$\"`" ]; then echo_not_found "SAM"; fi; printf "%s" "$PSTORAGE_WINDOWS_FILES" | grep -E "SAM$" | while read f; do ls -ld "$f" | sed -${E} "s,SAM$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_WINDOWS_FILES\" | grep -E \"SYSTEM$\"`" ]; then echo_not_found "SYSTEM"; fi; printf "%s" "$PSTORAGE_WINDOWS_FILES" | grep -E "SYSTEM$" | while read f; do ls -ld "$f" | sed -${E} "s,SYSTEM$,${SED_RED},"; done; echo ""; @@ -2669,10 +2680,8 @@ if [ "`echo $CHECKS | grep SofI`" ]; then if ! [ "`echo \"$PSTORAGE_WINDOWS_FILES\" | grep -E \"recentservers\.xml$\"`" ]; then echo_not_found "recentservers.xml"; fi; printf "%s" "$PSTORAGE_WINDOWS_FILES" | grep -E "recentservers\.xml$" | while read f; do ls -ld "$f" | sed -${E} "s,recentservers\.xml$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_WINDOWS_FILES\" | grep -E \"scclient\.exe$\"`" ]; then echo_not_found "scclient.exe"; fi; printf "%s" "$PSTORAGE_WINDOWS_FILES" | grep -E "scclient\.exe$" | while read f; do ls -ld "$f" | sed -${E} "s,scclient\.exe$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_WINDOWS_FILES\" | grep -E \"scheduledtasks\.xml$\"`" ]; then echo_not_found "scheduledtasks.xml"; fi; printf "%s" "$PSTORAGE_WINDOWS_FILES" | grep -E "scheduledtasks\.xml$" | while read f; do ls -ld "$f" | sed -${E} "s,scheduledtasks\.xml$,${SED_RED},"; done; echo ""; - if ! [ "`echo \"$PSTORAGE_WINDOWS_FILES\" | grep -E \"security$\"`" ]; then echo_not_found "security"; fi; printf "%s" "$PSTORAGE_WINDOWS_FILES" | grep -E "security$" | while read f; do ls -ld "$f" | sed -${E} "s,security$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_WINDOWS_FILES\" | grep -E \"security\.sav$\"`" ]; then echo_not_found "security.sav"; fi; printf "%s" "$PSTORAGE_WINDOWS_FILES" | grep -E "security\.sav$" | while read f; do ls -ld "$f" | sed -${E} "s,security\.sav$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_WINDOWS_FILES\" | grep -E \"server\.xml$\"`" ]; then echo_not_found "server.xml"; fi; printf "%s" "$PSTORAGE_WINDOWS_FILES" | grep -E "server\.xml$" | while read f; do ls -ld "$f" | sed -${E} "s,server\.xml$,${SED_RED},"; done; echo ""; - if ! [ "`echo \"$PSTORAGE_WINDOWS_FILES\" | grep -E \"services\.xml$\"`" ]; then echo_not_found "services.xml"; fi; printf "%s" "$PSTORAGE_WINDOWS_FILES" | grep -E "services\.xml$" | while read f; do ls -ld "$f" | sed -${E} "s,services\.xml$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_WINDOWS_FILES\" | grep -E \"setupinfo$\"`" ]; then echo_not_found "setupinfo"; fi; printf "%s" "$PSTORAGE_WINDOWS_FILES" | grep -E "setupinfo$" | while read f; do ls -ld "$f" | sed -${E} "s,setupinfo$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_WINDOWS_FILES\" | grep -E \"setupinfo\.bak$\"`" ]; then echo_not_found "setupinfo.bak"; fi; printf "%s" "$PSTORAGE_WINDOWS_FILES" | grep -E "setupinfo\.bak$" | while read f; do ls -ld "$f" | sed -${E} "s,setupinfo\.bak$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_WINDOWS_FILES\" | grep -E \"sitemanager\.xml$\"`" ]; then echo_not_found "sitemanager.xml"; fi; printf "%s" "$PSTORAGE_WINDOWS_FILES" | grep -E "sitemanager\.xml$" | while read f; do ls -ld "$f" | sed -${E} "s,sitemanager\.xml$,${SED_RED},"; done; echo ""; @@ -2681,17 +2690,19 @@ if [ "`echo $CHECKS | grep SofI`" ]; then if ! [ "`echo \"$PSTORAGE_WINDOWS_FILES\" | grep -E \"software\.sav$\"`" ]; then echo_not_found "software.sav"; fi; printf "%s" "$PSTORAGE_WINDOWS_FILES" | grep -E "software\.sav$" | while read f; do ls -ld "$f" | sed -${E} "s,software\.sav$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_WINDOWS_FILES\" | grep -E \"sysprep\.inf$\"`" ]; then echo_not_found "sysprep.inf"; fi; printf "%s" "$PSTORAGE_WINDOWS_FILES" | grep -E "sysprep\.inf$" | while read f; do ls -ld "$f" | sed -${E} "s,sysprep\.inf$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_WINDOWS_FILES\" | grep -E \"sysprep\.xml$\"`" ]; then echo_not_found "sysprep.xml"; fi; printf "%s" "$PSTORAGE_WINDOWS_FILES" | grep -E "sysprep\.xml$" | while read f; do ls -ld "$f" | sed -${E} "s,sysprep\.xml$,${SED_RED},"; done; echo ""; + if ! [ "`echo \"$PSTORAGE_WINDOWS_FILES\" | grep -E \"system$\"`" ]; then echo_not_found "system"; fi; printf "%s" "$PSTORAGE_WINDOWS_FILES" | grep -E "system$" | while read f; do ls -ld "$f" | sed -${E} "s,system$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_WINDOWS_FILES\" | grep -E \"system\.sav$\"`" ]; then echo_not_found "system.sav"; fi; printf "%s" "$PSTORAGE_WINDOWS_FILES" | grep -E "system\.sav$" | while read f; do ls -ld "$f" | sed -${E} "s,system\.sav$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_WINDOWS_FILES\" | grep -E \"unattend\.txt$\"`" ]; then echo_not_found "unattend.txt"; fi; printf "%s" "$PSTORAGE_WINDOWS_FILES" | grep -E "unattend\.txt$" | while read f; do ls -ld "$f" | sed -${E} "s,unattend\.txt$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_WINDOWS_FILES\" | grep -E \"unattend\.xml$\"`" ]; then echo_not_found "unattend.xml"; fi; printf "%s" "$PSTORAGE_WINDOWS_FILES" | grep -E "unattend\.xml$" | while read f; do ls -ld "$f" | sed -${E} "s,unattend\.xml$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_WINDOWS_FILES\" | grep -E \"unattended\.xml$\"`" ]; then echo_not_found "unattended.xml"; fi; printf "%s" "$PSTORAGE_WINDOWS_FILES" | grep -E "unattended\.xml$" | while read f; do ls -ld "$f" | sed -${E} "s,unattended\.xml$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_WINDOWS_FILES\" | grep -E \"wcx_ftp\.ini$\"`" ]; then echo_not_found "wcx_ftp.ini"; fi; printf "%s" "$PSTORAGE_WINDOWS_FILES" | grep -E "wcx_ftp\.ini$" | while read f; do ls -ld "$f" | sed -${E} "s,wcx_ftp\.ini$,${SED_RED},"; done; echo ""; + if ! [ "`echo \"$PSTORAGE_WINDOWS_FILES\" | grep -E \"ws_ftp\.ini$\"`" ]; then echo_not_found "ws_ftp.ini"; fi; printf "%s" "$PSTORAGE_WINDOWS_FILES" | grep -E "ws_ftp\.ini$" | while read f; do ls -ld "$f" | sed -${E} "s,ws_ftp\.ini$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_WINDOWS_FILES\" | grep -E \"web.*\.config$\"`" ]; then echo_not_found "web*.config"; fi; printf "%s" "$PSTORAGE_WINDOWS_FILES" | grep -E "web.*\.config$" | while read f; do ls -ld "$f" | sed -${E} "s,web.*\.config$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_WINDOWS_FILES\" | grep -E \"winscp\.ini$\"`" ]; then echo_not_found "winscp.ini"; fi; printf "%s" "$PSTORAGE_WINDOWS_FILES" | grep -E "winscp\.ini$" | while read f; do ls -ld "$f" | sed -${E} "s,winscp\.ini$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_WINDOWS_FILES\" | grep -E \"wsl\.exe$\"`" ]; then echo_not_found "wsl.exe"; fi; printf "%s" "$PSTORAGE_WINDOWS_FILES" | grep -E "wsl\.exe$" | while read f; do ls -ld "$f" | sed -${E} "s,wsl\.exe$,${SED_RED},"; done; echo ""; - print_2title "Analizing Other Interesting Files Files (limit 70)" + print_2title "Analyzing Other Interesting Files Files (limit 70)" if ! [ "`echo \"$PSTORAGE_OTHER_INTERESTING_FILES\" | grep -E \"\.bashrc$\"`" ]; then echo_not_found ".bashrc"; fi; printf "%s" "$PSTORAGE_OTHER_INTERESTING_FILES" | grep -E "\.bashrc$" | while read f; do ls -ld "$f" | sed -${E} "s,\.bashrc$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_OTHER_INTERESTING_FILES\" | grep -E \"\.google_authenticator$\"`" ]; then echo_not_found ".google_authenticator"; fi; printf "%s" "$PSTORAGE_OTHER_INTERESTING_FILES" | grep -E "\.google_authenticator$" | while read f; do ls -ld "$f" | sed -${E} "s,\.google_authenticator$,${SED_RED},"; done; echo ""; if ! [ "`echo \"$PSTORAGE_OTHER_INTERESTING_FILES\" | grep -E \"hosts\.equiv$\"`" ]; then echo_not_found "hosts.equiv"; fi; printf "%s" "$PSTORAGE_OTHER_INTERESTING_FILES" | grep -E "hosts\.equiv$" | while read f; do ls -ld "$f" | sed -${E} "s,hosts\.equiv$,${SED_RED},"; done; echo ""; diff --git a/os b/os new file mode 100644 index 0000000..e69de29 diff --git a/winPEAS/winPEASexe/Dotfuscator/DotfuscatorCE.zip b/winPEAS/winPEASexe/Dotfuscator/DotfuscatorCE.zip new file mode 100644 index 0000000..f75dfa5 Binary files /dev/null and b/winPEAS/winPEASexe/Dotfuscator/DotfuscatorCE.zip differ diff --git a/winPEAS/winPEASexe/Tests/App.config b/winPEAS/winPEASexe/Tests/App.config new file mode 100644 index 0000000..88fa402 --- /dev/null +++ b/winPEAS/winPEASexe/Tests/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/winPEAS/winPEASexe/Tests/Properties/AssemblyInfo.cs b/winPEAS/winPEASexe/Tests/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..4f5cbeb --- /dev/null +++ b/winPEAS/winPEASexe/Tests/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Tests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Tests")] +[assembly: AssemblyCopyright("Copyright © 2021")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("66aa4619-4d0f-4226-9d96-298870e9bb50")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/winPEAS/winPEASexe/Tests/SmokeTests.cs b/winPEAS/winPEASexe/Tests/SmokeTests.cs new file mode 100644 index 0000000..e355180 --- /dev/null +++ b/winPEAS/winPEASexe/Tests/SmokeTests.cs @@ -0,0 +1,42 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; + +namespace winPEAS.Tests +{ + [TestClass] + public class SmokeTests + { + [TestMethod] + public void ShouldRunWinPeass() + { + try + { + string[] args = new string[] { + "systeminfo", "servicesinfo", "processinfo", "applicationsinfo", "browserinfo", "debug" + }; + Program.Main(args); + } + catch (Exception e) + { + Assert.Fail($"Exception thrown: {e.Message}"); + } + } + + [TestMethod] + public void ShouldDisplayHelp() + { + try + { + string[] args = new string[] { + "help", + }; + Program.Main(args); + } + catch (Exception e) + { + Assert.Fail($"Exception thrown: {e.Message}"); + } + } + } +} + diff --git a/winPEAS/winPEASexe/Tests/packages.config b/winPEAS/winPEASexe/Tests/packages.config new file mode 100644 index 0000000..fce08e4 --- /dev/null +++ b/winPEAS/winPEASexe/Tests/packages.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/winPEAS/winPEASexe/Tests/winPEAS.Tests.csproj b/winPEAS/winPEASexe/Tests/winPEAS.Tests.csproj new file mode 100644 index 0000000..aa6e8bc --- /dev/null +++ b/winPEAS/winPEASexe/Tests/winPEAS.Tests.csproj @@ -0,0 +1,91 @@ + + + + + + + + Debug + AnyCPU + {66AA4619-4D0F-4226-9D96-298870E9BB50} + Library + Tests + Tests + v4.5.2 + 512 + true + true + + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + ..\packages\Microsoft.CodeCoverage.16.10.0\lib\net45\Microsoft.VisualStudio.CodeCoverage.Shim.dll + + + ..\packages\MSTest.TestFramework.2.2.5\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll + + + ..\packages\MSTest.TestFramework.2.2.5\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll + + + + + + + + + + + + + + + + + + + + + {d934058e-a7db-493f-a741-ae8e3df867f4} + winPEAS + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + + + + + + \ No newline at end of file diff --git a/winPEAS/winPEASexe/binaries/Obfuscated Releases/Dotfuscated/any/winPEASany.exe b/winPEAS/winPEASexe/binaries/Obfuscated Releases/Dotfuscated/any/winPEASany.exe new file mode 100644 index 0000000..12cd7a1 Binary files /dev/null and b/winPEAS/winPEASexe/binaries/Obfuscated Releases/Dotfuscated/any/winPEASany.exe differ diff --git a/winPEAS/winPEASexe/binaries/Obfuscated Releases/Dotfuscated/x64/winPEASx64.exe b/winPEAS/winPEASexe/binaries/Obfuscated Releases/Dotfuscated/x64/winPEASx64.exe new file mode 100644 index 0000000..285fd20 Binary files /dev/null and b/winPEAS/winPEASexe/binaries/Obfuscated Releases/Dotfuscated/x64/winPEASx64.exe differ diff --git a/winPEAS/winPEASexe/binaries/Obfuscated Releases/Dotfuscated/x86/winPEASx86.exe b/winPEAS/winPEASexe/binaries/Obfuscated Releases/Dotfuscated/x86/winPEASx86.exe new file mode 100644 index 0000000..fb89e9c Binary files /dev/null and b/winPEAS/winPEASexe/binaries/Obfuscated Releases/Dotfuscated/x86/winPEASx86.exe differ diff --git a/winPEAS/winPEASexe/binaries/Obfuscated Releases/any.xml b/winPEAS/winPEASexe/binaries/Obfuscated Releases/any.xml new file mode 100644 index 0000000..08fd49b --- /dev/null +++ b/winPEAS/winPEASexe/binaries/Obfuscated Releases/any.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/winPEAS/winPEASexe/binaries/Obfuscated Releases/winPEASany.exe b/winPEAS/winPEASexe/binaries/Obfuscated Releases/winPEASany.exe index b408ce6..12cd7a1 100755 Binary files a/winPEAS/winPEASexe/binaries/Obfuscated Releases/winPEASany.exe and b/winPEAS/winPEASexe/binaries/Obfuscated Releases/winPEASany.exe differ diff --git a/winPEAS/winPEASexe/binaries/Obfuscated Releases/winPEASx64.exe b/winPEAS/winPEASexe/binaries/Obfuscated Releases/winPEASx64.exe index 1302aff..285fd20 100755 Binary files a/winPEAS/winPEASexe/binaries/Obfuscated Releases/winPEASx64.exe and b/winPEAS/winPEASexe/binaries/Obfuscated Releases/winPEASx64.exe differ diff --git a/winPEAS/winPEASexe/binaries/Obfuscated Releases/winPEASx86.exe b/winPEAS/winPEASexe/binaries/Obfuscated Releases/winPEASx86.exe index f6dfdfa..fb89e9c 100755 Binary files a/winPEAS/winPEASexe/binaries/Obfuscated Releases/winPEASx86.exe and b/winPEAS/winPEASexe/binaries/Obfuscated Releases/winPEASx86.exe differ diff --git a/winPEAS/winPEASexe/binaries/Obfuscated Releases/x64.xml b/winPEAS/winPEASexe/binaries/Obfuscated Releases/x64.xml new file mode 100644 index 0000000..7a57981 --- /dev/null +++ b/winPEAS/winPEASexe/binaries/Obfuscated Releases/x64.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/winPEAS/winPEASexe/binaries/Obfuscated Releases/x86.xml b/winPEAS/winPEASexe/binaries/Obfuscated Releases/x86.xml new file mode 100644 index 0000000..9f53d81 --- /dev/null +++ b/winPEAS/winPEASexe/binaries/Obfuscated Releases/x86.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/winPEAS/winPEASexe/binaries/Release/winPEASany.exe b/winPEAS/winPEASexe/binaries/Release/winPEASany.exe index 65b5b84..8a7d1d9 100755 Binary files a/winPEAS/winPEASexe/binaries/Release/winPEASany.exe and b/winPEAS/winPEASexe/binaries/Release/winPEASany.exe differ diff --git a/winPEAS/winPEASexe/binaries/x64/Release/winPEASx64.exe b/winPEAS/winPEASexe/binaries/x64/Release/winPEASx64.exe index 860bb1d..8aa101e 100755 Binary files a/winPEAS/winPEASexe/binaries/x64/Release/winPEASx64.exe and b/winPEAS/winPEASexe/binaries/x64/Release/winPEASx64.exe differ diff --git a/winPEAS/winPEASexe/binaries/x86/Release/winPEASx86.exe b/winPEAS/winPEASexe/binaries/x86/Release/winPEASx86.exe index 4b19fe0..edbae1e 100755 Binary files a/winPEAS/winPEASexe/binaries/x86/Release/winPEASx86.exe and b/winPEAS/winPEASexe/binaries/x86/Release/winPEASx86.exe differ diff --git a/winPEAS/winPEASexe/winPEAS.sln b/winPEAS/winPEASexe/winPEAS.sln index 6e6c8c8..516c817 100755 --- a/winPEAS/winPEASexe/winPEAS.sln +++ b/winPEAS/winPEASexe/winPEAS.sln @@ -5,6 +5,8 @@ VisualStudioVersion = 16.0.29326.143 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "winPEAS", "winPEAS\winPEAS.csproj", "{D934058E-A7DB-493F-A741-AE8E3DF867F4}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "winPEAS.Tests", "Tests\winPEAS.Tests.csproj", "{66AA4619-4D0F-4226-9D96-298870E9BB50}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -27,6 +29,18 @@ Global {D934058E-A7DB-493F-A741-AE8E3DF867F4}.Release|x64.Build.0 = Release|x64 {D934058E-A7DB-493F-A741-AE8E3DF867F4}.Release|x86.ActiveCfg = Release|x86 {D934058E-A7DB-493F-A741-AE8E3DF867F4}.Release|x86.Build.0 = Release|x86 + {66AA4619-4D0F-4226-9D96-298870E9BB50}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {66AA4619-4D0F-4226-9D96-298870E9BB50}.Debug|Any CPU.Build.0 = Debug|Any CPU + {66AA4619-4D0F-4226-9D96-298870E9BB50}.Debug|x64.ActiveCfg = Debug|Any CPU + {66AA4619-4D0F-4226-9D96-298870E9BB50}.Debug|x64.Build.0 = Debug|Any CPU + {66AA4619-4D0F-4226-9D96-298870E9BB50}.Debug|x86.ActiveCfg = Debug|Any CPU + {66AA4619-4D0F-4226-9D96-298870E9BB50}.Debug|x86.Build.0 = Debug|Any CPU + {66AA4619-4D0F-4226-9D96-298870E9BB50}.Release|Any CPU.ActiveCfg = Release|Any CPU + {66AA4619-4D0F-4226-9D96-298870E9BB50}.Release|Any CPU.Build.0 = Release|Any CPU + {66AA4619-4D0F-4226-9D96-298870E9BB50}.Release|x64.ActiveCfg = Release|Any CPU + {66AA4619-4D0F-4226-9D96-298870E9BB50}.Release|x64.Build.0 = Release|Any CPU + {66AA4619-4D0F-4226-9D96-298870E9BB50}.Release|x86.ActiveCfg = Release|Any CPU + {66AA4619-4D0F-4226-9D96-298870E9BB50}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/ChangeLog.txt b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/ChangeLog.txt new file mode 100644 index 0000000..fa60ae8 --- /dev/null +++ b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/ChangeLog.txt @@ -0,0 +1,47 @@ +--- 2009-10-04 Osamu TAKEUCHI +Alpha release of YamlSerializer as 0.9.0.2 + +* All "_"s in integer and floating point values are neglected + to accommodate the !!int and !!float encoding. +* YamlConfig.DontUseVerbatimTag is added but the default value is set false. + Note that ! is much human friendly than !System.Int32%5B%2C%5D. +* Equality of YamlNode with an unknown tag is evaluated by identity, + while that of !!map and !!seq node is still evaluated by YAML's standard. + Note that equality of !!map and !!seq are different from that of object[] + and Dictionary. +* YamlConfig.OmitTagForRootNode was added. Fixed issue #2850. +* Serialize Dictionary to !!map. Fixed #2891. +* Modified [126-130] ns-plain-???, [147] c-ns-flow-map-separate-value(n,c) + to accommodate revision 2009-10-01 +* Omit !< > if Tag contains only ns-tag-char, Fixed issue #2813 + +--- 2009-09-23 Osamu TAKEUCHI +Alpha release of YamlSerializer as 0.9.0.1 + +* Removed TODO's for reporting bugs in YAML spec that are done. +* Fixed assembly copyright. +* !!merge is supported. Fixed issue#2605. +* Read-only class-type member with no child members are omitted when + serializing. Fixed issue#2599. +* Culture for TypeConverter is set to be CultureInfo.InvariantCulture. + Fixed issue #2629. +* To fix Issue#2631 + * Field names and property names are always presented as simple texts. + * When deserializing, we can not avoid the parser parses some spacial + names to !!bool and !!null. Such non-text nodes are converted to + texts at construction stage. +* To fix issue#2663 + * Hash code stored in a mapping node is now updated when the a key node's + content is changed. + * Hash code and equality became independent on the order of keys in a + mapping node. + * A mapping node checks for duplicated keys every time the node content + is changed. + * Test results are changed because some of them are dependent on the hash + key order. +* The current equality evaluation is too strict, probably needs some adjustment. +* NativeObject property was added to YamlScalar. +* YamlScalar's equality is evaluated by comparing NativeObject. + +--- 2009-09-11 Osamu TAKEUCHI +First release of YamlSerializer as 0.9.0.0 diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/EasyTypeConverter.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/EasyTypeConverter.cs new file mode 100644 index 0000000..d066124 --- /dev/null +++ b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/EasyTypeConverter.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +using System.ComponentModel; +using System.Globalization; + +namespace System.Yaml.Serialization +{ + /// + /// Converts various types to / from string.
+ /// I don't remember why this class was needed.... + ///
+ /// + /// + /// object obj = GetObjectToConvert(); + /// + /// // Check if the type has [TypeConverter] attribute. + /// if( EasyTypeConverter.IsTypeConverterSpecified(type) ) { + /// + /// // Convert the object to string. + /// string s = EasyTypeConverter.ConvertToString(obj); + /// + /// // Convert the string to an object of the spific type. + /// object restored = EasyTypeConverter.ConvertFromString(s, type); + /// + /// Assert.AreEqual(obj, restored); + /// + /// } + /// + /// + internal class EasyTypeConverter + { + internal CultureInfo Culture; + + public EasyTypeConverter() + { + Culture = System.Globalization.CultureInfo.InvariantCulture; + } + + private static Dictionary TypeConverters = new Dictionary(); + private static Dictionary TypeConverterSpecified = new Dictionary(); + + public static bool IsTypeConverterSpecified(Type type) + { + if ( !TypeConverterSpecified.ContainsKey(type) ) + RegisterTypeConverterFor(type); + return TypeConverterSpecified[type]; + } + + private static TypeConverter FindConverter(Type type) + { + if ( !TypeConverters.ContainsKey(type) ) { + return RegisterTypeConverterFor(type); + } else { + return TypeConverters[type]; + } + } + + private static TypeConverter RegisterTypeConverterFor(Type type) + { + var converter_attr = type.GetAttribute(); + if ( converter_attr != null ) { + // What is the difference between these two conditions? + TypeConverterSpecified[type] = true; + var converterType = TypeUtils.GetType(converter_attr.ConverterTypeName); + return TypeConverters[type] = Activator.CreateInstance(converterType) as TypeConverter; + } else { + // What is the difference between these two conditions? + TypeConverterSpecified[type] = false; + return TypeConverters[type] = TypeDescriptor.GetConverter(type); + } + } + + public string ConvertToString(object obj) + { + if ( obj == null ) + return "null"; + var converter = FindConverter(obj.GetType()); + if ( converter != null ) { + return converter.ConvertToString(null, Culture, obj); + } else { + return obj.ToString(); + } + } + + public object ConvertFromString(string s, Type type) + { + return FindConverter(type).ConvertFromString(null, Culture, s); + } + } +} diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/ObjectExtensions.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/ObjectExtensions.cs new file mode 100644 index 0000000..79f34fe --- /dev/null +++ b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/ObjectExtensions.cs @@ -0,0 +1,44 @@ +using System.Collections.Generic; +using System.Linq; +using System.Reflection; + +namespace YamlSerializerNamespace +{ + public static class ObjectExtensions + { + public static T ToObject(this IDictionary source) + where T : class, new() + { + var someObject = new T(); + var someObjectType = someObject.GetType(); + + foreach (var item in source) + { + someObjectType + .GetProperty((item.Key)) + .SetValue(someObject, item.Value, null); + } + + return someObject; + } + + public static string PascalCase(this string word) + { + return string.Join("", word.Split('_') + .Select(w => w.Trim()) + .Where(w => w.Length > 0) + .Select(w => w.Substring(0, 1).ToUpper() + w.Substring(1).ToLower())); + } + + public static IDictionary AsDictionary(this object source, BindingFlags bindingAttr = BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.Instance) + { + return source.GetType().GetProperties(bindingAttr).ToDictionary + ( + propInfo => propInfo.Name, + propInfo => propInfo.GetValue(source, null) + ); + + } + } + +} diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/ObjectMemberAccessor.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/ObjectMemberAccessor.cs new file mode 100644 index 0000000..0788a93 --- /dev/null +++ b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/ObjectMemberAccessor.cs @@ -0,0 +1,224 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +using System.ComponentModel; + +namespace System.Yaml.Serialization +{ + /// + /// + /// object に代入されたクラスや構造体のメンバーに、リフレクションを + /// 解して簡単にアクセスできるようにしたクラス + /// + /// アクセス方法をキャッシュするので、繰り返し使用する場合に高速化が + /// 期待できる + /// + internal class ObjectMemberAccessor + { + private readonly static object[] EmptyObjectArray = new object[0]; + + /// + /// Caches ObjectMemberAccessor instances for reuse. + /// + static Dictionary MemberAccessors = new Dictionary(); + /// + /// + /// 指定した型へのアクセス方法を表すインスタンスを返す + /// キャッシュに存在すればそれを返す + /// キャッシュに存在しなければ新しく作って返す + /// 作った物はキャッシュされる + /// + /// クラスまたは構造体を表す型情報 + /// + public static ObjectMemberAccessor FindFor(Type type) + { + if ( !MemberAccessors.ContainsKey(type) ) + MemberAccessors[type] = new ObjectMemberAccessor(type); + return MemberAccessors[type]; + } + + private ObjectMemberAccessor(Type type) + { + /* + if ( !TypeUtils.IsPublic(type) ) + throw new ArgumentException( + "Can not serialize non-public type {0}.".DoFormat(type.FullName)); + */ + + // public properties + foreach ( var p in type.GetProperties( + System.Reflection.BindingFlags.Instance | + System.Reflection.BindingFlags.Public | + System.Reflection.BindingFlags.GetProperty) ) { + var prop = p; // create closures with this local variable + // not readable or parameters required to access the property + if ( !prop.CanRead || prop.GetGetMethod(false) == null || prop.GetIndexParameters().Count() != 0 ) + continue; + Func get = obj => prop.GetValue(obj, EmptyObjectArray); + Action set = null; + if ( prop.CanWrite && prop.GetSetMethod(false) != null ) + set = (obj, value) => prop.SetValue(obj, value, EmptyObjectArray); + RegisterMember(type, prop, prop.PropertyType, get, set); + } + + // public fields + foreach ( var f in type.GetFields(System.Reflection.BindingFlags.Instance | + System.Reflection.BindingFlags.Public | + System.Reflection.BindingFlags.GetField) ) { + var field = f; + if ( !field.IsPublic ) + continue; + Func get = obj => field.GetValue(obj); + Action set = (obj, value) => field.SetValue(obj, value); + RegisterMember(type, field, field.FieldType, get, set); + } + + Type itype; + + // implements IDictionary + if ( type.GetInterface("System.Collections.IDictionary") != null ) { + IsDictionary = true; + IsReadOnly = obj => ( (System.Collections.IDictionary)obj ).IsReadOnly; + // extract Key, Value types from IDictionary + itype = type.GetInterface("System.Collections.Generic.IDictionary`2"); + if ( itype != null ) { + KeyType = itype.GetGenericArguments()[0]; + ValueType = itype.GetGenericArguments()[1]; + } + } else + // implements ICollection + if ( ( itype = type.GetInterface("System.Collections.Generic.ICollection`1") ) != null ) { + ValueType = itype.GetGenericArguments()[0]; + var add = itype.GetMethod("Add", new Type[] { ValueType }); + CollectionAdd = (obj, value) => add.Invoke(obj, new object[] { value }); + var clear = itype.GetMethod("Clear", new Type[0]); + CollectionClear = obj => clear.Invoke(obj, new object[0]); + var isReadOnly = itype.GetProperty("IsReadOnly", new Type[0]).GetGetMethod(); + IsReadOnly = obj => (bool)isReadOnly.Invoke(obj, new object[0]); + } else + // implements IList + if ( ( itype = type.GetInterface("System.Collections.IList") ) != null ) { + var add = itype.GetMethod("Add", new Type[] { typeof(object) }); + CollectionAdd = (obj, value) => add.Invoke(obj, new object[] { value }); + var clear = itype.GetMethod("Clear", new Type[0]); + CollectionClear = obj => clear.Invoke(obj, new object[0]); + /* IList implements ICollection + // Extract Value Type from IList + itype = type.GetInterface("System.Collections.Generic.IList`1"); + if ( itype != null ) + ValueType = itype.GetGenericArguments()[0]; + */ + IsReadOnly = obj => ((System.Collections.IList)obj).IsReadOnly; + } + } + + private void RegisterMember(Type type, System.Reflection.MemberInfo m, Type mType, Func get, Action set) + { + // struct that holds access method for property/field + MemberInfo accessor = new MemberInfo(); + + accessor.Type = mType; + accessor.Get = get; + accessor.Set = set; + + if(set!=null){ // writeable ? + accessor.SerializeMethod = YamlSerializeMethod.Assign; + } else { + accessor.SerializeMethod = YamlSerializeMethod.Never; + if ( mType.IsClass ) + accessor.SerializeMethod = YamlSerializeMethod.Content; + } + var attr1 = m.GetAttribute(); + if ( attr1 != null ) { // specified + if ( set == null ) { // read only member + if ( attr1.SerializeMethod == YamlSerializeMethod.Assign || + ( mType.IsValueType && accessor.SerializeMethod == YamlSerializeMethod.Content ) ) + throw new ArgumentException("{0} {1} is not writeable by {2}." + .DoFormat(mType.FullName, m.Name, attr1.SerializeMethod.ToString())); + } + accessor.SerializeMethod = attr1.SerializeMethod; + } + if ( accessor.SerializeMethod == YamlSerializeMethod.Never ) + return; // no need to register + if ( accessor.SerializeMethod == YamlSerializeMethod.Binary ) { + if ( !mType.IsArray ) + throw new InvalidOperationException("{0} {1} of {2} is not an array. Can not be serialized as binary." + .DoFormat(mType.FullName, m.Name, type.FullName)); + if ( !TypeUtils.IsPureValueType(mType.GetElementType()) ) + throw new InvalidOperationException( + "{0} is not a pure ValueType. {1} {2} of {3} can not serialize as binary." + .DoFormat(mType.GetElementType(), mType.FullName, m.Name, type.FullName)); + } + + // ShouldSerialize + // YamlSerializeAttribute(Never) => false + // ShouldSerializeSomeProperty => call it + // DefaultValueAttribute(default) => compare to it + // otherwise => true + var shouldSerialize = type.GetMethod("ShouldSerialize" + m.Name, + System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic, + null, Type.EmptyTypes, new System.Reflection.ParameterModifier[0]); + if ( shouldSerialize != null && shouldSerialize.ReturnType == typeof(bool) && accessor.ShouldSeriealize == null ) + accessor.ShouldSeriealize = obj => (bool)shouldSerialize.Invoke(obj, EmptyObjectArray); + var attr2 = m.GetAttribute(); + if ( attr2 != null && accessor.ShouldSeriealize == null ) { + var defaultValue = attr2.Value; + if ( TypeUtils.IsNumeric(defaultValue) && defaultValue.GetType() != mType ) + defaultValue = TypeUtils.CastToNumericType(defaultValue, mType); + accessor.ShouldSeriealize = obj => !TypeUtils.AreEqual(defaultValue, accessor.Get(obj)); + } + if ( accessor.ShouldSeriealize == null ) + accessor.ShouldSeriealize = obj => true; + + Accessors.Add(m.Name, accessor); + } + + public bool IsDictionary = false; + public Action CollectionAdd = null; + public Action CollectionClear = null; + public Type KeyType = null; + public Type ValueType = null; + public Func IsReadOnly; + + public struct MemberInfo + { + public YamlSerializeMethod SerializeMethod; + public Func Get; + public Action Set; + public Func ShouldSeriealize; + public Type Type; + } + Dictionary Accessors = new Dictionary(); + public MemberInfo this[string name] + { + get { return Accessors[name]; } + } + public bool ContainsKey(string name) + { + return Accessors.ContainsKey(name); + } + + /// + /// メンバへの読み書きを行うことができる + /// + /// オブジェクト + /// メンバの名前 + /// + public object this[object obj, string name] + { + get { return Accessors[name].Get(obj); } + set { Accessors[name].Set(obj, value); } + } + + /// + /// メンバ名と Accessor のペアを巡回する + /// + /// + public Dictionary.Enumerator GetEnumerator() + { + return Accessors.GetEnumerator(); + } + } +} diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/Parser.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/Parser.cs new file mode 100644 index 0000000..284d881 --- /dev/null +++ b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/Parser.cs @@ -0,0 +1,942 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +using System.Text.RegularExpressions; + +namespace System.Yaml +{ + /// + /// When reports syntax error by exception, this class is thrown. + /// + /// Sytax errors can also be reported by simply returing false with giving some warnings. + /// + internal class ParseErrorException: Exception + { + /// + /// Initialize an instance of + /// + /// Error message. + public ParseErrorException(string message) : base(message) { } + } + + /// + /// Base class to implement a parser class. + /// + /// It allows not very efficient but easy implementation of a text parser along + /// with a parameterized BNF productions. + /// + /// Parser specific state structure. + internal abstract class Parser + where State: struct + { + /// + /// Parse the using the + /// as the starting rule. + /// + /// Starting rule. + /// Text to be parsed. + /// + protected bool Parse(Func start_rule, string text) + { + this.text = text; + InitializeParser(); + return start_rule(); + } + void InitializeParser() + { + InitializeLines(); + p = 0; + stringValue.Length = 0; + state = new State(); + } + + #region Fields and Properties + /// + /// Gets / sets source text to be parsed. + /// While parsing, this variable will not be changed. + /// The current position to be read by parser is represented by the field . + /// Namely, the next character to be read is text[p]. + /// + protected string text; + /// + /// The current reading position. + /// + /// The next character to be read by the parser is text[p]. + /// + /// Increase to reduce some part of source text . + /// + /// The current position is automatically reverted at rewinding. + /// + /// + /// Example to show how to reduce BNF reduction rule of ( "t" "e" "x" "t" ). + /// + /// return RewindUnless(()=> + /// text[p++] == 't' && + /// text[p++] == 'e' && + /// text[p++] == 'x' && + /// text[p++] == 't' + /// ); + /// + /// + protected int p; + /// + /// Use this variable to build some string data from source text. + /// + /// It will be automatically reverted at rewinding. + /// + protected StringBuilder stringValue = new StringBuilder(); + /// + /// Individual-parser-specific state object. + /// + /// It will be automatically reverted at rewinding. + /// + /// If some action, in addition to simply restore the value of the state object, + /// is needed to recover the previous state, override + /// method. + /// + protected State state; + /// + /// Get current position represented by raw and column. + /// + public Position CurrentPosition + { + get + { + Position pos = new Position(); + pos.Raw = Lines.BinarySearch(p); + if ( pos.Raw < 0 ) { + pos.Raw = ~pos.Raw; + pos.Column = p - Lines[pos.Raw - 1] + 1; + } else { + pos.Raw++; // 1 base + pos.Column = 1; + } + return pos; + } + } + /// + /// Initialize , which represents line number to + /// start position of each line list. + /// + private void InitializeLines() + { + Lines = new List(); + Lines.Add(0); + for ( var p = 0; p < text.Length; p++ ) { + if ( text[p] == '\r' ) { + if ( p + 1 < text.Length - 1 && text[p + 1] == '\n' ) + p++; + Lines.Add(p + 1); + } else + if ( text[p] == '\n' ) + Lines.Add(p + 1); + } + } + /// + /// Line number to start position list. + /// + List Lines = new List(); + /// + /// Represents a position in a multiline text. + /// + public struct Position { + /// + /// Raw in a text. + /// + public int Raw; + /// + /// Column in a text. + /// + public int Column; + } + #endregion + + #region Error / Warning + /// + /// Reporting syntax error by throwing . + /// + /// template for the error message. + /// parameters if required + /// Because it throw exception, nothing will be returned in reality. + public bool Error(string message, params object[] args) + { + throw new ParseErrorException( + string.Format("Syntax error at line {0} column {1}\r\n", CurrentPosition.Raw, CurrentPosition.Column) + + string.Format(message, args)); + } + /// + /// Give warning if is true. + /// + /// By default, the warning will not be shown / stored to anywhere. + /// To show or log the warning, override . + /// + /// + /// + /// return + /// SomeObsoleteReductionRule() && + /// WarningIf( + /// context != Context.IndeedObsolete, + /// "Obsolete"); + /// + /// + /// If true, warning is given; otherwize do nothing. + /// template for the warning message. + /// parameters if required + /// Always true. + protected bool WarningIf(bool condition, string message, params object[] args) + { + if ( condition ) + Warning(message, args); + return true; + } + /// + /// Give warning if is false. + /// + /// By default, the warning will not be shown / stored to anywhere. + /// To show or log the warning, override . + /// + /// + /// + /// return + /// SomeObsoleteReductionRule() && + /// WarningUnless( + /// context != Context.NotObsolete, + /// "Obsolete"); + /// + /// + /// If false, warning is given; otherwize do nothing. + /// template for the warning message. + /// parameters if required + /// Always true. + protected bool WarningUnless(bool condition, string message, params object[] args) + { + if ( !condition ) + Warning(message, args); + return true; + } + /// + /// Give warning. + /// + /// By default, the warning will not be shown / stored to anywhere. + /// To show or log the warning, override . + /// + /// + /// + /// return + /// SomeObsoleteReductionRule() && + /// Warning("Obsolete"); + /// + /// + /// template for the warning message. + /// parameters if required + /// Always true. + protected bool Warning(string message, params object[] args) + { + message = string.Format( + "Warning: {0} at line {1} column {2}.", + string.Format(message, args), + CurrentPosition.Raw, + CurrentPosition.Column + ); + StoreWarning(message); + return true; + } + /// + /// Invoked when warning was given while parsing. + /// + /// Override this method to display / store the warning. + /// + /// Warning message. + protected virtual void StoreWarning(string message) { } + #endregion + + #region EBNF operators + /// + /// Represents EBNF operator of "join", i.e. serial appearence of several rules. + /// + /// + /// This recoveres , , + /// when does not return true. + /// + /// If any specific operation is needed for rewinding, in addition to simply + /// recover the value of , override . + /// + /// If false is returned, the parser status is rewound. + /// true if returned true; otherwise false. + /// + /// name ::= first-name middle-name? last-name + /// + /// bool Name() + /// { + /// return RewindUnless(()=> + /// FirstName() && + /// Optional(MiddleName) && + /// LastName() + /// ); + /// } + /// + /// + protected bool RewindUnless(Func rule) // (join) + { + var savedp = p; + var stringValueLength = stringValue.Length; + var savedStatus = state; + if ( rule() ) + return true; + state = savedStatus; + stringValue.Length = stringValueLength; + p = savedp; + Rewind(); + return false; + } + /// + /// This method is called just after recovers . + /// Override it to do any additional operation for rewinding. + /// + protected virtual void Rewind() {} + /// + /// Represents EBNF operator of "*". + /// + /// Reduction rule to be repeated. + /// Always true. + /// + /// lines-or-empty ::= line* + /// + /// bool LinesOrEmpty() + /// { + /// return + /// Repeat(Line); + /// } + /// + /// + /// lines-or-empty ::= (text line-break)* + /// Note: Do not forget if several + /// rules are sequentially appears in operator. + /// + /// bool LinesOrEmpty() + /// { + /// return + /// Repeat(()=> + /// RewindUnless(()=> + /// Text() && + /// LineBreak() + /// ) + /// ); + /// } + /// + /// + protected bool Repeat(Func rule) // * + { + // repeat while condition() returns true and + // it reduces any part of text. + int start; + do { + start = p; + } while ( rule() && start != p ); + return true; + } + /// + /// Represents EBNF operator of "+". + /// + /// Reduction rule to be repeated. + /// true if the rule matches; otherwise false. + /// + /// lines ::= line+ + /// + /// bool Lines() + /// { + /// return + /// Repeat(Line); + /// } + /// + /// + /// + /// lines ::= (text line-break)+ + /// + /// Note: Do not forget RewindUnless in Repeat operator. + /// + /// bool Lines() + /// { + /// return + /// Repeat(()=> + /// RewindUnless(()=> + /// Text() && + /// LineBreak() + /// ) + /// ); + /// } + /// + /// + protected bool OneAndRepeat(Func rule) // + + { + return rule() && Repeat(rule); + } + /// + /// Represents n times repeatition. + /// + /// + /// four-lines ::= (text line-break){4} + /// + /// Note: Do not forget if several + /// rules are sequentially appears in operator. + /// + /// bool FourLines() + /// { + /// return + /// Repeat(4, ()=> + /// RewindUnless(()=> + /// Text() && + /// LineBreak() + /// ) + /// ); + /// } + /// + /// + /// Repetition count. + /// Reduction rule to be repeated. + /// true if the rule matches; otherwise false. + protected bool Repeat(int n, Func rule) + { + return RewindUnless(() => { + for ( int i = 0; i < n; i++ ) + if ( !rule() ) + return false; + return true; + }); + } + /// + /// Represents at least , at most times repeatition. + /// + /// + /// google ::= "g" "o"{2,100} "g" "l" "e" + /// Note: Do not forget if several + /// rules are sequentially appears in operator. + /// + /// bool Google() + /// { + /// return + /// RewindUnless(()=> + /// text[p++] == 'g' && + /// Repeat(2, 100, + /// RewindUnless(()=> + /// text[p++] == 'o' + /// ) + /// ) + /// text[p++] == 'g' && + /// text[p++] == 'l' && + /// text[p++] == 'e' + /// ); + /// } + /// + /// + /// Minimum repetition count. Negative value is treated as 0. + /// Maximum repetition count. Negative value is treated as positive infinity. + /// Reduction rule to be repeated. + /// true if the rule matches; otherwise false. + protected bool Repeat(int min, int max, Func rule) + { + return RewindUnless(() => { + for ( int i = 0; i < min; i++ ) + if ( !rule() ) + return false; + for ( int i = 0; i < max || max < 0; i++ ) + if ( !rule() ) + return true; + return true; + }); + } + /// + /// Represents BNF operator "?". + /// + /// + /// file ::= header? body footer? + /// + /// Note: Do not forget if several + /// rules are sequentially appears in operator. + /// + /// bool File() + /// { + /// return + /// Optional(Header()) && + /// Body() && + /// Optional(Footer()); + /// } + /// + /// + /// Reduction rule that is optional. + /// Always true. + protected bool Optional(bool rule) // ? + { + return rule || true; + } + /// + /// Represents BNF operator "?" (WITH rewinding wrap). + /// + /// + /// file = header? body footer? + /// + /// Note: Do not forget if several + /// rules are sequentially appears in operator. + /// + /// bool File() + /// { + /// return + /// Optional(Header) && + /// Body() && + /// Optional(Footer); + /// } + /// + /// + /// Reduction rule that is optional. + /// Always true. + protected bool Optional(Func rule) // ? + { + return + RewindUnless(()=> rule()) || true; + } + #endregion + + #region Chars + /// + /// Reduce one character if it is a member of the specified character set. + /// + /// Acceptable character set. + /// true if the rule matches; otherwise false. + /// + /// alpha ::= [A-Z][a-z]
+ /// num ::= [0-9]
+ /// alpha-num :: alpha | num
+ /// word ::= alpha ( alpha-num )*
+ /// + /// Func<char,bool> Alpha = Charset( c => + /// ( 'A' <= c && c <= 'Z' ) || + /// ( 'a' <= c && c <= 'z' ) + /// ); + /// Func<char,bool> Num = Charset( c => + /// '0' <= c && c <= '9' + /// ); + /// Func<char,bool> AlphaNum = Charset( c => + /// Alpha(c) || Num(c) + /// ); + /// bool Word() + /// { + /// return + /// Accept(Alpha) && + /// Repeat(AlphaNum); + /// // No need for RewindUnless + /// } + /// + ///
+ protected bool Accept(Func charset) + { + if ( p < text.Length && charset(text[p]) ) { + p++; + return true; + } + return false; + } + /// + /// Accepts a character 'c'. + /// + /// It can be also represented by text[p++] == c wrapped by . + /// + /// The character to be accepted. + /// true if the rule matches; otherwise false. + /// + /// YMCA ::= "Y" "M" "C" "A" + /// + /// bool YMCA() + /// { + /// return + /// RewindUnless(()=> + /// Accept('Y') && + /// Accept('M') && + /// Accept('C') && + /// Accept('A') + /// ); + /// } + /// + /// -or- + /// + /// bool YMCA() + /// { + /// return + /// RewindUnless(()=> + /// text[p++] == 'Y' && + /// text[p++] == 'M' && + /// text[p++] == 'C' && + /// text[p++] == 'A' + /// ); + /// } + /// + /// + protected bool Accept(char c) + { + if ( p < text.Length && text[p] == c ) { + p++; + return true; + } + return false; + } + /// + /// Accepts a sequence of characters. + /// + /// Sequence of characters to be accepted. + /// true if the rule matches; otherwise false. + /// + /// YMCA ::= "Y" "M" "C" "A" + /// + /// bool YMCA() + /// { + /// return + /// Accept("YMCA"); + /// } + /// + /// + protected bool Accept(string s) + { + if ( p + s.Length >= text.Length ) + return false; + for ( int i = 0; i < s.Length; i++ ) + if ( s[i] != text[p + i] ) + return false; + p += s.Length; + return true; + } + /// + /// Represents sequence of characters. + /// + /// Sequence of characters to be accepted. + /// true if the rule matches; otherwise false. + protected bool Accept(Regex r) + { + var m = r.Match(text, p); + if ( !m.Success ) + return false; + p += m.Length; + return true; + } + /// + /// Represents BNF operator of "*". + /// + /// Character set to be accepted. + /// Always true. + protected bool Repeat(Func charset) + { + while ( charset(text[p]) ) + p++; + return true; + } + /// + /// Represents BNF operator of "+". + /// + /// Character set to be accepted. + /// true if the rule matches; otherwise false. + protected bool OneAndRepeat(Func charset) + { + if ( !charset(text[p]) ) + return false; + while ( charset(text[++p]) ) + ; + return true; + } + /// + /// Represents n times repetition of characters. + /// + /// Character set to be accepted. + /// Repetition count. + /// true if the rule matches; otherwise false. + protected bool Repeat(Func charset, int n) + { + for ( int i = 0; i < n; i++ ) + if ( !charset(text[p + i]) ) + return false; + p += n; + return true; + } + /// + /// Represents at least min times, at most max times + /// repetition of characters. + /// + /// Character set to be accepted. + /// Minimum repetition count. Negative value is treated as 0. + /// Maximum repetition count. Negative value is treated as positive infinity. + /// true if the rule matches; otherwise false. + protected bool Repeat(Func charset, int min, int max) + { + for ( int i = 0; i < min; i++ ) + if ( !charset(text[p + i]) ) + return false; + for ( int i = 0; i < max; i++ ) + if ( !charset(text[p + min + i]) ) { + p += min + i; + return true; + } + p += min + max; + return true; + } + /// + /// Represents BNF operator "?". + /// + /// Character set to be accepted. + /// Always true. + protected bool Optional(Func charset) // ? + { + if ( !charset(text[p]) ) + return true; + p++; + return true; + } + #endregion + + #region Charset + /// + /// Builds a performance-optimized table-based character set definition from a simple + /// but slow comparison-based definition. + /// + /// By default, the character table size is 0x100, namely only the characters of [\0-\xff] are + /// judged by using a character table and others are by the as-given slow comparisn-based definitions. + /// + /// To have maximized performance, locate the comparison for non-table based judgement first + /// in the definition as the example below. + /// + /// Use form to explicitly + /// specify the table size. + /// + /// This sample shows how to build a character set delegate. + /// + /// static class YamlCharsets: Charsets + /// { + /// Func<char, bool> cPrintable; + /// Func<char, bool> sWhite; + /// + /// static YamlCharsets() + /// { + /// cPrintable = CacheResult(c => + /// /* ( 0x10000 < c && c < 0x110000 ) || */ + /// ( 0xe000 <= c && c <= 0xfffd ) || + /// ( 0xa0 <= c && c <= 0xd7ff ) || + /// ( c < 0x100 && ( // to improve performance + /// c == 0x85 || + /// ( 0x20 <= c && c <= 0x7e ) || + /// c == 0x0d || + /// c == 0x0a || + /// c == 0x09 + /// ) ) + /// ); + /// sWhite = CacheResult(c => + /// c < 0x100 && ( // to improve performance + /// c == '\t' || + /// c == ' ' + /// ) + /// ); + /// } + /// } + /// + /// A simple but slow comparison-based definition of the charsert. + /// A performance-optimized table-based delegate built from the given . + protected static Func Charset(Func definition) + { + return Charset(0x100, definition); + } + /// + /// Builds a performance-optimized table-based character set definition from a simple + /// but slow comparison-based definition. + /// + /// Characters out of the table are judged by the as-given slow comparisn-based + /// definitions. + /// + /// So, to have maximized performance, locate the comparison for non-table based + /// judgement first in the definition as the example below. + /// + /// This sample shows how to build a character set delegate. + /// + /// static class YamlCharsets: Charsets + /// { + /// Func<char, bool> cPrintable; + /// Func<char, bool> sWhite; + /// + /// static YamlCharsets() + /// { + /// cPrintable = CacheResult(c => + /// /* ( 0x10000 < c && c < 0x110000 ) || */ + /// ( 0xe000 <= c && c <= 0xfffd ) || + /// ( 0xa0 <= c && c <= 0xd7ff ) || + /// ( c < 0x100 && ( // to improve performance + /// c == 0x85 || + /// ( 0x20 <= c && c <= 0x7e ) || + /// c == 0x0d || + /// c == 0x0a || + /// c == 0x09 + /// ) ) + /// ); + /// sWhite = CacheResult(c => + /// c < 0x100 && ( // to improve performance + /// c == '\t' || + /// c == ' ' + /// ) + /// ); + /// } + /// } + /// + /// Character table size. + /// A simple but slow comparison-based definition of the charsert. + /// A performance-optimized table-based delegate built from the given . + protected static Func Charset( + int table_size, Func definition) + { + var table = new bool[table_size]; + for ( char c = '\0'; c < table_size; c++ ) + table[c] = definition(c); + return c => c < table_size ? table[c] : definition(c); + } + #endregion + + #region Actions + /// + /// Saves a part of the source text that is reduced in the . + /// If the rule does not match, nothing happends. + /// + /// Reduction rule to match. + /// If the matches, + /// the part of the source text reduced in the is set; + /// otherwise String.Empty is set. + /// true if matches; otherwise false. + protected bool Save(Func rule, ref string value) + { + var value_ = ""; + var result = Save(rule, s => value_ = s); + if ( result ) + value = value_; + return result; + } + /// + /// Saves a part of the source text that is reduced in the + /// and append it to . + /// If the rule does not match, nothing happends. + /// + /// Reduction rule to match. + /// true if matches; otherwise false. + protected bool Save(Func rule) + { + return + Save(rule, s => stringValue.Append(s)); + } + /// + /// Saves a part of the source text that is reduced in the . + /// If the rule does not match, nothing happends. + /// + /// Reduction rule to match. + /// If matches, this delegate is invoked + /// with the part of the source text that is reduced in the + /// as the parameter. Do any action in the delegate. + /// true if matches; otherwise false. + /// + /// + /// bool SomeRule() + /// { + /// return + /// Save(()=> SubRule(), s => MessageBox.Show(s)); + /// } + /// + protected bool Save(Func rule, Action save) + { + int start = p; + var result = rule(); + if ( result ) + save(text.Substring(start, p - start)); + return result; + } + /// + /// Execute some action. + /// + /// Action to be done. + /// Always true. + /// + /// + /// bool SomeRule() + /// { + /// return + /// SubRule() && + /// Action(()=> do_some_action()); + /// } + /// + protected bool Action(Action action) + { + action(); + return true; + } + /// + /// Report error by throwing when the does not match. + /// + /// Some reduction rule that must match. + /// Error message as template + /// Parameters for template + /// Always true; otherwise an exception thrown. + protected bool ErrorUnless(bool rule, string message, params object[] args) + { + if ( !rule ) + Error(message, args); + return true; + } + /// + /// Report error by throwing when the does not match. + /// + /// Some reduction rule that must match. + /// Error message as template + /// Parameters for template + /// Always true; otherwise an exception is thrown. + protected bool ErrorUnless(Func rule, string message, params object[] args) + { + return ErrorUnless(rule(), message); + } + /// + /// Report error by throwing when the does not match + /// and an additional condition is true. + /// + /// Some reduction rule that must match. + /// Additional condition: if this parameter is false, + /// rewinding occurs, instead of throwing exception. + /// Error message as template + /// Parameters for template + /// true if the reduction rule matches; otherwise false. + protected bool ErrorUnlessWithAdditionalCondition(Func rule, bool to_be_error, string message, params object[] args) + { + if ( to_be_error ) { + if ( !rule() ) + Error(message, args); + return true; + } else { + return RewindUnless(rule); + } + } + /// + /// Report error by throwing when is true. + /// + /// True to throw exception. + /// Error message as template + /// Parameters for template + /// Always true. + protected bool ErrorIf(bool condition, string message, params object[] args) + { + if ( condition ) + Error(message, args); + return true; + } + /// + /// Assign var = value and return true; + /// + /// Type of the variable and value. + /// Variable to be assigned. + /// Value to be assigned. + /// Always true. + protected bool Assign(out T var, T value) + { + var = value; + return true; + } + #endregion + } +} diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/Readme.txt b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/Readme.txt new file mode 100644 index 0000000..c5b9d0b --- /dev/null +++ b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/Readme.txt @@ -0,0 +1,39 @@ +YamlSerializer 0.9.0.2 (2009-10-04) Osamu TAKEUCHI + +Description: + A library that serialize / deserialize C# native objects into YAML1.2 text. + +Development environment: + Visual C# 2008 Express Edition + Sandcastle (2008-05-29) + SandcastleBuilder 1.8.0.2 + HTML Help workshop 4.74.8702 + NUnit 2.5.0.9122 + TestDriven.NET 2.0 + +Support web page: + http://yamlserializer.codeplex.com/ + +License: + YamlSerializer is distributed under the MIT license as following: + +--- +The MIT License (MIT) +Copyright (c) 2009 Osamu TAKEUCHI + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in the +Software without restriction, including without limitation the rights to use, copy, +modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to the +following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE +OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/RehashableDictionary.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/RehashableDictionary.cs new file mode 100644 index 0000000..3a1fc36 --- /dev/null +++ b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/RehashableDictionary.cs @@ -0,0 +1,621 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +using System.Diagnostics; + +namespace System.Yaml +{ + interface IRehashableKey + { + event EventHandler Changed; + } + + /// + /// Dictionary that automatically rehash when the content of a key is changed. + /// Keys of this dictionary must implement . + /// It also call back item addition and removal by and + /// events. + /// + /// Type of key. Must implements . + /// Type of value. + class RehashableDictionary: IDisposable, IDictionary + where K: class, IRehashableKey + { + class KeyValue + { + public K key; + public V value; + public KeyValue(K key, V value) + { + this.key = key; + this.value = value; + } + } + /// + /// A dictionary that returns or + /// from hash code. This is the main repository that stores the pairs. + /// If there are several entries that have same hash code for thir keys, + /// a is stored to hold all those entries. + /// Otherwise, a is stored. + /// + SortedDictionary items = new SortedDictionary(); + /// + /// A dictionary that returns hash code from the key reference. + /// The key must be the instance that + /// to one exsisting in the dictionary. + /// + /// + /// We store the hashes correspoinding to each key. So that when rehash, + /// we can find old hash code to quickly find the entry for the key. + /// It is also used to remember the number of keys exists in the dictionary. + /// + Dictionary hashes = new Dictionary( + TypeUtils.EqualityComparerByRef.Default); + + /// + /// Recalc hash key of the . + /// + /// The key to be rehash. The key must be the instance that + /// to one exsisting in the dictionary. + void Rehash(K key) + { + // Note that key is compared by reference in this function! + + // update hash + var oldHash = hashes[key]; + var newHash = key.GetHashCode(); + hashes[key] = newHash; + + // remove old entry + var item = items[oldHash]; + KeyValue kv = null; + if ( item is KeyValue ) { + // only one item was found whose hash code equals to oldHash. + kv = (KeyValue)item; + // must be found + Debug.Assert(kv.key == key); + items.Remove(oldHash); + } else { + // several items were found whose hash codes equal to oldHash. + var list = (List)item; + for ( int i = 0; i < list.Count; i++ ) { + kv = list[i]; + if ( kv.key == key ) { + list.RemoveAt(i); + break; + } + // must be found + Debug.Assert(i + 1 < list.Count); + } + // only one item is left, whose hash code equals to oldHash. + if ( list.Count == 1 ) + items[oldHash] = list.First(); + } + + // add new entry + if ( items.TryGetValue(newHash, out item) ) { + if ( item is KeyValue ) { + // must not exist already + Debug.Assert(!( (KeyValue)item ).key.Equals(key)); + var list = new List(); + list.Add((KeyValue)item); + list.Add(kv); + items[newHash] = list; + } else { + // must not exist already + Debug.Assert(!( item as List ).Any(li => li.key.Equals(key))); + ( item as List ).Add(kv); + } + } else { + items[newHash] = kv; + } + } + + public class DictionaryEventArgs: EventArgs + { + public K Key; + public V Value; + public DictionaryEventArgs(K key, V value) + { + Key = key; + Value = value; + } + } + + protected virtual void OnAdded(K key, V value) + { + // set observer + key.Changed += new EventHandler(KeyChanged); + if ( Added != null ) + Added(this, new DictionaryEventArgs(key, value)); + } + public event EventHandler Added; + + void KeyChanged(object sender, EventArgs e) + { + Rehash((K)sender); + } + + protected virtual void OnRemoved(K key, V value) + { + // remove observer + key.Changed -= new EventHandler(KeyChanged); + if ( Removed != null ) + Removed(this, new DictionaryEventArgs(key, value)); + } + public event EventHandler Removed; + + public void Dispose() + { + // remove observers + Clear(); + } + + void AddCore(K key, V value, bool exclusive) + { + var newkv = new KeyValue(key, value); + FindItem(key, false, default(V), + (hash) => { // not found hash + items.Add(hash, newkv); + hashes.Add(key, hash); + }, + (hash, oldkv) => { // hash hit one entry but key not found + var list = new List(); + list.Add(oldkv); + items[hash] = list; + list.Add(newkv); + hashes.Add(key, hash); + }, + (hash, oldkv) => { // hash hit one entry and key found + ReplaceKeyValue(oldkv, newkv, exclusive); + }, + (hash, list) => { // hash hit several entries but key not found + list.Add(newkv); + hashes.Add(key, hash); + }, + (hash, oldkv, list, i) => { // hash hit several entries and key found + ReplaceKeyValue(oldkv, newkv, exclusive); + } + ); + OnAdded(key, value); + } + + void ReplaceKeyValue(KeyValue oldkv, KeyValue newkv, bool exclusive) + { + if ( exclusive ) + throw new InvalidOperationException("Same key already exists."); + var oldkv_saved = new KeyValue(oldkv.key, oldkv.value); + oldkv.key = newkv.key; + oldkv.value = newkv.value; + hashes.Remove(oldkv_saved.key); + OnRemoved(oldkv_saved.key, oldkv_saved.value); + } + + bool RemoveCore(K key, bool compareValue, V value) + { + bool result = true; + FindItem(key, compareValue, value, + (hash) => { result = false; }, // key not found + (hash, kv) => { // hash hit one entry and key found + items.Remove(hash); + hashes.Remove(kv.key); + OnRemoved(kv.key, kv.value); + }, + (hash, kv, list, i) => { // hash hit several entries and key found + list.RemoveAt(i); + // only one entry left + if ( list.Count == 1 ) + items[hash] = list.First(); + hashes.Remove(kv.key); + OnRemoved(kv.key, kv.value); + } + ); + return result; + } + + bool TryGetValueCore(K key, out V value) + { + bool result = true; + V v = default(V); + FindItem(key, false, default(V), + (hash) => { result = false; }, // key not found + (hash, kv) => { v = kv.value; }, // hash hit one entry and key found + (hash, kv, list, i) => { v = kv.value; } // hash hit several entries and key found + ); + value = v; + return result; + } + + public ICollection> ItemsFromHash(int key_hash) + { + object entry; + if ( items.TryGetValue(key_hash, out entry) ) { + if ( entry is KeyValue ) { + return new ItemsCollection(this, (KeyValue)entry); + } else { + return new ItemsCollection(this, (List)entry); + } + } else { + return new ItemsCollection(this); + } + } + + class ItemsCollection: KeysValuesBase> + { + List list; + public ItemsCollection(RehashableDictionary dictionary, List list) + : base(dictionary) + { + this.list = list; + } + public ItemsCollection(RehashableDictionary dictionary, KeyValue entry) + : base(dictionary) + { + this.list = new List(); + list.Add(entry); + } + public ItemsCollection(RehashableDictionary dictionary) + : base(dictionary) + { + this.list = new List(); + } + + public override int Count + { + get { return list.Count; } + } + + public override bool Contains(KeyValuePair item) + { + return list.Any(entry => entry.key.Equals(item.Key) && entry.value.Equals(item.Value)); + } + + public override void CopyTo(KeyValuePair[] array, int arrayIndex) + { + foreach ( var entry in list ) + array[arrayIndex++] = new KeyValuePair(entry.key, entry.value); + } + + public override IEnumerator> GetEnumerator() + { + foreach ( var item in list ) + yield return new KeyValuePair(item.key, item.value); + } + } + + /// + /// Try to find entry for key (and value). + /// + /// key to find + /// if true, value matters + /// value to find + /// key not found + /// hash hit one entry and key found + /// hash hit several entries and key found + void FindItem(K key, bool compareValue, V value, + Action NotFound, // key not found + Action FoundOne, // hash hit one entry and key found + Action, int> FoundList) // hash hit several entries and key found + { + FindItem(key, compareValue, value, + (hash) => NotFound(hash), + (hash, kv) => NotFound(hash), + (hash, kv) => FoundOne(hash, kv), + (hash, list) => NotFound(hash), + (hash, kv, list, i) => FoundList(hash, kv, list, i) + ); + } + + /// + /// Try to find entry for key (and value). + /// + /// key to find + /// if true, value matters + /// value to find + /// hash not found + /// hash hit one entry but key not found + /// hash hit one entry and key found + /// hash hit several entries but key not found + /// hash hit several entries and key found + void FindItem(K key, bool compareValue, V value, + Action NotFoundHash, // hash not found + Action NotFoundKeyOne, // hash hit one entry but key not found + Action FoundOne, // hash hit one entry and key found + Action> NotFoundKeyList, // hash hit several entries but key not found + Action, int> FoundList) // hash hit several entries and key found + { + var hash = key.GetHashCode(); + object item; + if ( !items.TryGetValue(hash, out item) ) { + NotFoundHash(hash); // hash not found + } else { + KeyValue kv; + if ( item is KeyValue ) { + kv = (KeyValue)item; + if ( !kv.key.Equals(key) || ( compareValue && !kv.value.Equals(value) ) ) { + NotFoundKeyOne(hash, kv); // hash hit one entry but key not found + } else { + FoundOne(hash, kv); // hash hit one entry and key found + } + } else { + var list = (List)item; + var i = list.FindIndex(i2 => i2.key.Equals(key)); + if ( i < 0 ) { + NotFoundKeyList(hash, list); // hash hit several entries but key not found + } else { + kv = list[i]; + if ( compareValue && !kv.value.Equals(value) ) { + NotFoundKeyList(hash, list); // hash hit several entries but key not found + } else { + FoundList(hash, kv, list, i); // hash hit several entries and key found + } + } + } + } + } + + IEnumerator GetEnumeratorCore(IDictionary items) + { + foreach ( var item in items ) + if ( item.Value is KeyValue ) { + var kv = (KeyValue)item.Value; + yield return kv; + } else { + var list = (List)item.Value; + foreach ( var kv in list ) + yield return kv; + } + } + + #region IDictionary メンバ + + public void Add(K key, V value) + { + AddCore(key, value, true); + } + + public bool ContainsKey(K key) + { + V value; + return TryGetValueCore(key, out value); + } + + public ICollection Keys + { + get { return new KeyCollection(this); } + } + + /// + /// Collection that is readonly and invalidated when an item is + /// added to or removed from the dictionary. + /// + abstract class KeysValuesBase: ICollection, IDisposable + { + protected bool Invalid = false; + protected RehashableDictionary Dictionary; + public KeysValuesBase(RehashableDictionary dictionary) + { + Dictionary = dictionary; + Dictionary.Added += DictionaryChanged; + Dictionary.Removed += DictionaryChanged; + } + public void Dispose() + { + Dictionary.Added -= DictionaryChanged; + Dictionary.Removed -= DictionaryChanged; + } + void DictionaryChanged(object sender, RehashableDictionary.DictionaryEventArgs e) + { + Invalid = true; + } + + protected void CheckValid() + { + if ( Invalid ) + throw new InvalidOperationException( + "Dictionary was modified after this collection was created."); + } + + static void ThrowReadOnlyError() + { + throw new InvalidOperationException("Collection is readonly."); + } + + #region ICollection メンバ + + public void Add(T item) + { ThrowReadOnlyError(); } + + public void Clear() + { ThrowReadOnlyError(); } + + public abstract bool Contains(T item); + + public abstract void CopyTo(T[] array, int arrayIndex); + + public virtual int Count + { get { return Dictionary.Count; } } + + public bool IsReadOnly + { get { return true; } } + + public bool Remove(T item) + { ThrowReadOnlyError(); return false; } + + #endregion + + #region IEnumerable メンバ + + public abstract IEnumerator GetEnumerator(); + + #endregion + + #region IEnumerable メンバ + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + #endregion + } + + class KeyCollection: KeysValuesBase + { + public KeyCollection(RehashableDictionary dictionary) + : base(dictionary) + { } + + public override bool Contains(K item) + { + return Dictionary.ContainsKey(item); + } + + public override void CopyTo(K[] array, int arrayIndex) + { + foreach ( var item in Dictionary ) { + CheckValid(); + array[arrayIndex++] = item.Key; + } + } + + public override IEnumerator GetEnumerator() + { + foreach ( var item in Dictionary ) { + CheckValid(); + yield return item.Key; + } + } + } + + public bool Remove(K key) + { + return RemoveCore(key, false, default(V)); + } + + public bool TryGetValue(K key, out V value) + { + return TryGetValueCore(key, out value); + } + + public ICollection Values + { + get { return new ValueCollection(this); } + } + + class ValueCollection: KeysValuesBase + { + public ValueCollection(RehashableDictionary dictionary) + : base(dictionary) + { } + + public override bool Contains(V item) + { + return Dictionary.Any(entry=>entry.Value.Equals(item)); + } + + public override void CopyTo(V[] array, int arrayIndex) + { + foreach ( var item in Dictionary ) { + CheckValid(); + array[arrayIndex++] = item.Value; + } + } + + public override IEnumerator GetEnumerator() + { + foreach ( var item in Dictionary ) { + CheckValid(); + yield return item.Value; + } + } + } + + public V this[K key] + { + get + { + V value; + if ( TryGetValueCore(key, out value) ) + return value; + throw new ArgumentException("Key not exist."); + } + set + { + AddCore(key, value, false); + } + } + + #endregion + + #region ICollection> メンバ + + public void Add(KeyValuePair item) + { + AddCore(item.Key, item.Value, true); + } + + public void Clear() + { + var oldItems = items; + items = new SortedDictionary(); + hashes.Clear(); + var iter= GetEnumeratorCore(oldItems); + while(iter.MoveNext()) + OnRemoved(iter.Current.key, iter.Current.value); + } + + public bool Contains(KeyValuePair item) + { + V value; + if ( !TryGetValueCore(item.Key, out value) ) + return false; + return value.Equals(item.Value); + } + + public void CopyTo(KeyValuePair[] array, int arrayIndex) + { + foreach ( var item in this ) + array[arrayIndex++] = item; + } + + public int Count + { + get { return hashes.Count; } + } + + public bool IsReadOnly + { + get { return false; } + } + + public bool Remove(KeyValuePair item) + { + return RemoveCore(item.Key, true, item.Value); + } + + #endregion + + #region IEnumerable> メンバ + + public IEnumerator> GetEnumerator() + { + var iter = GetEnumeratorCore(items); + while ( iter.MoveNext() ) + yield return new KeyValuePair(iter.Current.key, iter.Current.value); + } + + #endregion + + #region IEnumerable メンバ + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + #endregion + } +} diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/TypeUtils.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/TypeUtils.cs new file mode 100644 index 0000000..f643e17 --- /dev/null +++ b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/TypeUtils.cs @@ -0,0 +1,418 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +using System.Reflection; +using System.Reflection.Emit; + +namespace System.Yaml +{ + /// + /// Type 関連のユーティリティメソッド + /// + /// + /// + /// Type type; + /// AttributeType attr = type.GetAttribute<AttributeType>(); + /// + /// PropertyInfo propInfo; + /// AttributeType attr = propInfo.GetAttribute<AttributeType>(); + /// + /// string name; + /// Type type = TypeUtils.GetType(name); // search from all assembly loaded + /// + /// + /// + /// + internal static class TypeUtils + { + /// + /// Type や PropertyInfo, FieldInfo から指定された型の属性を取り出して返す + /// 複数存在した場合には最後の値を返す + /// 存在しなければ null を返す + /// + /// 取り出したい属性の型 + /// 取り出した属性値 + public static AttributeType GetAttribute(this System.Reflection.MemberInfo info) + where AttributeType: Attribute + { + var attrs = info.GetCustomAttributes(typeof(AttributeType), true); + if ( attrs.Length > 0 ) { + return attrs.Last() as AttributeType; + } else { + return null; + } + } + + /// + /// 現在ロードされているすべてのアセンブリから name という名の型を探して返す + /// + /// + /// + public static Type GetType(string name) + { + if ( AvailableTypes.ContainsKey(name) ) + return AvailableTypes[name]; + Type type = Type.GetType(name); + if ( type == null ) // ロードされているすべてのアセンブリから探す + type = System.AppDomain.CurrentDomain.GetAssemblies().Select( + asm => asm.GetType(name)).FirstOrDefault(t => t != null); + return AvailableTypes[name] = type; + } + static Dictionary AvailableTypes = new Dictionary(); + + /// + /// Check if the type is a ValueType and does not contain any non ValueType members. + /// + /// + /// + public static bool IsPureValueType(Type type) + { + if ( type == typeof(IntPtr) ) + return false; + if ( type.IsPrimitive ) + return true; + if ( type.IsEnum ) + return true; + if ( !type.IsValueType ) + return false; + // struct + foreach ( var f in type.GetFields( + BindingFlags.GetField | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance) ) + if ( !IsPureValueType(f.FieldType) ) + return false; + return true; + } + + /// + /// Returnes true if the specified is a struct type. + /// + /// to be analyzed. + /// true if the specified is a struct type; otehrwise false. + public static bool IsStruct(Type type) + { + return type.IsValueType && !type.IsPrimitive; + } + + /// + /// Compare two objects to see if they are equal or not. Null is acceptable. + /// + /// + /// + /// + public static bool AreEqual(object a, object b) + { + if ( a == null ) + return b == null; + if ( b == null ) + return false; + return a.Equals(b) || b.Equals(a); + } + + /// + /// Return if an object is a numeric value. + /// + /// Any object to be tested. + /// True if object is a numeric value. + public static bool IsNumeric(object obj) + { + if ( obj == null ) + return false; + Type type = obj.GetType(); + return type == typeof(sbyte) || type == typeof(short) || type == typeof(int) || type == typeof(long) || + type == typeof(byte) || type == typeof(ushort) || type == typeof(uint) || type == typeof(ulong) || + type == typeof(float) || type == typeof(double) || type == typeof(decimal); + } + + /// + /// Cast an object to a specified numeric type. + /// + /// Any object + /// Numric type + /// Numeric value or null if the object is not a numeric value. + public static object CastToNumericType(object obj, Type type) + { + var doubleValue = CastToDouble(obj); + if ( double.IsNaN(doubleValue) ) + return null; + + if ( obj is decimal && type == typeof(decimal) ) + return obj; // do not convert into double + + object result = null; + if ( type == typeof(sbyte) ) + result = (sbyte)doubleValue; + if ( type == typeof(byte) ) + result = (byte)doubleValue; + if ( type == typeof(short) ) + result = (short)doubleValue; + if ( type == typeof(ushort) ) + result = (ushort)doubleValue; + if ( type == typeof(int) ) + result = (int)doubleValue; + if ( type == typeof(uint) ) + result = (uint)doubleValue; + if ( type == typeof(long) ) + result = (long)doubleValue; + if ( type == typeof(ulong) ) + result = (ulong)doubleValue; + if ( type == typeof(float) ) + result = (float)doubleValue; + if ( type == typeof(double) ) + result = doubleValue; + if ( type == typeof(decimal) ) + result = (decimal)doubleValue; + return result; + } + + /// + /// Cast boxed numeric value to double + /// + /// boxed numeric value + /// Numeric value in double. Double.Nan if obj is not a numeric value. + public static double CastToDouble(object obj) + { + var result = double.NaN; + var type = obj != null ? obj.GetType() : null; + if ( type == typeof(sbyte) ) + result = (double)(sbyte)obj; + if ( type == typeof(byte) ) + result = (double)(byte)obj; + if ( type == typeof(short) ) + result = (double)(short)obj; + if ( type == typeof(ushort) ) + result = (double)(ushort)obj; + if ( type == typeof(int) ) + result = (double)(int)obj; + if ( type == typeof(uint) ) + result = (double)(uint)obj; + if ( type == typeof(long) ) + result = (double)(long)obj; + if ( type == typeof(ulong) ) + result = (double)(ulong)obj; + if ( type == typeof(float) ) + result = (double)(float)obj; + if ( type == typeof(double) ) + result = (double)obj; + if ( type == typeof(decimal) ) + result = (double)(decimal)obj; + return result; + } + + /// + /// Check if type is fully public or not. + /// Nested class is checked if all declared types are public. + /// + /// + /// + public static bool IsPublic(Type type) + { + return type.IsPublic || + ( type.IsNestedPublic && type.IsNested && IsPublic(type.DeclaringType) ); + } + + /// + /// Equality comparer that uses Object.ReferenceEquals(x, y) to compare class values. + /// + /// + public class EqualityComparerByRef: EqualityComparer + where T: class + { + /// + /// Determines whether two objects of type T are equal by calling Object.ReferenceEquals(x, y). + /// + /// The first object to compare. + /// The second object to compare. + /// true if the specified objects are equal; otherwise, false. + public override bool Equals(T x, T y) + { + return Object.ReferenceEquals(x, y); + } + + /// + /// Serves as a hash function for the specified object for hashing algorithms and + /// data structures, such as a hash table. + /// + /// The object for which to get a hash code. + /// A hash code for the specified object. + /// is null. + public override int GetHashCode(T obj) + { + return HashCodeByRef.GetHashCode(obj); + } + + /// + /// Returns a default equality comparer for the type specified by the generic argument. + /// + /// The default instance of the System.Collections.Generic.EqualityComparer<T> + /// class for type T. + new public static EqualityComparerByRef Default { get { return _default; } } + static EqualityComparerByRef _default = new EqualityComparerByRef(); + } + + /// + /// Calculate hash code by reference. + /// + /// + public class HashCodeByRef where T: class + { + /// + /// Calculate hash code by reference. + /// + new static public Func GetHashCode { get; private set; } + /// + /// Initializes a new instance of the HashCodeByRef<T> class. + /// + static HashCodeByRef() + { + var dm = new DynamicMethod( + "GetHashCodeByRef", // name of the dynamic method + typeof(int), // type of return value + new Type[] { + typeof(T) // type of "this" + }, + typeof(EqualityComparerByRef)); // owner + + var ilg = dm.GetILGenerator(); + + ilg.Emit(OpCodes.Ldarg_0); // push "this" on the stack + ilg.Emit(OpCodes.Call, + typeof(object).GetMethod("GetHashCode")); // returned value is on the stack + ilg.Emit(OpCodes.Ret); // return + GetHashCode = (Func)dm.CreateDelegate(typeof(Func)); + } + } + + class RehashableDictionary: IDictionary where K: class + { + Dictionary items = new Dictionary(); + + Dictionary hashes = + new Dictionary(EqualityComparerByRef.Default); + + class KeyValue + { + public int hash; + public K key; + public V value; + public KeyValue(K key, V value) + { + this.key = key; + this.value = value; + this.hash = key.GetHashCode(); + } + } + + #region IDictionary メンバ + + public void Add(K key, V value) + { + if ( hashes.ContainsKey(key) ) + throw new ArgumentException("Same key already exists."); + var entry = new KeyValue(key, value); + object item; + if ( items.TryGetValue(entry.hash, out item) ) { + + } else { + } + } + + public bool ContainsKey(K key) + { + throw new NotImplementedException(); + } + + public ICollection Keys + { + get { throw new NotImplementedException(); } + } + + public bool Remove(K key) + { + throw new NotImplementedException(); + } + + public bool TryGetValue(K key, out V value) + { + throw new NotImplementedException(); + } + + public ICollection Values + { + get { throw new NotImplementedException(); } + } + + public V this[K key] + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + #endregion + + #region ICollection> メンバ + + public void Add(KeyValuePair item) + { + throw new NotImplementedException(); + } + + public void Clear() + { + throw new NotImplementedException(); + } + + public bool Contains(KeyValuePair item) + { + throw new NotImplementedException(); + } + + public void CopyTo(KeyValuePair[] array, int arrayIndex) + { + throw new NotImplementedException(); + } + + public int Count + { + get { throw new NotImplementedException(); } + } + + public bool IsReadOnly + { + get { throw new NotImplementedException(); } + } + + public bool Remove(KeyValuePair item) + { + throw new NotImplementedException(); + } + + #endregion + + #region IEnumerable> メンバ + + public IEnumerator> GetEnumerator() + { + throw new NotImplementedException(); + } + + #endregion + + #region IEnumerable メンバ + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + throw new NotImplementedException(); + } + + #endregion + } + } +} diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/UriEncoding.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/UriEncoding.cs new file mode 100644 index 0000000..8992dc2 --- /dev/null +++ b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/UriEncoding.cs @@ -0,0 +1,149 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +using System.Text.RegularExpressions; + +namespace System.Yaml +{ + /// + /// Add string class two methods: .UriEscape(), .UriUnescape() + /// + /// Charset that is not escaped is represented NonUriChar member. + /// + /// NonUriChar = new Regex(@"[^0-9A-Za-z\-_.!~*'()\\;/?:@&=$,\[\]]"); + /// + internal static class StringUriEncodingExtention + { + /// + /// Escape the string in URI encoding format. + /// + /// String to be escaped. + /// Escaped string. + public static string UriEscape(this string s) + { + return UriEncoding.Escape(s); + } + + /// + /// Escape the string in URI encoding format. + /// + /// String to be escaped. + /// Escaped string. + public static string UriEscapeForTag(this string s) + { + return UriEncoding.EscapeForTag(s); + } + + /// + /// Unescape the string escaped in URI encoding format. + /// + /// String to be unescape. + /// Unescaped string. + public static string UriUnescape(this string s) + { + return UriEncoding.Unescape(s); + } + } + + /// + /// Escape / Unescape string in URI encoding format + /// + /// Charset that is not escaped is represented NonUriChar member. + /// + /// NonUriChar = new Regex(@"[^0-9A-Za-z\-_.!~*'()\\;/?:@&=$,\[\]]"); + /// + internal class UriEncoding + { + public static string Escape(string s) + { + return NonUriChar.Replace(s, m => { + var c = m.Value[0]; + return ( c == ' ' ) ? "+" : + ( c < 0x80 ) ? IntToHex(c) : + ( c < 0x0800 ) ? IntToHex(( ( c >> 6 ) & 0x1f ) + 0xc0, ( c & 0x3f ) + 0x80) : + IntToHex(( ( c >> 12 ) & 0x0f ) + 0xe0, ( ( c >> 6 ) & 0x3f ) + 0x80, ( c & 0x3f ) + 0x80); + } + ); + } + static Regex NonUriChar = new Regex(@"[^0-9A-Za-z\-_.!~*'()\\;/?:@&=$,\[\]]"); + + public static string EscapeForTag(string s) + { + return NonTagChar.Replace(s, m => { + var c = m.Value[0]; + return ( c == ' ' ) ? "+" : + ( c < 0x80 ) ? IntToHex(c) : + ( c < 0x0800 ) ? IntToHex(( ( c >> 6 ) & 0x1f ) + 0xc0, ( c & 0x3f ) + 0x80) : + IntToHex(( ( c >> 12 ) & 0x0f ) + 0xe0, ( ( c >> 6 ) & 0x3f ) + 0x80, ( c & 0x3f ) + 0x80); + } + ); + } + static Regex NonTagChar = new Regex(@"[^0-9A-Za-z\-_.!~*'()\\;/?:@&=$]"); + + static char[] intToHex = new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; + static string IntToHex(int c) + { + return new string(new char[] { + '%', intToHex[c>>4], intToHex[c&0x0f], + }); + } + static string IntToHex(int c1, int c2) + { + return new string(new char[] { + '%', intToHex[c1>>4], intToHex[c1&0x0f], + '%', intToHex[c2>>4], intToHex[c2&0x0f], + }); + } + static string IntToHex(int c1, int c2, int c3) + { + return new string(new char[] { + '%', intToHex[c1>>4], intToHex[c1&0x0f], + '%', intToHex[c2>>4], intToHex[c2&0x0f], + '%', intToHex[c3>>4], intToHex[c3&0x0f], + }); + } + + public static string Unescape(string s) + { + s = s.Replace('+', ' '); + + var result = new StringBuilder(); + var p = 0; + int pp; + while ( ( pp = s.IndexOf('%', p) ) >= 0 ) { + result.Append(s.Substring(p, pp - p)); + p = pp; + var c0 = ( HexToInt(s[p + 1]) << 4 ) + HexToInt(s[p + 2]); + if ( c0 < 0x80 ) { + p += 3; + result.Append((char)c0); + continue; + } + var c1 = ( HexToInt(s[p + 4]) << 4 ) + HexToInt(s[p + 5]); + if ( c0 < 0xe0 ) { + p += 6; + var c = (char)( ( ( c0 & 0x1f ) << 6 ) + ( c1 & 0x7f ) ); + result.Append(c); + continue; + } + var c2 = ( HexToInt(s[p + 7]) << 4 ) + HexToInt(s[p + 8]); + if ( c0 < 0xf1 ) { + p += 9; + var c = (char)( ( ( c0 & 0x0f ) << 12 ) + ( ( c1 & 0x7f ) << 6 ) + ( c2 & 0x7f ) ); + result.Append(c); + continue; + } + throw new FormatException("Charcorde over 0xffff is not supported"); + } + return result.Append(s.Substring(p)).ToString(); + } + static int HexToInt(char c) + { + return c <= '9' ? c - '0' : c < 'Z' ? c - 'A' + 10 : c - 'a' + 10; + + } + } + +} diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/YamlAnchorDictionary.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/YamlAnchorDictionary.cs new file mode 100644 index 0000000..19d089d --- /dev/null +++ b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/YamlAnchorDictionary.cs @@ -0,0 +1,72 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace System.Yaml +{ + internal class AnchorDictionary + { + Dictionary Items = new Dictionary(); + + struct RewindInfo + { + public RewindInfo(string anchor_name, YamlNode old_value) + { + this.anchor_name = anchor_name; + this.old_value = old_value; + } + public string anchor_name; + public YamlNode old_value; + } + Stack ItemsToRewind = new Stack(); + + Func error; + + public AnchorDictionary(Func error) + { + this.error = error; + } + bool Error(string format, params object[] args) + { + return error(format, args); + } + public YamlNode this[string anchor_name] + { + get + { + if ( !Items.ContainsKey(anchor_name) ) + Error("Anchor {0} has not been registered.", anchor_name); + return Items[anchor_name]; + } + } + public void Add(string anchor_name, YamlNode node) + { + if ( Items.ContainsKey(anchor_name) ) { + // override an existing anchor + ItemsToRewind.Push(new RewindInfo(anchor_name, this[anchor_name])); + Items[anchor_name] = node; + } else { + ItemsToRewind.Push(new RewindInfo(anchor_name, null)); + Items.Add(anchor_name, node); + } + } + public int RewindDeapth + { + get { return ItemsToRewind.Count; } + set + { + if ( RewindDeapth < value ) + throw new ArgumentOutOfRangeException(); + while ( value < RewindDeapth ) { + var rewind_item = ItemsToRewind.Pop(); + if ( rewind_item.old_value == null ) { + Items.Remove(rewind_item.anchor_name); + } else { + Items[rewind_item.anchor_name] = rewind_item.old_value; + } + } + } + } + } +} diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/YamlConstructor.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/YamlConstructor.cs new file mode 100644 index 0000000..3791c9d --- /dev/null +++ b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/YamlConstructor.cs @@ -0,0 +1,298 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +using System.Collections; +using System.ComponentModel; +using System.Text.RegularExpressions; +using System.Runtime.InteropServices; + +namespace System.Yaml.Serialization +{ + internal class ObjectActivator + { + Dictionary> activators = + new Dictionary>(); + public void Add(Func activator) + where T: class + { + activators.Add(typeof(T), activator); + } + public T Activate() where T: class + { + return (T)Activate(typeof(T)); + } + public object Activate(Type type) + { + if ( !activators.ContainsKey(type) ) + return Activator.CreateInstance(type); + return activators[type].Invoke(); + } + } + + /// + /// Construct YAML node tree that represents a given C# object. + /// + internal class YamlConstructor + { + /// + /// Construct YAML node tree that represents a given C# object. + /// + /// to be converted to C# object. + /// to customize serialization. + /// + public object NodeToObject(YamlNode node, YamlConfig config) + { + return NodeToObject(node, null, config); + } + /// + /// Construct YAML node tree that represents a given C# object. + /// + /// to be converted to C# object. + /// Expected type for the root object. + /// to customize serialization. + /// + public object NodeToObject(YamlNode node, Type expected, YamlConfig config) + { + this.config = config; + var appeared = + new Dictionary(TypeUtils.EqualityComparerByRef.Default); + return NodeToObjectInternal(node, expected, appeared); + } + YamlConfig config; + + static public YamlTagResolver TagResolver = new YamlTagResolver(); + + private static Type TypeFromTag(string tag) + { + if ( tag.StartsWith(YamlNode.DefaultTagPrefix) ) { + switch ( tag.Substring(YamlNode.DefaultTagPrefix.Length) ) { + case "str": + return typeof(string); + case "int": + return typeof(Int32); + case "null": + return typeof(object); + case "bool": + return typeof(bool); + case "float": + return typeof(double); + case "seq": + case "map": + return null; + default: + throw new NotImplementedException(); + } + } else { + return TypeUtils.GetType(tag.Substring(1)); + } + } + + object NodeToObjectInternal(YamlNode node, Type expected, Dictionary appeared) + { + if ( appeared.ContainsKey(node) ) + return appeared[node]; + + object obj = null; + + // Type resolution + Type type = expected == typeof(object) ? null : expected; + Type fromTag = TagResolver.TypeFromTag(node.Tag); + if ( fromTag == null ) + fromTag = TypeFromTag(node.Tag); + if ( fromTag != null && type != fromTag && fromTag.IsClass && fromTag != typeof(string) ) + type = fromTag; + if ( type == null ) + type = fromTag; + + // try TagResolver + if ( type == fromTag && fromTag != null ) + if ( node is YamlScalar && TagResolver.Decode((YamlScalar)node, out obj) ) + return obj; + + if ( node.Tag == YamlNode.DefaultTagPrefix + "null" ) { + obj = null; + } else + if ( node is YamlScalar ) { + obj = ScalarToObject((YamlScalar)node, type); + } else + if ( node is YamlMapping ) { + obj = MappingToObject((YamlMapping)node, type, null, appeared); + } else + if ( node is YamlSequence ) { + obj = SequenceToObject((YamlSequence)node, type, appeared); + } else + throw new NotImplementedException(); + + if ( !appeared.ContainsKey(node) ) + if(obj != null && obj.GetType().IsClass && ( !(obj is string) || ((string)obj).Length >= 1000 ) ) + appeared.Add(node, obj); + + return obj; + } + + object ScalarToObject(YamlScalar node, Type type) + { + if ( type == null ) + throw new FormatException("Could not find a type '{0}'.".DoFormat(node.Tag)); + + // To accommodate the !!int and !!float encoding, all "_"s in integer and floating point values + // are simply neglected. + if ( type == typeof(byte) || type == typeof(sbyte) || type == typeof(short) || type == typeof(ushort) || + type == typeof(int) || type == typeof(uint) || type == typeof(long) || type == typeof(ulong) + || type == typeof(float) || type == typeof(decimal) ) + return config.TypeConverter.ConvertFromString(node.Value.Replace("_", ""), type); + + if ( type.IsEnum || type.IsPrimitive || type == typeof(char) || type == typeof(bool) || + type == typeof(string) || EasyTypeConverter.IsTypeConverterSpecified(type) ) + return config.TypeConverter.ConvertFromString(node.Value, type); + + if ( type.IsArray ) { + // Split dimension from base64 strings + var s = node.Value; + var regex = new Regex(@" *\[([0-9 ,]+)\][\r\n]+((.+|[\r\n])+)"); + int[] dimension; + byte[] binary; + var elementSize = Marshal.SizeOf(type.GetElementType()); + if ( type.GetArrayRank() == 1 ) { + binary = System.Convert.FromBase64CharArray(s.ToCharArray(), 0, s.Length); + var arrayLength = binary.Length / elementSize; + dimension = new int[] { arrayLength }; + } else { + var m = regex.Match(s); + if ( !m.Success ) + throw new FormatException("Irregal binary array"); + // Create array from dimension + dimension = m.Groups[1].Value.Split(',').Select(n => Convert.ToInt32(n)).ToArray(); + if ( type.GetArrayRank() != dimension.Length ) + throw new FormatException("Irregal binary array"); + // Fill values + s = m.Groups[2].Value; + binary = System.Convert.FromBase64CharArray(s.ToCharArray(), 0, s.Length); + } + var paramType = dimension.Select(n => typeof(int) /* n.GetType() */).ToArray(); + var array = (Array)type.GetConstructor(paramType).Invoke(dimension.Cast().ToArray()); + if ( binary.Length != array.Length * elementSize ) + throw new FormatException("Irregal binary: data size does not match to array dimension"); + int j = 0; + for ( int i = 0; i < array.Length; i++ ) { + var p = Marshal.UnsafeAddrOfPinnedArrayElement(array, i); + Marshal.Copy(binary, j, p, elementSize); + j += elementSize; + } + return array; + } + + if ( node.Value == "" ) { + return config.Activator.Activate(type); + } else { + return TypeDescriptor.GetConverter(type).ConvertFromString(node.Value); + } + } + + object SequenceToObject(YamlSequence seq, Type type, Dictionary appeared) + { + if ( type == null ) + type = typeof(object[]); + + if ( type.IsArray ) { + var lengthes= new int[type.GetArrayRank()]; + GetLengthes(seq, 0, lengthes); + var array = (Array)type.GetConstructor(lengthes.Select(l => typeof(int) /* l.GetType() */).ToArray()) + .Invoke(lengthes.Cast().ToArray()); + appeared.Add(seq, array); + var indices = new int[type.GetArrayRank()]; + SetArrayElements(array, seq, 0, indices, type.GetElementType(), appeared); + return array; + } else { + throw new NotImplementedException(); + } + } + + void SetArrayElements(Array array, YamlSequence seq, int i, int[] indices, Type elementType, Dictionary appeared) + { + if ( i < indices.Length - 1 ) { + for ( indices[i] = 0; indices[i] < seq.Count; indices[i]++ ) + SetArrayElements(array, (YamlSequence)seq[indices[i]], i + 1, indices, elementType, appeared); + } else { + for ( indices[i] = 0; indices[i] < seq.Count; indices[i]++ ) + array.SetValue(NodeToObjectInternal(seq[indices[i]], elementType, appeared), indices); + } + } + + private static void GetLengthes(YamlSequence seq, int i, int[] lengthes) + { + lengthes[i] = Math.Max(lengthes[i], seq.Count); + if ( i < lengthes.Length - 1 ) + for ( int j = 0; j < seq.Count; j++ ) + GetLengthes((YamlSequence)seq[j], i + 1, lengthes); + } + + object MappingToObject(YamlMapping map, Type type, object obj, Dictionary appeared) + { + // Naked !!map is constructed as Dictionary. + if ( ( ( map.ShorthandTag() == "!!map" && type == null ) || type == typeof(Dictionary) ) && obj == null ) { + var dict = new Dictionary(); + appeared.Add(map, dict); + foreach ( var entry in map ) + dict.Add(NodeToObjectInternal(entry.Key, null, appeared), NodeToObjectInternal(entry.Value, null, appeared)); + return dict; + } + + if ( obj == null ) { + obj = config.Activator.Activate(type); + appeared.Add(map, obj); + } else { + if ( appeared.ContainsKey(map) ) + throw new InvalidOperationException("This member is not writeable: {0}".DoFormat(obj.ToString())); + } + + var access = ObjectMemberAccessor.FindFor(type); + foreach(var entry in map){ + if ( obj == null ) + throw new InvalidOperationException("Object is not initialized"); + var name = (string)NodeToObjectInternal(entry.Key, typeof(string), appeared); + switch ( name ) { + case "ICollection.Items": + if ( access.CollectionAdd == null ) + throw new FormatException("{0} is not a collection type.".DoFormat(type.FullName)); + access.CollectionClear(obj); + foreach(var item in (YamlSequence)entry.Value) + access.CollectionAdd(obj, NodeToObjectInternal(item, access.ValueType, appeared)); + break; + case "IDictionary.Entries": + if ( !access.IsDictionary ) + throw new FormatException("{0} is not a dictionary type.".DoFormat(type.FullName)); + var dict = obj as IDictionary; + dict.Clear(); + foreach ( var child in (YamlMapping)entry.Value ) + dict.Add(NodeToObjectInternal(child.Key, access.KeyType, appeared), NodeToObjectInternal(child.Value, access.ValueType, appeared)); + break; + default: + if (!access.ContainsKey(name)) + // ignoring non existing properties + //throw new FormatException("{0} does not have a member {1}.".DoFormat(type.FullName, name)); + continue; + switch ( access[name].SerializeMethod ) { + case YamlSerializeMethod.Assign: + access[obj, name] = NodeToObjectInternal(entry.Value, access[name].Type, appeared); + break; + case YamlSerializeMethod.Content: + MappingToObject((YamlMapping)entry.Value, access[name].Type, access[obj, name], appeared); + break; + case YamlSerializeMethod.Binary: + access[obj, name] = ScalarToObject((YamlScalar)entry.Value, access[name].Type); + break; + default: + throw new InvalidOperationException( + "Member {0} of {1} is not serializable.".DoFormat(name, type.FullName)); + } + break; + } + } + return obj; + } + + } +} diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/YamlDoubleQuoteEscaping.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/YamlDoubleQuoteEscaping.cs new file mode 100644 index 0000000..e644202 --- /dev/null +++ b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/YamlDoubleQuoteEscaping.cs @@ -0,0 +1,131 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +using System.Text.RegularExpressions; + +namespace System.Yaml +{ + /// + /// Extend string object to have .DoubleQuoteEscape() / .DoubleQuoteUnescape(). + /// + internal static class StringYamlDoubleQuoteEscapeExtention + { + /// + /// Escape control codes with YAML double quoted string format. + /// + /// + /// + public static string YamlDoubleQuoteEscape(this string s) + { + return YamlDoubleQuoteEscaping.Escape(s); + } + /// + /// Unescape control codes escaped with YAML double quoted string format. + /// + /// + /// + public static string YamlDoubleQuoteUnescape(this string s) + { + return YamlDoubleQuoteEscaping.Unescape(s); + } + } + + /// + /// YAML style double quoted string escape / unescape. + /// + internal static class YamlDoubleQuoteEscaping + { + const int controlCodeMax = 0x1f; + static string[] controlCodes = new string[controlCodeMax + 1] { + @"\0", @"\x01", @"\x02", @"\x03", @"\x04", @"\x05", @"\x06", @"\a", + @"\b", @"\t", @"\n", @"\v", @"\f", @"\r", @"\x0e", @"\x0f", + @"\x10", @"\x11", @"\x12", @"\x13", @"\x14", @"\x15", @"\x16", @"\x17", + @"\x18", @"\x19", @"\x1a", @"\e", @"\x1c", @"\x1d", @"\x1e", @"\x1f", + }; + static Dictionary escapeTable = new Dictionary(); + static Regex escapeRegexp = null; + static Regex escapeNonprintable; + + static Dictionary unescapeTable = new Dictionary(); + static Regex unescapeRegexp = null; + + /// + /// Initialize tables + /// + static YamlDoubleQuoteEscaping() + { + + // Create (additional) escaping table + escapeTable['\\'] = @"\\"; + escapeTable['"'] = "\\\""; + escapeTable['/'] = @"\/"; + escapeTable['\x85'] = @"\N"; + escapeTable['\xa0'] = @"\_"; + escapeTable['\u2028'] = @"\L"; + escapeTable['\u2029'] = @"\P"; + + // Create escaping regexp + escapeRegexp = new Regex(@"[\x00-\x1f\/\x85\xa0\u2028\u2029" + "\"]"); + escapeNonprintable = new Regex(@"[\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]"); + + // Create unescaping table + for ( char c = '\0'; c < controlCodes.Length; c++ ) + unescapeTable[controlCodes[c]] = c.ToString(); + foreach ( var c in escapeTable.Keys ) + unescapeTable[escapeTable[c]] = c.ToString(); + + // Create unescaping regex + var pattern = ""; + unescapeTable.Keys.ToList().ForEach(esc => { + if ( pattern != "" ) + pattern += "|"; + pattern += Regex.Escape(esc); + }); + unescapeRegexp = new Regex(pattern + + @"|\\x[0-9a-fA-F]{2}|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}"); + } + + /// + /// Escape control codes, double quotations, backslashes in the YAML double quoted string format + /// + public static string Escape(string s) + { + s = s.Replace(@"\", @"\\"); + s = escapeRegexp.Replace(s, escapeChar); + return escapeNonprintable.Replace(s, m => { + var c = m.Value[0]; + return c < 0x100 ? string.Format(@"\x{0:x2}", (int)c) : string.Format(@"\u{0:x4}", (int)c); + }); + } + static string escapeChar(Match m) + { + var c = m.Value[0]; + return c < controlCodes.Length ? controlCodes[c] : escapeTable[c]; + } + + /// + /// Unescape control codes, double quotations, backslashes escape in the YAML double quoted string format + /// + public static string Unescape(string s) + { + return unescapeRegexp.Replace(s, unescapeChar); + } + static string unescapeChar(Match m) + { + string s; + switch ( m.Value[1] ) { + case 'x': + case 'u': + case 'U': + s = ( (char)Convert.ToInt32("0x" + m.Value.Substring(2)) ).ToString(); + break; + default: + s = unescapeTable[m.Value]; + break; + } + return s; + } + } +} diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/YamlNode.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/YamlNode.cs new file mode 100644 index 0000000..c448854 --- /dev/null +++ b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/YamlNode.cs @@ -0,0 +1,2355 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +using System.IO; +using System.ComponentModel; +using System.Text.RegularExpressions; +using System.Globalization; + +namespace System.Yaml +{ + /// + /// Configuration to customize YAML serialization. + /// An instance of this class can be passed to the serialization + /// methods, such as YamlNode.ToYaml(YamlConfig) and + /// YamlNode.FromYaml(Stream,YamlConfig) or + /// it can be assigned to YamlNode.DefaultConfig. + /// + /// + public class YamlConfig + { + /// + /// If true, all line breaks in the node value are normalized into "\r\n" + /// (= ) when serialize and line breaks + /// that are not escaped in YAML stream are normalized into "\n" + /// (= . + /// If false, the line breaks are preserved. Setting this option false violates + /// the YAML specification but sometimes useful. The default is true. + /// + /// + /// The YAML sepcification requires a YAML parser to normalize every line break that + /// is not escaped in a YAML stream, into a single line feed "\n" when it parse a YAML stream. + /// But this is not convenient in some cases, especially under Windows environment, where + /// the system default line break + /// is "\r\n" instead of "\n". + /// + /// This library provides two workarounds for this problem. + /// One is setting false. It disables the line break + /// normalization. The line breaks are serialized into a YAML stream as is and + /// those in the YAML stream are deserialized as is. + /// Another is setting "\r\n". Then, the YAML parser + /// normalizes all line breaks into "\r\n" instead of "\n". + /// Note that although these two options are useful in some cases, + /// they makes the YAML parser violate the YAML specification. + /// + /// + /// + /// // A string containing line breaks "\n\r" and "\r". + /// YamlNode node = "a\r\n b\rcde"; + /// + /// // By default conversion, line breaks are escaped in a double quoted string. + /// var yaml = node.ToYaml(); + /// // %YAML 1.2 + /// // --- + /// // "a\r\n\ + /// // \ b\r\ + /// // cde" + /// // ... + /// + /// // "%YAML 1.2\r\n---\r\n\"a\\r\\n\\\r\n\ b\\r\\\r\ncde\"\r\n...\r\n" + /// + /// // Such a YAML stream is not pretty but is capable to preserve + /// // original line breaks even when the line breaks of the YAML stream + /// // are changed (for instance, by some editor) between serialization + /// // and deserialization. + /// var restored = YamlNode.FromYaml(yaml)[0]; + /// // "a\r\n b\rcde" // equivalent to the original + /// + /// yaml = yaml.Replace("\r\n", "\n").Replace("\r", "\n"); + /// var restored = YamlNode.FromYaml(yaml)[0]; + /// // "a\r\n b\rcde" // still equivalent to the original + /// + /// // By setting ExplicitlyPreserveLineBreaks false, the output becomes + /// // much prettier. + /// YamlNode.DefaultConfig.ExplicitlyPreserveLineBreaks = false; + /// yaml = node.ToYaml(); + /// // %YAML 1.2 + /// // --- + /// // |-2 + /// // a + /// // b + /// // cde + /// // ... + /// + /// // line breaks are nomalized to "\r\n" (= YamlNode.DefaultConfig.LineBreakForOutput) + /// // "%YAML 1.2\r\n---\r\n|-2\r\n a\r\n b\r\ncde\r\n...\r\n" + /// + /// // line breaks are nomalized to "\n" (= YamlNode.DefaultConfig.LineBreakForInput) + /// var restored = YamlNode.FromYaml(yaml)[0]; + /// // "a\n b\ncde" + /// + /// + /// // Disable line break normalization. + /// YamlNode.DefaultConfig.NormalizeLineBreaks = false; + /// yaml = node.ToYaml(); + /// + /// // line breaks are not nomalized + /// // "%YAML 1.2\r\n---\r\n|-2\r\n a\r\n b\rcde\r\n...\r\n" + /// + /// // Unless line breaks in YAML stream is preserved, original line + /// // breaks can be restored. + /// restored = YamlNode.FromYaml(yaml)[0]; + /// // "a\r\n b\rcde" // equivalent to the original + /// + /// yaml = yaml.Replace("\r\n", "\n").Replace("\r", "\n"); + /// restored = YamlNode.FromYaml(yaml)[0]; + /// // "a\n b\ncde" // original line breaks are lost + /// + /// + public bool NormalizeLineBreaks = true; + /// + /// If true, all s whose text expression contains line breaks + /// will be presented as double quoted texts, where the line break characters are escaped + /// by back slash as "\\n" and "\\r". The default is true. + /// + /// + /// The escaped line breaks makes the YAML stream hard to read, but is required to + /// prevent the line break characters be normalized by the YAML parser; the YAML + /// sepcification requires a YAML parser to normalize all line breaks that are not escaped + /// into a single line feed "\n" when it parse a YAML source. + /// + /// + /// If the preservation of line breaks are not required, set this value false. + /// + /// + /// Then, whenever it is possible, the s are presented + /// as literal style text, where the line breaks are not escaped. This results in + /// a much prettier output in the YAML stream. + /// + /// + /// + /// // A string containing line breaks "\n\r" and "\r". + /// YamlNode node = "a\r\n b\rcde"; + /// + /// // By default conversion, line breaks are escaped in a double quoted string. + /// var yaml = node.ToYaml(); + /// // %YAML 1.2 + /// // --- + /// // "a\r\n\ + /// // \ b\r\ + /// // cde" + /// // ... + /// + /// // "%YAML 1.2\r\n---\r\n\"a\\r\\n\\\r\n\ b\\r\\\r\ncde\"\r\n...\r\n" + /// + /// // Such a YAML stream is not pretty but is capable to preserve + /// // original line breaks even when the line breaks of the YAML stream + /// // are changed (for instance, by some editor) between serialization + /// // and deserialization. + /// var restored = YamlNode.FromYaml(yaml)[0]; + /// // "a\r\n b\rcde" // equivalent to the original + /// + /// yaml = yaml.Replace("\r\n", "\n").Replace("\r", "\n"); + /// var restored = YamlNode.FromYaml(yaml)[0]; + /// // "a\r\n b\rcde" // still equivalent to the original + /// + /// // By setting ExplicitlyPreserveLineBreaks false, the output becomes + /// // much prettier. + /// YamlNode.DefaultConfig.ExplicitlyPreserveLineBreaks = false; + /// yaml = node.ToYaml(); + /// // %YAML 1.2 + /// // --- + /// // |-2 + /// // a + /// // b + /// // cde + /// // ... + /// + /// // line breaks are nomalized to "\r\n" (= YamlNode.DefaultConfig.LineBreakForOutput) + /// // "%YAML 1.2\r\n---\r\n|-2\r\n a\r\n b\r\ncde\r\n...\r\n" + /// + /// // line breaks are nomalized to "\n" (= YamlNode.DefaultConfig.LineBreakForInput) + /// var restored = YamlNode.FromYaml(yaml)[0]; + /// // "a\n b\ncde" + /// + /// + /// // Disable line break normalization. + /// YamlNode.DefaultConfig.NormalizeLineBreaks = false; + /// yaml = node.ToYaml(); + /// + /// // line breaks are not nomalized + /// // "%YAML 1.2\r\n---\r\n|-2\r\n a\r\n b\rcde\r\n...\r\n" + /// + /// // Unless line breaks in YAML stream is preserved, original line + /// // breaks can be restored. + /// restored = YamlNode.FromYaml(yaml)[0]; + /// // "a\r\n b\rcde" // equivalent to the original + /// + /// yaml = yaml.Replace("\r\n", "\n").Replace("\r", "\n"); + /// restored = YamlNode.FromYaml(yaml)[0]; + /// // "a\n b\ncde" // original line breaks are lost + /// + /// + public bool ExplicitlyPreserveLineBreaks = true; + /// + /// Line break to be used when is presented in YAML stream. + /// "\r", "\r\n", "\n" are allowed. "\r\n" is defalut. + /// + /// + /// + /// // A string containing line breaks "\n\r" and "\r". + /// YamlNode node = "a\r\n b\rcde"; + /// + /// // By default conversion, line breaks are escaped in a double quoted string. + /// var yaml = node.ToYaml(); + /// // %YAML 1.2 + /// // --- + /// // "a\r\n\ + /// // \ b\r\ + /// // cde" + /// // ... + /// + /// // "%YAML 1.2\r\n---\r\n\"a\\r\\n\\\r\n\ b\\r\\\r\ncde\"\r\n...\r\n" + /// + /// // Such a YAML stream is not pretty but is capable to preserve + /// // original line breaks even when the line breaks of the YAML stream + /// // are changed (for instance, by some editor) between serialization + /// // and deserialization. + /// var restored = YamlNode.FromYaml(yaml)[0]; + /// // "a\r\n b\rcde" // equivalent to the original + /// + /// yaml = yaml.Replace("\r\n", "\n").Replace("\r", "\n"); + /// var restored = YamlNode.FromYaml(yaml)[0]; + /// // "a\r\n b\rcde" // still equivalent to the original + /// + /// // By setting ExplicitlyPreserveLineBreaks false, the output becomes + /// // much prettier. + /// YamlNode.DefaultConfig.ExplicitlyPreserveLineBreaks = false; + /// yaml = node.ToYaml(); + /// // %YAML 1.2 + /// // --- + /// // |-2 + /// // a + /// // b + /// // cde + /// // ... + /// + /// // line breaks are nomalized to "\r\n" (= YamlNode.DefaultConfig.LineBreakForOutput) + /// // "%YAML 1.2\r\n---\r\n|-2\r\n a\r\n b\r\ncde\r\n...\r\n" + /// + /// // line breaks are nomalized to "\n" (= YamlNode.DefaultConfig.LineBreakForInput) + /// var restored = YamlNode.FromYaml(yaml)[0]; + /// // "a\n b\ncde" + /// + /// + /// // Disable line break normalization. + /// YamlNode.DefaultConfig.NormalizeLineBreaks = false; + /// yaml = node.ToYaml(); + /// + /// // line breaks are not nomalized + /// // "%YAML 1.2\r\n---\r\n|-2\r\n a\r\n b\rcde\r\n...\r\n" + /// + /// // Unless line breaks in YAML stream is preserved, original line + /// // breaks can be restored. + /// restored = YamlNode.FromYaml(yaml)[0]; + /// // "a\r\n b\rcde" // equivalent to the original + /// + /// yaml = yaml.Replace("\r\n", "\n").Replace("\r", "\n"); + /// restored = YamlNode.FromYaml(yaml)[0]; + /// // "a\n b\ncde" // original line breaks are lost + /// + /// + public string LineBreakForOutput = "\r\n"; + /// + /// The YAML parser normalizes line breaks in a YAML stream to this value. + /// + /// "\n" is default, and is the only valid value in the YAML specification. "\r" and "\r\n" are + /// allowed in this library for convenience. + /// + /// To suppress normalization of line breaks by YAML parser, set + /// false, though it is also violate the YAML specification. + /// + /// + /// The YAML sepcification requires a YAML parser to normalize every line break that + /// is not escaped in a YAML stream, into a single line feed "\n" when it parse a YAML stream. + /// But this is not convenient in some cases, especially under Windows environment, where + /// the system default line break + /// is "\r\n" instead of "\n". + /// + /// This library provides two workarounds for this problem. + /// One is setting false. It disables the line break + /// normalization. The line breaks are serialized into a YAML stream as is and + /// those in the YAML stream are deserialized as is. + /// Another is setting "\r\n". Then, the YAML parser + /// normalizes all line breaks into "\r\n" instead of "\n". + /// Note that although these two options are useful in some cases, + /// they makes the YAML parser violate the YAML specification. + /// + /// + /// + /// // A string containing line breaks "\n\r" and "\r". + /// YamlNode node = "a\r\n b\rcde"; + /// + /// // By default conversion, line breaks are escaped in a double quoted string. + /// var yaml = node.ToYaml(); + /// // %YAML 1.2 + /// // --- + /// // "a\r\n\ + /// // \ b\r\ + /// // cde" + /// // ... + /// + /// // "%YAML 1.2\r\n---\r\n\"a\\r\\n\\\r\n\ b\\r\\\r\ncde\"\r\n...\r\n" + /// + /// // Such a YAML stream is not pretty but is capable to preserve + /// // original line breaks even when the line breaks of the YAML stream + /// // are changed (for instance, by some editor) between serialization + /// // and deserialization. + /// var restored = YamlNode.FromYaml(yaml)[0]; + /// // "a\r\n b\rcde" // equivalent to the original + /// + /// yaml = yaml.Replace("\r\n", "\n").Replace("\r", "\n"); + /// var restored = YamlNode.FromYaml(yaml)[0]; + /// // "a\r\n b\rcde" // still equivalent to the original + /// + /// // By setting ExplicitlyPreserveLineBreaks false, the output becomes + /// // much prettier. + /// YamlNode.DefaultConfig.ExplicitlyPreserveLineBreaks = false; + /// yaml = node.ToYaml(); + /// // %YAML 1.2 + /// // --- + /// // |-2 + /// // a + /// // b + /// // cde + /// // ... + /// + /// // line breaks are nomalized to "\r\n" (= YamlNode.DefaultConfig.LineBreakForOutput) + /// // "%YAML 1.2\r\n---\r\n|-2\r\n a\r\n b\r\ncde\r\n...\r\n" + /// + /// // line breaks are nomalized to "\n" (= YamlNode.DefaultConfig.LineBreakForInput) + /// var restored = YamlNode.FromYaml(yaml)[0]; + /// // "a\n b\ncde" + /// + /// + /// // Disable line break normalization. + /// YamlNode.DefaultConfig.NormalizeLineBreaks = false; + /// yaml = node.ToYaml(); + /// + /// // line breaks are not nomalized + /// // "%YAML 1.2\r\n---\r\n|-2\r\n a\r\n b\rcde\r\n...\r\n" + /// + /// // Unless line breaks in YAML stream is preserved, original line + /// // breaks can be restored. + /// restored = YamlNode.FromYaml(yaml)[0]; + /// // "a\r\n b\rcde" // equivalent to the original + /// + /// yaml = yaml.Replace("\r\n", "\n").Replace("\r", "\n"); + /// restored = YamlNode.FromYaml(yaml)[0]; + /// // "a\n b\ncde" // original line breaks are lost + /// + /// + public string LineBreakForInput = "\n"; + /// + /// If true, tag for the root node is omitted by . + /// + public bool OmitTagForRootNode = false; + /// + /// If true, the verbatim style of a tag, i.e. !< > is avoided as far as possible. + /// + public bool DontUseVerbatimTag = false; + + /// + /// Add a custom tag resolution rule. + /// + /// + /// + /// + /// + /// + /// Type of value. + /// Tag for the value. + /// Pattern to match the value. + /// Method that decode value from + /// data after matching by . + /// Method that encode value to . + public void AddRule(string tag, string regex, Func decode, Func encode) + { + TagResolver.AddRule(tag, regex, decode, encode); + } + internal YamlTagResolver TagResolver = new YamlTagResolver(); + + /// + /// Add an ability of instantiating an instance of a class that has no default constructer. + /// + /// Type of the object that is activated by this . + /// A delegate that creates an instance of . + /// + /// + /// var serializer= new YamlSerializer(); + /// + /// var yaml = + /// @"%YAML 1.2 + /// --- + /// !System.Drawing.SolidBrush + /// Color: Red + /// ... + /// "; + /// + /// SolidBrush b = null; + /// try { + /// b = (SolidBrush)serializer.Deserialize(yaml)[0]; + /// } catch(MissingMethodException) { + /// // SolidBrush has no default constructor! + /// } + /// + /// YamlNode.DefaultConfig.AddActivator<SolidBrush>(() => new SolidBrush(Color.Black)); + /// + /// // Now the serializer knows how to activate an instance of SolidBrush. + /// b = (SolidBrush)serializer.Deserialize(yaml)[0]; + /// + /// Assert.AreEqual(b.Color, Color.Red); + /// + /// + public void AddActivator(Func activator) + where T: class + { + Activator.Add(activator); + } + internal System.Yaml.Serialization.ObjectActivator Activator = + new System.Yaml.Serialization.ObjectActivator(); + + /// + /// Gets or sets CultureInfo with which the .NET native values are converted + /// to / from string. Currently, this is not to be changed from CultureInfo.InvariantCulture. + /// + internal CultureInfo Culture { + get { return TypeConverter.Culture; } + set { TypeConverter.Culture = value; } + } + internal System.Yaml.Serialization.EasyTypeConverter TypeConverter = + new System.Yaml.Serialization.EasyTypeConverter(); + } + + /// + /// Abstract base class of YAML data nodes. + /// + /// See , and + /// for actual data classes. + /// + /// + ///

YAML data model

+ /// See http://yaml.org/ for the official definition of + /// Information Models of YAML. + /// + /// YAML data structure is defined as follows. + /// Note that this does not represents the text syntax of YAML text + /// but does logical data structure. + /// + /// + /// yaml-stream ::= yaml-document*
+ /// yaml-document ::= yaml-directive* yaml-node
+ /// yaml-directive ::= YAML-directive | TAG-directive | user-defined-directive
+ /// yaml-node ::= yaml-scalar | yaml-sequence | yaml-mapping
+ /// yaml-scalar ::= yaml-tag yaml-value
+ /// yaml-sequence ::= yaml-tag yaml-node*
+ /// yaml-mapping ::= yaml-tag ( yaml-node yaml-node )*
+ /// yaml-tag ::= yaml-global-tag yaml-local-tag
+ /// yaml-global-tag ::= "tag:" taggingEntity ":" specific [ "#" fragment ]
+ /// yaml-local-tag ::= "!" yaml-local-tag-name
+ ///
+ /// + /// Namely, + /// + /// + /// A YAML stream consists of zero or more YAML documents.
+ /// A YAML documents have zero or more YAML directives and a root YAML node.
+ /// A YAML directive is either YAML-directive, TAG-directive or user-defined-directive.
+ /// A YAML node is either YAML scalar, YAML sequence or YAML mapping.
+ /// A YAML scalar consists of a YAML tag and a scalar value.
+ /// A YAML sequence consists of a YAML tag and zero or more child YAML nodes.
+ /// A YAML mapping cosists of a YAML tag and zero or more key/value pairs of YAML nodes.
+ /// A YAML tag is either a YAML global tag or a YAML local tag.
+ /// A YAML global tag starts with "tag:" and described in the "tag:" URI scheme defined in RFC4151.
+ /// A YAML local tag starts with "!" with a YAML local tag name
+ ///
+ /// + /// + /// // Construct YAML node tree + /// YamlNode node = + /// new YamlSequence( // !!seq node + /// new YamlScalar("abc"), // !!str node + /// new YamlScalar("!!int", "123"), // !!int node + /// new YamlScalar("!!float", "1.23"), // !!float node + /// new YamlSequence( // nesting !!seq node + /// new YamlScalar("def"), + /// new YamlScalar("ghi") + /// ), + /// new YamlMapping( // !!map node + /// new YamlScalar("key1"), new YamlScalar("value1"), + /// new YamlScalar("key2"), new YamlScalar("value2"), + /// new YamlScalar("key3"), new YamlMapping( // nesting !!map node + /// new YamlScalar("value3key1"), new YamlScalar("value3value1") + /// ), + /// new YamlScalar("key4"), new YamlScalar("value4") + /// ) + /// ); + /// + /// // Convert it to YAML stream + /// string yaml = node.ToYaml(); + /// + /// // %YAML 1.2 + /// // --- + /// // - abc + /// // - 123 + /// // - 1.23 + /// // - - def + /// // - ghi + /// // - key1: value1 + /// // key2: value2 + /// // key3: + /// // value3key1: value3value1 + /// // key4: value4 + /// // ... + /// + /// // Load the YAML node from the YAML stream. + /// // Note that a YAML stream can contain several YAML documents each of which + /// // contains a root YAML node. + /// YamlNode[] nodes = YamlNode.FromYaml(yaml); + /// + /// // The only one node in the stream is the one we have presented above. + /// Assert.AreEqual(1, nodes.Length); + /// YamlNode resotred = nodes[0]; + /// + /// // Check if they are equal to each other. + /// Assert.AreEquel(node, restored); + /// + /// // Extract sub nodes. + /// var seq = (YamlSequence)restored; + /// var map = (YamlMapping)seq[4]; + /// var map2 = (YamlMapping)map[new YamlScalar("key3")]; + /// + /// // Modify the restored node tree + /// map2[new YamlScalar("value3key1")] = new YamlScalar("value3value1 modified"); + /// + /// // Now they are not equal to each other. + /// Assert.AreNotEquel(node, restored); + /// + /// + ///

YamlNode class

+ /// + /// is an abstract class that represents a YAML node. + /// + /// In reality, a is either , or + /// . + /// + /// All has property that denotes + /// the actual data type represented in the YAML node. + /// + /// Default Tag value for , or are + /// "tag:yaml.org,2002:str", "tag:yaml.org,2002:seq", "tag:yaml.org,2002:map". + /// + /// Global tags that starts with "tag:yaml.org,2002:" ( = + /// YamlNode.DefaultTagPrefix) are defined in the YAML tag repository at + /// http://yaml.org/type/. In this library, such a tags can be also + /// represented in a short form that starts with "!!", like "!!str", "!!seq" and "!!map". + /// Tags in the formal style and the shorthand form can be converted to each other by the static methods of + /// and . + /// In addition to these three basic tags, this library uses "!!null", "!!bool", "!!int", + /// "!!float" and "!!timestamp" tags, by default. + /// + /// s can be read from a YAML stream with , + /// , and + /// static methods. Since a YAML stream generally consist of multiple + /// YAML documents, each of which has a root YAML node, these methods return an array of + /// that is contained in the stream. + /// + /// s can be written to a YAML stream with , + /// , and + /// . + /// + /// The way of serialization can be configured in some aspects. The custom settings are specified + /// by an instance of class. The serialization methods introduced above has + /// overloaded styles that accepts instance to customize serialization. + /// It is also possible to change the default serialization method by modifying + /// YamlNode.DefaultConfig static property. + /// + /// A has property, which holds the string expression + /// of the node value. + /// + /// A implements IList<YamlNode> + /// interface to access the child nodes. + /// + /// implements + /// IDictionary<YamlNode,YamlNode> interface + /// to access the key/value pairs under the node. + /// + ///

Implicit conversion from C# native object to YamlScalar

+ /// + /// Implicit cast operators from , , , + /// and to is defined. Thus, anytime + /// is required in C# source, naked scalar value can be written. Namely, + /// methods of and accept such C# native types + /// as arguments in addition to types. + /// + /// + /// var map = new YamlMapping(); + /// map["Time"] = DateTime.Now; // implicitly converted to YamlScalar + /// Assert.IsTrue(map.ContainsKey(new YamlScalar("Time"))); + /// Assert.IsTrue(map.ContainsKey("Time")); // implicitly converted to YamlScalar + /// + /// + ///

Equality of YamlNodes

+ /// + /// Equality of s are evaluated on the content base. Different + /// objects that have the same content are evaluated to be equal. Use method for + /// equality evaluation. + /// + /// In detail, two s are logically equal to each other when the + /// and its child nodes have the same contents ( and ) + /// and their node graph topology is exactly same. + /// + /// + /// + /// YamlNode a1 = "a"; // implicit conversion + /// YamlNode a2 = "a"; // implicit conversion + /// YamlNode a3 = new YamlNode("!char", "a"); + /// YamlNode b = "b"; // implicit conversion + /// + /// Assert.IsTrue(a1 != a2); // different objects + /// Assert.IsTrue(a1.Equals(a2)); // different objects having same content + /// + /// Assert.IsFalse(a1.Equals(a3)); // Tag is different + /// Assert.IsFalse(a1.Equals(b)); // Value is different + /// + /// var s1 = new YamlMapping(a1, new YamlSequence(a1, a2)); + /// var s2 = new YamlMapping(a1, new YamlSequence(a2, a1)); + /// var s3 = new YamlMapping(a2, new YamlSequence(a1, a2)); + /// + /// Assert.IsFalse(s1.Equals(s2)); // node graph topology is different + /// Assert.IsFalse(s1.Equals(s3)); // node graph topology is different + /// Assert.IsTrue(s2.Equals(s3)); // different objects having same content and node graph topology + /// + /// + ///
+ /// + /// Example 2.27 in YAML 1.2 specification + /// + /// + /// // %YAML 1.2 + /// // --- + /// // !<tag:clarkevans.com,2002:invoice> + /// // invoice: 34843 + /// // date : 2001-01-23 + /// // bill-to: &id001 + /// // given : Chris + /// // family : Dumars + /// // address: + /// // lines: | + /// // 458 Walkman Dr. + /// // Suite #292 + /// // city : Royal Oak + /// // state : MI + /// // postal : 48046 + /// // ship-to: *id001 + /// // product: + /// // - sku : BL394D + /// // quantity : 4 + /// // description : Basketball + /// // price : 450.00 + /// // - sku : BL4438H + /// // quantity : 1 + /// // description : Super Hoop + /// // price : 2392.00 + /// // tax : 251.42 + /// // total: 4443.52 + /// // comments: + /// // Late afternoon is best. + /// // Backup contact is Nancy + /// // Billsmer @ 338-4338. + /// // ... + /// + /// var invoice = new YamlMapping( + /// "invoice", 34843, + /// "date", new DateTime(2001, 01, 23), + /// "bill-to", new YamlMapping( + /// "given", "Chris", + /// "family", "Dumars", + /// "address", new YamlMapping( + /// "lines", "458 Walkman Dr.\nSuite #292\n", + /// "city", "Royal Oak", + /// "state", "MI", + /// "postal", 48046 + /// ) + /// ), + /// "product", new YamlSequence( + /// new YamlMapping( + /// "sku", "BL394D", + /// "quantity", 4, + /// "description", "Basketball", + /// "price", 450.00 + /// ), + /// new YamlMapping( + /// "sku", "BL4438H", + /// "quantity", 1, + /// "description", "Super Hoop", + /// "price", 2392.00 + /// ) + /// ), + /// "tax", 251.42, + /// "total", 4443.52, + /// "comments", "Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338." + /// ); + /// invoice["ship-to"] = invoice["bill-to"]; + /// invoice.Tag = "tag:clarkevans.com,2002:invoice"; + /// + /// invoice.ToYamlFile("invoice.yaml"); + /// // %YAML 1.2 + /// // --- + /// // !<tag:clarkevans.com,2002:invoice> + /// // invoice: 34843 + /// // date: 2001-01-23 + /// // bill-to: &A + /// // given: Chris + /// // family: Dumars + /// // address: + /// // lines: "458 Walkman Dr.\n\ + /// // Suite #292\n" + /// // city: Royal Oak + /// // state: MI + /// // postal: 48046 + /// // product: + /// // - sku: BL394D + /// // quantity: 4 + /// // description: Basketball + /// // price: !!float 450 + /// // - sku: BL4438H + /// // quantity: 1 + /// // description: Super Hoop + /// // price: !!float 2392 + /// // tax: 251.42 + /// // total: 4443.52 + /// // comments: Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338. + /// // ship-to: *A + /// // ... + /// + /// + /// + public abstract class YamlNode: IRehashableKey + { + #region Non content values + /// + /// Position in a YAML document, where the node appears. + /// Both and sets this property. + /// When the node appeared multiple times in the document, this property returns the position + /// where it appeared for the first time. + /// + [DefaultValue(0)] + public int Raw { get; set; } + + /// + /// Position in a YAML document, where the node appears. + /// Both and sets this property. + /// When the node appeared multiple times in the document, this property returns the position + /// where it appeared for the first time. + /// + [DefaultValue(0)] + public int Column { get; set; } + + /// + /// Temporary data, transfering information between YamlRepresenter and YamlPresenter. + /// + internal Dictionary Properties { get; private set; } + + /// + /// Initialize a node. + /// + public YamlNode() + { + Properties = new Dictionary(); + } + #endregion + + /// + /// YAML Tag for this node, which represents the type of node's value. + /// + /// + /// + /// YAML standard types has tags in a form of "tag:yaml.org,2002:???". Well known tags are + /// tag:yaml.org,2002:null, tag:yaml.org,2002:bool, tag:yaml.org,2002:int, tag:yaml.org,2002:str, + /// tag:yaml.org,2002:map, tag:yaml.org,2002:seq, tag:yaml.org,2002:float and tag:yaml.org,2002:timestamp. + /// + /// + public string Tag + { + get { return tag; } + set { + /* strict tag check + if ( value.StartsWith("!!") ) + throw new ArgumentException( + "Tag vallue {0} must be resolved to a local or global tag before assignment".DoFormat(value)); + if ( !value.StartsWith("!") && !DefaultTagValidator.IsValid(value) ) + throw new ArgumentException( + "{0} is not a valid global tag.".DoFormat(value)); + */ + tag = value; + OnChanged(); + } + } + string tag; +// static YamlTagValidator TagValidator = new YamlTagValidator(); + /// + /// YAML Tag for this node, which represents the type of node's value. + /// The property is returned in a shorthand style. + /// + public string ShorthandTag() + { + return ShorthandTag(Tag); + } + + #region Hash code + /// + /// Serves as a hash function for a particular type. + /// Hash code is calculated using Tag and Value properties. + /// + /// Hash code + public override int GetHashCode() + { + // caches hash code + if ( HashInvalid ) { + HashCode = GetHashCodeCore(); + HashInvalid = false; + } + return HashCode; + } + int HashCode; + bool HashInvalid = true; + bool ToBeRehash = false; + /// + /// Return the hash code. + /// The returned value will be cached until is called. + /// + /// Hash code + protected abstract int GetHashCodeCore(); + /// + /// Call this function when the content of the node is changed. + /// + protected virtual void OnChanged() + { + // avoiding inifinite loop + if ( !ToBeRehash ) { + try { + HashInvalid = true; + ToBeRehash = true; + if ( Changed != null ) + Changed(this, EventArgs.Empty); + } finally { + ToBeRehash = false; + } + } + } + /// + /// Invoked when the node's content or its childrens' content was changed. + /// + public event EventHandler Changed; + #endregion + + /// + /// Returns true if is of same type as the and + /// its content is also logically same. + /// + /// + /// Two 's are logically equal when the and its child nodes + /// have the same contents ( and ) + /// and their node graph topology is exactly same as the other. + /// + /// + /// + /// var a1 = new YamlNode("a"); + /// var a2 = new YamlNode("a"); + /// var a3 = new YamlNode("!char", "a"); + /// var b = new YamlNode("b"); + /// + /// Assert.IsTrue(a1 != a2); // different objects + /// Assert.IsTrue(a1.Equals(a2)); // different objects having same content + /// + /// Assert.IsFalse(a1.Equals(a3)); // Tag is different + /// Assert.IsFalse(a1.Equals(b)); // Value is different + /// + /// var s1 = new YamlMapping(a1, new YamlSequence(a1, a2)); + /// var s2 = new YamlMapping(a1, new YamlSequence(a2, a1)); + /// var s3 = new YamlMapping(a2, new YamlSequence(a1, a2)); + /// + /// Assert.IsFalse(s1.Equals(s2)); // node graph topology is different + /// Assert.IsFalse(s1.Equals(s3)); // node graph topology is different + /// Assert.IsTrue(s2.Equals(s3)); // different objects having same content and node graph topology + /// + /// + /// Object to be compared. + /// True if the logically equals to the ; otherwise false. + public override bool Equals(object obj) + { + if ( obj == null || !( obj is YamlNode ) ) + return false; + var repository = new ObjectRepository(); + return Equals((YamlNode)obj, repository); + } + + /// + /// Called when the node is loaded from a document. + /// + internal virtual void OnLoaded() + { + } + + /// + /// Remember the order of appearance of nodes. It also has ability of rewinding. + /// + internal class ObjectRepository + { + Dictionary nodes_a = + new Dictionary(TypeUtils.EqualityComparerByRef.Default); + Dictionary nodes_b = + new Dictionary(TypeUtils.EqualityComparerByRef.Default); + Stack stack_a = new Stack(); + Stack stack_b = new Stack(); + + public class Status + { + public int count { get; private set; } + public Status(int c) + { + count= c; + } + } + + public bool AlreadyAppeared(YamlNode a, YamlNode b, out bool identity) + { + int ai, bi; + bool ar = nodes_a.TryGetValue(a, out ai); + bool br = nodes_b.TryGetValue(b, out bi); + if ( ar && br && ai == bi ) { + identity = true; + return true; + } + if ( ar ^ br ) { + identity = false; + return true; + } + nodes_a.Add(a, nodes_a.Count); + nodes_b.Add(b, nodes_b.Count); + stack_a.Push(a); + stack_b.Push(b); + if ( a == b ) { + identity = true; + return true; + } + identity = false; + return false; + } + + public Status CurrentStatus + { + get { return new Status(stack_a.Count); } + set + { + var count = value.count; + while ( stack_a.Count > count ) { + var a = stack_a.Pop(); + nodes_a.Remove(a); + var b = stack_b.Pop(); + nodes_b.Remove(b); + } + } + } + } + + /// + /// Returns true if is of same type as the and + /// its content is also logically same. + /// + /// Node to be compared. + /// Node repository holds the nodes that already appeared and + /// the corresponding node in the other node tree. + /// true if they are equal to each other. + internal abstract bool Equals(YamlNode b, ObjectRepository repository); + /// + /// Returns true if is of same type as the and + /// its Tag is same as the node. It returns true for if they + /// both already appeared in the node trees and were compared. + /// + /// Node to be compared. + /// Node repository holds the nodes that already appeared and + /// the corresponding node in the other node tree. + /// true if they already appeared in the node tree and were compared. + /// true if they are equal to each other. + internal bool EqualsSub(YamlNode b, ObjectRepository repository, out bool skip) + { + YamlNode a = this; + bool identity; + if ( repository.AlreadyAppeared(a, b, out identity) ) { + skip = true; + return identity; + } + skip = false; + if ( a.GetType() != b.GetType() || a.Tag != b.Tag ) + return false; + return true; + } + + /// + /// Returns a that represents the current . + /// + /// A that represents the current + public override string ToString() + { + var length = 1024; + return ToString(ref length); + } + internal abstract string ToString(ref int length); + + #region ToYaml + /// + /// Convert to a YAML text. + /// + /// YAML stream. + public string ToYaml() + { + return ToYaml(DefaultConfig); + } + /// + /// Convert to a YAML text. + /// + /// YAML stream. + /// YAML configuration to customize serialization. + public string ToYaml(YamlConfig config) + { + return DefaultPresenter.ToYaml(this, config); + } + /// + /// Convert to a YAML text and save it to . + /// + /// to output. + public void ToYaml(Stream s) + { + ToYaml(s, DefaultConfig); + } + /// + /// Convert to a YAML text and save it to . + /// + /// to output. + /// YAML configuration to customize serialization. + public void ToYaml(Stream s, YamlConfig config) + { + DefaultPresenter.ToYaml(s, this, config); + } + /// + /// Convert to a YAML text and save it to . + /// + /// to output. + public void ToYaml(TextWriter tw) + { + ToYaml(tw, DefaultConfig); + } + /// + /// Convert to a YAML text and save it to . + /// + /// to output. + /// YAML configuration to customize serialization. + public void ToYaml(TextWriter tw, YamlConfig config) + { + DefaultPresenter.ToYaml(tw, this, config); + } + /// + /// Convert to a YAML text and save it to the file. + /// + /// Name of the file to output + public void ToYamlFile(string FileName) + { + ToYamlFile(FileName, DefaultConfig); + } + /// + /// Convert to a YAML text and save it to the file. + /// + /// Name of the file to output + /// YAML configuration to customize serialization. + public void ToYamlFile(string FileName, YamlConfig config) + { + using ( var s = new FileStream(FileName, FileMode.Create) ) + DefaultPresenter.ToYaml(s, this, config); + } + #endregion + + #region static members + + /// + /// Gets YAML's default tag prefix. + /// + /// "tag:yaml.org,2002:" + public static string DefaultTagPrefix { get; private set; } + /// + /// Gets or sets the default configuration to customize serialization of . + /// + public static YamlConfig DefaultConfig { get; set; } + internal static YamlParser DefaultParser { get; set; } + internal static YamlPresenter DefaultPresenter { get; set; } + + static YamlNode() + { + // Initializing order matters ! + DefaultTagPrefix = "tag:yaml.org,2002:"; + DefaultConfig = new YamlConfig(); + DefaultParser = new YamlParser(); + DefaultPresenter = new YamlPresenter(); + } + + /// + /// Convert YAML text to a list of . + /// + /// YAML text + /// YAML nodes + public static YamlNode[] FromYaml(string yaml) + { + return DefaultParser.Parse(yaml).ToArray(); + } + /// + /// Convert YAML text to a list of . + /// + /// YAML text + /// YAML nodes + /// YAML configuration to customize serialization. + public static YamlNode[] FromYaml(string yaml, YamlConfig config) + { + return DefaultParser.Parse(yaml, config).ToArray(); + } + /// + /// Convert YAML text to a list of . + /// + /// from which YAML document is read. + /// YAML nodes + public static YamlNode[] FromYaml(Stream s) + { + using ( var sr = new StreamReader(s) ) + return FromYaml(sr); + } + /// + /// Convert YAML text to a list of . + /// + /// from which YAML document is read. + /// YAML nodes + /// YAML configuration to customize serialization. + public static YamlNode[] FromYaml(Stream s, YamlConfig config) + { + using ( var sr = new StreamReader(s) ) + return FromYaml(sr, config); + } + /// + /// Convert YAML text to a list of . + /// + /// from which YAML document is read. + /// YAML nodes + public static YamlNode[] FromYaml(TextReader tr) + { + var yaml = tr.ReadToEnd(); + return FromYaml(yaml); + } + /// + /// Convert YAML text to a list of . + /// + /// from which YAML document is read. + /// YAML nodes + /// YAML configuration to customize serialization. + public static YamlNode[] FromYaml(TextReader tr, YamlConfig config) + { + var yaml = tr.ReadToEnd(); + return FromYaml(yaml, config); + } + /// + /// Convert YAML text to a list of . + /// + /// YAML File Name + /// YAML nodes + public static YamlNode[] FromYamlFile(string FileName) + { + using ( var s = new FileStream(FileName, FileMode.Open) ) + return FromYaml(s); + } + /// + /// Convert YAML text to a list of . + /// + /// YAML File Name + /// YAML nodes + /// YAML configuration to customize serialization. + public static YamlNode[] FromYamlFile(string FileName, YamlConfig config) + { + using ( var s = new FileStream(FileName, FileMode.Open) ) + return FromYaml(s, config); + } + + /// + /// Implicit conversion from string to . + /// + /// Value to be converted. + /// Conversion result. + public static implicit operator YamlNode(string value) + { + return new YamlScalar(value); + } + /// + /// Implicit conversion from string to . + /// + /// Value to be converted. + /// Conversion result. + public static implicit operator YamlNode(int value) + { + return new YamlScalar("!!int", YamlNode.DefaultConfig.TypeConverter.ConvertToString(value)); + } + /// + /// Implicit conversion from string to . + /// + /// Value to be converted. + /// Conversion result. + public static implicit operator YamlNode(double value) + { + return new YamlScalar("!!float", YamlNode.DefaultConfig.TypeConverter.ConvertToString(value)); + } + /// + /// Implicit conversion from string to . + /// + /// Value to be converted. + /// Conversion result. + public static implicit operator YamlNode(bool value) + { + return new YamlScalar("!!bool", YamlNode.DefaultConfig.TypeConverter.ConvertToString(value)); + } + /// + /// Implicit conversion from to . + /// + /// Value to be converted. + /// Conversion result. + public static implicit operator YamlNode(DateTime value) + { + YamlScalar node; + DefaultConfig.TagResolver.Encode(value, out node); + return node; + } + + /// + /// Convert shorthand tag starting with "!!" to the formal style that starts with "tag:yaml.org,2002:". + /// + /// + /// When starts with "!!", it is converted into formal style. + /// Otherwise, is returned as is. + /// + /// + /// + /// var tag = YamlNode.DefaultTagPrefix + "int"; // -> "tag:yaml.org,2002:int" + /// tag = YamlNode.ShorthandTag(tag); // -> "!!int" + /// tag = YamlNode.ExpandTag(tag); // -> "tag:yaml.org,2002:int" + /// + /// + /// Tag in the shorthand style. + /// Tag in formal style. + public static string ExpandTag(string tag) + { + if ( tag.StartsWith("!!") ) + return DefaultTagPrefix + tag.Substring(2); + return tag; + } + + /// + /// Convert a formal style tag that starts with "tag:yaml.org,2002:" to + /// the shorthand style that starts with "!!". + /// + /// + /// When contains YAML standard types, it is converted into !!xxx style. + /// Otherwise, is returned as is. + /// + /// + /// + /// var tag = YamlNode.DefaultTagPrefix + "int"; // -> "tag:yaml.org,2002:int" + /// tag = YamlNode.ShorthandTag(tag); // -> "!!int" + /// tag = YamlNode.ExpandTag(tag); // -> "tag:yaml.org,2002:int" + /// + /// + /// Tag in formal style. + /// Tag in compact style. + public static string ShorthandTag(string tag) + { + if ( tag != null && tag.StartsWith(DefaultTagPrefix) ) + return "!!" + tag.Substring(DefaultTagPrefix.Length); + return tag; + } + + #endregion + } + + /// + /// Represents a scalar node in a YAML document. + /// + /// + /// + /// var string_node = new YamlNode("abc"); + /// Assert.AreEqual("!!str", string_node.ShorthandTag()); + /// + /// var int_node1= new YamlNode(YamlNode.DefaultTagPrefix + "int", "1"); + /// Assert.AreEqual("!!int", int_node1.ShorthandTag()); + /// + /// // shorthand tag style can be specified + /// var int_node2= new YamlNode("!!int", "1"); + /// Assert.AreEqual(YamlNode.DefaultTagPrefix + "int", int_node1.Tag); + /// Assert.AreEqual("!!int", int_node1.ShorthandTag()); + /// + /// // or use implicit conversion + /// YamlNode int_node3 = 1; + /// + /// // YamlNodes Equals to another node when their values are equal. + /// Assert.AreEqual(int_node1, int_node2); + /// + /// // Of course, they are different if compaired by references. + /// Assert.IsTrue(int_node1 != int_node2); + /// + /// + public class YamlScalar: YamlNode + { + /// + /// String expression of the node value. + /// + public string Value + { + get { return value; } + set { this.value = value; OnChanged(); } + } + string value; + + #region constructors + /// + /// Create empty string node. + /// + public YamlScalar() { Tag = ExpandTag("!!str"); Value = ""; } + /// + /// Initialize string node that has as its content. + /// + /// Value of the node. + public YamlScalar(string value) { Tag = ExpandTag("!!str"); Value = value; } + /// + /// Create a scalar node with arbitral tag. + /// + /// Tag to the node. + /// Value of the node. + public YamlScalar(string tag, string value) { Tag = ExpandTag(tag); Value = value; } + /// + /// Initialize an integer node that has as its content. + /// + public YamlScalar(int value) + { + Tag = ExpandTag("!!int"); + Value = YamlNode.DefaultConfig.TypeConverter.ConvertToString(value); + } + /// + /// Initialize a float node that has as its content. + /// + public YamlScalar(double value) + { + Tag = ExpandTag("!!float"); + Value = YamlNode.DefaultConfig.TypeConverter.ConvertToString(value); + } + /// + /// Initialize a bool node that has as its content. + /// + public YamlScalar(bool value) + { + Tag = ExpandTag("!!bool"); + Value = YamlNode.DefaultConfig.TypeConverter.ConvertToString(value); + } + /// + /// Initialize a timestamp node that has as its content. + /// + public YamlScalar(DateTime value) + { + YamlScalar node = value; + Tag = node.Tag; + Value = node.Value; + } + + /// + /// Implicit conversion from string to . + /// + /// Value to be converted. + /// Conversion result. + public static implicit operator YamlScalar(string value) + { + return new YamlScalar(value); + } + /// + /// Implicit conversion from string to . + /// + /// Value to be converted. + /// Conversion result. + public static implicit operator YamlScalar(int value) + { + return new YamlScalar(value); + } + /// + /// Implicit conversion from string to . + /// + /// Value to be converted. + /// Conversion result. + public static implicit operator YamlScalar(double value) + { + return new YamlScalar(value); + } + /// + /// Implicit conversion from string to . + /// + /// Value to be converted. + /// Conversion result. + public static implicit operator YamlScalar(bool value) + { + return new YamlScalar(value); + } + /// + /// Implicit conversion from to . + /// + /// Value to be converted. + /// Conversion result. + public static implicit operator YamlScalar(DateTime value) + { + YamlScalar node; + DefaultConfig.TagResolver.Encode(value, out node); + return node; + } + #endregion + + /// + /// Call this function when the content of the node is changed. + /// + protected override void OnChanged() + { + base.OnChanged(); + UpdateNativeObject(); + } + + void UpdateNativeObject() + { + object value; + if ( NativeObjectAvailable = DefaultConfig.TagResolver.Decode(this, out value) ) { + NativeObject = value; + } else { + if ( ( ShorthandTag() == "!!float" ) && ( Value != null ) && new Regex(@"0|[1-9][0-9]*").IsMatch(Value) ) { + NativeObject = Convert.ToDouble(Value); + NativeObjectAvailable = true; + } + } + } + /// + /// When the node has YAML's standard scalar type, the native object corresponding to + /// it can be got from this property. To see if this property contains a valid data, + /// refer to . + /// + /// This property is not available. See . + /// + /// This property is available when . contains + /// an entry for the nodes tag and defines how to decode the property into native objects. + /// When this property is available, equality of the scalar node is evaluated by comparing the + /// properties by the language default equality operator. + /// + [Yaml.Serialization.YamlSerialize(System.Yaml.Serialization.YamlSerializeMethod.Never)] + public object NativeObject { + get + { + if ( !NativeObjectAvailable ) + throw new InvalidOperationException("NativeObject is not available."); + return nativeObject; + } + private set + { + nativeObject = value; + } + } + object nativeObject; + /// + /// Gets if contains a valid content. + /// + public bool NativeObjectAvailable { get; private set; } + + internal override bool Equals(YamlNode b, ObjectRepository repository) + { + bool skip; + if(! base.EqualsSub(b, repository, out skip) ) + return false; + if(skip) + return true; + YamlScalar aa = this; + YamlScalar bb = (YamlScalar)b; + if ( NativeObjectAvailable ) { + return bb.NativeObjectAvailable && + (aa.NativeObject == null ? + bb.NativeObject==null : + aa.NativeObject.Equals(bb.NativeObject) ); + } else { + if ( ShorthandTag() == "!!str" ) { + return aa.Value == bb.Value; + } else { + // Node with non standard tag is compared by its identity. + return false; + } + } + } + /// + /// Returns the hash code. + /// The returned value will be cached until is called. + /// + /// Hash code + protected override int GetHashCodeCore() + { + if ( NativeObjectAvailable ) { + if ( NativeObject == null ) { + return 0; + } else { + return NativeObject.GetHashCode(); + } + } else { + if ( ShorthandTag() == "!!str" ) { + return ( Value.GetHashCode() * 193 ) ^ Tag.GetHashCode(); + } else { + return TypeUtils.HashCodeByRef.GetHashCode(this); + } + } + } + + internal override string ToString(ref int length) + { + var tag= ShorthandTag() == "!!str" ? "" : ShorthandTag() + " "; + length -= tag.Length + 1; + if ( length <= 0 ) + return tag + "\"" + "..."; + if ( Value.Length > length ) + return tag + "\"" + Value.Substring(0, length) + "..."; + length -= Value.Length + 1; + return tag + "\"" + Value + "\""; + } + } + + /// + /// Abstract base class of that have child nodes. + /// + /// and inherites from this class. + /// + public abstract class YamlComplexNode: YamlNode + { + /// + /// Calculate hash code from property and all child nodes. + /// The result is cached. + /// + /// Hash value for the object. + protected override int GetHashCodeCore() + { + return GetHashCodeCoreSub(0, + new Dictionary( + TypeUtils.EqualityComparerByRef.Default)); + } + + /// + /// Calculates the hash code for a collection object. This function is called recursively + /// on the child objects with the sub cache code repository for the nodes already appeared + /// in the node tree. + /// + /// The cache code for the path where this node was found. + /// Repository of the nodes that already appeared in the node tree. + /// Sub hash code for the nodes can be refered to from this dictionary. + /// + protected abstract int GetHashCodeCoreSub(int path, Dictionary dict); + } + + /// + /// Represents a mapping node in a YAML document. + /// Use IDictionary<YamlNode,YamlNode> interface to + /// manipulate child key/value pairs. + /// + /// + /// Child items can be accessed via IDictionary<YamlNode, YamlNode> interface. + /// + /// Note that mapping object can not contain multiple keys with same value. + /// + /// + /// + /// // Create a mapping. + /// var map1 = new YamlMapping( + /// // (key, value) pairs should be written sequential + /// new YamlScalar("key1"), new YamlScalar("value1"), + /// "key2", "value2" // implicitely converted to YamlScalar + /// ); + /// + /// // Refer to the mapping. + /// Assert.AreEqual( map1[new Scalar("key1")], new YamlScalar("value1") ); + /// Assert.AreEqual( map1["key1"], "value1" ); + /// + /// // Add an entry. + /// map1.Add( "key3", new YamlSequence( "value3a", "value3b" ) ); + /// + /// // Create another mapping. + /// var map2 = new YamlMapping( + /// "key1", "value1", + /// "key2", "value2", + /// "key3", new YamlSequence( "value3a", "value3b" ) + /// ); + /// + /// // Mappings are equal when they have objects that are equal to each other. + /// Assert.IsTrue( map1.Equals( map2 ) ); + /// + /// + public class YamlMapping: YamlComplexNode, IDictionary + { + RehashableDictionary mapping = + new RehashableDictionary(); + + /// + /// Calculates the hash code for a collection object. This function is called recursively + /// on the child objects with the sub cache code repository for the nodes already appeared + /// in the node tree. + /// + /// The cache code for the path where this node was found. + /// Repository of the nodes that already appeared in the node tree. + /// Sub hash code for the nodes can be refered to from this dictionary. + /// + protected override int GetHashCodeCoreSub(int path, Dictionary dict) + { + if ( dict.ContainsKey(this) ) + return dict[this].GetHashCode() * 27 + path; + dict.Add(this, path); + + // Unless !!map, the hash code is based on the node's identity. + if ( ShorthandTag() != "!!map" ) + return TypeUtils.HashCodeByRef.GetHashCode(this); + + var result = Tag.GetHashCode(); + foreach ( var item in this ) { + int hash_for_key; + if ( item.Key is YamlComplexNode ) { + hash_for_key = GetHashCodeCoreSub(path * 317, dict); + } else { + hash_for_key = item.Key.GetHashCode(); + } + result += hash_for_key * 971; + if ( item.Value is YamlComplexNode ) { + result += GetHashCodeCoreSub(path * 317 + hash_for_key * 151, dict); + } else { + result += item.Value.GetHashCode() ^ hash_for_key; + } + } + return result; + } + + internal override bool Equals(YamlNode b, ObjectRepository repository) + { + YamlNode a = this; + + bool skip; + if ( !base.EqualsSub(b, repository, out skip) ) + return false; + if ( skip ) + return true; + + // Unless !!map, the hash equality is evaluated by the node's identity. + if ( ShorthandTag() != "!!map" ) + return false; + + var aa = this; + var bb = (YamlMapping)b; + if ( aa.Count != bb.Count ) + return false; + + var status= repository.CurrentStatus; + foreach ( var item in this ) { + var candidates = bb.ItemsFromHashCode(item.Key.GetHashCode()); + KeyValuePair theone = new KeyValuePair(); + if ( !candidates.Any(subitem => { + if ( item.Key.Equals(subitem.Key, repository) ) { + theone = subitem; + return true; + } + repository.CurrentStatus = status; + return false; + }) ) + return false; + if(!item.Value.Equals(theone.Value, repository)) + return false; + } + return true; + } + + internal ICollection> ItemsFromHashCode(int key_hash) + { + return mapping.ItemsFromHash(key_hash); + } + + /// + /// Create a YamlMapping that contains in it. + /// + /// + /// + /// // Create a mapping. + /// var map1 = new YamlMapping( + /// // (key, value) pairs should be written sequential + /// new YamlScalar("key1"), new YamlScalar("value1"), + /// new YamlScalar("key2"), new YamlScalar("value2") + /// ); + /// + /// + /// Even number of arguments are expected. + /// (key, value) pairs are written sequential. + public YamlMapping(params YamlNode[] nodes) + { + mapping.Added += ChildAdded; + mapping.Removed += ChildRemoved; + if ( nodes.Length / 2 != nodes.Length / 2.0 ) + throw new ArgumentException("Even number of arguments are expected."); + Tag = DefaultTagPrefix + "map"; + for ( int i = 0; i < nodes.Length; i += 2 ) + Add(nodes[i + 0], nodes[i + 1]); + } + + void CheckDuplicatedKeys() + { + foreach ( var entry in this ) + CheckDuplicatedKeys(entry.Key); + } + + void CheckDuplicatedKeys(YamlNode key) + { + foreach(var k in mapping.ItemsFromHash(key.GetHashCode())) + if( ( k.Key != key ) && k.Key.Equals(key) ) + throw new InvalidOperationException("Duplicated key found."); + } + + void ChildRemoved(object sender, RehashableDictionary.DictionaryEventArgs e) + { + e.Key.Changed -= KeyChanged; + e.Value.Changed -= ChildChanged; + OnChanged(); + CheckDuplicatedKeys(); + } + + void ChildAdded(object sender, RehashableDictionary.DictionaryEventArgs e) + { + e.Key.Changed += KeyChanged; + e.Value.Changed += ChildChanged; + OnChanged(); + CheckDuplicatedKeys(); + } + + void KeyChanged(object sender, EventArgs e) + { + ChildChanged(sender, e); + CheckDuplicatedKeys((YamlNode)sender); + } + + void ChildChanged(object sender, EventArgs e) + { + OnChanged(); + } + + internal override void OnLoaded() + { + base.OnLoaded(); + ProcessMergeKey(); + } + void ProcessMergeKey() + { + // find merge key + var merge_key = Keys.FirstOrDefault(key => key.Tag == YamlNode.ExpandTag("!!merge")); + if ( merge_key == null ) + return; + + // merge the value + var value = this[merge_key]; + if ( value is YamlMapping ) { + Remove(merge_key); + Merge((YamlMapping)value); + } else + if ( value is YamlSequence ) { + Remove(merge_key); + foreach ( var item in (YamlSequence)value ) + if ( item is YamlMapping ) + Merge((YamlMapping)item); + } else { + // ** ignore + // throw new InvalidOperationException( + // "Can't merge the value into a mapping: " + value.ToString()); + } + } + void Merge(YamlMapping map) + { + foreach ( var entry in map ) + if ( !ContainsKey(entry.Key) ) + Add(entry.Key, entry.Value); + } + + /// + /// Enumerate child nodes. + /// + /// Inumerator that iterates child nodes + internal override string ToString(ref int length) + { + var s = ""; + var t = ( ShorthandTag() == "!!map" ? "" : ShorthandTag() + " " ); + length -= t.Length + 2; + if ( length < 0 ) + return "{" + t + "..."; + foreach ( var entry in this ) { + if ( s != "" ) { + s += ", "; + length -= 2; + } + s += entry.Key.ToString(ref length); + if ( length < 0 ) + return "{" + t + s; + s += ": "; + length -= 2; + s += entry.Value.ToString(ref length); + if ( length < 0 ) + return "{" + t + s; + } + return "{" + t + s + "}"; + } + + #region IDictionary members + + /// + /// Adds an element with the provided key and value. + /// + /// or is a null reference. + /// An element with the same key already exists. + /// The node to use as the key of the element to add. + /// The node to use as the value of the element to add. + public void Add(YamlNode key, YamlNode value) + { + if ( key == null || value == null ) + throw new ArgumentNullException("Key and value must be a valid YamlNode."); + mapping.Add(key, value); + } + + /// + /// Determines whether the contains an element with the specified key. + /// + /// The key to locate in the . + /// is a null reference + /// true if the contains an element with the key that is equal to the specified value; otherwise, false. + public bool ContainsKey(YamlNode key) + { + return mapping.ContainsKey(key); + } + /// + /// Gets an ICollection<YamlNode> containing the keys of the . + /// + public ICollection Keys + { + get { return mapping.Keys; } + } + /// + /// Removes the element with the specified key from the . + /// + /// The key of the element to remove. + /// true if the element is successfully removed; otherwise, false. This method also returns false if key was not found in the original . + public bool Remove(YamlNode key) + { + return mapping.Remove(key); + } + /// + /// Gets the value associated with the specified key. + /// + /// The key whose value to get. + /// When this method returns, the value associated with the specified key, if the key is found; + /// otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized. + /// true if the object that implements contains an element with the specified key; otherwise, false. + public bool TryGetValue(YamlNode key, out YamlNode value) + { + return mapping.TryGetValue(key, out value); + } + /// + /// Gets an ICollection<YamlNode> containing the values of the . + /// + public ICollection Values + { + get { return mapping.Values; } + } + /// + /// Gets or sets the element with the specified key. + /// + /// The key of the element to get or set. + /// The element with the specified key. + /// key is a null reference + /// The property is retrieved and key is not found. + public YamlNode this[YamlNode key] + { + get { return mapping[key]; } + set { mapping[key] = value; } + } + #region ICollection> members + void ICollection>.Add(KeyValuePair item) + { + ( (ICollection>)mapping ).Add(item); + } + /// + /// Removes all entries from the . + /// + public void Clear() + { + mapping.Clear(); + } + /// + /// Determines whether the contains a specific value. + /// + /// The object to locate in the . + /// true if item is found in the otherwise, false. + public bool Contains(KeyValuePair item) + { + return ( (ICollection>)mapping ).Contains(item); + } + void ICollection>.CopyTo(KeyValuePair[] array, int arrayIndex) + { + ( (ICollection>)mapping ).CopyTo(array, arrayIndex); + } + /// + /// Returns the number of entries in a . + /// + public int Count + { + get { return mapping.Count; } + } + bool ICollection>.IsReadOnly + { + get { return false; } + } + bool ICollection>.Remove(KeyValuePair item) + { + return ( (ICollection>)mapping ).Remove(item); + } + #endregion + #region IEnumerable> members + /// + /// Returns an enumerator that iterates through the . + /// + /// An enumerator that iterates through the . + public IEnumerator> GetEnumerator() + { + return mapping.GetEnumerator(); + } + #endregion + #region IEnumerable members + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return mapping.GetEnumerator(); + } + #endregion + #endregion + } + + /// + /// Represents a sequence node in a YAML document. + /// Use IList<YamlNode> interface + /// to manipulate child nodes. + /// + public class YamlSequence: YamlComplexNode, IList, IDisposable + { + /// + /// Create a sequence node that has as its child. + /// + /// Child nodes of the sequence. + public YamlSequence(params YamlNode[] nodes) + { + Tag = DefaultTagPrefix + "seq"; + for ( int i = 0; i < nodes.Length; i++ ) + Add(nodes[i]); + } + + /// + /// Performs application-defined tasks associated with freeing, releasing, or + /// resetting unmanaged resources. + /// + public void Dispose() + { + Clear(); + } + + /// + /// Calculates the hash code for a collection object. This function is called recursively + /// on the child objects with the sub cache code repository for the nodes already appeared + /// in the node tree. + /// + /// The cache code for the path where this node was found. + /// Repository of the nodes that already appeared in the node tree. + /// Sub hash code for the nodes can be refered to from this dictionary. + /// + protected override int GetHashCodeCoreSub(int path, Dictionary dict) + { + if ( dict.ContainsKey(this) ) + return dict[this].GetHashCode() * 27 + path; + dict.Add(this, path); + + // Unless !!seq, the hash code is based on the node's identity. + if ( ShorthandTag() != "!!seq" ) + return TypeUtils.HashCodeByRef.GetHashCode(this); + + var result = Tag.GetHashCode(); + for ( int i=0; i members + List sequence = new List(); + /// + /// Determines the index of a specific child node in the . + /// + /// + /// If an node appears multiple times in the sequence, the IndexOf method always returns the first instance found. + /// + /// The child node to locate in the . + /// The index of if found in the sequence; otherwise, -1. + public int IndexOf(YamlNode item) + { + return sequence.IndexOf(item); + } + /// + /// Inserts an item to the at the specified . + /// + /// The zero-based index at which should be inserted. + /// The node to insert into the . + /// is not a valid index in the + /// . + /// + /// If equals the number of items in the , + /// then is appended to the sequence. + /// The nodes that follow the insertion point move down to accommodate the new node. + /// + public void Insert(int index, YamlNode item) + { + sequence.Insert(index, item); + OnItemAdded(item); + } + /// + /// Removes the item at the specified index. + /// + /// The zero-based index of the node to remove. + /// is not a valid index in the . + /// + /// The nodes that follow the removed node move up to occupy the vacated spot. + /// + public void RemoveAt(int index) + { + var item = sequence[index]; + sequence.RemoveAt(index); + OnItemRemoved(item); + } + /// + /// Gets or sets the node at the specified index. + /// + /// The zero-based index of the node to get or set. + /// The node at the specified index. + /// is not a valid index in the ). + /// + /// This property provides the ability to access a specific node in the sequence by using the following syntax: mySequence[index]. + /// + public YamlNode this[int index] + { + get { return sequence[index]; } + set { + if ( index < sequence.Count ) { + var item = sequence[index]; + sequence[index] = value; + OnItemRemoved(item); + } else { + sequence[index] = value; + } + OnItemAdded(value); + } + } + /// + /// Adds an item to the . + /// + /// The node to add to the . + public void Add(YamlNode item) + { + sequence.Add(item); + OnItemAdded(item); + } + /// + /// Removes all nodes from the . + /// + public void Clear() + { + var old = sequence; + sequence = new List(); + foreach ( var item in old ) + OnItemRemoved(item); + } + /// + /// Determines whether a sequence contains a child node that equals to the specified + /// by using the default equality comparer. + /// + /// The node value to locate in the sequence. + /// true If the sequence contains an node that has the specified value; otherwise, false. + /// + /// + /// var seq = new YamlSequence(new YamlScalar("a")); + /// + /// // different object that has same value + /// Assert.IsTrue(seq.Contains(new YamlScalar("a"))); + /// + /// // different value + /// Assert.IsFalse(s.Contains(str("b"))); + /// + /// + public bool Contains(YamlNode value) + { + return sequence.Contains(value); + } + /// + /// Copies the child nodes of the to an , starting at a particular index. + /// + /// The one-dimensional that is the destination of the elements copied from . + /// The zero-based index in at which copying begins. + /// is a null reference. + /// is less than 0. + /// + /// array is multidimensional. + /// -or- + /// The number of elements in the source is greater than the available space from + /// to the end of the destination array. + /// + public void CopyTo(YamlNode[] array, int arrayIndex) + { + sequence.CopyTo(array, arrayIndex); + } + /// + /// Gets the number of child nodes of the . + /// + /// The number of child nodes of the sequence. + public int Count + { + get { return sequence.Count; } + } + bool ICollection.IsReadOnly + { + get { return ( (ICollection)sequence ).IsReadOnly; } + } + /// + /// Removes the first occurrence of a specific node from the . + /// + /// The node to remove from the . + /// true if was successfully removed from the ; otherwise, false. + /// This method also returns false if is not found in the original . + /// + public bool Remove(YamlNode node) + { + var i = sequence.FindIndex(item => item.Equals(node)); + if ( i < 0 ) + return false; + var item2 = sequence[i]; + sequence.RemoveAt(i); + OnItemRemoved(item2); + return true; + } + /// + /// Returns an enumerator that iterates through the all child nodes. + /// + /// An enumerator that iterates through the all child nodes. + public IEnumerator GetEnumerator() + { + return sequence.GetEnumerator(); + } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return ( (System.Collections.IEnumerable)sequence ).GetEnumerator(); + } + #endregion + } + + /// + /// Implements utility functions to instantiating YamlNode's + /// + /// + /// + /// var node_tree = seq( + /// str("abc"), + /// str("def"), + /// map( + /// str("key"), str("value"), + /// str("key2"), seq( str("value2a"), str("value2b") ) + /// ), + /// str("2"), // !!str + /// str("!!int", "2") + /// ); + /// + /// string yaml = node_tree.ToYaml(); + /// + /// // %YAML 1.2 + /// // --- + /// // - abc + /// // - def + /// // - key: value + /// // key2: [ value2a, value2b ] + /// // - "2" # !!str + /// // - 2 # !!int + /// // ... + /// + /// + public class YamlNodeManipulator + { + /// + /// Create a scalar node. Tag is set to be "!!str". + /// + /// + /// + /// var node_tree = seq( + /// str("abc"), + /// str("def"), + /// map( + /// str("key"), str("value"), + /// str("key2"), seq( str("value2a"), str("value2b") ) + /// ), + /// str("2"), // !!str + /// str("!!int", "2") + /// ); + /// + /// string yaml = node_tree.ToYaml(); + /// + /// // %YAML 1.2 + /// // --- + /// // - abc + /// // - def + /// // - key: value + /// // key2: [ value2a, value2b ] + /// // - "2" # !!str + /// // - 2 # !!int + /// // ... + /// + /// + /// Value for the scalar node. + /// Created scalar node. + protected static YamlScalar str(string value) + { + return new YamlScalar(value); + } + /// + /// Create a scalar node. + /// + /// Tag for the scalar node. + /// Value for the scalar node. + /// Created scalar node. + protected static YamlScalar str(string tag, string value) + { + return new YamlScalar(tag, value); + } + /// + /// Create a sequence node. Tag is set to be "!!seq". + /// + /// Child nodes. + /// Created sequence node. + protected static YamlSequence seq(params YamlNode[] nodes) + { + return new YamlSequence(nodes); + } + /// + /// Create a sequence node. + /// + /// Child nodes. + /// Tag for the seuqnce. + /// Created sequence node. + protected static YamlSequence seq_tag(string tag, params YamlNode[] nodes) + { + var result= new YamlSequence(nodes); + result.Tag= tag; + return result; + } + /// + /// Create a mapping node. Tag is set to be "!!map". + /// + /// Sequential list of key/value pairs. + /// Created mapping node. + protected static YamlMapping map(params YamlNode[] nodes) + { + return new YamlMapping(nodes); + } + /// + /// Create a mapping node. + /// + /// Sequential list of key/value pairs. + /// Tag for the mapping. + /// Created mapping node. + protected static YamlMapping map_tag(string tag, params YamlNode[] nodes) + { + var map = new YamlMapping(nodes); + map.Tag = tag; + return map; + } + } +} diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/YamlParser.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/YamlParser.cs new file mode 100644 index 0000000..10ec2ea --- /dev/null +++ b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/YamlParser.cs @@ -0,0 +1,2116 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +using System.Text.RegularExpressions; +using System.Diagnostics; + +namespace System.Yaml +{ + /// + /// A text parser for
+ /// YAML Ain’t Markup Language (YAML™) Version 1.2
+ /// 3rd Edition (2009-07-21)
+ /// http://yaml.org/spec/1.2/spec.html
+ /// + /// This class parse a YAML document and compose representing graph. + ///
+ /// + /// + /// string yaml = LoadYamlSource(); + /// YamlParser parser = new YamlParser(); + /// Node[] result = null; + /// try { + /// result = parser.Parse(yaml); + /// ... + /// // you can reuse parser as many times you want + /// ... + /// + /// } catch( ParseErrorException e ) { + /// MessageBox.Show(e.Message); + /// } + /// if(result != null) { + /// ... + /// + /// } + /// + /// + /// + /// Currently, this parser violates the YAML 1.2 specification in the following points. + /// - line breaks are not normalized. + /// - omission of the final line break is allowed in plain / literal / folded text. + /// - ':' followed by ns-indicator is excluded from ns-plain-char. + /// + internal class YamlParser: Parser + { + /// + /// Initialize a YAML parser. + /// + public YamlParser() + { + Anchors = new AnchorDictionary(Error); + + TagPrefixes = new YamlTagPrefixes(Error); + + Warnings = new List(); + } + + YamlConfig config; + List ParseResult = new List(); + /// + /// Parse YAML text and returns a list of . + /// + /// YAML text to be parsed. + /// A list of parsed from the given text + public List Parse(string yaml) + { + return Parse(yaml, YamlNode.DefaultConfig); + } + /// + /// Parse YAML text and returns a list of . + /// + /// YAML text to be parsed. + /// YAML Configuration to be used in parsing. + /// A list of parsed from the given text + public List Parse(string yaml, YamlConfig config) + { + this.config = config; + Warnings.Clear(); + ParseResult.Clear(); + AlreadyWarnedChars.Clear(); + if ( base.Parse(lYamlStream, yaml + "\0") ) // '\0' = guard char + return ParseResult; + return new List(); + } + + internal bool IsValidPlainText(string plain, YamlConfig config) + { + this.config = config; + Warnings.Clear(); + ParseResult.Clear(); + AlreadyWarnedChars.Clear(); + return base.Parse(() => nsPlain(0, Context.BlockKey) && EndOfFile(), plain + "\0"); // '\0' = guard char + } + + #region Warnings + /// + /// Warnings that are made while parsing a YAML text. + /// This property is cleared by new call for method. + /// + public List Warnings { get; private set; } + Dictionary WarningAdded = new Dictionary(); + /// + /// Add message in property. + /// + /// + protected override void StoreWarning(string message) + { + // Warnings will not be rewound. + // We have to avoid same warnings from being repeatedly reported. + if ( !WarningAdded.ContainsKey(message) ) { + Warnings.Add(message); + WarningAdded[message] = true; + } + } + + /// + /// Invoked when unknown directive is found in YAML document. + /// + /// Name of the directive + /// Parameters for the directive + protected virtual void ReservedDirective(string name, params string[] args) + { + Warning("Custom directive %{0} was ignored", name); + } + /// + /// Invoked when YAML directive is found in YAML document. + /// + /// Given version + protected virtual void YamlDirective(string version) + { + if ( version != "1.2" ) + Warning("YAML version %{0} was specified but ignored", version); + } + Dictionary AlreadyWarnedChars = new Dictionary(); + void WarnIfCharWasBreakInYAML1_1() + { + if ( Charsets.nbCharWithWarning(text[p]) && !AlreadyWarnedChars.ContainsKey(text[p]) ) { + Warning("{0} is treated as non-break character unlike YAML 1.1", + text[p] < 0x100 ? string.Format("\\x{0:x2}", (int)text[p]) : + string.Format("\\u{0:x4}", (int)text[p]) + ); + AlreadyWarnedChars.Add(text[p], true); + } + } + #endregion + + #region Debug.Assert +#if DEBUG + /// + /// Since System.Diagnostics.Debug.Assert is too anoying while development, + /// this class temporarily override Debug.Assert action. + /// + private class Debug + { + public static void Assert(bool condition) + { + Assert(condition, ""); + } + public static void Assert(bool condition, string message) + { + if ( !condition ) + throw new Exception("assertion failed: " + message); + } + } + #endif + #endregion + + #region Status / Value + /// + /// additional fields to be rewound + /// + public struct State + { + /// + /// tag for the next value (will be cleared when the next value is created) + /// + public string tag; + /// + /// anchor for the next value (will be cleared when the next value is created) + /// + public string anchor; + /// + /// current value + /// + public YamlNode value; + /// + /// anchor rewinding position + /// + public int anchor_depth; + } + + /// + /// rewinding action + /// + protected override void Rewind() + { + Anchors.RewindDeapth = state.anchor_depth; + } + + bool SetValue(YamlNode v) + { + if ( state.value != null && v != null ) + throw new Exception(); + state.value = v; + v.OnLoaded(); + return true; + } + YamlNode GetValue() + { + var v = state.value; + state.value = null; + return v; + } + #endregion + + YamlTagPrefixes TagPrefixes; + + /// + /// set status.tag with tag resolution + /// + /// + /// + /// + private bool SetTag(string tag_handle, string tag_suffix) + { + return SetTag(TagPrefixes.Resolve(tag_handle, tag_suffix)); + } + /// + /// set status.tag with verbatim tag value + /// + /// verbatim tag + /// + private bool SetTag(string verbatim_tag) + { + Debug.Assert(verbatim_tag != ""); + // validate tag + if ( verbatim_tag.StartsWith("!") ) { + if ( verbatim_tag == "!" ) + Error("Empty local tag was found."); + } else { + if ( !TagValidator.IsValid(verbatim_tag) ) + Warning("Invalid global tag name '{0}' (c.f. RFC 4151) found", verbatim_tag); + } + state.tag = verbatim_tag; + return true; + } + YamlTagValidator TagValidator = new YamlTagValidator(); + + AnchorDictionary Anchors; + private void RegisterAnchorFor(YamlNode value) + { + if ( state.anchor != null ) { + Anchors.Add(state.anchor, value); + state.anchor = null; + state.anchor_depth = Anchors.RewindDeapth; + } + } + + /// + /// Used when the parser resolves a tag for a scalar node from its value. + /// + /// New resolution rules can be add before calling method. + /// + private void AutoDetectTag(string from_style) + { + if ( from_style != null ) + from_style = YamlNode.ExpandTag(from_style); + + if ( state.tag != null ) + return; + + if ( from_style == null ) + from_style = config.TagResolver.Resolve(stringValue.ToString()); + + if ( from_style != null ) + state.tag = from_style; + return; + } + private YamlScalar CreateScalar(string auto_detected_tag, Position pos) + { + AutoDetectTag(auto_detected_tag); + if ( state.tag == null || state.tag == "" /* ! was specified */ ) + state.tag = YamlNode.DefaultTagPrefix + "str"; + var value = new YamlScalar(state.tag, stringValue.ToString()); + value.Raw = pos.Raw; + value.Column = pos.Column; + stringValue.Length = 0; + RegisterAnchorFor(value); + state.tag = null; + return value; + } + private YamlSequence CreateSequence(Position pos) + { + if ( state.tag == null || state.tag == "" /* ! was specified */ ) + state.tag = YamlNode.DefaultTagPrefix + "seq"; + var seq = new YamlSequence(); + seq.Tag = state.tag; + seq.Raw = pos.Raw; + seq.Column = pos.Column; + RegisterAnchorFor(seq); + state.tag = null; + return seq; + } + private YamlMapping CreateMapping(Position pos) + { + if ( state.tag == null || state.tag == "" /* ! was specified */ ) + state.tag = YamlNode.DefaultTagPrefix + "map"; + var map = new YamlMapping(); + map.Tag = state.tag; + map.Raw = pos.Raw; + map.Column = pos.Column; + RegisterAnchorFor(map); + state.tag = null; + return map; + } + + #region The BNF syntax for YAML 1.2 + + #region Context + enum Context + { + BlockIn, + BlockOut, + FlowIn, + FlowOut, + BlockKey, + FlowKey, + Folded, + } + #endregion + + #region Chapter 5. Character Set + class Charsets + { + static Charsets() + { + // [1] + cPrintable = Charset(c => + /* ( 0x10000 < c && c < 0x110000 ) || */ + ( 0xe000 <= c && c <= 0xfffd ) || + ( 0xa0 <= c && c <= 0xd7ff ) || + c == 0x85 || + ( 0x20 <= c && c <= 0x7e ) || + c == 0x0d || + c == 0x0a || + c == 0x09 + ); + // [22] + cIndicator = Charset(c => + c < 0x100 && + "-?:,[]{}#&*!|>'\"%@`".Contains(c) + ); + // [23] + cFlowIndicator = Charset(c => + c < 0x100 && + ",[]{}".Contains(c) + ); + nsDecDigit = Charset(c => + c < 0x100 && + ( '0' <= c && c <= '9' ) + ); + nsHexDigit = Charset(c => + c < 0x100 && ( + nsDecDigit(c) || + ( 'A' <= c && c <= 'F' ) || + ( 'a' <= c && c <= 'f' ) + ) + ); + nbChar = Charset(c => + // ( 0x10000 < c && c < 0x110000 ) || + ( 0xe000 <= c && c <= 0xfffd && c != 0xFEFF ) || + ( 0xa0 <= c && c <= 0xd7ff ) || + c == 0x85 || + ( 0x20 <= c && c <= 0x7e ) || + // c == 0x0d || + // c == 0x0a || + c == 0x09 + ); + nbCharWithWarning = Charset(c => + c == 0x2029 || // paragraph separator + c == 0x2028 || // line separator + c == 0x85 || // next line + c == 0x0c // form feed + ); + sSpace = c => c == ' '; + sWhite = c => c == ' ' || c == '\t'; + nsChar = Charset(c => + // nbChar(c) && !sWhite(c) + // ( 0x10000 < c && c < 0x110000 ) || + ( 0xe000 <= c && c <= 0xfffd && c != 0xFEFF ) || + ( 0xa0 <= c && c <= 0xd7ff ) || + c == 0x85 || + ( 0x21 <= c && c <= 0x7e ) + // c == 0x0d || + // c == 0x0a || + // c == 0x09 + ); + nsAsciiLetter = Charset(c => + c < 0x100 && ( + ( 'A' <= c && c <= 'Z' ) || + ( 'a' <= c && c <= 'z' ) + ) + ); + nsWordChar = Charset(c => + c < 0x100 && ( + nsDecDigit(c) || + nsAsciiLetter(c) || + c == '-' + ) + ); + nsUriCharSub = Charset(c => + c < 0x100 && ( + nsWordChar(c) || + @"#;/?:@&=$,_.!~*'()[]".Contains(c) + ) + ); + nsTagCharSub = Charset(c => + c < 0x100 && + nsUriCharSub(c) && !( c == '!' || cFlowIndicator(c) ) + ); + nsAnchorChar = Charset(c => + nsChar(c) && !cFlowIndicator(c) + ); + nsPlainSafeOut = c => nsChar(c); + nsPlainSafeIn = Charset(c => + nsPlainSafeOut(c) && !cFlowIndicator(c) + ); + nsPlainFirstSub = Charset(c => + nsChar(c) && !cIndicator(c) + ); + } + + public static Func cPrintable; // [1] + public static bool nbJson(char c) // [2] + { + return c == 0x09 || ( 0x20 <= c /* && c<=0x10ffff */ ); + } + public static bool cByteOrdermark(char c) // [3] + { + return c == '\uFEFF'; + } + /// + /// [22] + /// + public static Func cIndicator; + /// + /// [23] + /// + public static Func cFlowIndicator; + public static Func nsDecDigit; + public static Func nsHexDigit; + public static Func nsAsciiLetter; + public static Func nsWordChar; + public static Func sSpace; + public static Func sWhite; + public static Func nbChar; + public static Func nbCharWithWarning; + public static Func nsChar; + public static Func nsUriCharSub; + public static Func nsTagCharSub; + public static Func nsAnchorChar; + public static Func nsPlainSafeIn; + public static Func nsPlainSafeOut; + public static Func nsPlainFirstSub; + public static bool bChar(char c) { return c == '\n' || c == '\r'; } + } + + bool nbChar() // [27] + { + WarnIfCharWasBreakInYAML1_1(); + if ( Charsets.nbChar(text[p]) ) { + p++; + return true; + } + return false; + } + bool bBreak() // [28] + { // \r\n? | \n + if ( text[p] == '\r' ) { + p++; + if ( text[p] == '\n' ) + p++; + return true; + } + if ( text[p] == '\n' ) { + p++; + return true; + } + return false; + } + bool bAsLineFeed() // [29] + { + if ( config.NormalizeLineBreaks ) { + if ( bBreak() ) { + stringValue.Append(config.LineBreakForInput); + return true; + } + return false; + } else { + return Save(() => bBreak(), s => stringValue.Append(s)); + } + } + bool bNonContent() // [30] + { + return bBreak(); + } + bool sWhite() // [33] + { + if ( text[p] == ' ' || text[p] == '\t' ) { + p++; + return true; + } + return false; + } + bool Repeat_sWhiteAsString() + { + var start = p; + while ( Charsets.sWhite(text[p]) ) + stringValue.Append(text[p++]); + return true; + } + bool nsChar() // [34] + { + WarnIfCharWasBreakInYAML1_1(); + if ( Charsets.nsChar(text[p]) ) { + p++; + return true; + } + return false; + } + bool nsUriChar() // [39] + { + if ( Charsets.nsUriCharSub(text[p]) ) { + stringValue.Append(text[p++]); + return true; + } + return nsUriEscapedChar(); + } + bool nsUriEscapedChar() + { + if ( text[p] == '+' ) { + stringValue.Append(' '); + p++; + return true; + } + if ( text[p] != '%' ) + return false; + // http://www.cresc.co.jp/tech/java/URLencoding/JavaScript_URLEncoding.htm + int v1 = -1, v2 = -1, v3 = -1, v4 = -1; + ErrorUnless( + text[p] == '%' && HexValue(p + 1, out v1) && + ( v1 < 0x80 || ( text[p + 3] == '%' && HexValue(p + 4, out v2) ) ) && + ( v1 < 0xe0 || ( text[p + 6] == '%' && HexValue(p + 7, out v3) ) ) && + ( v1 < 0xf1 || ( text[p + 9] == '%' && HexValue(p + 10, out v4) ) ), + "Invalid URI escape." + ); + if ( v2 == -1 ) { // 1 byte code + stringValue.Append( + (char)v1 + ); + p += 3; + return true; + } + if ( v3 == -1 ) { + stringValue.Append( + (char)( ( ( v1 & 0x1f ) << 6 ) + ( v2 & 0x7f ) ) + ); + p += 6; + return true; + } + if ( v4 == -1 ) { + stringValue.Append( + (char)( ( ( v1 & 0x0f ) << 12 ) + ( ( v2 & 0x7f ) << 6 ) + ( v3 & 0x7f ) ) + ); + p += 9; + return true; + } + stringValue.Append( + (char)( ( ( v1 & 0x07 ) << 18 ) + ( ( v2 & 0x7f ) << 12 ) + ( ( v3 & 0x7f ) << 6 ) + ( v4 & 0x7f ) ) + ); + p += 12; + return true; + } + bool nsTagChar() // [40] + { + if ( Charsets.nsTagCharSub(text[p]) ) { + stringValue.Append(text[p++]); + return true; + } + return nsUriEscapedChar(); + } + bool c_nsEscChar() // [62] + { + if ( text[p] != '\\' ) + return false; + + char c = '\0'; + int v1 = 0; + int v2 = 0; + int v3 = 0; + int v4 = 0; + switch ( text[p + 1] ) { + case '0': + c = '\0'; + break; + case 'a': + c = '\a'; + break; + case 'b': + c = '\b'; + break; + case 't': + case '\x09': + c = '\t'; + break; + case 'n': + c = '\n'; + break; + case 'v': + c = '\v'; + break; + case 'f': + c = '\f'; + break; + case 'r': + c = '\r'; + break; + case 'e': + c = '\x1b'; + break; + case ' ': + c = ' '; + break; + case '"': + c = '"'; + break; + case '/': + c = '/'; + break; + case '\\': + c = '\\'; + break; + case 'N': + c = '\x85'; + break; + case '_': + c = '\xa0'; + break; + case 'L': + c = '\u2028'; + break; + case 'P': + c = '\u2029'; + break; + case 'x': + if(!HexValue(p + 2, out v1)) + InvalidEscapeSequence(4); + c = (char)v1; + p+=2; + break; + case 'u': + if(!(HexValue(p + 2, out v1) && HexValue(p + 4, out v2))) + InvalidEscapeSequence(6); + c = (char)( ( v1 << 8 ) + v2 ); + p+=4; + break; + case 'U': + if(!(HexValue(p + 2, out v1) && HexValue(p + 4, out v2) && HexValue(p + 6, out v3) && HexValue(p + 8, out v4))) + InvalidEscapeSequence(10); + c = (char)( ( v1 << 24 ) + ( v2 << 16 ) + ( v3 << 8 ) + v4 ); + p += 8; + break; + default: + // escaped line break or error + if ( text[p + 1] != '\n' && text[p + 1] != '\r' ) + InvalidEscapeSequence(2); + return false; + } + p += 2; + stringValue.Append(c); + return true; + } + void InvalidEscapeSequence(int n) + { // n chars from the current point should be reported by not acrossing " nor EOF + var s = ""; + for ( int i = 0; i < n; i++ ) + if ( text[p + i] != '"' && Charsets.nbJson(text[p + i]) ) { + s += text[p + i]; + } else + break; + Error("{0} is not a valid escape sequence.", s); + } + bool HexValue(int p, out int v) + { + v = 0; + if ( text.Length <= p + 1 || !Charsets.nsHexDigit(text[p]) || !Charsets.nsHexDigit(text[p + 1]) ) + return false; + v = ( HexNibble(text[p]) << 4 ) + HexNibble(text[p + 1]); + return true; + } + int HexNibble(char c) + { + if ( c <= '9' ) + return c - '0'; + if ( c < 'Z' ) + return c - 'A' + 10; + return c - 'a' + 10; + } + #endregion + + #region Chapter 6. Basic Structures + #region 6.1 Indentation Spaces + bool TabCharFoundForIndentation = false; + bool sIndent(int n) // [63] + { + TabCharFoundForIndentation = false; + Debug.Assert(StartOfLine() || EndOfFile()); + for ( int i = 0; i < n; i++ ) + if ( text[p + i] != ' ' ) { + if ( text[p + i] == '\t' ) + TabCharFoundForIndentation = true; + return false; + } + p += n; + return true; + } + bool sIndentLT(int n) // [64] + { + Debug.Assert(StartOfLine() || EndOfFile()); + int i = 0; + while ( Charsets.sSpace(text[p + i]) ) + i++; + if ( i < n ) { + p += i; + return true; + } + return false; + } + bool sIndentLE(int n) // [65] + { + return sIndentLT(n + 1); + } + bool sIndentCounted(int n, out int m) // [185, 187] + { + m = 0; + while ( n < 0 || text[p] == ' ' ) { + n++; + p++; + m++; + } + return m > 0; + } + #endregion + #region 6.2 Separation Spaces + private bool sSeparateInLine() // [66] + { + return OneAndRepeat(Charsets.sWhite) || StartOfLine(); + } + private bool StartOfLine() // [66, 79, 206] + { // TODO: how about "---" ? + return p == 0 || text[p - 1] == '\n' || text[p - 1] == '\r' || text[p - 1] == '\ufeff'; + } + #endregion + #region 6.3 Line Prefixes + private bool sLinePrefix(int n, Context c) // [67] + { + switch ( c ) { + case Context.Folded: + case Context.BlockOut: + case Context.BlockIn: + return sBlockLinePrefix(n); + case Context.FlowOut: + case Context.FlowIn: + return sFlowLinePrefix(n); + default: + throw new NotImplementedException(); + } + } + private bool sBlockLinePrefix(int n) // [68] + { + return sIndent(n); + } + bool sFlowLinePrefix(int n) // [69] + { + return sIndent(n) && Optional(sSeparateInLine); + } + #endregion + #region 6.4 Empty Lines + private bool lEmpty(int n, Context c) // [70] + { + return + RewindUnless(() => ( sLinePrefix(n, c) || sIndentLT(n) ) && bAsLineFeed()); + } + #endregion + #region 6.5 Line Folding + private bool b_lTrimmed(int n, Context c) // [71] + { + return RewindUnless(() => + bNonContent() && OneAndRepeat(() => lEmpty(n, c)) + ); + } + bool bAsSpace() // [72] + { + return + bBreak() && + Action(()=>stringValue.Append(' ')); + } + private bool b_lFolded(int n, Context c) // [73] + { + return b_lTrimmed(n, c) || bAsSpace(); + } + private bool sFlowFolded(int n) // [74] + { + return RewindUnless(() => + Optional(sSeparateInLine) && + b_lFolded(n, Context.FlowIn) && + !cForbidden() && + sFlowLinePrefix(n) + ); + } + #endregion + #region 6.6 Comments + private bool c_nbCommentText() // [75] + { + return text[p] == '#' && Repeat(nbChar); + } + bool bComment() // [76] + { + return bNonContent() || EndOfFile(); + } + bool EndOfFile() // [76, 206] + { + return p == text.Length - 1; // text[text.Length-1] == '\0' /* guard char */ + } + bool s_bComment() // [77] + { + return RewindUnless(() => + Optional(sSeparateInLine() && Optional(c_nbCommentText)) && + bComment() + ); + } + bool lComment() // [78] + { + return RewindUnless(() => + sSeparateInLine() && + Optional(c_nbCommentText) && + bComment() + ); + + } + bool s_lComments() // [79] + { + return ( s_bComment() || StartOfLine() ) && Repeat(lComment); + } + #endregion + #region 6.7 Separation Lines + bool sSeparate(int n, Context c) // [80] + { + switch ( c ) { + case Context.BlockOut: + case Context.BlockIn: + case Context.FlowOut: + case Context.FlowIn: + return sSeparateLines(n); + case Context.BlockKey: + case Context.FlowKey: + return sSeparateInLine(); + default: + throw new NotImplementedException(); + } + } + bool sSeparateLines(int n) // [81] + { + return + RewindUnless(() => s_lComments() && sFlowLinePrefix(n)) || + sSeparateInLine(); + } + #endregion + #region 6.8 Directives + bool lDirective() // [82] + { + return RewindUnless(() => + text[p++] == '%' && + RewindUnless(() => + nsYamlDirective() || + nsTagDirective() || + nsReservedDirective()) && + s_lComments() + ); + } + bool nsReservedDirective() // [83] + { + var name = ""; + var args = new List(); + return RewindUnless(() => + Save(() => OneAndRepeat(nsChar), ref name) && + Repeat(() => + sSeparateInLine() && Save(() => OneAndRepeat(nsChar), s => args.Add(s)) + ) + ) && + Action(() => ReservedDirective(name, args.ToArray()) ); + } + bool YamlDirectiveAlreadyAppeared = false; + bool nsYamlDirective() // [86] + { + string version = ""; + return RewindUnless(() => + Accept("YAML") && + sSeparateInLine() && + Save(() => + OneAndRepeat(Charsets.nsHexDigit) && + text[p++] == '.' && + OneAndRepeat(Charsets.nsHexDigit), + ref version) + ) && + Action(() => { + if ( YamlDirectiveAlreadyAppeared ) + Error("The YAML directive must only be given at most once per document."); + YamlDirective(version); + YamlDirectiveAlreadyAppeared = true; + }); + } + bool nsTagDirective() // [88] + { + string tag_handle = ""; + string tag_prefix = ""; + return RewindUnless(() => + Accept("TAG") && sSeparateInLine() && + ErrorUnless(()=> + text[p++] == '!' && + cTagHandle(out tag_handle) && sSeparateInLine() && + nsTagPrefix(out tag_prefix), + "Invalid TAG directive found." + ) + ) && + Action(() => TagPrefixes.Add(tag_handle, tag_prefix) ); + } + private bool cTagHandle(out string tag_handle) // [89]' + { + var _tag_handle = tag_handle = ""; + if ( Save(() => Optional(RewindUnless(() => + Repeat(Charsets.nsWordChar) && text[p++] == '!' + )), + s => _tag_handle = s) ) { + tag_handle = "!" + _tag_handle; + return true; + } + return false; + } + private bool nsTagPrefix(out string tag_prefix) // [93] + { + return + c_nsLocalTagPrefix(out tag_prefix) || + nsGlobalTagPrefix(out tag_prefix); + } + private bool c_nsLocalTagPrefix(out string tag_prefix) // [94] + { + Debug.Assert(stringValue.Length == 0); + if ( RewindUnless(() => + text[p++] == '!' && + Repeat(nsUriChar) + ) ) { + tag_prefix = "!" + stringValue.ToString(); + stringValue.Length = 0; + return true; + } + tag_prefix = ""; + return false; + } + private bool nsGlobalTagPrefix(out string tag_prefix) // [95] + { + Debug.Assert(stringValue.Length == 0); + if(RewindUnless(()=> nsTagChar() && Repeat(nsUriChar) )){ + tag_prefix = stringValue.ToString(); + stringValue.Length = 0; + return true; + } + tag_prefix = ""; + return false; + } + #endregion + #region 6.9 Node Properties + bool c_nsProperties(int n, Context c) // [96] + { + state.anchor = null; + state.tag = null; + return + ( c_nsTagProperty() && Optional(RewindUnless(()=> sSeparate(n, c) && c_nsAnchorProperty()) )) || + ( c_nsAnchorProperty() && Optional(RewindUnless(()=>sSeparate(n, c) && c_nsTagProperty()) )); + } + bool c_nsTagProperty() // [97]' + { + if(text[p] != '!') + return false; + + // reduce '!' here to improve perfomance + p++; + return + cVerbatimTag() || + c_nsShorthandTag() || + cNonSpecificTag(); + } + private bool cVerbatimTag() // [98]' + { + return + text[p] == '<' && + ErrorUnless( + text[p++] == '<' && + OneAndRepeat(nsUriChar) && + text[p++] == '>', + "Invalid verbatim tag" + ) && + SetTag(GetStringValue()); + } + + private bool c_nsShorthandTag() // [99]' + { + var tag_handle = ""; + return RewindUnless(() => + cTagHandle(out tag_handle) && + ErrorUnlessWithAdditionalCondition(() => + OneAndRepeat(nsTagChar), + tag_handle != "!", + string.Format("The {0} handle has no suffix.", tag_handle) + ) && + SetTag(tag_handle, GetStringValue()) + ); + } + string GetStringValue() + { + var s = stringValue.ToString(); + stringValue.Length = 0; + return s; + } + private bool cNonSpecificTag() // [100]' + { + // disable tag resolution to restrict tag to be ( map | seq | str ) + state.tag = ""; + return true; /* empty */ + } + bool c_nsAnchorProperty() // [101] + { + if ( text[p] != '&' ) + return false; + p++; + return Save(nsAnchorName, s => state.anchor = s); + } + private bool nsAnchorName() // [103] + { + return OneAndRepeat(Charsets.nsAnchorChar); + } + #endregion + #endregion + + #region Chapter 7. Flow Styles + #region 7.1 Alias Nodes + private bool c_nsAliasNode() // [104] + { + string anchor_name = ""; + var pos = CurrentPosition; + return RewindUnless(() => + text[p++] == '*' && + Save(() => nsAnchorName(), s => anchor_name = s) + ) && + SetValue(Anchors[anchor_name]); + } + #endregion + #region 7.2 Empty Nodes + /// + /// [105] + /// + private bool eScalar() + { + Debug.Assert(stringValue.Length == 0); + return SetValue(CreateScalar("!!null", CurrentPosition)); /* empty */ + } + /// + /// [106] + /// + private bool eNode() + { + return eScalar(); + } + #endregion + #region 7.3 Flow Scalar Styles + #region 7.3.1 Double-Quoted Style + private bool nbDoubleChar() // [107] + { + if ( text[p] != '\\' && text[p] != '"' && Charsets.nbJson(text[p]) ) { + stringValue.Append(text[p++]); + return true; + } + return c_nsEscChar(); + } + bool nsDoubleChar() // [108] + { + return !Charsets.sWhite(text[p]) && nbDoubleChar(); + } + private bool cDoubleQuoted(int n, Context c) // [109] + { + Position pos = CurrentPosition; + Debug.Assert(stringValue.Length == 0); + return text[p] == '"' && + ErrorUnlessWithAdditionalCondition(() => + text[p++] == '"' && + nbDoubleText(n, c) && + text[p++] == '"', + c == Context.FlowOut, + "Closing quotation \" was not found." + + ( TabCharFoundForIndentation ? " Tab char \\t can not be used for indentation." : "" ) + ) && + SetValue(CreateScalar("!!str", pos)); + } + private bool nbDoubleText(int n, Context c) // [110] + { + switch ( c ) { + case Context.FlowOut: + case Context.FlowIn: + return nbDoubleMultiLine(n); + case Context.BlockKey: + case Context.FlowKey: + return nbDoubleOneLine(n); + default: + throw new NotImplementedException(); + } + } + private bool nbDoubleOneLine(int n) // [111] + { + return Repeat(nbDoubleChar); + } + private bool sDoubleEscaped(int n) // [112] + { + return RewindUnless(() => + Repeat_sWhiteAsString() && + text[p++] == '\\' && bNonContent() && + Repeat(() => lEmpty(n, Context.FlowIn)) && + sFlowLinePrefix(n) + ); + } + private bool sDoubleBreak(int n) // [113] + { + return sDoubleEscaped(n) || sFlowFolded(n); + } + private bool nb_nsDoubleInLine() // [114] + { + return Repeat(() => RewindUnless(()=> Repeat_sWhiteAsString() && OneAndRepeat(nsDoubleChar)) ); + } + private bool sDoubleNextLine(int n) // [115] + { + return + sDoubleBreak(n) && + Optional(RewindUnless(() => + nsDoubleChar() && + nb_nsDoubleInLine() && + ( sDoubleNextLine(n) || Repeat(Repeat_sWhiteAsString) ) + )) + ; + } + private bool nbDoubleMultiLine(int n) // [116] + { + return nb_nsDoubleInLine() && + ( sDoubleNextLine(n) || Repeat(Repeat_sWhiteAsString) ); + } + #endregion + #region 7.3.2 Single-Quoted Style + bool nbSingleChar() // [118] + { + if ( text[p] != '\'' && Charsets.nbJson(text[p]) ) { + stringValue.Append(text[p++]); + return true; + } + // [117] cQuotedQuote + if ( text[p] == '\'' && text[p + 1] == '\'' ) { + stringValue.Append('\''); + p += 2; + return true; + } + return false; + } + bool nsSingleChar() // [119] + { + return !Charsets.sWhite(text[p]) && nbSingleChar(); + } + private bool cSingleQuoted(int n, Context c) // [120] + { + Debug.Assert(stringValue.Length == 0); + Position pos = CurrentPosition; + return text[p] == '\'' && + ErrorUnlessWithAdditionalCondition(()=> + text[p++] == '\'' && + nbSingleText(n, c) && + text[p++] == '\'', + c == Context.FlowOut, + "Closing quotation \' was not found." + + (TabCharFoundForIndentation ? " Tab char \\t can not be used for indentation." : "") + ) && + SetValue(CreateScalar("!!str", pos)); + } + private bool nbSingleText(int n, Context c) // [121] + { + switch ( c ) { + case Context.FlowOut: + case Context.FlowIn: + return nbSingleMultiLine(n); + case Context.BlockKey: + case Context.FlowKey: + return nbSingleOneLine(n); + default: + throw new NotImplementedException(); + } + } + private bool nbSingleOneLine(int n) // [122] + { + return Repeat(nbSingleChar); + } + private bool nb_nsSingleInLine() // [123] + { + return Repeat(() => RewindUnless(()=> Repeat_sWhiteAsString() && OneAndRepeat(nsSingleChar))); + } + private bool sSingleNextLine(int n) // [124] + { + return RewindUnless(() => + sFlowFolded(n) && ( + nsSingleChar() && + nb_nsSingleInLine() && + Optional(sSingleNextLine(n) || Repeat_sWhiteAsString() ) + ) + ); + } + private bool nbSingleMultiLine(int n) // [125] + { + return nb_nsSingleInLine() && + ( sSingleNextLine(n) || Repeat_sWhiteAsString() ); + } + #endregion + #region 7.3.3 Plain Style + private bool nsPlainFirst(Context c) // [126] + { + if ( Charsets.nsPlainFirstSub(text[p]) || + ( ( text[p] == '?' || text[p] == ':' || text[p] == '-' ) && nsPlainSafe(c, text[p+1]) ) ) { + WarnIfCharWasBreakInYAML1_1(); + stringValue.Append(text[p++]); + return true; + } + return false; + } + private bool nsPlainSafe(Context c) // [127] + { + if ( !nsPlainSafe(c, text[p]) ) + return false; + WarnIfCharWasBreakInYAML1_1(); + stringValue.Append(text[p++]); + return true; + } + private bool nsPlainSafe(Context c, char cc) // [127] + { + switch ( c ) { + case Context.FlowOut: + case Context.BlockKey: + return Charsets.nsPlainSafeOut(cc); + case Context.FlowIn: + case Context.FlowKey: + return Charsets.nsPlainSafeIn(cc); + default: + throw new NotImplementedException(); + } + } + private bool nsPlainChar(Context c) // [130] + { + if ( text[p]!= ':' && text[p]!='#' && nsPlainSafe(c) ) + return true; + if ( ( /* An ns-char preceding '#' */ + p != 0 && + Charsets.nsChar(text[p - 1]) && + text[p] == '#' ) || + ( /* ':' Followed by an ns-char */ + text[p] == ':' && nsPlainSafe(c, text[p+1]) ) + ) { + stringValue.Append(text[p++]); + return true; + } + return false; + } + private bool nsPlain(int n, Context c) // [131] + { + if ( cForbidden() ) + return false; + var pos = CurrentPosition; + Debug.Assert(stringValue.Length == 0); + switch ( c ) { + case Context.FlowOut: + case Context.FlowIn: + return + nsPlainMultiLine(n, c) && + SetValue(CreateScalar(null, pos)); + case Context.BlockKey: + case Context.FlowKey: + return nsPlainOneLine(c) && + SetValue(CreateScalar(null, pos)); + default: + throw new NotImplementedException(); + } + } + private bool nb_nsPlainInLine(Context c) // [132] + { + return Repeat(() => RewindUnless(() => + Repeat_sWhiteAsString() && + OneAndRepeat(() => nsPlainChar(c)) + )); + } + private bool nsPlainOneLine(Context c) // [133] + { + return nsPlainFirst(c) && nb_nsPlainInLine(c); + } + private bool s_nsPlainNextLine(int n, Context c) // [134] + { + return RewindUnless(() => + sFlowFolded(n) && + nsPlainChar(c) && + nb_nsPlainInLine(c) + ); + } + private bool nsPlainMultiLine(int n, Context c) // [135] + { + return + nsPlainOneLine(c) && + Repeat(() => s_nsPlainNextLine(n, c)); + } + #endregion + #endregion + #region 7.4 Flow Collection Styles + private Context InFlow(Context c) // [136] + { + switch ( c ) { + case Context.FlowOut: + case Context.FlowIn: + return Context.FlowIn; + case Context.BlockKey: + case Context.FlowKey: + return Context.FlowKey; + default: + throw new NotImplementedException(); + } + } + #region 7.4.1 Flow Sequences + private bool cFlowSequence(int n, Context c) // [137] + { + YamlSequence sequence = null; + Position pos = CurrentPosition; + return RewindUnless(() => + text[p++] == '[' && + ErrorUnlessWithAdditionalCondition(() => + Optional(sSeparate(n, c)) && + Optional(ns_sFlowSeqEntries(n, InFlow(c), + sequence = CreateSequence(pos))) && + text[p++] == ']', + c == Context.FlowOut, + "Closing brace ] was not found." + + ( TabCharFoundForIndentation ? " Tab char \\t can not be used for indentation." : "" ) + ) + ) && + SetValue(sequence); + } + + private bool ns_sFlowSeqEntries(int n, Context c, YamlSequence sequence) // [138] + { + return + nsFlowSeqEntry(n, c) && + Action(() => sequence.Add(GetValue()) ) && + Optional(sSeparate(n, c)) && + Optional(RewindUnless(() => + text[p++] == ',' && + Optional(sSeparate(n, c)) && + Optional(ns_sFlowSeqEntries(n, c, sequence)) + )); + } + private bool nsFlowSeqEntry(int n, Context c) // [139] + { + YamlNode key = null; + Position pos = CurrentPosition; + return + RewindUnless(()=> + nsFlowPair(n, c, ref key) && + Action(()=>{ + var map= CreateMapping(pos); + map.Add(key, GetValue()); + SetValue(map); + }) + ) || + nsFlowNode(n, c); + } + #endregion + #region 7.4.2 Flow Mappings + private bool cFlowMapping(int n, Context c) // [140] + { + Position pos = CurrentPosition; + YamlMapping mapping = null; + return RewindUnless(() => + text[p++] == '{' && + Optional(sSeparate(n, c)) && + ErrorUnlessWithAdditionalCondition(() => + Optional(ns_sFlowMapEntries(n, InFlow(c), mapping = CreateMapping(pos))) && + text[p++] == '}', + c == Context.FlowOut, + "Closing brace }} was not found." + + ( TabCharFoundForIndentation ? " Tab char \\t can not be used for indentation." : "" ) + ) + ) && + SetValue(mapping); + } + private bool ns_sFlowMapEntries(int n, Context c, YamlMapping mapping) // [141] + { + YamlNode key = null; + return + nsFlowMapEntry(n, c, ref key) && + Action(() => mapping.Add(key, GetValue()) ) && + Optional(sSeparate(n, c)) && + Optional(RewindUnless(() => + text[p++] == ',' && + Optional(sSeparate(n, c)) && + Optional(ns_sFlowMapEntries(n, c, mapping)) + )); + } + private bool nsFlowMapEntry(int n, Context c, ref YamlNode key) // [142] + { + YamlNode _key = null; + return ( + RewindUnless(() => text[p++] == '?' && sSeparate(n, c) && nsFlowMapExplicitEntry(n, c, ref _key)) || + nsFlowMapImplicitEntry(n, c, ref _key) + ) && + Assign(out key, _key); + } + private bool nsFlowMapExplicitEntry(int n, Context c, ref YamlNode key) // [143] + { + return nsFlowMapImplicitEntry(n, c, ref key) || ( + eNode() /* Key */ && + Assign(out key, GetValue()) && + eNode() /* Value */ + ); + } + private bool nsFlowMapImplicitEntry(int n, Context c, ref YamlNode key) // [144] + { + return + nsFlowMapYamlKeyEntry(n, c, ref key) || + c_nsFlowMapEmptyKeyEntry(n, c, ref key) || + c_nsFlowMapJsonKeyEntry(n, c, ref key); + } + private bool nsFlowMapYamlKeyEntry(int n, Context c, ref YamlNode key) // [145] + { + return + nsFlowYamlNode(n, c) && + Assign(out key, GetValue()) && ( + RewindUnless(() => ( Optional(sSeparate(n, c)) && c_nsFlowMapSeparateValue(n, c) )) || + eNode() + ); + } + private bool c_nsFlowMapEmptyKeyEntry(int n, Context c, ref YamlNode key) // [146] + { + YamlNode _key = null; + return RewindUnless(() => + eNode() /* Key */ && + Assign(out _key, GetValue()) && + c_nsFlowMapSeparateValue(n, c) + ) && + Assign(out key, _key); + } + private bool c_nsFlowMapSeparateValue(int n, Context c) // [147] + { + return RewindUnless(() => + text[p++] == ':' && !nsPlainSafe(c, text[p]) && ( + RewindUnless(() => sSeparate(n, c) && nsFlowNode(n, c)) || + eNode() /* Value */ + ) + ); + } + private bool c_nsFlowMapJsonKeyEntry(int n, Context c, ref YamlNode key) // [148] + { + return + cFlowJsonNode(n, c) && + Assign(out key, GetValue()) && ( + RewindUnless(() => Optional(sSeparate(n, c)) && c_nsFlowMapAdjacentValue(n, c)) || + eNode() + ); + } + private bool c_nsFlowMapAdjacentValue(int n, Context c) // [149] + { + return RewindUnless(() => + text[p++] == ':' && ( + RewindUnless(() => Optional(sSeparate(n, c)) && nsFlowNode(n, c)) || + eNode() /* Value */ + ) + ); + } + private bool nsFlowPair(int n, Context c, ref YamlNode key) // [150] + { + YamlNode _key = null; + return ( + RewindUnless(() => text[p++] == '?' && sSeparate(n, c) && nsFlowMapExplicitEntry(n, c, ref _key)) || + nsFlowPairEntry(n, c, ref _key) + ) && + Assign(out key, _key); + } + private bool nsFlowPairEntry(int n, Context c, ref YamlNode key) // [151] + { + return + nsFlowPairYamlKeyEntry(n, c, ref key) || + c_nsFlowMapEmptyKeyEntry(n, c, ref key) || + c_nsFlowPairJsonKeyEntry(n, c, ref key); + } + private bool nsFlowPairYamlKeyEntry(int n, Context c, ref YamlNode key) // [152] + { + return + ns_sImplicitYamlKey(Context.FlowKey) && + Assign(out key, GetValue()) && + c_nsFlowMapSeparateValue(n, c); + } + private bool c_nsFlowPairJsonKeyEntry(int n, Context c, ref YamlNode key) // [153] + { + return + c_sImplicitJsonKey(Context.FlowKey) && + Assign(out key, GetValue()) && + c_nsFlowMapAdjacentValue(n, c); + } + private bool ns_sImplicitYamlKey(Context c) // [154] + { + /* At most 1024 characters altogether */ + int start = p; + if ( nsFlowYamlNode(-1 /* not used */, c) && Optional(sSeparateInLine) ) { + ErrorUnless(( p - start ) < 1024, "The implicit key was too long."); + return true; + } + return false; + } + private bool c_sImplicitJsonKey(Context c) // [155] + { + /* At most 1024 characters altogether */ + int start = p; + if ( cFlowJsonNode(-1 /* not used */, c) && Optional(sSeparateInLine) ) { + ErrorUnless(( p - start ) < 1024, "The implicit key was too long."); + return true; + } + return false; + } + #endregion + #endregion + #region 7.5 Flow Nodes + private bool nsFlowYamlContent(int n, Context c) // [156] + { + return nsPlain(n, c); + } + private bool cFlowJsonContent(int n, Context c) // [157] + { + return cFlowSequence(n, c) || cFlowMapping(n, c) || + cSingleQuoted(n, c) || cDoubleQuoted(n, c); + } + private bool nsFlowContent(int n, Context c) // [158] + { + return + nsFlowYamlContent(n, c) || + cFlowJsonContent(n, c); + } + private bool nsFlowYamlNode(int n, Context c) // [159] + { + return + c_nsAliasNode() || + nsFlowYamlContent(n, c) || + ( c_nsProperties(n, c) && ( + RewindUnless(()=> sSeparate(n, c) && nsFlowYamlContent(n, c) ) || eScalar() ) ); + } + private bool cFlowJsonNode(int n, Context c) // [160] + { + return + Optional(RewindUnless(() => c_nsProperties(n, c) && sSeparate(n, c))) && + cFlowJsonContent(n, c); + } + private bool nsFlowNode(int n, Context c) // [161] + { + if( c_nsAliasNode() || + nsFlowContent(n, c) || + RewindUnless(() => c_nsProperties(n, c) && + ( RewindUnless(() => sSeparate(n, c) && nsFlowContent(n, c)) || eScalar() )) ) + return true; + if( text[p] == '@' || text[p] == '`' ) + Error("Reserved indicators '@' and '`' can't start a plain scalar."); + return false; + } + #endregion + #endregion + + #region Chapter 8. Block Styles + #region 8.1 Block Scalar Styles + #region 8.1.1 Block Scalar Headers + enum ChompingIndicator + { + Strip, + Keep, + Clip + } + private bool c_bBlockHeader(out int m, out ChompingIndicator t) // [162] + { + var _m = m = 0; + var _t = t = ChompingIndicator.Clip; + if ( RewindUnless(() => + ( ( cIndentationIndicator(ref _m) && Optional(cChompingIndicator(ref _t)) ) || + ( Optional(cChompingIndicator(ref _t)) && Optional(cIndentationIndicator(ref _m)) ) ) && + s_bComment() + ) ) { + m = _m; + t = _t; + return true; + } + return false; + } + bool cIndentationIndicator(ref int m) // [163] + { + if ( Charsets.nsDecDigit(text[p]) ) { + m = text[p] - '0'; + p++; + return true; + } + return false; + } + bool cChompingIndicator(ref ChompingIndicator t) // [164] + { + switch ( text[p] ) { + case '-': + p++; + t = ChompingIndicator.Strip; + return true; + case '+': + p++; + t = ChompingIndicator.Keep; + return true; + } + return false; + } + private bool bChompedLast(ChompingIndicator t) // [165] + { + return EndOfFile() || ( + ( t == ChompingIndicator.Strip ) ? bBreak() : bAsLineFeed() + ); + } + private bool lChompedEmpty(int n, ChompingIndicator t) // [166] + { + return ( t == ChompingIndicator.Keep ) ? lKeepEmpty(n) : lStripEmpty(n); + } + private bool lStripEmpty(int n) // [167] + { + return Repeat(() =>RewindUnless(()=> sIndentLE(n) && bNonContent())) && + Optional(lTrailComments(n)); + } + private bool lKeepEmpty(int n) // [168] + { + return Repeat(() => lEmpty(n, Context.BlockIn)) && + Optional(lTrailComments(n)); + } + private bool lTrailComments(int n) // [169] + { + return RewindUnless(() => + sIndentLT(n) && + c_nbCommentText() && + bComment() && + Repeat(lComment) + ); + } + int AutoDetectIndentation(int n) // [170, 183] + { + int m = 0, max = 0, maxp = 0; + RewindUnless(() => + Repeat(() => RewindUnless(() => + Save(() => Repeat(Charsets.sSpace), s => { + if ( s.Length > max ) { + max = s.Length; + maxp = p; + } + }) && bBreak()) + ) && + Save(() => Repeat(Charsets.sSpace), s => m = s.Length - n) && + Action(() => { if ( text[p] == '\t' ) TabCharFoundForIndentation = true; }) && + false // force Rewind + ); + if ( m < 1 && TabCharFoundForIndentation ) + Error("Tab character found for indentation."); + if ( m < max - n ) { + p = maxp; + Error("Too many indentation was found."); + } + return m <= 1 ? 1 : m; + } + #endregion + #region 8.1.2. Literal Style + bool c_lLiteral(int n) // [170] + { + Debug.Assert(stringValue.Length == 0); + + int m = 0; + var t = ChompingIndicator.Clip; + Position pos = CurrentPosition; + return RewindUnless(() => + text[p++] == '|' && + c_bBlockHeader(out m, out t) && + Action(() => { if ( m == 0 ) m = AutoDetectIndentation(n); }) && + ErrorUnless(lLiteralContent(n + m, t), "Irregal literal text found.") + ) && + SetValue(CreateScalar("!!str", pos)); + } + bool l_nbLiteralText(int n) // [171] + { + return RewindUnless(() => + Repeat(() => lEmpty(n, Context.BlockIn)) && + sIndent(n) && + Save(() => Repeat(nbChar), s => stringValue.Append(s) ) + ); + } + bool b_nbLiteralNext(int n) // [172] + { + return RewindUnless(() => + bAsLineFeed() && + !cForbidden() && + l_nbLiteralText(n) + ); + } + private bool lLiteralContent(int n, ChompingIndicator t) // [173] + { + return RewindUnless(()=> + Optional(RewindUnless(()=>l_nbLiteralText(n) && Repeat(() => b_nbLiteralNext(n)) && bChompedLast(t))) && + lChompedEmpty(n, t) + ); + } + #endregion + #region 8.1.3. Folded Style + private bool c_lFolded(int n) // [174] + { + Debug.Assert(stringValue.Length == 0); + + int m = 0; + var t = ChompingIndicator.Clip; + Position pos = CurrentPosition; + return RewindUnless(() => + text[p++] == '>' && + c_bBlockHeader(out m, out t) && + WarningIf(t== ChompingIndicator.Keep, + "Keep line breaks for folded text '>+' is invalid") && + Action(() => { if ( m == 0 ) m = AutoDetectIndentation(n); }) && + ErrorUnless(lFoldedContent(n + m, t), "Irregal folded string found.") + ) && + SetValue(CreateScalar("!!str", pos)); + } + private bool s_nbFoldedText(int n) // [175] + { + return RewindUnless(() => + sIndent(n) && + Save(() => nsChar() && Repeat(nbChar), s => stringValue.Append(s)) + ); + } + private bool l_nbFoldedLines(int n) // [176] + { + return s_nbFoldedText(n) && + Repeat(() => RewindUnless(() => b_lFolded(n, Context.BlockIn) && s_nbFoldedText(n))); + } + private bool s_nbSpacedText(int n) // [177] + { + return RewindUnless(() => + sIndent(n) && + Save(() => sWhite() && Repeat(nbChar), s => stringValue.Append(s)) + ); + } + private bool b_lSpaced(int n) // [178] + { + return + bAsLineFeed() && + !cForbidden() && + Repeat(() => lEmpty(n, Context.Folded)); + } + private bool l_nbSpacedLines(int n) // [179] + { + return RewindUnless(() => + s_nbSpacedText(n) && + Repeat(() => RewindUnless(() => b_lSpaced(n) && s_nbSpacedText(n))) + ); + } + private bool l_nbSameLines(int n) // [180] + { + return RewindUnless(() => + Repeat(() => lEmpty(n, Context.BlockIn)) && + ( l_nbFoldedLines(n) || l_nbSpacedLines(n) ) + ); + } + private bool l_nbDiffLines(int n) // [181] + { + return + l_nbSameLines(n) && + Repeat(() => RewindUnless(() => bAsLineFeed() && !cForbidden() && l_nbSameLines(n))); + } + private bool lFoldedContent(int n, ChompingIndicator t) // [182] + { + return RewindUnless(()=> + Optional(RewindUnless(() => l_nbDiffLines(n) && bChompedLast(t))) && + lChompedEmpty(n, t) + ); + } + #endregion + #endregion + #region 8.2. Block Collection Styles + #region 8.2.1 Block Sequences + private bool lBlockSequence(int n) // [183] + { + int m = AutoDetectIndentation(n); + YamlSequence sequence = null; + Position pos = new Position(); + return OneAndRepeat(() => RewindUnless(() => + sIndent(n + m) && + Action(() => { if ( sequence == null ) pos = CurrentPosition; }) && + text[p] == '-' && !Charsets.nsChar(text[p + 1]) && + Action(() => { if ( sequence == null ) sequence = CreateSequence(pos); }) && + c_lBlockSeqEntry(n + m, sequence) + )) && + SetValue(sequence); + } + private bool c_lBlockSeqEntry(int n, YamlSequence sequence) // [184] + { + Debug.Assert(text[p] == '-' && !Charsets.nsChar(text[p + 1])); + p++; + return + s_lBlockIndented(n, Context.BlockIn) && + Action(()=> sequence.Add(GetValue()) ); + } + bool s_lBlockIndented(int n, Context c) // [185] + { + int m; + return + RewindUnless(() => sIndentCounted(n, out m) && + ( ns_lCompactSequence(n + 1 + m) || ns_lCompactMapping(n + 1 + m) )) || + s_lBlockNode(n, c) || + ( eNode() && s_lComments() ); + } + private bool ns_lCompactSequence(int n) // [186] + { + YamlSequence sequence = null; + Position pos = CurrentPosition; + return + text[p] == '-' && !Charsets.nsChar(text[p + 1]) && + Action(() => sequence = CreateSequence(pos)) && + c_lBlockSeqEntry(n, sequence) && + Repeat(() => RewindUnless(() => + sIndent(n) && + text[p] == '-' && !Charsets.nsChar(text[p + 1]) && + c_lBlockSeqEntry(n, sequence))) && + SetValue(sequence); + } + #endregion + #region 8.2.2 Block Mappings + private bool lBlockMapping(int n) // [187] + { + YamlMapping mapping = null; + int m = 0; + YamlNode key = null; + return OneAndRepeat(() => + sIndent(n + m) && + ( m > 0 || sIndentCounted(n, out m) ) && + Action(() => { + if ( mapping == null ) { + mapping = CreateMapping(CurrentPosition); + } + }) && + ns_lBlockMapEntry(n + m, ref key) && + Action(() => mapping.Add(key, GetValue())) + ) && + SetValue(mapping); + } + private bool ns_lBlockMapEntry(int n, ref YamlNode key) // [188] + { + return c_lBlockMapExplicitEntry(n, ref key) || + ns_lBlockMapImplicitEntry(n, ref key); + } + private bool c_lBlockMapExplicitEntry(int n, ref YamlNode key) // [189] + { + YamlNode _key= null; + return RewindUnless(() => + c_lBlockMapExplicitKey(n, ref _key) && + ErrorUnless( + ( lBlockMapExplicitValue(n) || eNode() ), + "irregal block mapping explicit entry" + ) + ) && + Assign(out key, _key); + } + private bool c_lBlockMapExplicitKey(int n, ref YamlNode key) // [190] + { + return RewindUnless(() => + text[p++] == '?' && + s_lBlockIndented(n, Context.BlockOut) + ) && + Assign(out key, GetValue()); + } + private bool lBlockMapExplicitValue(int n) // [191] + { + return RewindUnless(() => + sIndent(n) && + text[p++] == ':' && + s_lBlockIndented(n, Context.BlockOut) + ); + } + private bool ns_lBlockMapImplicitEntry(int n, ref YamlNode key) // [192] + { + YamlNode _key = null; + return RewindUnless(() => + ( ns_sBlockMapImplicitKey() || eNode() ) && + Assign(out _key, GetValue()) && + c_lBlockMapImplicitValue(n) + ) && + Assign(out key, _key); + } + private bool ns_sBlockMapImplicitKey() // [193] + { + return c_sImplicitJsonKey(Context.BlockKey) || + ns_sImplicitYamlKey(Context.BlockKey); + } + private bool c_lBlockMapImplicitValue(int n) // [194] + { + return RewindUnless(() => + text[p++] == ':' && + ( s_lBlockNode(n, Context.BlockOut) || ( eNode() && s_lComments() ) ) + ); + } + private bool ns_lCompactMapping(int n) // [195] + { + var mapping = CreateMapping(CurrentPosition); + YamlNode key = null; + return RewindUnless(() => + ns_lBlockMapEntry(n, ref key) && + Action(() => mapping.Add(key, GetValue())) && + Repeat(() => RewindUnless(() => + sIndent(n) && + ns_lBlockMapEntry(n, ref key) && + Action(() => mapping.Add(key, GetValue())) + )) + ) && + SetValue(mapping); + } + #endregion + #region 8.2.3 Block Nodes + bool s_lBlockNode(int n, Context c) // [196] + { + return + s_lBlockInBlock(n, c) || + s_lFlowInBlock(n); + } + bool s_lFlowInBlock(int n) // [197] + { + return RewindUnless(() => + sSeparate(n + 1, Context.FlowOut) && + nsFlowNode(n + 1, Context.FlowOut) && + s_lComments() + ); + } + bool s_lBlockInBlock(int n, Context c) // [198] + { + Debug.Assert(stringValue.Length == 0); + return + s_lBlockScalar(n, c) || + s_lBlockCollection(n, c); + } + bool s_lBlockScalar(int n, Context c) // [199] + { + return RewindUnless(() => + sSeparate(n + 1, c) && + Optional(RewindUnless(() => c_nsProperties(n + 1, c) && sSeparate(n + 1, c))) && + ( c_lLiteral(n) || c_lFolded(n) ) + ); + } + bool s_lBlockCollection(int n, Context c) // [200] + { + return RewindUnless(() => + Optional(RewindUnless(() => sSeparate(n + 1, c) && c_nsProperties(n + 1, c))) && + s_lComments() && + ( lBlockSequence(SeqSpaces(n, c)) || lBlockMapping(n) ) + ) || + RewindUnless(() => + s_lComments() && + ( lBlockSequence(SeqSpaces(n, c)) || lBlockMapping(n) ) + ); + } + private int SeqSpaces(int n, Context c) // [201] + { + switch ( c ) { + case Context.BlockOut: + return n - 1; + case Context.BlockIn: + return n; + default: + throw new NotImplementedException(); + } + } + #endregion + #endregion + #endregion + + #region Chapter 9. YAML Character Stream + #region 9.1. Documents + private bool lDocumentPrefix() // [202] + { + return Optional(Charsets.cByteOrdermark) && Repeat(lComment); + } + private bool cDirectivesEnd() // [203] + { + return Accept("---"); + } + private bool cDocumentEnd() // [204] + { + return Accept("..."); + } + bool lDocumentSuffix() // [205] + { + return RewindUnless(() => + cDocumentEnd() && + s_lComments() + ); + } + bool cForbidden() // [206] + { + if ( !StartOfLine() || ( text.Length - p ) < 3 ) + return false; + var s = text.Substring(p, 3); + if ( s != "---" && s != "..." ) + return false; + return + text.Length - p == 3 + 1 || + Charsets.sWhite(text[p + 3]) || + Charsets.bChar(text[p + 3]); + } + bool lBareDocument() // [207] + { + var length = stringValue.Length; + var s = stringValue.ToString(); + stringValue.Length = 0; + Debug.Assert(length == 0, "stringValue should be empty but '" + s + "' was found"); + state.value = null; + + TagPrefixes.SetupDefaultTagPrefixes(); + return + s_lBlockNode(-1, Context.BlockIn) && + Action(() => ParseResult.Add(GetValue())); + } + bool lExplicitDocument() // [208] + { + return RewindUnless(() => + cDirectivesEnd() && + ( lBareDocument() || eNode() && s_lComments() && Action(() => ParseResult.Add(GetValue())) ) + ); + } + bool lDirectiveDocument() // [209] + { + YamlDirectiveAlreadyAppeared = false; + return RewindUnless(() => + OneAndRepeat(lDirective) && lExplicitDocument() + ); + } + #endregion + #region 9.2. Streams + bool lAnyDocument() // [210] + { + return + lDirectiveDocument() || + lExplicitDocument() || + lBareDocument(); + } + private bool lYamlStream() // [211] + { + TagPrefixes.Reset(); + Anchors.RewindDeapth = 0; + state.anchor_depth = 0; + WarningAdded.Clear(); + Warnings.Clear(); + stringValue.Length = 0; + bool BomReduced = false; + if ( Repeat(lDocumentPrefix) && + Optional(lAnyDocument) && + Repeat(() => + TagPrefixes.Reset() && + RewindUnless(() => + OneAndRepeat(() => lDocumentSuffix() && Action(() => BomReduced = false)) && + Repeat(lDocumentPrefix) && Optional(lAnyDocument)) || + RewindUnless(() => + Repeat(() => Action(() => BomReduced |= Charsets.cByteOrdermark(text[p])) && lDocumentPrefix() ) && + Optional(lExplicitDocument() && Action(() => BomReduced = false))) + ) && + EndOfFile() ) + return true; + if ( BomReduced ) { + Error("A BOM (\\ufeff) must not appear inside a document."); + }else + if(Charsets.cIndicator(text[p])){ + Error("Plain text can not start with indicator characters -?:,[]{{}}#&*!|>'\"%@`"); + }else + if ( text[p] == ' ' && StartOfLine() ) { + Error("Extra line was found. Maybe indentation was incorrect."); + } else + if ( Charsets.nbChar(text[p]) ){ + Error("Extra content was found. Maybe indentation was incorrect."); + } else { + Error("An irregal character {0} appeared.", + (text[p]<0x100) ? + string.Format("'\\x{0:x2}'", (int)text[p]) : + string.Format("'\\u{0:x4}'", (int)text[p]) + ); + } + return false; + } + #endregion + #endregion + + #endregion + } +} diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/YamlPresenter.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/YamlPresenter.cs new file mode 100644 index 0000000..e6dbee5 --- /dev/null +++ b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/YamlPresenter.cs @@ -0,0 +1,505 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +using System.ComponentModel; +using System.Text.RegularExpressions; +using System.IO; + +namespace System.Yaml +{ + /// + /// Converts YamlNode tree into yaml text. + /// + /// + /// + /// YamlNode node; + /// YamlPresenter.ToYaml(node); + /// + /// YamlNode node1; + /// YamlNode node2; + /// YamlNode node3; + /// YamlPresenter.ToYaml(node1, node2, node3); + /// + /// + internal class YamlPresenter + { + TextWriter yaml; + int column, raw; + YamlConfig config; + + public string ToYaml(YamlNode node) + { + return ToYaml(node, YamlNode.DefaultConfig); + } + + public string ToYaml(YamlNode node, YamlConfig config) + { + yaml = new StringWriter(); + ToYaml(yaml, node, config); + return yaml.ToString(); + } + + public void ToYaml(Stream s, YamlNode node, YamlConfig config) + { + using ( var yaml = new StreamWriter(s) ) + ToYaml(yaml, node, config); + } + + public void ToYaml(TextWriter yaml, YamlNode node, YamlConfig config) + { + this.config = config; + this.yaml = yaml; + MarkMultiTimeAppearingChildNodesToBeAnchored(node); + yaml.NewLine = config.LineBreakForOutput; + + column = 1; + raw = 1; + WriteLine("%YAML 1.2"); + WriteLine("---"); + NodeToYaml(node, "", Context.Normal); + WriteLine("..."); + } + + static void MarkMultiTimeAppearingChildNodesToBeAnchored(YamlNode node) + { + var AlreadyAppeared = new Dictionary( + TypeUtils.EqualityComparerByRef.Default); + var anchor = ""; + + Action analyze = null; + analyze = n => { + if ( !AlreadyAppeared.ContainsKey(n) ) { + n.Properties.Remove("ToBeAnchored"); + n.Properties.Remove("Anchor"); + AlreadyAppeared[n] = true; + } else { + if ( !n.Properties.ContainsKey("Anchor") ) { + anchor = NextAnchor(anchor); + n.Properties["ToBeAnchored"] = "true"; + n.Properties["Anchor"] = anchor; + } + return; + } + if ( n is YamlSequence ) { + var seq = (YamlSequence)n; + foreach ( var child in seq ) + analyze(child); + } + if ( n is YamlMapping ) { + var map = (YamlMapping)n; + foreach ( var child in map ) { + analyze(child.Key); + analyze(child.Value); + } + } + }; + analyze(node); + } + + internal static string NextAnchor(string anchor) // this is "protected" for test use + { + if ( anchor == "" ) { + return "A"; + } else + if ( anchor[anchor.Length - 1] != 'Z' ) { + return anchor.Substring(0, anchor.Length - 1) + ((char)( anchor[anchor.Length - 1] + 1 )).ToString(); + } else { + return NextAnchor(anchor.Substring(0, anchor.Length - 1)) + "A"; + } + } + + internal enum Context + { + Normal, + List, + Map, + NoBreak + } + + void Write(string s) + { + int start = 0; + for ( int p = 0; p < s.Length; ) { + if ( s[p] != '\r' && s[p] != '\n' ) { + // proceed until finding a line break + p++; + } else { + int pp = p; + if ( p + 1 < s.Length && s[p] == '\r' && s[p + 1] == '\n' ) + p++; + p++; + if ( config.NormalizeLineBreaks ) { + // output with normalized line break + yaml.WriteLine(s.Substring(start, pp - start)); + } else { + // output with native line break + yaml.Write(s.Substring(start, p - start)); + } + raw++; + column = 1; + start = p; + } + } + // rest of the string + s = s.Substring(start, s.Length - start); + column += s.Length; + yaml.Write(s); + } + + void WriteLine(string s) + { + Write(s); + WriteLine(); + } + + void WriteLine() + { + yaml.WriteLine(); + raw++; + column = 1; + } + + private void NodeToYaml(YamlNode node, string pres, Context c) + { + if ( node.Properties.ContainsKey("ToBeAnchored") ) { + node.Raw = raw; + node.Column = column; + Write("&" + node.Properties["Anchor"] + " "); + node.Properties.Remove("ToBeAnchored"); + c = Context.Map; + } else { + if ( node.Properties.ContainsKey("Anchor") ) { + Write("*" + node.Properties["Anchor"]); + if ( c != Context.NoBreak ) { + WriteLine(); + } + return; + } + node.Raw = raw; + node.Column = column; + } + + if ( node is YamlSequence ) { + SequenceToYaml((YamlSequence)node, pres, c); + } else + if ( node is YamlMapping ) { + MappingToYaml((YamlMapping)node, pres, c); + } else { + ScalarToYaml((YamlScalar)node, pres, c); + } + } + + private static string GetPropertyOrNull(YamlNode node, string name) + { + string result; + if ( node.Properties.TryGetValue(name, out result) ) + return result; + return null; + } + + private void ScalarToYaml(YamlScalar node, string pres, Context c) + { + var s = node.Value; + + // If tag can be resolved from the content, or tag is !!str, + // no need to explicitly specify it. + var auto_tag = YamlNode.ShorthandTag(AutoTagResolver.Resolve(s)); + var tag = TagToYaml(node, auto_tag); + if ( tag != "" && tag != "!!str" ) + Write(tag + " "); + + if ( IsValidPlainText(s, c) && !( node.ShorthandTag() == "!!str" && auto_tag != null && !node.Properties.ContainsKey("plainText")) ) { + // one line plain style + Write(s); + if ( c != Context.NoBreak ) + WriteLine(); + } else { + if ( ForbiddenChars.IsMatch(s) || OneLine.IsMatch(s) || + ( config.ExplicitlyPreserveLineBreaks && + GetPropertyOrNull(node, "Don'tCareLineBreaks") == null ) ) { + // double quoted + Write(DoubleQuotedString.Quote(s, pres, c)); + if ( c != Context.NoBreak ) + WriteLine(); + } else { + // Literal style + if ( s[s.Length - 1] == '\n' || s[s.Length - 1] == '\r' ) { + WriteLine("|+2"); + } else { + WriteLine("|-2"); + s += "\r\n"; // guard + } + var press = pres + " "; + for ( int p = 0; p < s.Length; ) { + var m = UntilBreak.Match(s, p); // does not fail because of the guard + Write(pres + s.Substring(p, m.Length)); + p += m.Length; + } + } + } + } + + private bool IsValidPlainText(string s, Context c) + { + if ( s == "" ) + return true; + switch ( c ) { + case Context.Normal: // Block Key + case Context.Map: // BlockValue + case Context.List: // ListItem + case Context.NoBreak: // Flow Key + return ( s == "" || PlainChecker.IsValidPlainText(s, config) ); + default: + throw new NotImplementedException(); + } + } + private static DoubleQuote DoubleQuotedString = new DoubleQuote(); + private static Regex ForbiddenChars = new Regex(@"[\x00-\x08\x0B\x0C\x0E-\x1F]"); + private static Regex OneLine = new Regex(@"^([^\n\r]|\n)*(\r?\n|\r)?$"); + private static Regex UntilBreak = new Regex(@"[^\r\n]*(\r?\n|\r)"); + + public class DoubleQuote: Parser + { + internal struct State { } + Func nbDoubleSafeCharset = Charset(c => + ( 0x100 <= c && c != '\u2028' && c != '\u2029' ) || + c == 0x09 || + ( 0x20 <= c && c < 0x100 && c != '\\' && c != '"' && c != 0x85 && c != 0xA0 ) + ); + + public DoubleQuote() + { + CharEscaping.Add('\x00', @"\0"); + CharEscaping.Add('\x07', @"\a"); + CharEscaping.Add('\x08', @"\b"); + CharEscaping.Add('\x0B', @"\v"); + CharEscaping.Add('\x0C', @"\f"); + CharEscaping.Add('\x1B', @"\e"); + CharEscaping.Add('\x22', @"\"""); + CharEscaping.Add('\x5C', @"\\"); + CharEscaping.Add('\x85', @"\N"); + CharEscaping.Add('\xA0', @"\_"); + CharEscaping.Add('\u2028', @"\L"); + CharEscaping.Add('\u2029', @"\P"); + } + + bool nbDoubleSafeChar() + { + if ( nbDoubleSafeCharset(text[p]) ) { + stringValue.Append(text[p++]); + return true; + } + return false; + } + + public string Quote(string s, string pres, Context c) + { + base.Parse(() => DoubleQuoteString(pres, c), s); + return "\"" + stringValue.ToString() + "\""; + } + + bool DoubleQuoteString(string pres, Context c) + { + return Repeat(() => cDoubleQuoteChar(pres, c)); + } + + bool cDoubleQuoteChar(string pres, Context c) + { + return + !EndOfString() && ( + nbDoubleSafeChar() || + bBreak(pres, c) || + nsEscapedChar() + ); + } + + Dictionary CharEscaping = new Dictionary(); + private bool nsEscapedChar() + { + var c= text[p]; + string escaped; + if ( CharEscaping.TryGetValue(c, out escaped) ) { + stringValue.Append(escaped); + } else { + if ( c < 0x100 ) { + stringValue.Append(string.Format(@"\x{0:x2}", (int)c)); + } else { + stringValue.Append(string.Format(@"\u{0:x4}", (int)c)); + } + } + p++; + return true; + } + + private bool bBreak(string pres, Context c) + { + if ( text[p] == '\r' ) { + stringValue.Append(@"\r"); + p++; + if ( !EndOfString() && text[p] == '\n' ) { + stringValue.Append(@"\n"); + p++; + } + } else + if ( text[p] == '\n' ) { + stringValue.Append(@"\n"); + p++; + } else { + return false; + } + if ( EndOfString() || c == Context.NoBreak ) + return true; + + // fold the string with escaping line break + stringValue.AppendLine(@"\"); + stringValue.Append(pres); + + // if the following line starts from space char, escape it. + if ( text[p] == ' ' ) + stringValue.Append(@"\"); + return true; + } + + private bool EndOfString() + { + return p == text.Length; + } + } + + private static YamlTagResolver AutoTagResolver = new YamlTagResolver(); + private static YamlParser PlainChecker = new YamlParser(); + + private void SequenceToYaml(YamlSequence node, string pres, Context c) + { + if ( node.Count == 0 || GetPropertyOrNull(node, "Compact") != null ) { + FlowSequenceToYaml(node, pres, c); + } else { + BlockSequenceToYaml(node, pres, c); + } + } + + private void BlockSequenceToYaml(YamlSequence node, string pres, Context c) + { + var tag = TagToYaml(node, "!!seq"); + if ( tag != "" || c == Context.Map ) { + WriteLine(tag); + c = Context.Normal; + } + string press = pres + " "; + foreach ( var item in node ) { + if ( c == Context.Normal ) + Write(pres); + Write("- "); + NodeToYaml(item, press, Context.List); + c = Context.Normal; + } + } + + private void FlowSequenceToYaml(YamlSequence node, string pres, Context c) + { + var tag = TagToYaml(node, "!!seq"); + if ( column > 80 ) { + WriteLine(); + Write(pres); + } + if ( tag != "" && tag != "!!seq" ) + Write(tag + " "); + Write("["); + foreach ( var item in node ) { + if ( item != node.First() ) + Write(", "); + if ( column > 100 ) { + WriteLine(); + Write(pres); + } + NodeToYaml(item, pres, Context.NoBreak); + } + Write("]"); + if ( c != Context.NoBreak ) + WriteLine(); + } + + private void MappingToYaml(YamlMapping node, string pres, Context c) + { + var tag = TagToYaml(node, "!!map"); + if ( node.Count > 0 ) { + if ( tag != "" || c == Context.Map ) { + WriteLine(tag); + c = Context.Normal; + } + string press = pres + " "; + foreach ( var item in node ) { + if ( c != Context.List ) + Write(pres); + c = Context.Normal; + if ( WriteImplicitKeyIfPossible(item.Key, press, Context.NoBreak) ) { + Write(": "); + NodeToYaml(item.Value, press, Context.Map); + } else { + // explicit key + Write("? "); + NodeToYaml(item.Key, press, Context.List); + Write(pres); + Write(": "); + NodeToYaml(item.Value, press, Context.List); + } + } + } else { + if ( tag != "" && tag != "!!map" ) + Write(tag + " "); + Write("{}"); + if ( c != Context.NoBreak ) + WriteLine(); + } + } + + bool WriteImplicitKeyIfPossible(YamlNode node, string pres, Context c) + { + if ( !( node is YamlScalar ) ) + return false; + int raw_saved = raw; + int col_saved = column; + var yaml_saved = yaml; + var result = ""; + using ( yaml = new StringWriter() ) { + NodeToYaml(node, pres, c); + result = yaml.ToString(); + } + if ( result.Length < 80 && result.IndexOf('\n') < 0 ) { + yaml = yaml_saved; + yaml.Write(result); + return true; + } else { + yaml = yaml_saved; + raw = raw_saved; + column = col_saved; + return false; + }; + } + + private string TagToYaml(YamlNode node, string defaultTag) + { + var tag = node.ShorthandTag(); + if ( tag == YamlNode.ShorthandTag(defaultTag) ) + return ""; + if ( tag == YamlNode.ShorthandTag(GetPropertyOrNull(node, "expectedTag")) ) + return ""; + if ( config.DontUseVerbatimTag ) { + if ( tag.StartsWith("!") ) { + tag = tag.UriEscapeForTag(); + } else { + tag = "!<" + tag.UriEscape() + ">"; + } + } else { + tag = tag.UriEscape(); + if ( !CanBeShorthand.IsMatch(tag) ) + tag = "!<" + tag + ">"; + } + return tag; + } + // has a tag handle and the body contains only ns-tag-char. + static Regex CanBeShorthand = new Regex(@"^!([-0-9a-zA-Z]*!)?[-0-9a-zA-Z%#;/?:@&=+$_.^*'\(\)]*$"); + } +} diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/YamlRepresenter.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/YamlRepresenter.cs new file mode 100644 index 0000000..6bcf6d8 --- /dev/null +++ b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/YamlRepresenter.cs @@ -0,0 +1,305 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +using System.Collections; +using System.Runtime.InteropServices; + +namespace System.Yaml.Serialization +{ + /// + /// Converts C# object to YamlNode + /// + /// + /// + /// object obj; + /// YamlNode node = YamlRepresenter.ObjectToNode(obj); + /// + /// + internal class YamlRepresenter: YamlNodeManipulator + { + private static string TypeNameToYamlTag(Type type) + { + /* + if ( TypeUtils.GetType(type.FullName) == null ) { + throw new ArgumentException( + "Can not serialize (non public?) type '{0}'.".DoFormat(type.FullName)); + } + */ + if ( type == typeof(int) ) + return YamlNode.ExpandTag("!!int"); + if ( type == typeof(string) ) + return YamlNode.ExpandTag("!!str"); + if ( type == typeof(Double) ) + return YamlNode.ExpandTag("!!float"); + if ( type == typeof(bool) ) + return YamlNode.ExpandTag("!!bool"); + if ( type == typeof(object[]) ) + return YamlNode.ExpandTag("!!seq"); + return "!" + type.FullName; + } + + public YamlNode ObjectToNode(object obj) + { + return ObjectToNode(obj, YamlNode.DefaultConfig); + } + + YamlConfig config; + public YamlNode ObjectToNode(object obj, YamlConfig config) + { + this.config = config; + appeared.Clear(); + if ( config.OmitTagForRootNode ) { + return ObjectToNode(obj, obj.GetType()); + } else { + return ObjectToNode(obj, (Type)null); + } + } + + YamlNode ObjectToNode(object obj, Type expect) + { + if ( obj != null && obj.GetType().IsClass && ( !(obj is string) || ((string)obj).Length >= 1000 ) ) + if ( appeared.ContainsKey(obj) ) + return appeared[obj]; + + var node = ObjectToNodeSub(obj, expect); + + if ( expect != null && expect != typeof(Object) ) + node.Properties["expectedTag"] = TypeNameToYamlTag(expect); + + AppendToAppeared(obj, node); + + return node; + } + + private void AppendToAppeared(object obj, YamlNode node) + { + if ( obj != null && obj.GetType().IsClass && ( !( obj is string ) || ( (string)obj ).Length >= 1000 ) ) + if ( !appeared.ContainsKey(obj) ) + appeared.Add(obj, node); + } + Dictionary appeared = + new Dictionary(TypeUtils.EqualityComparerByRef.Default); + + YamlNode ObjectToNodeSub(object obj, Type expect) + { + // !!null + if ( obj == null ) + return str("!!null", "null"); + + YamlScalar node; + if ( config.TagResolver.Encode(obj, out node) ) + return node; + + var type = obj.GetType(); + + if ( obj is IntPtr || type.IsPointer ) + throw new ArgumentException("Pointer object '{0}' can not be serialized.".DoFormat(obj.ToString())); + + if ( obj is char ) { + // config.TypeConverter.ConvertToString("\0") does not show "\0" + var n = str(TypeNameToYamlTag(type), obj.ToString() ); + return n; + } + + // bool, byte, sbyte, decimal, double, float, int ,uint, long, ulong, short, ushort, string, enum + if ( type.IsPrimitive || type.IsEnum || type == typeof(decimal) || type == typeof(string) ) { + var n = str(TypeNameToYamlTag(type), config.TypeConverter.ConvertToString(obj) ); + return n; + } + + // TypeConverterAttribute + if ( EasyTypeConverter.IsTypeConverterSpecified(type) ) + return str(TypeNameToYamlTag(type), config.TypeConverter.ConvertToString(obj)); + + // array + if ( type.IsArray ) + return CreateArrayNode((Array)obj); + + if ( type == typeof(Dictionary) ) + return DictionaryToMap(obj); + + // class / struct + if ( type.IsClass || type.IsValueType ) + return CreateMapping(TypeNameToYamlTag(type), obj); + + throw new NotImplementedException( + "Type '{0}' could not be written".DoFormat(type.FullName) + ); + } + + private YamlNode CreateArrayNode(Array array) + { + Type type = array.GetType(); + return CreateArrayNodeSub(array, 0, new long[type.GetArrayRank()]); + } + private YamlNode CreateArrayNodeSub(Array array, int i, long[] indices) + { + var type= array.GetType(); + var element = type.GetElementType(); + var sequence = seq(); + if ( i == 0 ) { + sequence.Tag = TypeNameToYamlTag(type); + AppendToAppeared(array, sequence); + } + if ( element.IsPrimitive || element.IsEnum || element == typeof(decimal) ) + if ( array.Rank == 1 || ArrayLength(array, i+1) < 20 ) + sequence.Properties["Compact"] = "true"; + for ( indices[i] = 0; indices[i] < array.GetLength(i); indices[i]++ ) + if ( i == array.Rank - 1 ) { + var n = ObjectToNode(array.GetValue(indices), type.GetElementType()); + sequence.Add(n); + } else { + var s = CreateArrayNodeSub(array, i + 1, indices); + sequence.Add(s); + } + return sequence; + } + static long ArrayLength(Array array, int i) + { + long n = 1; + for ( ; i < array.Rank; i++ ) + n *= array.GetLength(i); + return n; + } + + private YamlNode CreateBinaryArrayNode(Array array) + { + var type = array.GetType(); + var element = type.GetElementType(); + if ( !TypeUtils.IsPureValueType(element) ) + throw new InvalidOperationException( + "Can not serialize {0} as binary because it contains non-value-type(s).".DoFormat(type.FullName)); + var elementSize = Marshal.SizeOf(element); + var binary = new byte[array.LongLength * elementSize]; + int j = 0; + for ( int i = 0; i < array.Length; i++ ) { + IntPtr p = Marshal.UnsafeAddrOfPinnedArrayElement(array, i); + Marshal.Copy(p, binary, j, elementSize); + j += elementSize; + } + var dimension = ""; + if ( array.Rank > 1 ) { + for ( int i = 0; i < array.Rank; i++ ) { + if ( dimension != "" ) + dimension += ", "; + dimension += array.GetLength(i); + } + dimension = "[" + dimension + "]\r\n"; + } + var result= str(TypeNameToYamlTag(type), dimension + Base64Encode(type, binary)); + result.Properties["Don'tCareLineBreaks"] = "true"; + return result; + } + + private static string Base64Encode(Type type, byte[] binary) + { + var s = System.Convert.ToBase64String(binary); + var sb = new StringBuilder(); + for ( int i = 0; i < s.Length; i += 80 ) { + if ( i + 80 < s.Length ) { + sb.AppendLine(s.Substring(i, 80)); + } else { + sb.AppendLine(s.Substring(i)); + } + } + return sb.ToString(); + } + + private YamlScalar MapKey(string key) + { + var node = (YamlScalar)key; + node.Properties["expectedTag"] = YamlNode.ExpandTag("!!str"); + node.Properties["plainText"] = "true"; + return node; + } + + private YamlMapping CreateMapping(string tag, object obj /*, bool by_content */ ) + { + var type = obj.GetType(); + + /* + if ( type.IsClass && !by_content && type.GetConstructor(Type.EmptyTypes) == null ) + throw new ArgumentException("Type {0} has no default constructor.".DoFormat(type.FullName)); + */ + + var mapping = map(); + mapping.Tag = tag; + AppendToAppeared(obj, mapping); + + // iterate props / fields + var accessor = ObjectMemberAccessor.FindFor(type); + foreach ( var entry in accessor ) { + var name = entry.Key; + var access = entry.Value; + if ( !access.ShouldSeriealize(obj) ) + continue; + if ( access.SerializeMethod == YamlSerializeMethod.Binary ) { + var array = CreateBinaryArrayNode((Array)access.Get(obj)); + AppendToAppeared(access.Get(obj), array); + array.Properties["expectedTag"] = TypeNameToYamlTag(access.Type); + mapping.Add(MapKey(entry.Key), array); + } else { + try { + var value = ObjectToNode(access.Get(obj), access.Type); + if( (access.SerializeMethod != YamlSerializeMethod.Content) || + !(value is YamlMapping) || ((YamlMapping)value).Count>0 ) + mapping.Add(MapKey(entry.Key), value); + } catch { + } + } + } + // if the object is IDictionary or IDictionary<,> + if ( accessor.IsDictionary && !accessor.IsReadOnly(obj) ) { + var dictionary = DictionaryToMap(obj); + if ( dictionary.Count > 0 ) + mapping.Add(MapKey("IDictionary.Entries"), dictionary); + } else { + // if the object is ICollection<> or IList + if ( accessor.CollectionAdd != null && !accessor.IsReadOnly(obj)) { + var iter = ( (IEnumerable)obj ).GetEnumerator(); + if ( iter.MoveNext() ) { // Count > 0 + iter.Reset(); + mapping.Add(MapKey("ICollection.Items"), CreateSequence("!!seq", iter, accessor.ValueType)); + } + } + } + return mapping; + } + + private YamlMapping DictionaryToMap(object obj) + { + var accessor = ObjectMemberAccessor.FindFor(obj.GetType()); + var iter = ( (IEnumerable)obj ).GetEnumerator(); + var dictionary = map(); + Func key = null, value = null; + while ( iter.MoveNext() ) { + if ( key == null ) { + var keyvalue = iter.Current.GetType(); + var keyprop = keyvalue.GetProperty("Key"); + var valueprop = keyvalue.GetProperty("Value"); + key = o => keyprop.GetValue(o, new object[0]); + value = o => valueprop.GetValue(o, new object[0]); + } + dictionary.Add( + ObjectToNode(key(iter.Current), accessor.KeyType), + ObjectToNode(value(iter.Current), accessor.ValueType) + ); + } + return dictionary; + } + + public YamlSequence CreateSequence(string tag, IEnumerator iter, Type expect) + { + var sequence = seq(); + sequence.Tag = tag; + if ( expect != null && ( expect.IsPrimitive || expect.IsEnum || expect == typeof(decimal) ) ) + sequence.Properties["Compact"] = "true"; + + while ( iter.MoveNext() ) + sequence.Add(ObjectToNode(iter.Current, expect)); + return sequence; + } + } +} diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/YamlSerializer.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/YamlSerializer.cs new file mode 100644 index 0000000..ff70f79 --- /dev/null +++ b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/YamlSerializer.cs @@ -0,0 +1,869 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +using System.ComponentModel; +using System.Collections; +using System.Text.RegularExpressions; +using System.Diagnostics; + +using System.IO; + +namespace System.Yaml.Serialization +{ + /// + /// class has instance methods and , + /// with which C# native objects can be converted into / from YAML text without any preparations. + /// + /// var serializer = new YamlSerializer(); + /// object obj = GetObjectToSerialize(); + /// string yaml = serializer.Serialize(obj); + /// object restored = serializer.Deserialize(yaml); + /// Assert.AreEqual(obj, restored); + /// + /// + /// + /// + ///

What kind of objects can be serialized?

+ /// + /// can serialize / deserialize native C# objects of primitive types + /// (bool, char, int,...), enums, built-in non-primitive types (string, decimal), structures, + /// classes and arrays of these types. + /// + /// + /// On the other hand, it does not deal with IntPtr (which is a primitive type, though) and + /// pointer types (void*, int*, ...) because these types are, by their nature, not persistent. + /// + /// + /// + /// Classes without a default constructor can be deserialized only when the way of activating an instance + /// is explicitly specified by . + /// + /// + /// + /// object obj = new object[]{ + /// null, + /// "abc", + /// true, + /// 1, + /// (Byte)1, + /// 1.0, + /// "1", + /// new double[]{ 1.1, 2, -3 }, + /// new string[]{ "def", "ghi", "1" }, + /// new System.Drawing.Point(1,3), + /// new System.Drawing.SolidBrush(Color.Blue) + /// }; + /// + /// var serializer = new YamlSerializer(); + /// string yaml = serializer.Serialize(obj); + /// // %YAML 1.2 + /// // --- + /// // - null + /// // - abc + /// // - True + /// // - 1 + /// // - !System.Byte 1 + /// // - !!float 1 + /// // - "1" + /// // - !<!System.Double[]%gt; [1.1, 2, -3] + /// // - !<!System.String[]%gt; + /// // - def + /// // - ghi + /// // - !System.Drawing.Point 1, 3 + /// // - !System.Drawing.SolidBrush + /// // Color: Blue + /// // ... + /// + /// object restored; + /// try { + /// restored = YamlSerializer.Deserialize(yaml)[0]; + /// } catch(MissingMethodException) { + /// // default constructor is missing for SolidBrush + /// } + /// + /// // Let the library know how to activate an instance of SolidBrush. + /// YamlNode.DefaultConfig.AddActivator<System.Drawing.SolidBrush>( + /// () => new System.Drawing.SolidBrush(Color.Black /* dummy */)); + /// + /// // Then, all the objects can be restored correctly. + /// restored = serializer.Deserialize(yaml)[0]; + /// + /// + /// A YAML document generated by always have a %YAML directive and + /// explicit document start ("---") and end ("...") marks. + /// This allows several documents to be written in a single YAML stream. + /// + /// + /// var yaml = ""; + /// var serializer = new YamlSerializer(); + /// yaml += serializer.Serialize("a"); + /// yaml += serializer.Serialize(1); + /// yaml += serializer.Serialize(1.1); + /// // %YAML 1.2 + /// // --- + /// // a + /// // ... + /// // %YAML 1.2 + /// // --- + /// // 1 + /// // ... + /// // %YAML 1.2 + /// // --- + /// // 1.1 + /// // ... + /// + /// object[] objects = serializer.Deserialize(yaml); + /// // objects[0] == "a" + /// // objects[1] == 1 + /// // objects[2] == 1.1 + /// + /// + /// Since a YAML stream can consist of multiple YAML documents as above, + /// returns an array of . + /// + /// + ///

Serializing structures and classes

+ /// + /// For structures and classes, by default, all public fields and public properties are + /// serialized. Note that protected / private members are always ignored. + /// + ///

Serialization methods

+ /// + /// Readonly value-type members are also ignored because there is no way to + /// assign a new value to them on deserialization, while readonly class-type members + /// are serialized. When deserializing, instead of creating a new object and assigning it + /// to the member, the child members of such class instance are restored independently. + /// Such a deserializing method is refered to + /// YamlSerializeMethod.Content. + /// + /// + /// On the other hand, when writeable fields/properties are deserialized, new objects are + /// created by using the parameters in the YAML description and assiend to the fields/properties. + /// Such a deserializing method is refered to + /// YamlSerializeMethod.Assign. Writeable properties can be explicitly specified to use + /// YamlSerializeMethod.Content method for + /// deserialization, by adding to its definition. + /// + /// + /// Another type of serializing method is + /// YamlSerializeMethod.Binary. + /// This method is only applicable to an array-type field / property that contains + /// only value-type members. + /// + /// If serializing method is specified, + /// the member is never serialized nor deserialized. + /// + /// + /// public class Test1 + /// { + /// public int PublicProp { get; set; } // processed (by assign) + /// protected int ProtectedProp { get; set; } // Ignored + /// private int PrivateProp { get; set; } // Ignored + /// internal int InternalProp { get; set; } // Ignored + /// + /// public int PublicField; // processed (by assign) + /// protected int ProtectedField; // Ignored + /// private int PrivateField; // Ignored + /// internal int InternalField; // Ignored + /// + /// public List<string> ClassPropByAssign // processed (by assign) + /// { get; set; } + /// + /// public int ReadOnlyValueProp { get; private set; } // Ignored + /// public List<string> ReadOnlyClassProp // processed (by content) + /// { get; private set; } + /// + /// [YamlSerialize(YamlSerializeMethod.Content)] + /// public List<string> ClassPropByContent// processed (by content) + /// { get; set; } + /// + /// public int[] IntArrayField = // processed (by assign) + /// new int[10]; + /// + /// [YamlSerialize(YamlSerializeMethod.Binary)] + /// public int[] IntArrayFieldBinary = // processed (as binary) + /// new int[100]; + /// + /// [YamlSerialize(YamlSerializeMethod.Never)] + /// public int PublicPropHidden; // Ignored + /// + /// public Test1() + /// { + /// ClassPropByAssign = new List<string>(); + /// ReadOnlyClassProp = new List<string>(); + /// ClassPropByContent = new List<string>(); + /// } + /// } + /// + /// public void TestPropertiesAndFields1() + /// { + /// var test1 = new Test1(); + /// test1.ClassPropByAssign.Add("abc"); + /// test1.ReadOnlyClassProp.Add("def"); + /// test1.ClassPropByContent.Add("ghi"); + /// var rand = new Random(0); + /// for ( int i = 0; i < test1.IntArrayFieldBinary.Length; i++ ) + /// test1.IntArrayFieldBinary[i] = rand.Next(); + /// + /// var serializer = new YamlSerializer(); + /// string yaml = serializer.Serialize(test1); + /// // %YAML 1.2 + /// // --- + /// // !YamlSerializerTest.Test1 + /// // PublicProp: 0 + /// // ClassPropByAssign: + /// // Capacity: 4 + /// // ICollection.Items: + /// // - abc + /// // ReadOnlyClassProp: + /// // Capacity: 4 + /// // ICollection.Items: + /// // - def + /// // ClassPropByContent: + /// // Capacity: 4 + /// // ICollection.Items: + /// // - ghi + /// // PublicField: 0 + /// // IntArrayField: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + /// // IntArrayFieldBinary: |+2 + /// // Gor1XAwenmhGkU5ib9NxR11LXxp1iYlH5LH4c9hImTitWSB9Z78II2UvXSXV99A79fj6UBn3GDzbIbd9 + /// // yBDjAyslYm58iGd/NN+tVjuLRCg3cJBo+PWMbIWm9n4AEC0E7LKXWV5HXUNk7I13APEDWFMM/kWTz2EK + /// // s7LzFw2gBjpKugkmQJqIfinpQ1J1yqhhz/XjA3TBxDBsEuwrD+SNevQSqEC+/KRbwgE6D011ACMeyRt0 + /// // BOG6ZesRKCtL0YU6tSnLEpgKVBz+R300qD3/W0aZVk+1vHU+auzyGCGUaHCGd6dpRoEhXoIg2m3+AwJX + /// // EJ37T+TA9BuEPJtyGoq+crQMFQtXj1Zriz3HFbReclLvDdVpZlcOHPga/3+3Y509EHZ7UyT7H1xGeJxn + /// // eXPrDDb0Ul04MfZb4UYREOfR3HNzNTUYGRsIPUvHOEW7AaoplIfkVQp19DvGBrBqlP2TZ9atlWUHVdth + /// // 7lIBeIh0wiXxoOpCbQ7qVP9GkioQUrMkOcAJaad3exyZaOsXxznFCA== + /// // ... + /// } + /// + /// + ///

Default values of fields and properties

+ /// + /// is aware of + /// System.ComponentModel.DefaultValueAttribute. + /// So, when a member of a structure / class instance has a value that equals to the default value, + /// the member will not be written in the YAML text. + /// + /// It also checkes for the result of ShouldSerializeXXX method. For instance, just before serializing Font + /// property of some type, bool ShouldSerializeFont() method is called if exists. If the method returns false, + /// Font property will not be written in the YAML text. ShouldSerializeXXX method can be non-public. + /// + /// + /// using System.ComponentModel; + /// + /// public class Test2 + /// { + /// [DefaultValue(0)] + /// public int Default0 = 0; + /// + /// [DefaultValue("a")] + /// public string Defaulta = "a"; + /// + /// public int DynamicDefault = 0; + /// + /// bool ShouldSerializeDynamicDefault() + /// { + /// return Default0 != DynamicDefault; + /// } + /// } + /// + /// public void TestDefaultValue() + /// { + /// var test2 = new Test2(); + /// var serializer = new YamlSerializer(); + /// + /// // All properties have defalut values. + /// var yaml = serializer.Serialize(test2); + /// // %YAML 1.2 + /// // --- + /// // !YamlSerializerTest.Test2 {} + /// // ... + /// + /// test2.Defaulta = "b"; + /// yaml = serializer.Serialize(test2); + /// // %YAML 1.2 + /// // --- + /// // !YamlSerializerTest.Test2 + /// // Defaulta: b + /// // ... + /// + /// test2.Defaulta = "a"; + /// var yaml = serializer.Serialize(test2); + /// // %YAML 1.2 + /// // --- + /// // !YamlSerializerTest.Test2 {} + /// // ... + /// + /// test2.DynamicDefault = 1; + /// yaml = serializer.Serialize(test2); + /// // %YAML 1.2 + /// // --- + /// // !YamlSerializerTest.Test2 + /// // DynamicDefault: 1 + /// // ... + /// + /// test2.Default0 = 1; + /// yaml = serializer.Serialize(test2); + /// // %YAML 1.2 + /// // --- + /// // !YamlSerializerTest.Test2 + /// // Default0: 1 + /// // ... + /// } + /// + /// + ///

Collection classes

+ /// + /// If an object implements , or + /// the child objects are serialized as well its other public members. + /// Pseudproperty ICollection.Items or IDictionary.Entries appears to hold the child objects. + /// + ///

Multitime appearance of a same object

+ /// + /// preserve C# objects' graph structure. Namely, when a same objects are refered to + /// from several points in the object graph, the structure is correctly described in YAML text and restored objects + /// preserve the structure. can safely manipulate directly / indirectly self refering + /// objects, too. + /// + /// + /// public class TestClass + /// { + /// public List<TestClass> list = + /// new List<TestClass>(); + /// } + /// + /// public class ChildClass: TestClass + /// { + /// } + /// + /// void RecursiveObjectsTest() + /// { + /// var a = new TestClass(); + /// var b = new ChildClass(); + /// a.list.Add(a); + /// a.list.Add(a); + /// a.list.Add(b); + /// a.list.Add(a); + /// a.list.Add(b); + /// b.list.Add(a); + /// var serializer = new YamlSerializer(); + /// string yaml = serializer.Serialize(a); + /// // %YAML 1.2 + /// // --- + /// // &A !TestClass + /// // list: + /// // Capacity: 8 + /// // ICollection.Items: + /// // - *A + /// // - *A + /// // - &B !ChildClass + /// // list: + /// // Capacity: 4 + /// // ICollection.Items: + /// // - *A + /// // - *A + /// // - *B + /// // ... + /// + /// var restored = (TestClass)serializer.Deserialize(yaml)[0]; + /// Assert.IsTrue(restored == restored.list[0]); + /// Assert.IsTrue(restored == restored.list[1]); + /// Assert.IsTrue(restored == restored.list[3]); + /// Assert.IsTrue(restored == restored.list[5]); + /// Assert.IsTrue(restored.list[2] == restored.list[4]); + /// } + /// + /// + /// This is not the case if the object is . Same instances of + /// are repeatedly written in a YAML text and restored as different + /// instance of when deserialized, unless the content of the string + /// is extremely long (longer than 999 chars). + /// + /// + /// // 1000 chars + /// string long_str = + /// "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" + + /// "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" + + /// "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" + + /// "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" + + /// "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" + + /// "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" + + /// "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" + + /// "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" + + /// "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" + + /// "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"; + /// string short_str = "12345"; + /// object obj = new object[] { long_str, long_str, short_str, short_str }; + /// var serializer = new YamlSerializer(); + /// string yaml = serializer.Serialize(obj); + /// // %YAML 1.2 + /// // --- + /// // - &A 01234567890123456789012345678901234567890123456789 ... (snip) ... 789 + /// // - *A + /// // - "12345" + /// // - "12345" + /// // ... + /// + /// + ///

YAML text written / read by

+ /// + /// When serializing, intelligently uses various YAML 1.2 styles, + /// namely the block style, flow style, explicit mapping and implicit mapping, to maximize readability + /// of the YAML stream. + /// + /// + /// [Flags] + /// enum TestEnum: uint + /// { + /// abc = 1, + /// あいう = 2 + /// } + /// + /// public void TestVariousFormats() + /// { + /// var dict = new Dictionary<object, object>(); + /// dict.Add(new object[] { 1, "a" }, new object()); + /// object obj = new object[]{ + /// dict, + /// null, + /// "abc", + /// "1", + /// "a ", + /// "- a", + /// "abc\n", + /// "abc\ndef\n", + /// "abc\ndef\nghi", + /// new double[]{ 1.1, 2, -3, 3.12, 13.2 }, + /// new int[,] { { 1, 3}, {4, 5}, {10, 1} }, + /// new string[]{ "jkl", "mno\npqr" }, + /// new System.Drawing.Point(1,3), + /// TestEnum.abc, + /// TestEnum.abc | TestEnum.あいう, + /// }; + /// var config = new YamlConfig(); + /// config.ExplicitlyPreserveLineBreaks = false; + /// var serializer = new YamlSerializer(config); + /// string yaml = serializer.Serialize(obj); + /// + /// // %YAML 1.2 + /// // --- + /// // - !<!System.Collections.Generic.Dictionary%602[[System.Object,...],[System.Object,...]]> + /// // Keys: {} + /// // Values: {} + /// // IDictionary.Entries: + /// // ? - 1 + /// // - a + /// // : !System.Object {} + /// // - null + /// // - abc + /// // - "1" + /// // - "a " + /// // - "- a" + /// // - "abc\n" + /// // - |+2 + /// // abc + /// // def + /// // - |-2 + /// // abc + /// // def + /// // ghi + /// // - !<!System.Double[]> [1.1, 2, -3, 3.12, 13.2] + /// // - !<!System.Int32[,]> [[1, 3], [4, 5], [10, 1]] + /// // - !<!System.String[]> + /// // - jkl + /// // - |-2 + /// // mno + /// // pqr + /// // - !System.Drawing.Point 1, 3 + /// // - !TestEnum abc + /// // - !TestEnum abc, あいう + /// // ... + /// } + /// + /// + /// When deserializing, accepts any valid YAML 1.2 documents. + /// TAG directives, comments, flow / block styles, implicit / explicit mappings can be freely used + /// to express valid C# objects. Namely, the members of the array can be given eighter in a flow style + /// or in a block style. + /// + /// + /// By default, outputs a YAML stream with line break of "\r\n". + /// This can be customized either by setting YamlNode.DefaultConfig.LineBreakForOutput or + /// by giving an instance of to the + /// constructor. + /// + /// + /// + /// var serializer = new YamlSerializer(); + /// var yaml = serializer.Serialize("abc"); + /// // %YAML 1.2\r\n // line breaks are explicitly shown in this example + /// // ---\r\n + /// // abc\r\n + /// // ...\r\n + /// + /// var config = new YamlConfig(); + /// config.LineBreakForOutput = "\n"; + /// serializer = new YamlSerializer(config); + /// var yaml = serializer.Serialize("abc"); + /// // %YAML 1.2\n + /// // ---\n + /// // abc\n + /// // ...\n + /// + /// YamlNode.DefaultConfig.LineBreakForOutput = "\n"; + /// + /// var serializer = new YamlSerializer(); + /// serializer = new YamlSerializer(); + /// var yaml = serializer.Serialize("abc"); + /// // %YAML 1.2\n + /// // ---\n + /// // abc\n + /// // ...\n + /// + /// + ///

Line breaks in YAML text

+ /// + /// By default, line breaks in multi line values are explicitly presented as escaped style. + /// Although, this makes the resulting YAML stream hard to read, it is necessary to preserve + /// the exact content of the string because the YAML specification requires that a YAML parser + /// must normalize evely line break that is not escaped in a YAML document to be a single line + /// feed "\n" when deserializing. + /// + /// In order to have the YAML documents easy to be read, set + /// YamlConfig.ExplicitlyPreserveLineBreaks + /// false. Then, the multiline values of will be written in literal style. + /// + /// Of course, it makes all the line breaks to be normalized into a single line feeds "\n". + /// + /// + /// var serializer = new YamlSerializer(); + /// var text = "abc\r\n def\r\nghi\r\n"; + /// // abc + /// // def + /// // ghi + /// + /// // By default, line breaks explicitly appears in escaped form. + /// var yaml = serializer.Serialize(text); + /// // %YAML 1.2 + /// // --- + /// // "abc\r\n\ + /// // \ def\r\n\ + /// // ghi\r\n" + /// // ... + /// + /// // Original line breaks are preserved + /// var restored = (string)serializer.Deserialize(yaml)[0]; + /// // "abc\r\n def\r\nghi\r\n" + /// + /// + /// YamlNode.DefaultConfig.ExplicitlyPreserveLineBreaks = false; + /// + /// // Literal style is easier to be read. + /// var yaml = serializer.Serialize(text); + /// // %YAML 1.2 + /// // --- + /// // |+2 + /// // abc + /// // def + /// // ghi + /// // ... + /// + /// // Original line breaks are lost. + /// var restored = (string)serializer.Deserialize(yaml)[0]; + /// // "abc\n def\nghi\n" + /// + /// + /// This library offers two work arounds for this problem, although both of which + /// violates the official behavior of a YAML parser defined in the YAML specification. + /// + /// One is to set YamlConfig.LineBreakForInput + /// to be "\r\n". Then, the YAML parser normalizes all line breaks into "\r\n" instead of "\n". + /// + /// The other is to set YamlConfig.NormalizeLineBreaks + /// false. It disables the line break normalization both at output and at input. Namely, the line breaks are + /// written and read as-is when serialized / deserialized. + /// + /// + /// var serializer = new YamlSerializer(); + /// + /// // text with mixed line breaks + /// var text = "abc\r def\nghi\r\n"; + /// // abc\r // line breaks are explicitly shown in this example + /// // def\n + /// // ghi\r\n + /// + /// YamlNode.DefaultConfig.ExplicitlyPreserveLineBreaks = false; + /// + /// // By default, all line breaks are normalized to "\r\n" when serialized. + /// var yaml = serializer.Serialize(text); + /// // %YAML 1.2\r\n + /// // ---\r\n + /// // |+2\r\n + /// // abc\r\n + /// // def\r\n + /// // ghi\r\n + /// // ...\r\n + /// + /// // When deserialized, line breaks are normalized into "\n". + /// var restored = (string)serializer.Deserialize(yaml)[0]; + /// // "abc\n def\nghi\n" + /// + /// // Line breaks are normalized into "\r\n" instead of "\n". + /// YamlNode.DefaultConfig.LineBreakForInput = "\r\n"; + /// restored = (string)serializer.Deserialize(yaml)[0]; + /// // "abc\r\n def\r\nghi\r\n" + /// + /// // Line breaks are written as is, + /// YamlNode.DefaultConfig.NormalizeLineBreaks = false; + /// var yaml = serializer.Serialize(text); + /// // %YAML 1.2\r\n + /// // ---\r\n + /// // |+2\r\n + /// // abc\r + /// // def\n + /// // ghi\r\n + /// // ...\r\n + /// + /// // and are read as is. + /// restored = (string)serializer.Deserialize(yaml)[0]; + /// // "abc\r def\nghi\r\n" + /// + /// // Note that when the line breaks of YAML stream is changed + /// // between serialization and deserialization, the original + /// // line breaks are lost. + /// yaml = yaml.Replace("\r\n", "\n").Replace("\r", "\n"); + /// restored = (string)serializer.Deserialize(yaml)[0]; + /// // "abc\n def\nghi\n" + /// + /// + /// It is repeatedly stated that although these two options are useful in many situation, + /// they makes the YAML parser violate the YAML specification. + /// + ///
+ public class YamlSerializer + { + static YamlRepresenter representer = new YamlRepresenter(); + static YamlConstructor constructor = new YamlConstructor(); + + YamlConfig config = null; + + /// + /// Initialize an instance of that obeys + /// . + /// + public YamlSerializer() + { } + + /// + /// Initialize an instance of with custom . + /// + /// Custom to customize serialization. + public YamlSerializer(YamlConfig config) + { + this.config = config; + } + + /// + /// Serialize C# object into YAML text. + /// + /// Object to be serialized. + /// YAML text. + public string Serialize(object obj) + { + var c = config != null ? config : YamlNode.DefaultConfig; + var node = representer.ObjectToNode(obj, c); + return node.ToYaml(c); + } + /// + /// Serialize C# object into YAML text and write it into a . + /// + /// A to which the YAML text is written. + /// Object to be serialized. + public void Serialize(Stream s, object obj) + { + var c = config != null ? config : YamlNode.DefaultConfig; + var node = representer.ObjectToNode(obj, c); + node.ToYaml(s, c); + } + /// + /// Serialize C# object into YAML text and write it into a . + /// + /// A to which the YAML text is written. + /// Object to be serialized. + public void Serialize(TextWriter tw, object obj) + { + var c = config != null ? config : YamlNode.DefaultConfig; + var node = representer.ObjectToNode(obj, c); + node.ToYaml(tw, c); + } + /// + /// Serialize C# object into YAML text and save it into a file named as . + /// + /// A file name to which the YAML text is written. + /// Object to be serialized. + public void SerializeToFile(string YamlFileName, object obj) + { + using ( var s = new FileStream(YamlFileName, FileMode.Create, FileAccess.Write) ) + Serialize(s, obj); + } + + /// + /// Deserialize C# object(s) from a YAML text. Since a YAML text can contain multiple YAML documents, each of which + /// represents a C# object, the result is returned as an array of . + /// + /// A YAML text from which C# objects are deserialized. + /// Expected type(s) of the root object(s) in the YAML stream. + /// C# object(s) deserialized from YAML text. + public object[] Deserialize(string yaml, params Type[] types) + { + var c = config != null ? config : YamlNode.DefaultConfig; + + var parser = new YamlParser(); + var nodes = parser.Parse(yaml, c); + var objects = new List(); + for ( int i = 0; i < nodes.Count; i++ ) { + var node = nodes[i]; + if ( i < types.Length ) { + objects.Add(constructor.NodeToObject(node, types[i], c)); + } else { + objects.Add(constructor.NodeToObject(node, null, c)); + } + } + return objects.ToArray(); + } + /// + /// Deserialize C# object(s) from a YAML text in a . + /// Since a YAML text can contain multiple YAML documents, each of which + /// represents a C# object, the result is returned as an array of . + /// + /// A that contains YAML text from which C# objects are deserialized. + /// Expected type(s) of the root object(s) in the YAML stream. + /// C# object(s) deserialized from YAML text. + public object[] Deserialize(Stream s, params Type[] types) + { + return Deserialize(new StreamReader(s), types); + } + /// + /// Deserialize C# object(s) from a YAML text in a . + /// Since a YAML text can contain multiple YAML documents, each of which + /// represents a C# object, the result is returned as an array of . + /// + /// A that contains YAML text from which C# objects are deserialized. + /// Expected type(s) of the root object(s) in the YAML stream. + /// C# object(s) deserialized from YAML text. + public object[] Deserialize(TextReader tr, params Type[] types) + { + return Deserialize(tr.ReadToEnd(), types); + } + /// + /// Deserialize C# object(s) from a YAML text in a file named as . + /// Since a YAML text can contain multiple YAML documents, each of which + /// represents a C# object, the result is returned as an array of . + /// + /// The name of a file that contains YAML text from which C# objects are deserialized. + /// Expected type(s) of the root object(s) in the YAML stream. + /// C# object(s) deserialized from YAML text. + public object[] DeserializeFromFile(string YamlFileName, params Type[] types) + { + using ( var s = new FileStream(YamlFileName, FileMode.Open, FileAccess.Read) ) + return Deserialize(s, types); + } + } + + /// + /// Add .DoFunction method to string + /// + internal static class StringExtention + { + /// + /// Short expression of string.Format(XXX, arg1, arg2, ...) + /// + /// + /// + /// + public static string DoFormat(this string format, params object[] args) + { + return string.Format(format, args); + } + } + + /// + /// Specify the way to store a property or field of some class or structure. + /// See for detail. + /// + /// + /// + public enum YamlSerializeMethod + { + /// + /// The property / field will not be stored. + /// + Never, + /// + /// When restored, new object is created by using the parameters in + /// the YAML data and assigned to the property / field. When the + /// property / filed is writeable, this is the default. + /// + Assign, + /// + /// Only valid for a property / field that has a class or struct type. + /// When restored, instead of recreating the whole class or struct, + /// the members are independently restored. When the property / field + /// is not writeable this is the default. + /// + Content, + /// + /// Only valid for a property / field that has an array type of a + /// some value type. The content of the array is stored in a binary + /// format encoded in base64 style. + /// + Binary + } + + /// + /// Specify the way to store a property or field of some class or structure. + /// + /// See for detail. + /// + /// + /// + public sealed class YamlSerializeAttribute: Attribute + { + internal YamlSerializeMethod SerializeMethod; + /// + /// Specify the way to store a property or field of some class or structure. + /// + /// See for detail. + /// + /// + /// + /// + /// + /// - Never: The property / field will not be stored. + /// + /// + /// - Assign: When restored, new object is created by using the parameters in + /// the YAML data and assigned to the property / field. When the + /// property / filed is writeable, this is the default. + /// + /// + /// - Content: Only valid for a property / field that has a class or struct type. + /// When restored, instead of recreating the whole class or struct, + /// the members are independently restored. When the property / field + /// is not writeable this is the default. + /// + /// + /// - Binary: Only valid for a property / field that has an array type of a + /// some value type. The content of the array is stored in a binary + /// format encoded in base64 style. + /// + /// + public YamlSerializeAttribute(YamlSerializeMethod SerializeMethod) + { + this.SerializeMethod = SerializeMethod; + } + } + +} diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/YamlSerializer.csproj b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/YamlSerializer.csproj new file mode 100644 index 0000000..5090863 --- /dev/null +++ b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/YamlSerializer.csproj @@ -0,0 +1,99 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {AD9F3A60-C492-4823-8F24-6F4854E7CBF5} + Exe + Properties + YamlSerializer + YamlSerializer + v4.5.2 + 512 + + + + + 3.5 + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + false + + + none + true + bin\Release\ + TRACE + prompt + 4 + bin\Release\YamlSerializer.XML + false + + + YamlSerializerProgram.Program + + + + + 3.5 + + + 3.5 + + + 3.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/YamlTagPrefixes.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/YamlTagPrefixes.cs new file mode 100644 index 0000000..51e84a1 --- /dev/null +++ b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/YamlTagPrefixes.cs @@ -0,0 +1,85 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace System.Yaml +{ + /// + /// Reset(); + /// SetupDefaultTagPrefixes(); + /// Add(tag_handle, tag_prefix); + /// verbatim_tag = Resolve(tag_handle, tag_name); + /// + internal class YamlTagPrefixes + { + Dictionary TagPrefixes = new Dictionary(); + Func error; + + #region Debug.Assert + #if DEBUG + /// + /// Since System.Diagnostics.Debug.Assert is too anoying while development, + /// this class temporarily override Debug.Assert action. + /// + private class Debug + { + public static void Assert(bool condition) + { + Assert(condition, ""); + } + public static void Assert(bool condition, string message) + { + if ( !condition ) + throw new Exception("assertion failed: " + message); + } + } + #endif + #endregion + + public YamlTagPrefixes(Func error) + { + this.error = error; + } + void Error(string format, params object[] args) + { + error(format, args); + } + public bool Reset() + { + TagPrefixes.Clear(); + return true; + } + public void SetupDefaultTagPrefixes() + { + if ( !TagPrefixes.ContainsKey("!") ) + TagPrefixes.Add("!", "!"); + if ( !TagPrefixes.ContainsKey("!!") ) + TagPrefixes.Add("!!", YamlNode.DefaultTagPrefix); + } + public void Add(string tag_handle, string tag_prefix) + { + if ( TagPrefixes.ContainsKey(tag_handle) ) { + switch ( tag_handle ) { + case "!": + Error("Primary tag prefix is already defined as '{0}'.", TagPrefixes["!"]); + break; + case "!!": + Error("Secondary tag prefix is already defined as '{0}'.", TagPrefixes["!!"]); + break; + default: + Error("Tag prefix for the handle {0} is already defined as '{1}'.", tag_handle, TagPrefixes[tag_handle]); + break; + } + } + TagPrefixes.Add(tag_handle, tag_prefix); + } + public string Resolve(string tag_handle, string tag_name) + { + if ( !TagPrefixes.ContainsKey(tag_handle) ) + Error("Tag handle {0} is not registered.", tag_handle); + var tag = TagPrefixes[tag_handle] + tag_name; + return tag; + } + } +} diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/YamlTagResolutionScheme.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/YamlTagResolutionScheme.cs new file mode 100644 index 0000000..dc626b2 --- /dev/null +++ b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/YamlTagResolutionScheme.cs @@ -0,0 +1,289 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +using System.Text.RegularExpressions; + +namespace System.Yaml +{ + /// + /// Represents the way to automatically resolve Tag from the Value of a YamlScalar. + /// + internal class YamlTagResolver + { + /// + /// Create TagResolver with default resolution rules. + /// + public YamlTagResolver() + { + AddDefaultRules(); + } + + /// + /// Add default tag resolution rules to the rule list. + /// + void AddDefaultRules() + { + BeginUpdate(); + AddRule("!!int", @"([-+]?(0|[1-9][0-9_]*))", + m => Convert.ToInt32(m.Value.Replace("_", "")), null); + AddRule("!!int", @"([-+]?)0b([01_]+)", m => { + var v = Convert.ToInt32(m.Groups[2].Value.Replace("_", ""), 2); + return m.Groups[1].Value == "-" ? -v : v; + }, null); + AddRule("!!int", @"([-+]?)0o?([0-7_]+)", m => { + var v = Convert.ToInt32(m.Groups[2].Value.Replace("_", ""), 8); + return m.Groups[1].Value == "-" ? -v : v; + }, null); + AddRule("!!int", @"([-+]?)0x([0-9a-fA-F_]+)", m => { + var v = Convert.ToInt32(m.Groups[2].Value.Replace("_", ""), 16); + return m.Groups[1].Value == "-" ? -v : v; + }, null); + // Todo: http://yaml.org/type/float.html is wrong => [0-9.] should be [0-9_] + AddRule("!!float", @"[-+]?(0|[1-9][0-9_]*)\.[0-9_]*([eE][-+]?[0-9]+)?", + m => Convert.ToDouble(m.Value.Replace("_", "")), null); + AddRule("!!float", @"[-+]?\._*[0-9][0-9_]*([eE][-+]?[0-9]+)?", + m => Convert.ToDouble(m.Value.Replace("_", "")), null); + AddRule("!!float", @"[-+]?(0|[1-9][0-9_]*)([eE][-+]?[0-9]+)", + m => Convert.ToDouble(m.Value.Replace("_", "")), null); + AddRule("!!float", @"\+?(\.inf|\.Inf|\.INF)", m => double.PositiveInfinity, null); + AddRule("!!float", @"-(\.inf|\.Inf|\.INF)", m => double.NegativeInfinity, null); + AddRule("!!float", @"\.nan|\.NaN|\.NAN", m => double.NaN, null); + AddRule("!!bool", @"y|Y|yes|Yes|YES|true|True|TRUE|on|On|ON", m => true, null); + AddRule("!!bool", @"n|N|no|No|NO|false|False|FALSE|off|Off|OFF", m => false, null); + AddRule("!!null", @"null|Null|NULL|\~|", m => null, null); + AddRule("!!merge", @"<<", m => "<<", null); + AddRule("!!timestamp", // Todo: spec is wrong (([ \t]*)Z|[-+][0-9][0-9]?(:[0-9][0-9])?)? should be (([ \t]*)(Z|[-+][0-9][0-9]?(:[0-9][0-9])?))? to accept "2001-12-14 21:59:43.10 -5" + @"([0-9]{4})-([0-9]{2})-([0-9]{2})" + + @"(" + + @"([Tt]|[\t ]+)" + + @"([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})(\.([0-9]*))?" + + @"(" + + @"([ \t]*)" + + @"(Z|([-+])([0-9]{1,2})(:([0-9][0-9]))?)" + + @")?" + + @")?", + match => DateTime.Parse(match.Value), + datetime => { + var z = datetime.ToString("%K"); + if ( z != "Z" && z != "" ) + z = " " + z; + if ( datetime.Millisecond == 0 ) { + if ( datetime.Hour == 0 && datetime.Minute == 0 && datetime.Second == 0 ) { + return datetime.ToString("yyyy-MM-dd" + z); + } else { + return datetime.ToString("yyyy-MM-dd HH:mm:ss" + z); + } + } else { + return datetime.ToString("yyyy-MM-dd HH:mm:ss.fff" + z); + } + }); + EndUpdate(); + } + + public Type TypeFromTag(string tag) + { + tag= YamlNode.ExpandTag(tag); + if ( types.ContainsKey(tag) ) + return types[tag][0].GetTypeOfValue(); + return null; + } + + /// + /// List of tag resolution rules. + /// + List Rules = new List(); + /// + /// Add a tag resolution rule that is invoked when matches + /// the Value of a node. + /// + /// The tag is resolved to and is + /// invoked when actual value of type is extracted from + /// the node text. + /// + /// + /// Surround sequential calls of this function by / + /// pair to avoid invoking slow internal calculation method many times. + /// + /// + /// + /// BeginUpdate(); // to avoid invoking slow internal calculation method many times. + /// Add( ... ); + /// Add( ... ); + /// Add( ... ); + /// Add( ... ); + /// EndUpdate(); // automaticall invoke internal calculation method + /// + /// + /// + /// + /// + public void AddRule(string tag, string regex, Func decode, Func encode) + { + Rules.Add(new YamlTagResolutionRule(tag, regex, decode, encode)); + if ( UpdateCounter == 0 ) + Update(); + } + + public void AddRule(string regex, Func decode, Func encode) + { + Rules.Add(new YamlTagResolutionRule("!"+typeof(T).FullName, regex, decode, encode)); + if ( UpdateCounter == 0 ) + Update(); + } + + int UpdateCounter = 0; + /// + /// Supress invoking slow internal calculation method when + /// called. + /// + /// BeginUpdate / can be called nestedly. + /// + public void BeginUpdate() + { + UpdateCounter++; + } + /// + /// Quit to supress invoking slow internal calculation method when + /// called. + /// + public void EndUpdate() + { + if ( UpdateCounter == 0 ) + throw new InvalidOperationException(); + UpdateCounter--; + if ( UpdateCounter == 0 ) + Update(); + } + + Dictionary algorithms; + void Update() + { + // Tag to joined regexp source + var sources = new Dictionary(); + foreach ( var rule in Rules ) { + if ( !sources.ContainsKey(rule.Tag) ) { + sources.Add(rule.Tag, rule.PatternSource); + } else { + sources[rule.Tag] += "|" + rule.PatternSource; + } + } + + // Tag to joined regexp + algorithms = new Dictionary(); + foreach ( var entry in sources ) { + algorithms.Add( + entry.Key, + new Regex("^(" + entry.Value + ")$") + ); + } + + // Tag to decoding methods + types = new Dictionary>(); + foreach ( var rule in Rules ) { + if ( !types.ContainsKey(rule.Tag) ) + types[rule.Tag] = new List(); + types[rule.Tag].Add(rule); + } + + TypeToRule = new Dictionary(); + foreach ( var rule in Rules ) + if(rule.HasEncoder()) + TypeToRule[rule.GetTypeOfValue()] = rule; + } + + Dictionary> types; + Dictionary TypeToRule; + + /// + /// Execute tag resolution and returns automatically determined tag value from . + /// + /// Node text with which automatic tag resolution is done. + /// Automatically determined tag value . + public string Resolve(string text) + { + foreach ( var entry in algorithms ) + if ( entry.Value.IsMatch(text) ) + return entry.Key; + return null; + } + + /// + /// Decode and returns actual value in C# object. + /// + /// Node to be decoded. + /// Decoded value. + /// True if decoded successfully. + public bool Decode(YamlScalar node, out object obj) + { + obj = null; + if ( node.Tag == null || node.Value == null ) + return false; + var tag= YamlNode.ExpandTag(node.Tag); + if ( !types.ContainsKey(tag) ) + return false; + foreach ( var rule in types[tag] ) { + var m = rule.Pattern.Match(node.Value); + if ( m.Success ) { + obj = rule.Decode(m); + return true; + } + } + return false; + } + + public bool Encode(object obj, out YamlScalar node) + { + node = null; + YamlTagResolutionRule rule; + if ( !TypeToRule.TryGetValue(obj.GetType(), out rule) ) + return false; + node = new YamlScalar(rule.Tag, rule.Encode(obj)); + return true; + } + } + + internal abstract class YamlTagResolutionRule + { + public string Tag { get; protected set; } + public Regex Pattern { get; protected set; } + public string PatternSource { get; protected set; } + public abstract object Decode(Match m); + public abstract string Encode(object obj); + public abstract Type GetTypeOfValue(); + public abstract bool HasEncoder(); + public bool IsMatch(string value) { return Pattern.IsMatch(value); } + } + + internal class YamlTagResolutionRule: YamlTagResolutionRule + { + public YamlTagResolutionRule(string tag, string regex, Func decoder, Func encoder) + { + Tag = YamlNode.ExpandTag(tag); + PatternSource = regex; + Pattern = new Regex("^(?:" + regex + ")$"); + Decoder = decoder; + Encoder = encoder; + } + private Func Decoder; + private Func Encoder; + public override object Decode(Match m) + { + return Decoder(m); + } + public override string Encode(object obj) + { + return Encoder((T)obj); + } + public override Type GetTypeOfValue() + { + return typeof(T); + } + public override bool HasEncoder() + { + return Encoder != null; + } + } + +} diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/YamlTagValidator.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/YamlTagValidator.cs new file mode 100644 index 0000000..970c41b --- /dev/null +++ b/winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/YamlTagValidator.cs @@ -0,0 +1,181 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +using System.Text.RegularExpressions; + +namespace System.Yaml +{ + /// + /// Validates a text as a global tag in YAML. + /// + /// RFC4151 - The 'tag' URI Scheme> + /// + internal class YamlTagValidator: Parser + { + /// + /// Not used in this parser + /// + public struct Status { } + + public static YamlTagValidator Default + { + get { return default_; } + } + static YamlTagValidator default_ = new YamlTagValidator(); + + /// + /// Validates a text as a global tag in YAML. + /// + /// A candidate for a global tag in YAML. + /// True if is a valid global tag. + public bool IsValid(string tag) + { + text = tag; + p = 0; + return TagUri(); + } + + private bool TagUri() + { + return + Accept("tag:") && + taggingEntity() && + Accept(':') && + specific() && + Optional( + Accept('#') && + fragment() + ) && + EndOfString(); + } + + private bool taggingEntity() + { + return + RewindUnless(() => + authorityName() && + Accept(',') && + date() + ); + } + + private bool authorityName() + { + return + emailAddress() || + DNSname(); + } + + private bool DNSname() + { + return + DNScomp() && + Repeat(() => + Accept('.') && + DNScomp() + ); + } + + private bool DNScomp() + { + return RewindUnless(() => + OneAndRepeat(alphaNum) && + Repeat(() => RewindUnless(() => + Accept('-') && + OneAndRepeat(alphaNum) + )) + ); + } + + private bool alphaNum() + { + return + Accept(alphaNumCharset); + } + Func alphaNumCharset = Charset(c => + c < 0x100 && ( + ( '0' <= c && c <= '9' ) || + ( 'A' <= c && c <= 'Z' ) || + ( 'a' <= c && c <= 'z' ) + ) + ); + + private bool emailAddress() + { + return RewindUnless(() => + OneAndRepeat(() => alphaNum() || Accept('-') || Accept('.') || Accept('_')) && + Accept('@') && + DNSname() + ); + } + + private bool date() + { + return + Accept(dateRegex); + } + Regex dateRegex = new Regex(@"(19[89][0-9]|20[0-4][0-9])(-(0[1-9]|1[0-2])(-(0[1-9]|[12][0-9]|3[01]))?)?"); + + private bool num() + { + return + Accept(numCharset); + } + Func numCharset = Charset(c => + c < 0x100 && + ( '0' <= c && c <= '9' ) + ); + + private bool specific() + { + return + Repeat(() => pchar() || Accept('/') || Accept('?')); + } + + private bool fragment() + { + return + Repeat(() => pchar() || Accept('/') || Accept('?')); + } + + private bool EndOfString() + { + return text.Length == p; + } + + bool pchar() + { + return + Accept(pcharCharsetSub) || + RewindUnless(() => + Accept('%') && + hexDig() && + hexDig() + ); + } + Func pcharCharsetSub = Charset(c => + c < 0x100 && ( + ( '0' <= c && c <= '9' ) || + ( 'A' <= c && c <= 'Z' ) || + ( 'a' <= c && c <= 'z' ) || + "-._~!$&'()*+,;=:@".Contains(c) + ) + ); + + bool hexDig() + { + return Accept(hexDigCharset); + } + Func hexDigCharset = Charset(c => + c < 0x100 && ( + ( '0' <= c && c <= '9' ) || + ( 'A' <= c && c <= 'F' ) || + ( 'a' <= c && c <= 'f' ) + ) + ); + + } + +} diff --git a/winPEAS/winPEASexe/winPEAS/Checks/Checks.cs b/winPEAS/winPEASexe/winPEAS/Checks/Checks.cs index 7187eaf..9ce51be 100644 --- a/winPEAS/winPEASexe/winPEAS/Checks/Checks.cs +++ b/winPEAS/winPEASexe/winPEAS/Checks/Checks.cs @@ -8,6 +8,7 @@ using winPEAS.Helpers; using winPEAS.Helpers.AppLocker; using winPEAS.Helpers.Registry; using winPEAS.Helpers.Search; +using winPEAS.Helpers.YamlConfig; using winPEAS.Info.UserInfo; namespace winPEAS.Checks @@ -35,6 +36,7 @@ namespace winPEAS.Checks public static string PaintDisabledUsersNoAdministrator = ""; //static string paint_lockoutUsers = ""; public static string PaintAdminUsers = ""; + public static YamlConfig YamlConfig; private static List _systemChecks; private static readonly HashSet _systemCheckSelectedKeysHashSet = new HashSet(); @@ -78,6 +80,7 @@ namespace winPEAS.Checks new SystemCheck("windowscreds", new WindowsCreds()), new SystemCheck("browserinfo", new BrowserInfo()), new SystemCheck("filesinfo", new FilesInfo()), + new SystemCheck("fileAnalysis", new FileAnalysis()) }; var systemCheckAllKeys = new HashSet(_systemChecks.Select(i => i.Key)); @@ -188,6 +191,8 @@ namespace winPEAS.Checks RunChecks(isAllChecks, wait); + SearchHelper.CleanLists(); + Beaprint.PrintMarketingBanner(); }, IsDebug, "Total time"); @@ -225,9 +230,20 @@ namespace winPEAS.Checks private static void CreateDynamicLists() { + Beaprint.GrayPrint(" Creating Dynamic lists, this could take a while, please wait..."); + + try + { + Beaprint.GrayPrint(" - Loading YAML definitions file..."); + YamlConfig = YamlConfigHelper.GetWindowsSearchConfig(); + } + catch (Exception ex) + { + Beaprint.GrayPrint("Error while getting AD info: " + ex); + } + try { - Beaprint.GrayPrint(" Creating Dynamic lists, this could take a while, please wait..."); Beaprint.GrayPrint(" - Checking if domain..."); CurrentAdDomainName = DomainHelper.IsDomainJoined(); IsPartOfDomain = !string.IsNullOrEmpty(CurrentAdDomainName); diff --git a/winPEAS/winPEASexe/winPEAS/Checks/FileAnalysis.cs b/winPEAS/winPEASexe/winPEAS/Checks/FileAnalysis.cs new file mode 100644 index 0000000..646b4c5 --- /dev/null +++ b/winPEAS/winPEASexe/winPEAS/Checks/FileAnalysis.cs @@ -0,0 +1,296 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text.RegularExpressions; +using winPEAS.Helpers; +using winPEAS.Helpers.Search; +using static winPEAS.Helpers.YamlConfig.YamlConfig.SearchParameters; + +namespace winPEAS.Checks +{ + internal class FileAnalysis : ISystemCheck + { + private const int ListFileLimit = 70; + + public void PrintInfo(bool isDebug) + { + Beaprint.GreatPrint("File Analysis"); + + new List + { + PrintYAMLSearchFiles + }.ForEach(action => CheckRunner.Run(action, isDebug)); + } + + private static List InitializeFileSearch() + { + var files = new List(); + var systemDrive = $"{SearchHelper.SystemDrive}\\"; + + List directories = new List() + { + @$"{systemDrive}inetpub", + @$"{systemDrive}usr\etc\snmp", + @$"{systemDrive}windows\temp", + @$"{systemDrive}xampp", + }; + + List wildcardDirectories = new List() + { + "apache*", + "tomcat*", + }; + + foreach (var wildcardDirectory in wildcardDirectories) + { + directories.AddRange(Directory.GetDirectories(systemDrive, wildcardDirectory, SearchOption.TopDirectoryOnly)); + } + + foreach (var directory in directories) + { + files.AddRange(SearchHelper.GetFilesFast(directory, "*", isFoldersIncluded: true)); + } + + files.AddRange(SearchHelper.RootDirUsers); + // files.AddRange(SearchHelper.RootDirCurrentUser); // not needed, it's contained within RootDirUsers + files.AddRange(SearchHelper.DocumentsAndSettings); + files.AddRange(SearchHelper.GroupPolicyHistory); // TODO maybe not needed here + files.AddRange(SearchHelper.ProgramFiles); + files.AddRange(SearchHelper.ProgramFilesX86); + + return files; + } + + private static bool Search(List files, string fileName, FileSettings fileSettings, ref int resultsCount) + { + bool isRegexSearch = fileName.Contains("*"); + string pattern = string.Empty; + + if (isRegexSearch) + { + pattern = GetRegexpFromString(fileName); + } + + foreach (var file in files) + { + bool isFileFound; + if (isRegexSearch) + { + isFileFound = Regex.IsMatch(file.Filename, pattern, RegexOptions.IgnoreCase); + } + else + { + isFileFound = file.Filename.ToLower() == fileName; + } + + if (isFileFound) + { + // there are no inner sections + if (fileSettings.files == null) + { + var isProcessed = ProcessResult(file, fileSettings, ref resultsCount); + if (!isProcessed) + { + return true; + } + } + // there are inner sections + else + { + foreach (var innerFileToSearch in fileSettings.files) + { + // search for inner files/folders by inner file/folder name + var innerFiles = SearchHelper.GetFilesFast(file.FullPath, innerFileToSearch.name, isFoldersIncluded: true); + + foreach (var innerFile in innerFiles) + { + // process inner file/folder + var isProcessed = ProcessResult(innerFile, innerFileToSearch.value, ref resultsCount); + if (!isProcessed) + { + return true; + } + } + } + } + } + } + + return false; + } + + private static void PrintYAMLSearchFiles() + { + try + { + var files = InitializeFileSearch(); + var folders = files.Where(f => f.IsDirectory).ToList(); + var config = Checks.YamlConfig; + var defaults = config.defaults; + var searchItems = config.search.Where(i => i.value.config.auto_check && + (i.value.disable == null || !i.value.disable.Contains("winpeas"))); + + foreach (var searchItem in searchItems) + { + var searchName = searchItem.name; + var value = searchItem.value; + var searchConfig = value.config; + + CheckRunner.Run(() => + { + Beaprint.MainPrint($"Analyzing {searchName} Files (limit {ListFileLimit})"); + + int resultsCount = 0; + bool isSearchFinished = false; + + foreach (var file in value.files) + { + var fileName = file.name.ToLower(); + var fileSettings = file.value; + var itemsToSearch = fileSettings.type == "f" ? files : folders; + + isSearchFinished = Search(itemsToSearch, fileName, fileSettings, ref resultsCount); + + if (isSearchFinished) + { + break; + } + } + }, Checks.IsDebug); + } + } + catch (Exception e) + { + } + } + + private static string GetRegexpFromString(string str) + { + // we need to update the regexp to work here + // . -> \. + // * -> .* + // add $ at the end to avoid false positives + + var pattern = str.Replace(".", @"\.") + .Replace("*", @".*"); + + pattern = $"{pattern}$"; + + return pattern; + } + + private static bool ProcessResult( + CustomFileInfo fileInfo, + Helpers.YamlConfig.YamlConfig.SearchParameters.FileSettings fileSettings, + ref int resultsCount) + { + // print depending on the options here + resultsCount++; + + if (resultsCount > ListFileLimit) return false; + + + if (fileSettings.type == "f") + { + if ((bool)fileSettings.just_list_file) + { + Beaprint.BadPrint($" {fileInfo.FullPath}"); + } + else + { + GrepResult(fileInfo, fileSettings); + } + } + else if (fileSettings.type == "d") + { + // just list the directory + if ((bool)fileSettings.just_list_file) + { + string[] files = Directory.GetFiles(fileInfo.FullPath, "*", SearchOption.TopDirectoryOnly); + + foreach (var file in files) + { + Beaprint.BadPrint($" {file}"); + } + } + else + { + // should not happen + } + } + + return true; + } + + private static void GrepResult(CustomFileInfo fileInfo, FileSettings fileSettings) + { + Beaprint.NoColorPrint($" '{fileInfo.FullPath}' - content:"); + + var fileContent = File.ReadLines(fileInfo.FullPath); + var colors = new Dictionary(); + + if ((bool)fileSettings.only_bad_lines) + { + colors.Add(fileSettings.bad_regex, Beaprint.ansi_color_bad); + fileContent = fileContent.Where(l => Regex.IsMatch(l, fileSettings.bad_regex, RegexOptions.IgnoreCase)); + } + else + { + string lineGrep = null; + + if ((bool)fileSettings.remove_empty_lines) + { + fileContent = fileContent.Where(l => !string.IsNullOrWhiteSpace(l)); + } + + if (!string.IsNullOrWhiteSpace(fileSettings.remove_regex)) + { + var pattern = GetRegexpFromString(fileSettings.remove_regex); + fileContent = fileContent.Where(l => !Regex.IsMatch(l, pattern, RegexOptions.IgnoreCase)); + } + + if (!string.IsNullOrWhiteSpace(fileSettings.good_regex)) + { + colors.Add(fileSettings.good_regex, Beaprint.ansi_color_good); + } + if (!string.IsNullOrWhiteSpace(fileSettings.bad_regex)) + { + colors.Add(fileSettings.bad_regex, Beaprint.ansi_color_bad); + } + if (!string.IsNullOrWhiteSpace(fileSettings.line_grep)) + { + lineGrep = SanitizeLineGrep(fileSettings.line_grep); + } + + fileContent = fileContent.Where(line => (!string.IsNullOrWhiteSpace(fileSettings.good_regex) && Regex.IsMatch(line, fileSettings.good_regex, RegexOptions.IgnoreCase)) || + (!string.IsNullOrWhiteSpace(fileSettings.bad_regex) && Regex.IsMatch(line, fileSettings.bad_regex, RegexOptions.IgnoreCase)) || + (!string.IsNullOrWhiteSpace(lineGrep) && Regex.IsMatch(line, lineGrep, RegexOptions.IgnoreCase))); + } + + var content = string.Join(Environment.NewLine, fileContent); + + Beaprint.AnsiPrint(content, colors); + + Console.WriteLine(); + } + + private static string SanitizeLineGrep(string lineGrep) + { + // sanitize the string, e.g. + // '-i -a -o "description.*" | sort | uniq' + // - remove everything except from "description.*" + + Regex regex = new Regex("\"([^\"]+)\""); + Match match = regex.Match(lineGrep); + + if (match.Success) + { + var group = match.Groups[1]; + return group.Value; + } + + return null; + } + } +} diff --git a/winPEAS/winPEASexe/winPEAS/Checks/FilesInfo.cs b/winPEAS/winPEASexe/winPEAS/Checks/FilesInfo.cs index 4699bea..a2d3cbe 100644 --- a/winPEAS/winPEASexe/winPEAS/Checks/FilesInfo.cs +++ b/winPEAS/winPEASexe/winPEAS/Checks/FilesInfo.cs @@ -142,10 +142,8 @@ namespace winPEAS.Checks PrintHiddenFilesAndFolders, PrintOtherUsersInterestingFiles, PrintExecutablesInNonDefaultFoldersWithWritePermissions, - PrintWSLDistributions, + PrintWSLDistributions }.ForEach(action => CheckRunner.Run(action, isDebug)); - - SearchHelper.CleanLists(); } void PrintCloudCreds() diff --git a/winPEAS/winPEASexe/winPEAS/Helpers/Beaprint.cs b/winPEAS/winPEASexe/winPEAS/Helpers/Beaprint.cs index 9a05937..8388fb6 100644 --- a/winPEAS/winPEASexe/winPEAS/Helpers/Beaprint.cs +++ b/winPEAS/winPEASexe/winPEAS/Helpers/Beaprint.cs @@ -154,27 +154,37 @@ namespace winPEAS.Helpers ///////////////////////////////// public static void GreatPrint(string toPrint) { + // print_title Console.WriteLine(); Console.WriteLine(); int halfTotal = 60; - Console.WriteLine(LCYAN + " " + new String('=', halfTotal - toPrint.Length) + "(" + NOCOLOR + YELLOW + toPrint + LCYAN + ")" + new String('=', halfTotal - toPrint.Length) + NOCOLOR); + //Console.WriteLine(LCYAN + " " + new String('=', halfTotal - toPrint.Length) + "(" + NOCOLOR + YELLOW + toPrint + LCYAN + ")" + new String('=', halfTotal - toPrint.Length) + NOCOLOR); + + Console.WriteLine($"{LCYAN}════════════════════════════════════╣ {GREEN}{toPrint}{LCYAN} ╠════════════════════════════════════{NOCOLOR}"); } public static void MainPrint(string toPrint) { + // print_2title + Console.WriteLine(); - Console.WriteLine(YELLOW + " [+] " + GREEN + toPrint + NOCOLOR); + //Console.WriteLine(YELLOW + " [+] " + GREEN + toPrint + NOCOLOR); + Console.WriteLine($"{LCYAN}╔══════════╣ {GREEN}{toPrint}{NOCOLOR}"); } public static void LinkPrint(string link, string comment = "") { - Console.WriteLine(YELLOW + " [?] " + LBLUE + comment + " " + LYELLOW + link + NOCOLOR); + // print_info + //Console.WriteLine(YELLOW + " [?] " + LBLUE + comment + " " + LYELLOW + link + NOCOLOR); + Console.WriteLine($"{LCYAN}╚ {LBLUE}{comment} {LYELLOW}{link}{NOCOLOR}"); } public static void InfoPrint(string toPrint) { - Console.WriteLine(YELLOW + " [i] " + LBLUE + toPrint + NOCOLOR); + // print_info + //Console.WriteLine(YELLOW + " [i] " + LBLUE + toPrint + NOCOLOR); + Console.WriteLine($"{LCYAN}╚ {LBLUE}{toPrint}{NOCOLOR}"); } public static void NotFoundPrint() @@ -361,6 +371,7 @@ namespace winPEAS.Helpers foreach (string elem in list_to_print) { Console.WriteLine(" " + elem); + // printf ${BLUE}"═╣ "$GREEN"$1"$NC #There is 1 "═" } } else diff --git a/winPEAS/winPEASexe/winPEAS/Helpers/CustomFileInfo.cs b/winPEAS/winPEASexe/winPEAS/Helpers/CustomFileInfo.cs index 165780f..b020e3b 100644 --- a/winPEAS/winPEASexe/winPEAS/Helpers/CustomFileInfo.cs +++ b/winPEAS/winPEASexe/winPEAS/Helpers/CustomFileInfo.cs @@ -2,16 +2,17 @@ { internal class CustomFileInfo { - public string Filename { get; set; } - public string Extension { get; set; } - public string FullPath { get; set; } - public bool IsDirectory { get { return string.IsNullOrEmpty(Filename); } } + public string Filename { get; } + public string Extension { get; } + public string FullPath { get; } + public bool IsDirectory { get; } - public CustomFileInfo(string filename, string extension, string fullPath) + public CustomFileInfo(string filename, string extension, string fullPath, bool isDirectory) { Filename = filename; Extension = extension; FullPath = fullPath; + IsDirectory = isDirectory; } } } diff --git a/winPEAS/winPEASexe/winPEAS/Helpers/Search/Patterns.cs b/winPEAS/winPEASexe/winPEAS/Helpers/Search/Patterns.cs index f7c16e8..d9a1f2c 100644 --- a/winPEAS/winPEASexe/winPEAS/Helpers/Search/Patterns.cs +++ b/winPEAS/winPEASexe/winPEAS/Helpers/Search/Patterns.cs @@ -9,94 +9,18 @@ namespace winPEAS.Helpers.Search ".cer", ".csr", ".der", - ".ftpconfig", - ".gpg", - ".kdbx", - ".ovpn", ".p12", - ".pgp", - ".rdg", - ".git-credentials", - ".gitconfig", - ".htpasswd", }; public static readonly HashSet WhiteListExactfilenamesWithExtensions = new HashSet() { - "id_dsa", - "id_rsa", - "access.log", - "access_tokens.db", - "accesstokens.json", - "appcmd.exe", - "appevent.evt", - "azureprofile.json", - "bash.exe", - "datasources.xml", - "default.sav", "docker-compose.yml", "dockerfile", - "drives.xml", - "error.log", - "ffftp.ini", - "filezilla.xml", - "freesshdservice.ini", - "groups.xml", - "httpd.conf", - "https-xampp.conf", - "https.conf", - "iis6.log", - "index.dat", - "keepass.config", - "keepass.config.xml", - "my.cnf", - "my.ini", - "netsetup.log", - "ntds.dit", - "ntuser.dat", - "pagefile.sys", - "php.ini", - "printers.xml", - "protecteduserkey.bin", - "rdcman.settings", - "recentservers.xml", - "sam", - "scclient.exe", - "scheduledtasks.xml", - "secevent.evt", - "security", - "security.sav", - "server.xml", - "services.xml", - "setupinfo", - "setupinfo.bak", - "sitemanager.xml", - "sites.ini", - "software", - "software.sav", - "sysprep.inf", - "sysprep.xml", - "system", - "system.sav", - "tomcat-users.xml", - "unattend.txt", - "unattend.xml", - "unattended.xml", - "wcx_ftp.ini", - "winscp.ini", - "ws_ftp.ini", - "wsl.exe", - "known_hosts", }; public static readonly IList WhiteListRegexp = new List() { - ".*_history\\.*", "config.*\\.php$", - "vnc\\.*", - "elasticsearch\\.y*ml$", - "kibana\\.y*ml$", - "web.*\\.config$", }; } } diff --git a/winPEAS/winPEASexe/winPEAS/Helpers/Search/SearchHelper.cs b/winPEAS/winPEASexe/winPEAS/Helpers/Search/SearchHelper.cs index e856b3c..e34c278 100644 --- a/winPEAS/winPEASexe/winPEAS/Helpers/Search/SearchHelper.cs +++ b/winPEAS/winPEASexe/winPEAS/Helpers/Search/SearchHelper.cs @@ -10,20 +10,20 @@ namespace winPEAS.Helpers.Search { static class SearchHelper { - public static List RootDirUsers; - private static List RootDirCurrentUser; - public static List ProgramFiles; - public static List ProgramFilesX86; - public static List DocumentsAndSettings; - private static List GroupPolicyHistory; + public static List RootDirUsers = new List(); + public static List RootDirCurrentUser = new List(); + public static List ProgramFiles = new List(); + public static List ProgramFilesX86 = new List(); + public static List DocumentsAndSettings = new List(); + public static List GroupPolicyHistory = new List(); - private static string SystemDrive = Environment.GetEnvironmentVariable("SystemDrive"); + public static string SystemDrive = Environment.GetEnvironmentVariable("SystemDrive"); private static string GlobalPattern = "*"; public static List GetFilesFast(string folder, string pattern = "*", HashSet excludedDirs = null, bool isFoldersIncluded = false) { ConcurrentBag files = new ConcurrentBag(); - IEnumerable startDirs = GetStartDirectories(folder, files, pattern); + IEnumerable startDirs = GetStartDirectories(folder, files, pattern, isFoldersIncluded); IList startDirsExcluded = new List(); if (excludedDirs != null) @@ -52,7 +52,7 @@ namespace winPEAS.Helpers.Search { GetFiles(dir.FullName, pattern).ForEach( (f) => - files.Add(new CustomFileInfo(f.Name, f.Extension, f.FullName)) + files.Add(new CustomFileInfo(f.Name, f.Extension, f.FullName, false)) ); }); }); @@ -132,13 +132,13 @@ namespace winPEAS.Helpers.Search { foreach (var directory in directories) { - files.Add(new CustomFileInfo(null, null, directory.FullName)); + files.Add(new CustomFileInfo(directory.Name, null, directory.FullName, true)); } } foreach (var f in dirInfo.GetFiles(pattern)) { - files.Add(new CustomFileInfo(f.Name, f.Extension, f.FullName)); + files.Add(new CustomFileInfo(f.Name, f.Extension, f.FullName, false)); } if (directories.Length > 1) return new List(directories); diff --git a/winPEAS/winPEASexe/winPEAS/Helpers/YamlConfig/YamlConfig.cs b/winPEAS/winPEASexe/winPEAS/Helpers/YamlConfig/YamlConfig.cs new file mode 100644 index 0000000..4590a40 --- /dev/null +++ b/winPEAS/winPEASexe/winPEAS/Helpers/YamlConfig/YamlConfig.cs @@ -0,0 +1,82 @@ +using static winPEAS.Helpers.YamlConfig.YamlConfig.SearchParameters; + +namespace winPEAS.Helpers.YamlConfig +{ + public class YamlConfig + { + + public class FileParam + { + public string name { get; set; } + public FileSettings value { get; set; } + } + + public class SearchParameters + { + public class FileSettings + { + public string bad_regex { get; set; } + // public string check_extra_path { get; set; } // not used in Winpeas + public string good_regex { get; set; } + public bool? just_list_file { get; set; } + public string line_grep { get; set; } + public bool? only_bad_lines { get; set; } + public bool? remove_empty_lines { get; set; } + // public string remove_path { get; set; } // not used in Winpeas + public string remove_regex { get; set; } + // public string[] search_in { get; set; } // not used in Winpeas + public string type { get; set; } + public FileParam[] files { get; set; } + } + + public class FileParameters + { + public string file { get; set; } + public FileSettings options { get; set; } + } + + public class Config + { + public bool auto_check { get; set; } + } + + public Config config { get; set; } + public string[] disable { get; set; } // disabled scripts - linpeas/winpeas + public FileParam[] files { get; set; } + } + + public class SearchParams + { + public string name { get; set; } + public SearchParameters value { get; set; } + } + + public class Defaults + { + public bool auto_check { get; set; } + public string bad_regex { get; set; } + //public string check_extra_path { get; set; } not used in winpeas + public string good_regex { get; set; } + public bool just_list_file { get; set; } + public string line_grep { get; set; } + public bool only_bad_lines { get; set; } + public bool remove_empty_lines { get; set; } + public string remove_path { get; set; } + public string remove_regex { get; set; } + public string[] search_in { get; set; } + public string type { get; set; } + } + + public class Variable + { + public string name { get; set; } + public string value { get; set; } + } + + public SearchParams[] search { get; set; } + + public Defaults defaults { get; set; } + + public Variable[] variables { get; set; } + } +} diff --git a/winPEAS/winPEASexe/winPEAS/Helpers/YamlConfig/YamlConfigHelper.cs b/winPEAS/winPEASexe/winPEAS/Helpers/YamlConfig/YamlConfigHelper.cs new file mode 100644 index 0000000..702566a --- /dev/null +++ b/winPEAS/winPEASexe/winPEAS/Helpers/YamlConfig/YamlConfigHelper.cs @@ -0,0 +1,110 @@ +using System.Collections.Generic; +using System.Yaml.Serialization; +using System.IO; +using System.Reflection; +using System.Linq; +using static winPEAS.Helpers.YamlConfig.YamlConfig; + +namespace winPEAS.Helpers.YamlConfig +{ + internal class YamlConfigHelper + { + const string SENSITIVE_FILES = "sensitive_files.yaml"; + + public static YamlConfig GetWindowsSearchConfig() + { + var assembly = Assembly.GetExecutingAssembly(); + var resourceName = assembly.GetManifestResourceNames().Where(i => i.EndsWith(SENSITIVE_FILES)).FirstOrDefault(); + + try + { + using (Stream stream = assembly.GetManifestResourceStream(resourceName)) + using (StreamReader reader = new StreamReader(stream)) + { + string configFileContent = reader.ReadToEnd(); + + YamlSerializer yamlSerializer = new YamlSerializer(); + YamlConfig yamlConfig = (YamlConfig)yamlSerializer.Deserialize(configFileContent, typeof(YamlConfig))[0]; + + // update variables + foreach (var variable in yamlConfig.variables) + { + configFileContent = configFileContent.Replace($"${variable.name}", variable.value); + } + + // deserialize again + yamlConfig = (YamlConfig)yamlSerializer.Deserialize(configFileContent, typeof(YamlConfig))[0]; + + // check + if (yamlConfig.defaults == null || yamlConfig.search == null || yamlConfig.search.Length == 0) + { + throw new System.Exception("No configuration was read"); + } + + // apply the defaults e.g. for filesearch + foreach (var searchItem in yamlConfig.search) + { + SetDefaultOptions(searchItem, yamlConfig.defaults); + } + + return yamlConfig; + } + } + catch (System.Exception e) + { + Beaprint.PrintException($"An exception occured while parsing YAML configuration file: {e.Message}"); + + throw; + } + } + + private static void SetDefaultOptions(SearchParams searchItem, Defaults defaults) + { + searchItem.value.config.auto_check = GetValueOrDefault(searchItem.value.config.auto_check, defaults.auto_check); + + SetFileOptions(searchItem.value.files, defaults); + } + + private static void SetFileOptions(FileParam[] fileParams, Defaults defaults) + { + foreach (var fileParam in fileParams) + { + var value = fileParam.value; + + value.bad_regex = GetValueOrDefault(value.bad_regex, defaults.bad_regex); + value.good_regex = GetValueOrDefault(value.good_regex, defaults.good_regex); + value.just_list_file = GetValueOrDefault(value.just_list_file, defaults.just_list_file); + value.line_grep = GetValueOrDefault(value.line_grep, defaults.line_grep); + value.only_bad_lines = GetValueOrDefault(value.only_bad_lines, defaults.only_bad_lines); + value.remove_empty_lines = GetValueOrDefault(value.remove_empty_lines, defaults.remove_empty_lines); + value.remove_regex = GetValueOrDefault(value.remove_regex, defaults.remove_regex); + value.type = GetValueOrDefault(value.type, defaults.type).ToLower(); + + if (value.files != null) + { + SetFileOptions(value.files, defaults); + } + } + } + + //private static WildcardOptions GetWildCardOptions(string str) + //{ + // if (!str.Contains("*")) return WildcardOptions.None; + // if (str.StartsWith("*")) return WildcardOptions.StartsWith; + // if (str.EndsWith("*")) return WildcardOptions.EndsWith; + + // return WildcardOptions.Middle; + //} + + private static T GetValueOrDefault(T val, T defaultValue) + { + return val == null ? defaultValue : val; + } + + private static T GetValueOrDefault(Dictionary dict, string key, T defaultValue) + { + return dict.ContainsKey(key) ? (T)dict[key] : defaultValue; + } + } +} + diff --git a/winPEAS/winPEASexe/winPEAS/winPEAS.csproj b/winPEAS/winPEASexe/winPEAS/winPEAS.csproj index 25893bd..d9bf88a 100755 --- a/winPEAS/winPEASexe/winPEAS/winPEAS.csproj +++ b/winPEAS/winPEASexe/winPEAS/winPEAS.csproj @@ -371,8 +371,27 @@ + + + + + + + + + + + + + + + + + + + @@ -399,6 +418,8 @@ + + @@ -658,6 +679,7 @@ + @@ -670,6 +692,5 @@ - \ No newline at end of file diff --git a/yaml b/yaml new file mode 100644 index 0000000..e69de29