concuss 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c5ead6fff82661378bb379172fb4e62a3d22c5a312d363cc9c49a8ebce268e40
4
- data.tar.gz: 9bce360c65581ef6ec55ecd6084609680fff69a4480f7ef75041a8cb1c8df756
3
+ metadata.gz: d8cda3e6dd7c8fec832edc74bfd9ce03f2f3879642664e0fd32f887b3c3ddcb0
4
+ data.tar.gz: a1f8fabf05a0ac40d9c4aa0b189f24dab1d6ad8dfb528adf53585f244209ccd5
5
5
  SHA512:
6
- metadata.gz: 5f83174439a0930992841f179026927addfd43b3aab14ce08738959f28a04a23eff6b40d83ca610586b5d23aa22c9073d59c0fa04843e0fe15bcf8f865a51302
7
- data.tar.gz: 517db0408b735b4f4741f720f23222e5c9ab2f4cdc5b09f3a943df65e54b33dfc68256bcd3b9fda1d350c597003b6ce7cbb6bcc08e39a6b15f8d1233872f2ad3
6
+ metadata.gz: b964667adac8e919166dbbaff87cd822250071b77539cf5d0e93ce9fbddefc043de7f8b3205471f13f2e7bffdc81228a2ade804e539a3e12a40aef58ec77c5fd
7
+ data.tar.gz: 922a3c95a34088569b528f032f08e62c427238790031b467cc96775f9d32498e440c64721297e7278bf1b38307f451b3300abe37e194f9e7de0f0f8f09423ae0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,7 @@
1
- ## [Unreleased]
1
+ ## [0.2.0] - 2023-01-29
2
+
3
+ * Add support for custom user agents. If none provided, used a default user agent that identifies itself as Concuss/VERSION
2
4
 
3
5
  ## [0.1.0] - 2023-01-18
4
6
 
