forked from Arachni/arachni
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
95 lines (75 loc) · 2.36 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
=begin
Arachni
Copyright (c) 2010-2012 Tasos "Zapotek" Laskos <[email protected]>
This is free software; you can copy and distribute and modify
this program under the term of the GPL v2.0 License
(See LICENSE file for details)
=end
require File.expand_path( File.dirname( __FILE__ ) ) + '/lib/arachni/version'
desc "Generate docs"
task :docs do
outdir = "../arachni-gh-pages"
sh "mkdir #{outdir}" if !File.directory?( outdir )
sh "inkscape gfx/logo.svg --export-png=#{outdir}/logo.png"
sh "inkscape gfx/icon.svg --export-png=#{outdir}/icon.png"
sh "inkscape gfx/icon.svg --export-png=#{outdir}/favicon.ico"
sh "inkscape gfx/banner.svg --export-png=#{outdir}/banner.png"
sh "yardoc --verbose --title \
\"Arachni - Web Application Security Scanner Framework\" \
external/* path_extractors/* plugins/* reports/* modules/* metamodules/* lib/* -o #{outdir} \
- EXPLOITATION.md HACKING.md CHANGELOG.md LICENSE.md AUTHORS.md \
CONTRIBUTORS.md ACKNOWLEDGMENTS.md"
sh "rm -rf .yard*"
end
#
# Simple profiler using perftools[1].
#
# To install perftools for Ruby:
# gem install perftools.rb
#
# [1] https://github.com/tmm1/perftools.rb
#
desc "Profile Arachni"
task :profile do
sh "CPUPROFILE_FREQUENCY=500 CPUPROFILE=/tmp/profile.dat " +
"RUBYOPT=\"-r`gem which perftools | tail -1`\" " +
" ./bin/arachni http://demo.testfire.net --link-count=5 && " +
"pprof.rb --gif /tmp/profile.dat > profile.gif"
end
#
# Cleans reports and logs
#
desc "Cleaning report and log files."
task :clean do
sh "rm *.afr || true"
sh "rm *.yaml || true"
sh "rm *.json || true"
sh "rm *.marshal || true"
sh "rm *.gem || true"
sh "rm logs/*.log || true"
sh "rm lib/arachni/ui/web/server/db/*.* || true"
sh "rm lib/arachni/ui/web/server/db/welcomed || true"
sh "rm lib/arachni/ui/web/server/public/reports/*.* || true"
sh "rm lib/arachni/ui/web/server/tmp/*.* || true"
end
#
# Building
#
desc "Build the arachni gem."
task :build => [ :clean ] do
sh "gem build arachni.gemspec"
end
#
# Installing
#
desc "Build and install the arachni gem."
task :install => [ :build ] do
sh "gem install arachni-#{Arachni::VERSION}.gem"
end
#
# Publishing
#
desc "Push a new version to Gemcutter"
task :publish => [ :build ] do
sh "gem push arachni-#{Arachni::VERSION}.gem"
end