Skip to content

Commit

Permalink
Implemented two command line options. Replaced cutycapt by wkhtmltoim…
Browse files Browse the repository at this point in the history
…age.
  • Loading branch information
st3r30byt3 committed Feb 16, 2019
1 parent de303d3 commit 6eb64ba
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 28 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ SPARTA 1.0.4 (BETA)

DEV
* implemented two command line options (--target and --file)

* dropped cutycapt in favour of wkhtmltoimage
23 changes: 4 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SPARTA v1.0.4 BETA (http://sparta.secforce.com)
SPARTA v1.0.5 BETA (http://sparta.secforce.com)
==

Authors:
Expand All @@ -24,20 +24,19 @@ It is recommended that Kali Linux is used as it already has most tools installed

Kali (preferred):

apt-get install python-elixir python-pyside.qtwebkit
apt-get install python-elixir python-pyside.qtwebkit wkhtmltopdf

Ubuntu 12.04+ (untested)

apt-get install python-elixir python-qt4 xsltproc
apt-get install python-elixir python-qt4 xsltproc wkhtmltopdf

Other than these, the following tools are required for SPARTA to have its minimum functionality:
- nmap (for adding hosts)
- hydra (for the brute tab)
- cutycapt (for screenshots)

In Kali Linux these can be installed with:

apt-get install nmap hydra cutycapt
apt-get install nmap hydra

In Kali, to ensure that you have all the tools used by SPARTA's default configuration use:

Expand Down Expand Up @@ -72,20 +71,6 @@ The source code is structured in folders as such:
* sparta.py - The main program. The one that needs to be executed by the user.


Known issues
----

SPARTA uses a third-party tool called Cutycapt to take screenshots. One of the problems with the version that is currently in Kali's repositories is that it fails to take screenshots of HTTPS pages when self-signed certificates are in use. A way around this is to compile the Cutycapt executable yourself and edit SPARTA's configuration file to specify the path to the compiled executable.

It can be compiled in Kali by following these instructions:

% sudo apt-get install subversion libqt4-webkit libqt4-dev g++
% svn co svn://svn.code.sf.net/p/cutycapt/code/ cutycapt
% cd cutycapt/CutyCapt
% qmake
% make
% ./CutyCapt --url=http://www.example.org --out=example.png


Credits
----
Expand Down
20 changes: 14 additions & 6 deletions app/auxiliary.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def run(self):
for i in range(0, len(self.urls)):
try:
url = self.urls.pop(0)
outputfile = getTimestamp()+'-screenshot-'+url.replace(':', '-')+'.png'
outputfile = getTimestamp()+'-screenshot-'+url.replace(':', '-')+'.jpg'
ip = url.split(':')[0]
port = url.split(':')[1]
# print '[+] Taking screenshot of '+url
Expand All @@ -270,12 +270,20 @@ def run(self):
print '\t[+] Finished.'

def save(self, url, ip, port, outputfile):
print '[+] Saving screenshot as: '+str(outputfile)
command = "cutycapt --max-wait="+str(self.timeout)+" --url="+str(url)+"/ --out=\""+str(self.outputfolder)+"/"+str(outputfile)+"\""
# print command
print '[+] Taking screenshot for ' + str(url)
out = str(self.outputfolder) + "/" + str(outputfile)
command = "wkhtmltoimage --load-error-handling ignore " + str(url) + " " + out
p = subprocess.Popen(command, shell=True)
p.wait() # wait for command to finish
self.done.emit(ip,port,outputfile) # send a signal to add the 'process' to the DB
p.wait()

if os.path.exists(out) and os.stat(out).st_size > 0:
print '[+] Saved screenshot as: '+str(outputfile)
self.done.emit(ip,port,outputfile)

else:
raise Exception("Screenshot is empty file.")



# This class handles what is to be shown in each panel
class Filters():
Expand Down
4 changes: 2 additions & 2 deletions controller/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

'''
SPARTA - Network Infrastructure Penetration Testing Tool (http://sparta.secforce.com)
Copyright (c) 2015 SECFORCE (Antonio Quina and Leonidas Stavliotis)
Copyright (c) 2019 SECFORCE (Antonio Quina and Leonidas Stavliotis)
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Expand All @@ -22,7 +22,7 @@ class Controller():

# initialisations that will happen once - when the program is launched
def __init__(self, view, logic):
self.version = 'SPARTA 1.0.4 (BETA)' # update this everytime you commit!
self.version = 'SPARTA 1.0.5 (BETA)' # update this everytime you commit!
self.logic = logic
self.view = view
self.view.setController(self)
Expand Down

0 comments on commit 6eb64ba

Please sign in to comment.