Skip to content

Commit d0bf67a

Browse files
author
micabot
committed
Merge branch 'white/master'
2 parents 4d1c3f4 + 8678074 commit d0bf67a

45 files changed

Lines changed: 1868 additions & 1239 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ Project contributors
1818
* Andres Tarantini
1919
* Ezequiel Tavella
2020
* Martin Tartarelli
21+
* Ronald Iraheta

RELEASE.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,23 @@ Please run ./faraday.py --update
1010
New features in the latest update
1111
=====================================
1212

13+
Feb 26, 2016:
14+
---
15+
* Fixed bug in pip debian
16+
* BugFix pip install.
17+
* Checks additionals about dependencies in installation.
18+
* Warning about a upgrade to experimental in debian installation.
19+
* Fixed small bug in CSV importing
20+
* Fixed styles for Status Report
21+
* Fixed bug on Status Report filter after editing
22+
* Added support for Kali Rolling Edition
23+
* Notify user when the current Workspace doesn't exist
24+
* Show all evidence files in Status Report
25+
* Added script to remove all vulns with a specific severity value (parameterized)
26+
* Fixed Arachni Plugin bugs
27+
* Added new version for Maltego Plugin
28+
* Added support for Mint 17
29+
1330
Dec 18, 2015:
1431
---
1532
* Immunity Canvas plugin added

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.16
1+
1.0.17

config/default.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<faraday>
33

44
<appname>Faraday - Penetration Test IDE</appname>
5-
<version>1.0.16</version>
5+
<version>1.0.17</version>
66
<debug_status>0</debug_status>
77
<font>-Misc-Fixed-medium-r-normal-*-12-100-100-100-c-70-iso8859-1</font>
88
<home_path>~/</home_path>

faraday.py

Lines changed: 28 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import argparse
1818
import platform
1919
import subprocess
20-
import pip
2120
import json
2221

2322
from utils.logs import getLogger, setUpLogger
@@ -28,7 +27,6 @@
2827
from utils.user_input import query_yes_no
2928

3029

31-
3230
USER_HOME = os.path.expanduser(CONST_USER_HOME)
3331
FARADAY_BASE = os.path.dirname(os.path.realpath(__file__))
3432
QTDIR=os.path.join(FARADAY_BASE, 'external_libs', 'qt')
@@ -125,11 +123,6 @@ def getParserArgs():
125123
help="Disable the application exception hook that allows to send error \
126124
reports to developers.")
127125

128-
parser.add_argument('--disable-login', action="store_true",
129-
dest="disable_login",
130-
default=False,
131-
help="Disable the auth splash screen.")
132-
133126
parser.add_argument('--dev-mode', action="store_true", dest="dev_mode",
134127
default=False,
135128
help="Enable dev mode. This will use the user config and plugin folder.")
@@ -153,7 +146,7 @@ def getParserArgs():
153146

154147
parser_gui_ex.add_argument('--cli', '--console', action="store_true",
155148
dest="cli",
156-
default="false",
149+
default=False,
157150
help="Set this flag to avoid gui and use faraday as a cli.")
158151

