Skip to content

Commit

Permalink
screenshot plugin creates 2 files (fixes #494)
Browse files Browse the repository at this point in the history
  • Loading branch information
xmendez committed Oct 12, 2016
1 parent f7cf258 commit a589195
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions plugins/scripts/screenshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import subprocess
import tempfile
import pipes
import os

@moduleman_plugin
class screenshot(BasePlugin):
Expand All @@ -16,7 +17,10 @@ def validate(self, fuzzresult):
return fuzzresult.code not in [404]

def process(self, fuzzresult):
(fd, filename) = tempfile.mkstemp()
temp_name = next(tempfile._get_candidate_names())
defult_tmp_dir = tempfile._get_default_tempdir()

subprocess.call(['cutycapt', '--url=%s' % pipes.quote(fuzzresult.url), '--out=%s.png' % filename])
self.add_result("Screnshot taken, output at %s.png" % filename)
filename = os.path.join(defult_tmp_dir, temp_name + ".png")

subprocess.call(['cutycapt', '--url=%s' % pipes.quote(fuzzresult.url), '--out=%s' % filename])
self.add_result("Screnshot taken, output at %s" % filename)

0 comments on commit a589195

Please sign in to comment.