Skip to content

Commit cbb9984

Browse files
committed
Merge branch 'master' into retab/rumpus
2 parents 84aaf23 + 264031a commit cbb9984

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

modules/payloads/stagers/python/bind_tcp.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
##
77

88
require 'msf/core'
9-
require 'msf/core/handler/reverse_tcp'
9+
require 'msf/core/handler/bind_tcp'
1010
require 'msf/base/sessions/command_shell'
1111
require 'msf/base/sessions/command_shell_options'
1212

tools/dev/retab.rb

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,32 @@
44
# Replace leading tabs with 2-width spaces.
55
# I'm sure there's a sed/awk/perl oneliner that's
66
# a million times better but this is more readable for me.
7+
#
8+
# Usage:
9+
# metasploit-framework$ ./tools/dev/retab.rb [path]
10+
#
11+
# If local backups are desired, prepend with "MSF_RETAB_BACKUPS" set,
12+
# like so:
13+
# metasploit-framework$ MSF_RETAB_BACKUPS=1 ./tools/dev/retab.rb [path]
714

815
require 'fileutils'
916
require 'find'
1017

1118
dir = ARGV[0] || "."
19+
keep_backups = !!(ENV['MSF_RETAB_BACKUPS'] || ENV['MSF_RETAB_BACKUP'])
20+
puts "Keeping .notab backups" if keep_backups
21+
1222
raise ArgumentError, "Need a filename or directory" unless (dir and File.readable? dir)
1323

1424
Find.find(dir) do |infile|
1525
next unless File.file? infile
1626
next unless infile =~ /rb$/
1727
outfile = infile
18-
backup = "#{infile}.notab"
19-
FileUtils.cp infile, backup
28+
29+
if keep_backups
30+
backup = "#{infile}.notab"
31+
FileUtils.cp infile, backup
32+
end
2033

2134
data = File.open(infile, "rb") {|f| f.read f.stat.size}
2235
fixed = []

0 commit comments

Comments
 (0)