159152
#args = parser.parse_args(['@parser_args.cfg'])
@@ -208,30 +201,32 @@ def checkDependencies():
208201
"""
209202

210203
if not args.ignore_deps:
211-
212-
modules = []
213-
f = open(CONST_REQUIREMENTS_FILE)
214-
for line in f:
215-
if not line.find('#'):
216-
break
217-
else:
218-
modules.append([line[:line.index('=')], (line[line.index('=')+2:]).strip()])
219-
f.close()
220-
221-
pip_dist = [dist.project_name.lower() for dist in pip.get_installed_distributions()]
222-
223-
for module in modules:
224-
if module[0].lower() not in pip_dist:
225-
try:
226-
__import__(module[0])
227-
except ImportError:
228-
if query_user_bool("Missing module %s."
229-
" Do you wish to install it?" % module[0]):
230-
pip.main(['install', "%s==%s" %
231-
(module[0], module[1]), '--user'])
232-
233-
else:
234-
return False
204+
try:
205+
import pip
206+
modules = []
207+
f = open(CONST_REQUIREMENTS_FILE)
208+
for line in f:
209+
if not line.find('#'):
210+
break
211+
else:
212+
modules.append([line[:line.index('=')], (line[line.index('=')+2:]).strip()])
213+
f.close()
214+
pip_dist = [dist.project_name.lower() for dist in pip.get_installed_distributions()]
215+
216+
for module in modules:
217+
if module[0].lower() not in pip_dist:
218+
try:
219+
__import__(module[0])
220+
except ImportError:
221+
if query_user_bool("Missing module %s."
222+
" Do you wish to install it?" % module[0]):
223+
pip.main(['install', "%s==%s" %
224+
(module[0], module[1]), '--user'])
225+
226+
else:
227+
return False
228+
except ImportError:
229+
pass
235230

236231
return True
237232

@@ -283,8 +278,6 @@ def setConf():
283278
CONF.setApiConInfoPort(port_xmlrpc)
284279
CONF.setApiRestfulConInfoPort(port_rest)
285280

286-
CONF.setAuth(args.disable_login)
287-
288281

289282
def startFaraday():
290283
"""Application startup.
@@ -548,7 +541,7 @@ def checkUpdates():
548541
getInstanceConfiguration().setAppname("Faraday - Penetration Test IDE Community")
549542
parameter = {"version": getInstanceConfiguration().getVersion()}
550543

551-
f.close
544+
f.close()
552545
resp = requests.get(uri, params=parameter, timeout=1, verify=True)
553546
resp = resp.text.strip()
554547
except Exception as e:

gui/qt3/hostsbrowser.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -758,8 +758,7 @@ def _importVulnsCvs(self,item):
758758
continue
759759

760760
d = l.split("|")
761-
762-
if len(d) <=8:
761+
if len(d) <8:
763762
api.log("Error vuln line: ("+l+")" )
764763
else:
765764
self._newVulnImport(d[1],d[2],d[3],d[4],d[5],d[6],d[7])

