97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
|
# File 'lib/wasp/stingab.rb', line 97
def fire (num_requests, concurrnet_user, url, id, report=false, keepalive=false, without_cookie=false, time=nil, =nil)
if @ssh.nil? then
print "[Error]".red + " Check your weapon first!"
return nil
end
keepalive_s = ""
keepalive_s = "-k" if keepalive
gnuplot = "-g #{id}.plot" if report
cookie = "-C 'sessionid=NotARealSessionID'"
cookie = nil if without_cookie
= "-H '#{}'" if not .nil?
option = "-n #{num_requests}"
option = "-t #{time}" if not time.nil?
command = "ab #{keepalive_s} -r #{gnuplot} #{option} #{} -c #{concurrnet_user} #{cookie} #{url}/"
report = @ssh.exec! command
command = "zip #{id}.zip #{id}.plot"
@ssh.exec! command
report
end
|