This commit is contained in:
cktricky
2016-06-09 22:33:53 -04:00
parent d1874789f2
commit 79c1ddd45d
12 changed files with 13 additions and 25 deletions
+2 -2
View File
@@ -6,7 +6,7 @@ feature 'broken_auth' do
@normal_user = UserFixture.normal_user @normal_user = UserFixture.normal_user
end end
scenario 'one' do scenario "one\nTutorial: https://github.com/OWASP/railsgoat/wiki/A2-Credential-Enumeration" do
visit '/' visit '/'
within('.signup') do within('.signup') do
fill_in 'email', :with => @normal_user.email + 'not' fill_in 'email', :with => @normal_user.email + 'not'
@@ -19,7 +19,7 @@ feature 'broken_auth' do
expect(find('div#flash_notice').text).to eq("#{@normal_user.email}not doesn't exist!") expect(find('div#flash_notice').text).to eq("#{@normal_user.email}not doesn't exist!")
end end
scenario 'two' do scenario "two\nTutorial: https://github.com/OWASP/railsgoat/wiki/A2-Credential-Enumeration" do
visit '/' visit '/'
within('.signup') do within('.signup') do
fill_in 'email', :with => @normal_user.email fill_in 'email', :with => @normal_user.email
@@ -7,7 +7,7 @@ feature 'command injection' do
@normal_user = UserFixture.normal_user @normal_user = UserFixture.normal_user
end end
scenario 'attack', :js => true do scenario "attack\nTutorial: https://github.com/OWASP/railsgoat/wiki/A1-Command-Injection", :js => true do
login @normal_user login @normal_user
legit_file = File.join(Rails.root, 'public', 'data', 'legit.txt') legit_file = File.join(Rails.root, 'public', 'data', 'legit.txt')
+1 -1
View File
@@ -7,7 +7,7 @@ feature 'csrf' do
@normal_user = UserFixture.normal_user @normal_user = UserFixture.normal_user
end end
scenario 'attack', :js => true do scenario "attack\nTutorial: https://github.com/OWASP/railsgoat/wiki/R4-A8-CSRF", :js => true do
visit '/' visit '/'
# TODO: is there a way to get this without visiting root first? # TODO: is there a way to get this without visiting root first?
base_url = current_url base_url = current_url
+1 -1
View File
@@ -19,7 +19,7 @@ feature 'insecure direct object reference' do
expect(page.response_headers['Content-Length']).to eq('709') expect(page.response_headers['Content-Length']).to eq('709')
end end
scenario 'attack two' do scenario "attack two\nTutorial: https://github.com/OWASP/railsgoat/wiki/A4-Insecure-Direct-Object-Reference" do
login(@normal_user) login(@normal_user)
expect(@normal_user.user_id).not_to eq(2) expect(@normal_user.user_id).not_to eq(2)
+1 -1
View File
@@ -21,7 +21,7 @@ feature 'mass assignment' do
expect(@normal_user.reload.admin).to be_truthy expect(@normal_user.reload.admin).to be_truthy
end end
scenario 'attack two' do scenario 'attack two, Tutorial: https://github.com/OWASP/railsgoat/wiki/R4-Extras-Mass-Assignment-Admin-Role' do
params = {:user => {:admin => 't', params = {:user => {:admin => 't',
:email => 'hackety@h4x0rs.c0m', :email => 'hackety@h4x0rs.c0m',
:first_name => 'hackety', :first_name => 'hackety',
@@ -6,7 +6,7 @@ feature 'password complexity' do
@normal_user = UserFixture.normal_user @normal_user = UserFixture.normal_user
end end
scenario 'one' do scenario "one\nTutorial: https://github.com/OWASP/railsgoat/wiki/A2-Lack-of-Password-Complexity" do
visit '/signup' visit '/signup'
within('.signup') do within('.signup') do
fill_in 'user_email', :with => @normal_user.email + 'not' fill_in 'user_email', :with => @normal_user.email + 'not'
+1 -13
View File
@@ -6,7 +6,7 @@ feature 'improper password hashing' do
@normal_user = UserFixture.normal_user @normal_user = UserFixture.normal_user
end end
scenario 'with just md5' do scenario "with just md5\nTutorial: https://github.com/OWASP/railsgoat/wiki/A6-Sensitive-Data-Exposure-Insecure-Password-Storage" do
new_pass = 'testpassword' new_pass = 'testpassword'
@normal_user.password = new_pass @normal_user.password = new_pass
@normal_user.password_confirmation = new_pass @normal_user.password_confirmation = new_pass
@@ -15,16 +15,4 @@ feature 'improper password hashing' do
expect(Digest::MD5.hexdigest(new_pass)).to eq(@normal_user.password) expect(Digest::MD5.hexdigest(new_pass)).to eq(@normal_user.password)
end end
=begin
scenario 'with md5 and salt' do
pending unless @normal_user.has_attribute?('salt')
new_pass = 'testpassword'
@normal_user.password = new_pass
@normal_user.password_confirmation = new_pass
@normal_user.save
pending if verifying_fixed?
expec(Digest::MD5.hexdigest(@normal_user.salt + new_pass))to. eq(@normal_user.password)
end
=end
end end
@@ -9,7 +9,7 @@ feature 'sensitive data exposure' do
# this won't work with javascript_driver, as it'll apply the javascript # this won't work with javascript_driver, as it'll apply the javascript
# function to mask this value and the source will be overwritten. # function to mask this value and the source will be overwritten.
scenario 'attack' do scenario "attack\nTutorial: https://github.com/OWASP/railsgoat/wiki/A6-Sensitive-Data-Exposure-Cleartext-Storage-SSNs" do
login @normal_user login @normal_user
visit "/users/#{@normal_user.user_id}/work_info" visit "/users/#{@normal_user.user_id}/work_info"
+1 -1
View File
@@ -7,7 +7,7 @@ feature 'sql injection' do
@admin_user = User.where("admin='t'").first @admin_user = User.where("admin='t'").first
end end
scenario 'attack' do scenario "attack\nTutorial: https://github.com/OWASP/railsgoat/wiki/R4-A1-SQL-Injection-Concatentation" do
expect(@admin_user.admin).to be_truthy expect(@admin_user.admin).to be_truthy
login(@normal_user) login(@normal_user)
@@ -6,7 +6,7 @@ feature 'unvalidated redirect' do
@normal_user = UserFixture.normal_user @normal_user = UserFixture.normal_user
end end
scenario 'attack', :js => true do scenario "attack\nTutorial: https://github.com/OWASP/railsgoat/wiki/A10-Unvalidated-Redirects-and-Forwards-(redirect_to)", :js => true do
visit '/?url=http://example.com/do/evil/things' visit '/?url=http://example.com/do/evil/things'
within('.signup') do within('.signup') do
fill_in 'email', :with => @normal_user.email fill_in 'email', :with => @normal_user.email
+1 -1
View File
@@ -6,7 +6,7 @@ feature 'url access' do
@normal_user = UserFixture.normal_user @normal_user = UserFixture.normal_user
end end
scenario 'attack', :js => true do scenario "attack\nTutorial: https://github.com/OWASP/railsgoat/wiki/A7-Missing-Function-Level-Access-Control--(Admin-Controller)", :js => true do
login @normal_user login @normal_user
visit '/admin/1/dashboard' visit '/admin/1/dashboard'
+1 -1
View File
@@ -6,7 +6,7 @@ feature 'xss' do
@normal_user = UserFixture.normal_user @normal_user = UserFixture.normal_user
end end
scenario 'attack', :js => true do scenario "attack\nTutorial: https://github.com/OWASP/railsgoat/wiki/A3-Cross-Site-Scripting", :js => true do
login @normal_user login @normal_user
visit "/users/#{@normal_user.user_id}/account_settings" visit "/users/#{@normal_user.user_id}/account_settings"