File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
modules/payloads/stagers/python Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 6
6
##
7
7
8
8
require 'msf/core'
9
- require 'msf/core/handler/reverse_tcp '
9
+ require 'msf/core/handler/bind_tcp '
10
10
require 'msf/base/sessions/command_shell'
11
11
require 'msf/base/sessions/command_shell_options'
12
12
Original file line number Diff line number Diff line change 4
4
# Replace leading tabs with 2-width spaces.
5
5
# I'm sure there's a sed/awk/perl oneliner that's
6
6
# 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]
7
14
8
15
require 'fileutils'
9
16
require 'find'
10
17
11
18
dir = ARGV [ 0 ] || "."
19
+ keep_backups = !!( ENV [ 'MSF_RETAB_BACKUPS' ] || ENV [ 'MSF_RETAB_BACKUP' ] )
20
+ puts "Keeping .notab backups" if keep_backups
21
+
12
22
raise ArgumentError , "Need a filename or directory" unless ( dir and File . readable? dir )
13
23
14
24
Find . find ( dir ) do |infile |
15
25
next unless File . file? infile
16
26
next unless infile =~ /rb$/
17
27
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
20
33
21
34
data = File . open ( infile , "rb" ) { |f | f . read f . stat . size }
22
35
fixed = [ ]
You can’t perform that action at this time.
0 commit comments