helpers/removeBySeverity.py

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
#!/usr/bin/env python2.7
2+
'''
3+
Faraday Penetration Test IDE
4+
Copyright (C) 2014 Infobyte LLC (http://www.infobytesec.com/)
5+
See the file 'doc/LICENSE' for the license information
6+
7+
'''
8+
'''
9+
This script either updates or removes Interfaces, Services and Vulnerabilities in case their parent property is null.
10+
If the property is null but a parent is found in Couch, the document is updated.
11+
If the parent is not found in Couch the document is deleted, since it is an invalid one.
12+
'''
13+
14+
import argparse
15+
import json
16+
import requests
17+
import os
18+
19+
def main():
20+
#arguments parser
21+
parser = argparse.ArgumentParser(prog='removeBySeverity', epilog="Example: ./%(prog)s.py")
22+
parser.add_argument('-c', '--couchdburi', action='store', type=str,
23+
dest='couchdb',default="http://127.0.0.1:5984",
24+
help='Couchdb URL as http://user:password@couch_ip:couch_port (defaults to http://127.0.0.1:5984)')
25+
parser.add_argument('-d', '--db', action='store', type=str, required=True,
26+
dest='db', help='DB to process')
27+
parser.add_argument('-s', '--severity', action='store', type=str, required=True,
28+
dest='severity', help='Vulnerability severity')
29+
parser.add_argument('-t', '--test', action='store_true',
30+
dest='test', help='Dry run, does everything except updating the DB')
31+
parser.add_argument('-v', '--verbose', action='store_true',
32+
dest='verbose', help='Extended output')
33+
34+
#arguments put in variables
35+
args = parser.parse_args()
36+
db = args.db
37+
severity = args.severity
38+
test = args.test
39+
verbose = args.verbose
40+
41+
#default value from ENV COUCHDB
42+
couchdb = os.environ.get('COUCHDB')
43+
#Else from argument
44+
if not couchdb:
45+
couchdb = args.couchdb
46+
47+
fixDb(couchdb, db, severity, test, verbose)
48+
49+
def fixDb(couchdb, db, severity, test, verbose):
50+
couchdb = str(couchdb)
51+
db = str(db)
52+
53+
#get all broken elements from CouchDB
54+
headers = {'Content-Type': 'application/json'}
55+
payload = { "map" : """function(doc) { if((doc.type == \"Vulnerability\" && doc.severity == \""""+severity+"""\") ||
56+
(doc.type == \"VulnerabilityWeb\" && doc.severity == \""""+severity+"""\")){ emit(doc._id, doc._rev); }}""" }
57+
58+
r = requests.post(couchdb + '/' + db + '/_temp_view', headers=headers, data=json.dumps(payload))
59+
response_code = r.status_code
60+
61+
if response_code == 200:
62+
response = r.json()
63+
rows = response['rows']
64+
# ID is ID, value is REV
65+
66+
if len(rows) > 0:
67+
print " [*[ Processing " + str(len(rows)) + " documents for " + db + " ]*]"
68+
69+
for row in rows:
70+
id = str(row['id'])
71+
rev = str(row['value'])
72+
73+
# delete vuln
74+
if verbose:
75+
print " - Deleting vulnerability with ID " + id
76+
if not test:
77+
delete = requests.delete(couchdb + '/' + db + '/' + id + '?rev=' + rev)
78+
if verbose:
79+
print " -- " + delete.reason + " (" + str(delete.status_code) + ")"
80+
print " Done"
81+
else:
82+
print "No vulns were found in DB " + db + " with severity " + severity + "!"
83+
elif response_code == 401:
84+
print " Autorization required to access " + db + ", make sure to add user:pwd to Couch URI using --couchdburi"
85+
else:
86+
print "Error connecting to CouchDB, please verify the service is up"
87+
88+
if __name__ == "__main__":
89+
main()

install.sh

Lines changed: 50 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
## See the file 'doc/LICENSE' for the license information
66
###
77

8-
98
#Check if is it root
109
if [ $EUID -ne 0 ]; then
1110
echo "You must be root."
@@ -41,13 +40,19 @@ else
4140
os="$(uname -s) $(uname -r)"
4241
fi
4342

