Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
require 'rbconfig'
require 'fileutils'
require 'find'
require 'open3'
require 'pathname'
require 'pp'

task :default => :help
Expand Down Expand Up @@ -94,6 +96,15 @@ task :unpack do
}
}

File.open("payload.txt") do |f|
f.each_line do |i|
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe i.chomp! or something is needed.

i.chomp!
if File.exist? i
File.unlink "#{LATEST_DIR}/#{i}"
puts "removed: #{i}"
end
end
end
end

task :index => :index_codesearch
Expand Down Expand Up @@ -132,13 +143,25 @@ def fix_permission(dir)
}
end

RB_EXT_NAMES = %w(.rb .ru .gemspec .rake .cmd .gemfile .thor)
C_EXT_NAMES = %w(.c .h .cpp .hpp)
def clean_files(dir)
return unless File.exist? dir
Find.find(dir) {|fn|
st = File.lstat(fn)
if st.file?
if fn.end_with?('.ri')
if C_EXT_NAMES.any?{|ext| fn.end_with?(ext)}
next
elsif !(RB_EXT_NAMES.any?{|ext| fn.end_with?(ext)} || Pathname(fn).extname.empty?)
File.unlink fn
puts "removed: #{fn}"
next
else
_, _, _, wait_thr = *Open3.popen3("ruby -c #{fn}")
if wait_thr.value.exitstatus != 0
File.unlink fn
puts "removed: #{fn}"
end
end
end
}
Expand Down
12 changes: 12 additions & 0 deletions payload.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
EICAR-0.0.6/bin/eicar.com
clamd-1.0.1/spec/fixtures/virus
clamrb-0.0.3/test/files/eicar.txt
clamav-0.4.1/spec/clamav-testfiles/eicar.com
clamav-0.4.1/spec/clamav-testfiles/test.txt
metasploit-payloads-1.3.60/data/java/metasploit/RMILoader.class
meterpreter_bins-0.0.22/meterpreter/metsrv.x64.dll
meterpreter_bins-0.0.22/meterpreter/ext_server_priv.x86.dll
metasploit-payloads-1.3.60/data/java/metasploit/Payload.class
warp-clamav-0.3.1/spec/clamav-testfiles/eicar.com
warp-clamav-0.3.1/spec/clamav-testfiles/test.txt
video_to_ascii-0.0.3/bin/wacaw