5
- - Initial release
7
+ * Initial release
data/README.md CHANGED
@@ -1,11 +1,16 @@
1
1
  # Concuss
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/concuss.svg)](https://badge.fury.io/rb/concuss)
4
+ [![Build Status](https://github.com/patricktulskie/concuss/actions/workflows/main.yml/badge.svg)](https://github.com/patricktulskie/concuss/actions/workflows/main.yml)
5
+
3
6
  ## What is it?
4
7
 
5
8
  Concuss is a tool for banging against a url with a bunch of different headers to look for potential vulnerabilities.
6
9
 
7
10
  It works by sending a custom or a random string to a webserver for a specific url in a variety of headers to see if it's able to get that string to appear on the page. If so, you'll get a HIT and you can evaluate that header to see if it's useful for some kind of XSS, cache poisoning, or some other form of injection from malformed headers.
8
11
 
12
+ Often times web app and framework developers assume that headers from the client are not malicious or manipulated and will just write them out to the page in one form or another. This project is a specialized tool to find instances of this so that they can be fixed before they are abused.
13
+
9
14
  ## What it is NOT.
10
15
 
11
16
  Concuss is not a tool for automating vulnerabilities, nor should it be used to certify that a page is safe from vulnerabilities. It should not be used on applications or website that you do not personally have permission to scan.
@@ -44,12 +49,34 @@ concuss.attack!
44
49
 
45
50
  This will spit out the results, which isn't super useful if you need to post process them... I'll work on that though.
46
51
 
52
+ ## Demo
53
+
54
+ There is a sample app with a vulnerability to test with in the `vuln_app` directory. It takes the contents of `X-CSRF-Token` and spits them out blindly.
55
+
56
+ Here's some steps to get going with that:
57
+
58
+ ```
59
+ docker-compose build
60
+ docker-compose run console bash
61
+
62
+ # You should see the vuln_app container boot up and
63
+ # then you'll land in bash on the console container
64
+
65
+ bin/concuss http://vuln_app:4567 -h non_standard
66
+ ```
67
+
47
68
  ## Development
48
69
 
49
- After checking out the repo, run `script/setup` to install dependencies. Then, run `rspec` to run the tests. You can also run `script/console` for an interactive prompt that will allow you to experiment.
70
+ Primarily, you'll want to use Docker to do debugging and development. To get into the console, just run `docker-compose run console bash` and from there you can run `bin/concuss` against the sample vulnerable app, or you can run `rspec` to run the specs.
71
+
72
+ If you prefer to develop without docker, after checking out the repo, run `bundle install` to install dependencies. Then, run `rspec` to run the tests.
73
+
74
+ When developing using docker or on your bare machine you can also run `script/console` for an interactive prompt that will allow you to experiment. This will give you access to the underlying classes and let you experiment outside the confines of the CLI.
50
75
 
51
76
  If you add features or fix bugs, please write specs and open up a PR.
52
77
 
78
+ Note: Concuss was designed to easily install on most systems with ruby 3+. As such, its only dependencies are in the ruby standard library.
79
+
53
80
  ## Contributing
54
81
 
55
82
  Bug reports and pull requests are welcome on GitHub at https://github.com/patricktulskie/concuss
data/bin/concuss CHANGED
@@ -19,6 +19,10 @@ OptionParser.new do |opts|
19
19
  opts.on("-t", "--test-string STRING", "Set a custom test string. If none specified, it sets a random string to match on.") do |v|
20
20
  options[:test_string] = v
21
21
  end
22
+
23
+ opts.on("-a", "--user-agent STRING", "Set a custom user agent. If none specified, it defaults to Concuss/#{Concuss::VERSION}") do |v|
24
+ options[:user_agent] = v
25
+ end
22
26
  end.parse!
23
27
 
24
28
  if ARGV[0].nil?
@@ -30,7 +30,6 @@ class Concuss::Headers
30
30
  'Range',
31
31
  'Referer',
32
32
  'TE',
33
- 'User-Agent',
34
33
  'Upgrade',
35
34
  'Via',
36
35
  'Warning'
@@ -2,12 +2,15 @@ require 'securerandom'
2
2
  require 'net/http'
3
3
 
4
4
  class Concuss::Runner
5
- attr_reader :headers, :url, :test_string
5
+ DEFAULT_USER_AGENT = "Concuss/#{Concuss::VERSION}"
6
+
7
+ attr_reader :headers, :url, :test_string, :user_agent
6
8
 
7
- def initialize(headers:, url:, test_string: nil)
9
+ def initialize(headers:, url:, test_string: nil, user_agent: nil)
8
10
  @headers = headers
9
11
  @url = url
10
12
  @test_string = test_string || SecureRandom.hex(25)
13
+ @user_agent = user_agent || DEFAULT_USER_AGENT
11
14
  end
12
15
 
13
16
  def run
@@ -15,7 +18,10 @@ class Concuss::Runner
15
18
 
16
19
  @headers.each do |header|
17
20
  response = Net::HTTP.get_response(uri,
18
- { header => test_string }
21
+ {
22
+ header => test_string,
23
+ 'User-Agent' => user_agent
24
+ }
19
25
  )
20
26
 
21
27
  if response.code == "200" && response.body.include?(@test_string)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Concuss
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
data/lib/concuss.rb CHANGED
@@ -3,19 +3,20 @@
3
3
  class Concuss
4
4
  class Error < StandardError; end
5
5
 
6
- attr_reader :url, :file, :header_set, :headers, :test_string
6
+ attr_reader :url, :file, :header_set, :headers, :test_string, :user_agent
7
7
 
8
- def initialize(url:, file: nil, header_set: :all, test_string: nil)
8
+ def initialize(url:, file: nil, header_set: :all, test_string: nil, user_agent: nil)
9
9
  @url = url
10
10
  @file = file
11
11
  @header_set = file.nil? ? header_set : :file
12
12
  @test_string = test_string
13
+ @user_agent = user_agent
13
14
 
14
15
  @headers = Concuss::Headers.new(header_set: @header_set, file: @file).group
15
16
  end
16
17
 
17
18
  def attack!
18
- runner = Concuss::Runner.new(headers: headers, url: url, test_string: test_string)
19
+ runner = Concuss::Runner.new(headers: headers, url: url, test_string: test_string, user_agent: user_agent)
19
20
 
20
21
  runner.run
21
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: concuss
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Tulskie
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-21 00:00:00.000000000 Z
11
+ date: 2023-01-29 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Test websites for header injection issues
14
14
  email:
@@ -45,7 +45,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
45
45
  requirements:
46
46
  - - ">="
47
47
  - !ruby/object:Gem::Version
48
- version: 2.6.0
48
+ version: 3.0.0
49
49
  required_rubygems_version: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - ">="