0 | 0 |
--- a/faraday.py
|
1 | 1 |
+++ b/faraday.py
|
2 | |
@@ -17,7 +17,6 @@ import shutil
|
3 | |
import argparse
|
4 | |
import platform
|
5 | |
import subprocess
|
6 | |
-import pip
|
7 | |
import json
|
|
2 |
@@ -132,10 +132,6 @@ def getParserArgs():
|
|
3 |
default=False,
|
|
4 |
help="Ignore python dependencies resolution.")
|
8 | 5 |
|
9 | |
from utils.logs import getLogger, setUpLogger
|
10 | |
@@ -199,42 +198,6 @@ def query_user_bool(question, default=Tr
|
|
6 |
- parser.add_argument('--update', action="store_true", dest="update",
|
|
7 |
- default=False,
|
|
8 |
- help="Update Faraday IDE.")
|
|
9 |
-
|
|
10 |
parser.add_argument('--cert', action="store", dest="cert_path",
|
|
11 |
default=None,
|
|
12 |
help="Path to the valid CouchDB certificate")
|
|
13 |
@@ -192,45 +188,6 @@ def query_user_bool(question, default=Tr
|
11 | 14 |
"(or 'y' or 'n').\n")
|
12 | 15 |
|
13 | 16 |
|
|
20 | 23 |
- """
|
21 | 24 |
-
|
22 | 25 |
- if not args.ignore_deps:
|
|
26 |
- try:
|
|
27 |
- import pip
|
|
28 |
- modules = []
|
|
29 |
- f = open(CONST_REQUIREMENTS_FILE)
|
|
30 |
- for line in f:
|
|
31 |
- if not line.find('#'):
|
|
32 |
- break
|
|
33 |
- else:
|
|
34 |
- modules.append([line[:line.index('=')], (line[line.index('=')+2:]).strip()])
|
|
35 |
- f.close()
|
|
36 |
- pip_dist = [dist.project_name.lower() for dist in pip.get_installed_distributions()]
|
23 | 37 |
-
|
24 | |
- modules = []
|
25 | |
- f = open(CONST_REQUIREMENTS_FILE)
|
26 | |
- for line in f:
|
27 | |
- if not line.find('#'):
|
28 | |
- break
|
29 | |
- else:
|
30 | |
- modules.append([line[:line.index('=')], (line[line.index('=')+2:]).strip()])
|
31 | |
- f.close()
|
|
38 |
- for module in modules:
|
|
39 |
- if module[0].lower() not in pip_dist:
|
|
40 |
- try:
|
|
41 |
- __import__(module[0])
|
|
42 |
- except ImportError:
|
|
43 |
- if query_user_bool("Missing module %s."
|
|
44 |
- " Do you wish to install it?" % module[0]):
|
|
45 |
- pip.main(['install', "%s==%s" %
|
|
46 |
- (module[0], module[1]), '--user'])
|
32 | 47 |
-
|
33 | |
- pip_dist = [dist.project_name.lower() for dist in pip.get_installed_distributions()]
|
34 | |
-
|
35 | |
- for module in modules:
|
36 | |
- if module[0].lower() not in pip_dist:
|
37 | |
- try:
|
38 | |
- __import__(module[0])
|
39 | |
- except ImportError:
|
40 | |
- if query_user_bool("Missing module %s."
|
41 | |
- " Do you wish to install it?" % module[0]):
|
42 | |
- pip.main(['install', "%s==%s" %
|
43 | |
- (module[0], module[1]), '--user'])
|
44 | |
-
|
45 | |
- else:
|
46 | |
- return False
|
|
48 |
- else:
|
|
49 |
- return False
|
|
50 |
- except ImportError:
|
|
51 |
- pass
|
47 | 52 |
-
|
48 | 53 |
- return True
|
49 | 54 |
-
|
50 | |
|
|
55 |
-
|
51 | 56 |
def startProfiler(app, output, depth):
|
52 | 57 |
"""Profiler handler.
|
53 | |
@@ -525,39 +488,6 @@ _/ ____\_____ ____________ __| _/__
|
|
58 |
|
|
59 |
@@ -518,40 +475,6 @@ _/ ____\_____ ____________ __| _/__
|
54 | 60 |
logger.info("Starting Faraday IDE.")
|
55 | 61 |
|
56 | 62 |
|
|
77 | 83 |
- getInstanceConfiguration().setAppname("Faraday - Penetration Test IDE Community")
|
78 | 84 |
- parameter = {"version": getInstanceConfiguration().getVersion()}
|
79 | 85 |
-
|
80 | |
- f.close
|
|
86 |
- f.close()
|
81 | 87 |
- resp = requests.get(uri, params=parameter, timeout=1, verify=True)
|
82 | 88 |
- resp = resp.text.strip()
|
83 | 89 |
- except Exception as e:
|
|
87 | 93 |
- else:
|
88 | 94 |
- logger.info("No updates available, enjoy Faraday")
|
89 | 95 |
-
|
90 | |
|
|
96 |
-
|
91 | 97 |
def checkCouchUrl():
|
92 | 98 |
import requests
|
93 | |
@@ -574,29 +504,6 @@ def checkCouchUrl():
|
|
99 |
try:
|
|
100 |
@@ -567,30 +490,6 @@ def checkCouchUrl():
|
94 | 101 |
# Non fatal error
|
95 | 102 |
pass
|
96 | 103 |
|
|
117 | 124 |
- getLogger("launcher").error("It seems that something's wrong with your version\nPlease contact customer support")
|
118 | 125 |
- exit(-1)
|
119 | 126 |
-
|
120 | |
|
|
127 |
-
|
121 | 128 |
def init():
|
122 | 129 |
"""Initializes what is needed before starting.
|
123 | |
@@ -623,20 +530,12 @@ def main():
|
|
130 |
|
|
131 |
@@ -616,20 +515,12 @@ def main():
|
124 | 132 |
"""
|
125 | 133 |
|
126 | 134 |
init()
|