43+
#Check if python2 is already installed
44+
if ! which python2 > /dev/null; then
45+
echo "[-] Please install Python2 or make sure it is in your path"
46+
exit 1
47+
fi
48+
4449
echo "[+] Install $os $arch"
4550
down=0
4651
if [ "$os" = "Ubuntu 10.04.2 LTS" ]; then
4752
version="ubuntu10-04.02$arch"
48-
elif [[ "$os" =~ "Kali GNU/Linux 2."* ]]; then
53+
elif [[ "$os" =~ "Kali GNU/Linux 2."*|"Kali GNU/Linux Rolling".* ]]; then
4954
version="kali2-$arch"
50-
down=1
55+
down=1
5156
elif [[ "$os" =~ .*Kali.* ]]; then
5257
version="kali-$arch"
5358
down=1
@@ -60,6 +65,13 @@ elif [ "$os" = "Ubuntu 13.04" ]; then
6065
version="ubuntu13-04-$arch"
6166
down=1
6267
elif [[ "$os" =~ "Ubuntu 14.04".*|"Ubuntu 14.10".*|"Ubuntu Vivid Vervet (development branch)"|"Ubuntu 15".* ]]; then
68+
version="ubuntu13-10-$arch"
69+
down=1
70+
# Install pip from github.
71+
# Bug: https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1306991
72+
wget https://bootstrap.pypa.io/get-pip.py
73+
python get-pip.py
74+
elif [[ "$os" =~ "Mint 17".* ]]; then
6375
version="ubuntu13-10-$arch"
6476
down=1
6577
# Install pip from github.
@@ -69,38 +81,49 @@ elif [[ "$os" =~ "Ubuntu 14.04".*|"Ubuntu 14.10".*|"Ubuntu Vivid Vervet (develop
6981
elif [[ "$os" =~ "Debian 7".*|"Debian 8".*|"stretch/sid".* ]]; then
7082
version="ubuntu13-10-$arch"
7183
down=1
72-
wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py
73-
python get-pip.py
84+
# Install pip from github.
85+
# Bug: https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1306991
86+
wget https://bootstrap.pypa.io/get-pip.py
87+
python get-pip.py
88+
89+
#Check if user agree with change to experimental
90+
read -r -p "We need change your debian to experimental - sid branch (If you are not). You agree?[Y/n] " input
91+
92+
case $input in
93+
94+
[nN][oO]|[nN])
95+
echo "[!]Faraday install: Aborted"
96+
echo "[!]You need agree the update to experimental - sid"
97+
exit 1;;
98+
esac
99+
74100
echo "deb http://ftp.debian.org/debian experimental main" >> /etc/apt/sources.list
75101
echo "deb http://ftp.debian.org/debian sid main" >> /etc/apt/sources.list
76102
apt-get update
77103

78104
if [[ "$os" =~ "Debian 7".* ]]; then
79105
apt-get -t experimental -y install libc6-dev
80-
sed -i 's/deb http:\/\/ftp.debian.org\/debian experimental main//' /etc/apt/sources.list
81-
sed -i 's/deb http:\/\/ftp.debian.org\/debian sid main//' /etc/apt/sources.list
82-
apt-get update
83106
fi
84107
else
85108
echo "[-] Could not find a install for $os ($arch $kernel)"
86109
exit
87110
fi
88111

89112
if [ "$down" -eq 1 ]; then
90-
113+
91114
if [ -e lib-$version.tgz ]; then
92115
echo "[+] QT Libs already downloaded"
93116
else
94117
echo "[+] Download QT Libs"
95118
wget "https://www.faradaysec.com/down/faraday/lib-$version.tgz" -O lib-$version.tgz
96119
fi
97-
120+
98121
shav="sha_${version//-/_}"
99122
echo `sha256sum lib-$version.tgz`
100123
if [ -e lib-$version.tgz ]; then
101124
if [ "`echo ${!shav}`" = "`sha256sum lib-$version.tgz | awk -F\" \" \{'print $1'\}`" ]; then
102125
echo "[+] SHA256 ok"
103-
tar -xvzf lib-$version.tgz
126+
tar -xvzf lib-$version.tgz
104127
mv lib-$version/ external_libs
105128
else
106129
rm lib-$version.tgz
@@ -119,7 +142,23 @@ if [ "$update" -eq 0 ]; then
119142
apt-get update
120143
update=1
121144
fi
145+
122146
apt-get --ignore-missing -y install ipython python-pip python-dev libpq-dev couchdb
147+
148+
#Check if python-setuptools not exists.
149+
python -c "import setuptools" > /dev/null 2>&1
150+
151+
if [ "$?" -eq 1 ]; then
152+
apt-get install python-setuptools
153+
fi
154+
155+
#Delete debian experimental from sources.
156+
if [[ "$os" =~ "Debian 7".*|"Debian 8".*|"stretch/sid".* ]]; then
157+
sed -i 's/deb http:\/\/ftp.debian.org\/debian experimental main//' /etc/apt/sources.list
158+
sed -i 's/deb http:\/\/ftp.debian.org\/debian sid main//' /etc/apt/sources.list
159+
apt-get update
160+
fi
161+
123162
pip install -r requirements.txt
124163

125164
echo "You can now run Faraday, enjoy!"

0 commit comments

Comments
 (0)