diff --git a/.mailmap b/.mailmap new file mode 100644 index 0000000000..1ed9a37c78 --- /dev/null +++ b/.mailmap @@ -0,0 +1,66 @@ +wchen-r7 sinn3r # aka sinn3r +wchen-r7 Wei Chen +wchen-r7 sinn3r +todb-r7 Tod Beardsley +jvazquez-r7 jvazquez-r7 +hmoore-r7 HD Moore +hmoore-r7 HD Moore +jlee-r7 James Lee # aka egypt +jlee-r7 James Lee +dmaloney-r7 David Maloney # aka TheLightCosine +dmaloney-r7 David Maloney +joev-r7 Joe Vennix +bturner-r7 Brandon Turner +ecarey-r7 Erran Carey +limhoff-r7 Luke Imhoff +todb-r7 Tod Beardsley +tasos-r7 Tasos Laskos +shuckins-r7 Samuel Huckins +bperry-r7 Brandon Perry +bperry-r7 Brandon Perry + +# Above this line are current Rapid7 employees Below this paragraph are +# volunteers, former employees, and potential Rapid7 employees who, at +# one time or another, had some largeish number of commits landed on +# rapid7/metasploit-framework master branch. This should be refreshed +# periodically. If you're on this list and would like to not be, just +# let todb@metasploit.com know. + +Meatballs1 Meatballs +Meatballs1 Meatballs1 +Meatballs1 Ben Campbell +jduck Joshua Drake +jcran Jonathan Cran +jcran Jonathan Cran +bannedit David Rude +darkoperator Carlos Perez +scriptjunkie Matt Weeks +skape Matt Miller +ceballosm Mario Ceballos +swtornio Steve Tornio +kris kris <> +spoonm Spoon M +fab fab <> # fab at revhosts.net (Fabrice MOURRON) +efraintorres efraintorres +efraintorres et <> +r3dy Royce Davis +r3dy Royce Davis +mubix Rob Fuller +nmonkee nmonkee +rsmudge Raphael Mudge # Aka `butane +m-1-k-3 m-1-k-3 +kost Vlatko Kosturjak +ohdae ohdae +schierlm Michael Schierl # Aka mihi +corelanc0d3er Peter Van Eeckhoutte (corelanc0d3r) +corelanc0d3er corelanc0d3r +kernelsmith Joshua Smith +kernelsmith kernelsmith +h0ng10 h0ng10 +h0ng10 Hans-Martin Münch +nullbind nullbind +nevdull77 Patrik Karlsson +jgor jgor +ChrisJohnRiley Chris John Riley +ChrisJohnRiley Chris John Riley +FireFart Christian Mehlmauer diff --git a/tools/committer_count.rb b/tools/committer_count.rb new file mode 100755 index 0000000000..0b3bf42a03 --- /dev/null +++ b/tools/committer_count.rb @@ -0,0 +1,70 @@ +#!/usr/bin/env ruby + +# The committer_count.rb is a way to tell who's been active over the last +# given period. It's of course, quite coarse -- someone with 10 commits in a day +# may or may not be more productive than someone with 3, but over long enough +# periods, it's an okay metric to measure involvement with the project, since +# large and small commits will tend to average out. +# +# Note that this includes merge commits by default (which usually means at least +# code review happened, so it's still a measure of work). You can get different +# stats by ignoring merge commits, once option parsing is implemented. +# +# Usage: ./committer_count.rb 2011-01-01 | head -10 # Since a particular date +# ./committer_count.rb 1y | head -10 # Last year +# ./committer_count.rb 6m | head -10 # Last six months +# ./committer_count.rb 12w | head -10 # Last twelve weeks +# ./committer_count.rb 100d | head -10 # Last hundred days +# +# +# History with colors and e-mail addresses (respecting .mailmap): +# git log --pretty=format:"%C(white)%ad %C(yellow)%h %Cblue'%aN' <%aE> %Cgreen%f%Creset" --date=short + +class GitLogLine < Struct.new(:date, :hash, :author, :message) +end + +@history = `git log --pretty=format:"%ad %h '%aN' %f" --date=short --date-order` +@recent_history = [] +@commits_by_author = {} + +def parse_date(date) + case date + when /([0-9]+)y(ear)?s?/ + seconds = $1.to_i* (60*60*24*365.25) + calc_date = (Time.now - seconds).strftime("%Y-%m-%d") + when /([0-9]+)m(onth)?s?/ + seconds = $1.to_i* (60*60*24*(365.25 / 12)) + calc_date = (Time.now - seconds).strftime("%Y-%m-%d") + when /([0-9]+)w(eek)?s?/ + seconds = $1.to_i* (60*60*24*7) + calc_date = (Time.now - seconds).strftime("%Y-%m-%d") + when /([0-9]+)d(ay)?s?/ + seconds = $1.to_i* (60*60*24) + calc_date = (Time.now - seconds).strftime("%Y-%m-%d") + else + calc_date = Time.new(date).strftime("%Y-%m-%d") + end +end + +date = ARGV[0] || "2005-03-22" # A day before the first SVN commit. +calc_date = parse_date(date) + +@history.each_line do |line| + parsed_line = line.match(/^([^\s+]+)\s(.{7,})\s'(.*)'\s(.*)[\r\n]*$/) + next unless parsed_line + break if calc_date == parsed_line[1] + @recent_history << GitLogLine.new(*parsed_line[1,4]) +end + +@recent_history.each do |logline| + @commits_by_author[logline.author] ||= [] + @commits_by_author[logline.author] << logline.message +end + +puts "Commits since #{calc_date}" +puts "-" * 50 + +@commits_by_author.sort_by {|k,v| v.size}.reverse.each do |k,v| + puts "%-25s %3d" % [k,v.size] +end + diff --git a/tools/module_commits.rb b/tools/module_commits.rb new file mode 100755 index 0000000000..2f447c9f82 --- /dev/null +++ b/tools/module_commits.rb @@ -0,0 +1,64 @@ +#!/usr/bin/env ruby + +# Check the commit history of a module or tree of modules. +# and sort by number of commits. +# +# Usage: tools/module_commits.rb [module dir | module fname] + +require 'find' + +class GitLogLine < Struct.new(:date, :hash, :author, :message) +end + +class CommitHistory < Struct.new(:fname, :total, :authors) +end + +msfbase = __FILE__ +while File.symlink?(msfbase) + msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase)) +end + +dir = ARGV[0] || File.join(msfbase, "modules", "exploits") +raise ArgumentError, "Need a filename or directory" unless (dir and File.readable? dir) + +def check_commit_history(fname) + + git_cmd = `git log --pretty=format:"%ad %h '%aN' %f" --date=short --date-order #{fname}` + commit_history = [] + commits_by_author = {} + + git_cmd.each_line do |line| + parsed_line = line.match(/^([^\s+]+)\s(.{7,})\s'(.*)'\s(.*)[\r\n]*$/) + commit_history << GitLogLine.new(*parsed_line[1,4]) + end + + commit_history.each do |logline| + commits_by_author[logline.author] ||= [] + commits_by_author[logline.author] << logline.message + end + + puts "Commits for #{fname} #{commit_history.size}" + puts "-" * 72 + + commits_by_author.sort_by {|k,v| v.size}.reverse.each do |k,v| + puts "%-25s %3d" % [k,v.size] + end + + this_module = CommitHistory.new(fname,commit_history.size,commits_by_author) + return this_module + +end + +@module_stats = [] + +Find.find(dir) do |fname| + next unless fname =~ /rb$/ + @module_stats << check_commit_history(fname) +end + +puts "=" * 72 +puts "Sorted modules by commit counts" + +@module_stats.sort_by {|m| m.total }.reverse.each do |m| + puts "%-60s %d" % [m.fname, m.total] +end diff --git a/tools/module_count.rb b/tools/module_count.rb new file mode 100755 index 0000000000..4080a17eeb --- /dev/null +++ b/tools/module_count.rb @@ -0,0 +1,49 @@ +#!/usr/bin/env ruby + +# Lists the current count of modules, by type, and outputs a bare CSV. + +msfbase = __FILE__ +while File.symlink?(msfbase) + msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase)) +end + +$:.unshift(File.expand_path(File.join(File.dirname(msfbase), '..', 'lib'))) +require 'fastlib' +require 'msfenv' + +$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB'] + +require 'rex' +require 'msf/ui' +require 'msf/base' + +# Always disable the database (we never need it just to list module +# information). +framework_opts = { 'DisableDatabase' => true } + +# Initialize the simplified framework instance. +$framework = Msf::Simple::Framework.create(framework_opts) +Indent = ' ' + +i = 0 +module_types = { + :exploit => 0, + :auxiliary => 0, + :post => 0, + :payload => 0, + :encoder => 0, + :nop => 0 +} + +$framework.modules.each do |name, mod| + this_mod = mod.new + [:exploit, :auxiliary, :post, :payload, :encoder, :nop].each do |meth| + interrogative = "#{meth}?".intern + if this_mod.send(interrogative) + module_types[meth] += 1 + end + end +end + +puts module_types.keys.map {|k| k.to_s}.join(",") +puts module_types.values.join(",")