{"id":13540223,"url":"https://github.com/owasp/railsgoat","last_synced_at":"2025-04-11T19:14:25.500Z","repository":{"id":7537153,"uuid":"8889192","full_name":"OWASP/railsgoat","owner":"OWASP","description":"A vulnerable version of Rails that follows the OWASP Top 10","archived":false,"fork":false,"pushed_at":"2024-08-20T23:59:01.000Z","size":8078,"stargazers_count":885,"open_issues_count":37,"forks_count":723,"subscribers_count":33,"default_branch":"master","last_synced_at":"2025-04-11T19:14:15.616Z","etag":null,"topics":["appsec","owasp-top","rails","ruby","ruby-on-rails","security","vulnerabilities"],"latest_commit_sha":null,"homepage":"railsgoat.cktricky.com","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OWASP.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-03-19T21:03:36.000Z","updated_at":"2025-04-04T02:21:40.000Z","dependencies_parsed_at":"2024-01-16T12:49:36.718Z","dependency_job_id":"73cf769c-c129-46b2-81ed-e26f25747793","html_url":"https://github.com/OWASP/railsgoat","commit_stats":{"total_commits":1508,"total_committers":48,"mean_commits":"31.416666666666668","dds":"0.38262599469496017","last_synced_commit":"c1e8ff1e3b24a1c48fcfc9fbee0f65dc296b49d9"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OWASP%2Frailsgoat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OWASP%2Frailsgoat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OWASP%2Frailsgoat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OWASP%2Frailsgoat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OWASP","download_url":"https://codeload.github.com/OWASP/railsgoat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248465345,"owners_count":21108244,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["appsec","owasp-top","rails","ruby","ruby-on-rails","security","vulnerabilities"],"created_at":"2024-08-01T09:01:43.058Z","updated_at":"2025-04-11T19:14:25.479Z","avatar_url":"https://github.com/OWASP.png","language":"HTML","readme":"# RailsGoat [![Build Status](https://api.travis-ci.org/OWASP/railsgoat.png?branch=master)](https://travis-ci.org/OWASP/railsgoat) [![Code Climate](https://codeclimate.com/github/OWASP/railsgoat.png)](https://codeclimate.com/github/OWASP/railsgoat)\n\nRailsGoat is a vulnerable version of the Ruby on Rails Framework from versions 3 to 6. It includes vulnerabilities from the OWASP Top 10, as well as some \"extras\" that the initial project contributors felt worthwhile to share. This project is designed to educate both developers, as well as security professionals.\n\n## Support\n\nIf you are looking for support or troubleshooting assistance, please visit our [OWASP Slack Channel](https://owasp.slack.com/messages/project-railsgoat/).\n\n## Getting Started\n\nTo begin, if you do not have Ruby, Git, MySQL, and Postgres, we suggest\nusing this [site](https://gorails.com/setup) to install the software.\nPick the appropriate operating system and follow the instructions.\n\nAfter installing the above software, clone this repo:\n\n```bash\n$ git clone git@github.com:OWASP/railsgoat.git\n```\n\n**NOTE: NOT NECESSARY IF YOU WANT TO WORK WITH RAILS 6.** Otherwise, if you wish to use the Rails 3 or 4 versions, you'll need to switch branches:\n\n```bash\n$ cd railsgoat\n$ git checkout rails_3_2\n$ git checkout rails_4_2\n```\n\nNavigate into the directory (already there if you followed the previous step) and install the dependencies:\n\n```bash\n$ bundle install\n```\n\nIf you receive an error, make sure you have `bundler` installed:\n\n```bash\n$ gem install bundler\n```\n\nInitialize the database:\n\n```bash\n$ rails db:setup\n```\n\nStart the Thin web server:\n\n```bash\n$ rails server\n```\n\nOpen your favorite browser, navigate to `http://localhost:3000` and start hacking!\n\n## Docker Install\nTo run Railsgoat with Docker you must first have [Docker](https://docs.docker.com/engine/installation/) and [Docker Compose](https://docs.docker.com/compose/install/) installed. Once those dependencies are installed, cd into the Railsgoat directory where you've cloned the code and run. Rails requires Compose **1.6.0** or above and require a Docker Engine of version **1.10.0** or above.\n\nFor Mac Apple Silicon (ARM64) you must also have Rosetta install\n\n```\n#~/code/railsgoat\n$ docker-compose build\n$ docker-compose run web rails db:setup\n$ docker-compose up\n...\n  Creating railsgoat_web_1\n  Attaching to railsgoat_web_1\n$\n```\nOnce you see the preceeding message Railsgoat is running on your localhost on port 3000.\n\nOpen your favorite browser, navigate to `http://\u003cdockerIP\u003e:3000` and start hacking! The Docker IP is usually `192.168.99.100`. Run `docker-machine env` to verify.\n\nNote: if your container exits with an error, it may be because a server is already running:\n```\nA server is already running. Check /myapp/tmp/pids/server.pid.\n=\u003e Booting Thin\n=\u003e Rails 6.0.0 application starting in development on\nhttp://0.0.0.0:3000\n=\u003e Run `rails server -h` for more startup options\n=\u003e Ctrl-C to shutdown server\nExiting\n```\nIn this case, remove that server.pid file and try again. Note also that this file is in your current working directory, not inside the container.\n\n## Capybara Tests\n\nRailsGoat now includes a set of failing Capybara RSpecs, each one indicating that a separate vulnerability exists in the application. To run them, you first need to install [PhantomJS](https://github.com/jonleighton/poltergeist#installing-phantomjs) (version 2.1.1 has been tested in Dev and on Travis CI), which is required by the Poltergeist Capybara driver. Upon installation, simply run the following task:\n\n```\n$ rails training\n```\n\nTo run just one spec:\n\n```\n$ rails training SPEC=spec/vulnerabilities/sql_injection_spec.rb\n```\n\n## MySQL Environment\n\nBy default in development mode Railsgoat runs with a SQLite database. There is an environment defined to use MySQL. For some of the SQL injection vulnerabilities to work you have to run the app with MySQL as the database. The following steps will setup and run Railsgoat to use MySQL. *MySQL must be installed and running before running these steps*\n\n```\n#Create the MySQL database\nRAILS_ENV=mysql rails db:create\n\n#Run the migrations against the database\nRAILS_ENV=mysql rails db:migrate\n\n#Boot Rails using MySQl\nRAILS_ENV=mysql rails s\n```\n\n## Processing Email\n\nIn order for RailsGoat to effectively process email, you will first need to run MailCatcher, an SMTP server that will intercept email messages and display them in a web interface.\n\nMailcatcher is not installed by default. To install MailCatcher and start an instance of it, simply run:\n\n```\n$ gem install mailcatcher\n$ mailcatcher\n```\n\nIf successful, you should see the following output:\n\n```\nStarting MailCatcher\n==\u003e smtp://127.0.0.1:1025\n==\u003e http://127.0.0.1:1080\n*** MailCatcher runs as a daemon by default. Go to the web interface to quit.\n```\n\nAlternatively, you can run MailCatcher in the foreground by running `mailcatcher -f` in your terminal.\n\n## Contributing\n\nPlease see our [contribution document](./CONTRIBUTING.md) to learn more. Additionally, note that as changes are made to the application, the Capybara RSpecs can be used to verify that the vulnerabilities in the application are still intact. To use them in this way, and have them change to `pending` instead of `fail`, set the `RAILSGOAT_MAINTAINER` environment variable.\n\nConversion to the OWASP Top Ten 2013 completed in November, 2013.\n\n# License\n\n[The MIT License (MIT)](./LICENSE.md)\n","funding_links":[],"categories":["\u003ca id=\"761a373e2ec1c58c9cd205cd7a03e8a8\"\u003e\u003c/a\u003e靶机\u0026\u0026漏洞环境\u0026\u0026漏洞App"],"sub_categories":["\u003ca id=\"3e751670de79d2649ba62b177bd3e4ef\"\u003e\u003c/a\u003e未分类-VulnerableMachine"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fowasp%2Frailsgoat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fowasp%2Frailsgoat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fowasp%2Frailsgoat/lists"}