- Install VirtualBox
- Install vagrant (use the OS installer instead of gem)
vagrant box add <box_name> <box_url>
require 'spec/support/grep_matcher' | |
describe do | |
disallow_presence_of pattern: "send(.*#", | |
location: "app/", | |
description: "Do not use dynamic method invocations", | |
failure: "Please change dynamic method call to something more sane." | |
end |
# | |
# | |
# ms12-020 "chinese shit" PoC v2 (wireshark version) | |
# | |
# tested on winsp3 spanish, reported to work on Win7, win 2008 | |
# | |
# original source: http://115.com/file/be27pff7 | |
# | |
# |
class UserMailer < ActionMailer::Base | |
default :from => "[email protected]" | |
def welcome_email_to_player | |
attachments.inline['user_back'] = { | |
:data => File.read("#{Rails.root.to_s + '/app/assets/images/bg.jpg'}"), | |
:mime_type => "image/jpg", | |
:encoding => "base64" | |
} | |
mail(:to => "[email protected]", :subject => "Welcome to here") | |
end |
class ApplicationController < ActionController::Base | |
# Creates an accessor which is exposed to the view | |
def self.view_accessor(*names) | |
attr_accessor *names | |
helper_method *names | |
end | |
end |
package examples.database; | |
import com.google.common.collect.Lists; | |
import examples.database.dao.PeopleDAO; | |
import examples.database.model.PeopleInfo; | |
import org.apache.commons.lang.time.StopWatch; | |
import org.apache.commons.logging.Log; | |
import org.apache.commons.logging.LogFactory; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; |
#!/usr/bin/env ruby | |
# | |
# Proof-of-Concept exploit for Rails Remote Code Execution (CVE-2013-0156) | |
# | |
# ## Advisory | |
# | |
# https://groups.google.com/forum/#!topic/rubyonrails-security/61bkgvnSGTQ/discussion | |
# | |
# ## Caveats | |
# |
This bash script offers quick shortcuts to simulate slower network connections. It is useful when you need to simulate a wireless network on a Linux network server, especially when you are using a virtual machine guest on your local machine or in the cloud.
slow 3G # Slow network on default eth0 down to 3G wireless speeds
slow reset # Reset connection for default eth0 to normal
slow vsat --latency=500ms # Simulate satellite internet with a high latency
slow dsl -b 1mbps # Simulate DSL with a slower speed than the default
slow modem-56k -d eth0 # Simulate a 56k modem on the eth1 device. eth0 is unchanged.
<%= simple_form_for @product do |f| %> | |
<%= f.simple_fields_for :attributes do |d| %> | |
<% f.object.attributes.try(:each) do |key, value| %> | |
<%= d.input key, :input_html => {:value => value } %> | |
<% end %> | |
<% end %> | |
<% end %> |