infobyte / faraday

Open Source Vulnerability Management Platform
https://www.faradaysec.com
GNU General Public License v3.0
4.87k stars 893 forks source link

Error while running ./faraday.py #248

Closed attacker34 closed 6 years ago

attacker34 commented 6 years ago

Dear Team,

I got error while running the ./faraday.py


./faraday.py
2018-03-27 10:15:37,507 - faraday.launcher - INFO - Checking dependencies...
2018-03-27 10:15:37,507 - faraday.launcher - INFO - Dependencies met

  _____                           .___
_/ ____\_____  ____________     __| _/_____   ___.__.
\   __\ \__  \ \_  __ \__  \   / __ | \__  \ <   |  |
 |  |    / __ \_|  | \// __ \_/ /_/ |  / __ \_\___  |
 |__|   (____  /|__|  (____  /\____ | (____  // ____|
             \/            \/      \/      \/ \/

[*[       Open Source Penetration Test IDE       ]*]
            Where pwnage goes multiplayer

2018-03-27 10:15:37,508 - faraday.launcher - INFO - Starting Faraday IDE.
2018-03-27 10:15:37,508 - faraday.launcher - INFO - Checking configuration.
2018-03-27 10:15:37,508 - faraday.launcher - INFO - Setting up plugins.
2018-03-27 10:15:37,508 - faraday.launcher - INFO - Removing old plugins folder.
2018-03-27 10:15:37,547 - faraday.launcher - INFO - Setting up ZSH integration.
2018-03-27 10:15:37,547 - faraday.launcher - INFO - Setting up user configuration.
2018-03-27 10:15:37,548 - faraday.launcher - INFO - Using custom user configuration.
2018-03-27 10:15:37,548 - faraday.launcher - INFO - Setting up icons for GTK interface.
2018-03-27 10:15:37,559 - faraday.launcher - INFO - Setting configuration.
2018-03-27 10:15:38,904 - faraday.launcher - INFO - No updates available, enjoy Faraday.
2018-03-27 10:15:39,039 - faraday.launcher - INFO - All done. Opening environment.
2018-03-27 10:15:39,343 - faraday.launcher - INFO - Main application ExceptHook enabled.
2018-03-27 10:15:39,344 - faraday.launcher - INFO - Starting main application.

*              faraday ui is ready              
Make sure you got couchdb up and running.
If couchdb is up, point your browser to: 
[http://127.0.0.1:5985/_ui]

2018-03-27 10:15:39,345 - faraday - INFO - XMLRPC API server configured on ('localhost', 9876)
2018-03-27 10:15:39,360 - faraday - INFO - REST API server configured on ('localhost', 9977)
Error in sys.excepthook:
Traceback (most recent call last):
  File "/root/pentest/faraday-dev/utils/error_report.py", line 83, in exception_handler
    model.guiapi.postCustomEvent(event)
  File "/root/pentest/faraday-dev/model/guiapi.py", line 38, in postCustomEvent
    receiver = getMainWindow()
  File "/root/pentest/faraday-dev/model/guiapi.py", line 34, in getMainWindow
    return __the_mainapp.getMainWindow()
AttributeError: 'NoneType' object has no attribute 'getMainWindow'

Original exception was:
Traceback (most recent call last):
  File "/root/pentest/faraday-dev/gui/gtk/application.py", line 635, in do_startup
    CONF.getLastWorkspace())
  File "/root/pentest/faraday-dev/gui/gtk/mainwidgets.py", line 515, in __init__
    self.workspaces = self.serverIO.get_workspaces_names()
  File "/root/pentest/faraday-dev/gui/gtk/decorators.py", line 17, in wrapper
    res = func(*args, **kwargs)
  File "/root/pentest/faraday-dev/gui/gtk/server.py", line 67, in get_workspaces_names
    return models.get_workspaces_names()
  File "/root/pentest/faraday-dev/persistence/server/models.py", line 647, in get_workspaces_names
    return server.get_workspaces_names()['workspaces']
  File "/root/pentest/faraday-dev/persistence/server/server.py", line 470, in get_workspaces_names
    return _get("{0}/ws".format(_create_server_api_url()))
  File "/root/pentest/faraday-dev/persistence/server/server.py", line 152, in _get
    params=params))
  File "/root/pentest/faraday-dev/persistence/server/server.py", line 118, in _unsafe_io_with_server
    answer = server_io_function(server_url, **payload)
  File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/api.py", line 70, in get
  File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/api.py", line 56, in request
  File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 488, in request
  File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 609, in send
  File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/adapters.py", line 487, in send
requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=5985): Max retries exceeded with url: /_api/ws (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7f2c60e712d0>: Failed to establish a new connection: [Errno 111] Connection refused',))
Error in sys.excepthook:
Traceback (most recent call last):
  File "/root/pentest/faraday-dev/utils/error_report.py", line 83, in exception_handler
    model.guiapi.postCustomEvent(event)
  File "/root/pentest/faraday-dev/model/guiapi.py", line 38, in postCustomEvent
    receiver = getMainWindow()
  File "/root/pentest/faraday-dev/model/guiapi.py", line 34, in getMainWindow
    return __the_mainapp.getMainWindow()
AttributeError: 'NoneType' object has no attribute 'getMainWindow'

Original exception was:
Traceback (most recent call last):
  File "/root/pentest/faraday-dev/gui/gtk/application.py", line 718, in do_activate
    self.window = AppWindow(self.sidebar,
AttributeError: 'GuiApp' object has no attribute 'sidebar'
2018-03-27 10:15:39,739 - faraday - INFO - Closing Faraday...

Can you please tell me what commands i should use to remove this error...

Thanks.

montive commented 6 years ago

Hi @attacker420 Please check the file ./faraday/config/user.xml and make sure that the content of the tag <couch_uri> is this one: <couch_uri>http://127.0.0.1:5985</couch_uri>

Also make sure that the server is running.

ghost commented 6 years ago

I have the same issue, except I'm running Kali Linux and this occurs:

2018-05-04 16:45:06,358 - faraday.Server-GTK IO - WARNING - Couldn't get a valid response from the server when requesting to URL http://127.0.0.1:6482/_api/ws and function <function get at 0x7f81b21aa398>. 2018-05-04 16:45:10,733 - faraday.GTK - ERROR - Couldn't get a valid response from the server when requesting to URL http://127.0.0.1:6482/_api/ws and function <function get at 0x7f81b21aa398>. 2018-05-04 16:45:11,288 - faraday - INFO - Closing Faraday...

Ezequieltbh commented 6 years ago

Hi @razercortex101 Are you running the faraday server in port 6482? Try connecting to http://localhost:6482/_ui, can you see the Faraday WebUI?

ghost commented 6 years ago

Here is the information:

__ . / \ ____ | _/___ .. \ \ _ \ _ __ \ / | __ \ < | | | | / _ \| | \// _/ /_/ | / __ | || (__ /|| (__ /__ | (__ // ____| \/ \/ \/ \/ \/

[[ Open Source Penetration Test IDE ]] Where pwnage goes multiplayer

2018-05-07 08:35:47,147 - faraday.launcher - INFO - Starting Faraday IDE. 2018-05-07 08:35:47,495 - faraday.launcher - INFO - Checking configuration. 2018-05-07 08:35:47,540 - faraday.launcher - INFO - Setting up plugins. 2018-05-07 08:35:47,540 - faraday.launcher - INFO - Removing old plugins folder. 2018-05-07 08:35:49,962 - faraday.launcher - INFO - Setting up ZSH integration. 2018-05-07 08:35:50,044 - faraday.launcher - INFO - Setting up user configuration. 2018-05-07 08:35:50,044 - faraday.launcher - INFO - Using custom user configuration. 2018-05-07 08:35:50,045 - faraday.launcher - INFO - Setting up icons for GTK interface. 2018-05-07 08:35:50,092 - faraday.launcher - INFO - Setting configuration. 2018-05-07 08:35:52,159 - faraday.launcher - INFO - All done. Opening environment. 2018-05-07 08:35:53,461 - faraday.launcher - INFO - Main application ExceptHook enabled. 2018-05-07 08:35:53,462 - faraday.launcher - INFO - Starting main application.

2018-05-07 08:35:53,462 - faraday - INFO - XMLRPC API server configured on ('127.0.0.1', 6668) 2018-05-07 08:35:53,508 - faraday - INFO - REST API server configured on ('127.0.0.1', 9978) 2018-05-07 08:35:53,560 - faraday.Server-GTK IO - WARNING - Couldn't get a valid response from the server when requesting to URL http://127.0.0.1:5985/api/_api/ws and function <function get at 0x7f792aba9410>. 2018-05-07 08:35:58,930 - faraday.GTK - ERROR - Couldn't get a valid response from the server when requesting to URL http://127.0.0.1:5985/api/_api/ws and function <function get at 0x7f792aba9410>.

WinnaZ commented 6 years ago

Guys, are you running Faraday's server? To use faraday you must first run python2 faraday-server.py and then! python2 faraday.py. Go to http://127.0.0.1:5985/_ui and see if you already have Faraday running there.

On second note, if you Are indeed running the server already in which port are you running it. would you paste here ~/.faraday/config/server.ini Cheers

ghost commented 6 years ago

Here it is. + CouchDB config.

CouchDB Config.zip Faraday Config.zip

ghost commented 6 years ago

Also, label should be changed

WinnaZ commented 6 years ago

You are missing the most important part tho: "Guys, are you running Faraday's server? To use faraday you must first run python2 faraday-server.py and then! python2 faraday.py. Go to http://127.0.0.1:5985/_ui and see if you already have Faraday running there. (if you can add a screenshot of what you see there even better"

ghost commented 6 years ago

I already tried the steps.

On Tue, May 8, 2018 at 2:38 PM, WinnaZ notifications@github.com wrote:

You are missing the most important part tho: "Guys, are you running Faraday's server? To use faraday you must first run python2 faraday-server.py and then! python2 faraday.py. Go to http://127.0.0.1:5985/_ui and see if you already have Faraday running there. (if you can add a screenshot of what you see there even better"

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/infobyte/faraday/issues/248#issuecomment-387501026, or mute the thread https://github.com/notifications/unsubscribe-auth/Ag9AP_mBfV_GptZtmG1gFTLOx84eAb61ks5tweY0gaJpZM4S9AzT .

ghost commented 6 years ago

I just told you I attempted to run the server on Kali, cloned the repo, still nothing even after executing the commands comes with the same error.

On Wed, May 9, 2018 at 1:42 PM, Ubayd Sarfraz ubayds04@gmail.com wrote:

I already tried the steps.

On Tue, May 8, 2018 at 2:38 PM, WinnaZ notifications@github.com wrote:

You are missing the most important part tho: "Guys, are you running Faraday's server? To use faraday you must first run python2 faraday-server.py and then! python2 faraday.py. Go to http://127.0.0.1:5985/_ui and see if you already have Faraday running there. (if you can add a screenshot of what you see there even better"

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/infobyte/faraday/issues/248#issuecomment-387501026, or mute the thread https://github.com/notifications/unsubscribe-auth/Ag9AP_mBfV_GptZtmG1gFTLOx84eAb61ks5tweY0gaJpZM4S9AzT .

WinnaZ commented 6 years ago

would you open a terminal and run: netstat -onaput please paste here the output

montive commented 6 years ago

Hi. I'm sending you back the Faraday's config file: server.ini. I fixed some issues on the CouchDB's section of these file.

server.ini.tar.gz

Paste the content of the file i'm sending you on your server.ini file. Now:

Let us know how it went. Cheers.

ghost commented 6 years ago

@WinnaZ here's the output

Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name Timer tcp 0 0 127.0.0.1:5939 0.0.0.0:* LISTEN 883/teamviewerd off (0.00/0/0) tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN 3161/dnsmasq off (0.00/0/0) tcp 0 0 127.0.0.1:5985 0.0.0.0:* LISTEN 28800/beam.smp off (0.00/0/0) tcp 0 0 10.48.183.38:36142 216.58.217.66:443 ESTABLISHED 3660/firefox off (0.00/0/0) tcp 0 0 10.48.183.38:46206 192.30.253.112:443 ESTABLISHED 3660/firefox keepalive (6.23/0/0) tcp 0 0 10.48.183.38:58526 151.188.217.148:443 ESTABLISHED 3660/firefox keepalive (8.76/0/0) tcp 0 0 10.48.183.38:55752 151.101.32.133:443 ESTABLISHED 3660/firefox keepalive (6.35/0/0) tcp 0 0 10.48.183.38:46168 192.30.253.112:443 ESTABLISHED 3660/firefox keepalive (3.39/0/0) tcp 0 0 10.48.183.38:39716 34.209.2.245:443 ESTABLISHED 3660/firefox keepalive (3.90/0/0) tcp 0 0 10.48.183.38:41100 216.58.217.131:443 ESTABLISHED 3660/firefox off (0.00/0/0) tcp 0 0 10.48.183.38:55754 151.101.32.133:443 ESTABLISHED 3660/firefox keepalive (6.38/0/0) tcp 0 0 10.48.183.38:34256 192.30.253.124:443 TIME_WAIT - timewait (19.02/0/0) tcp 0 0 10.48.183.38:44636 216.58.217.142:443 ESTABLISHED 3660/firefox off (0.00/0/0) tcp 0 0 10.48.183.38:55672 151.101.32.133:443 ESTABLISHED 3660/firefox keepalive (2.88/0/0) tcp 0 0 10.48.183.38:39718 34.209.2.245:443 ESTABLISHED 3660/firefox keepalive (3.90/0/0) tcp 0 0 10.48.183.38:55670 151.101.32.133:443 ESTABLISHED 3660/firefox keepalive (6.47/0/0) tcp 0 0 127.0.0.1:34416 127.0.0.1:5985 TIME_WAIT - timewait (0.00/0/0) tcp 0 0 10.48.183.38:54528 192.30.253.117:443 ESTABLISHED 3660/firefox keepalive (7.53/0/0) tcp 0 0 10.48.183.38:44688 216.58.217.142:443 ESTABLISHED 3660/firefox off (0.00/0/0) tcp 0 0 10.48.183.38:54588 69.196.230.170:443 ESTABLISHED 3660/firefox keepalive (0.07/0/0) tcp 0 0 10.48.183.38:54530 192.30.253.117:443 ESTABLISHED 3660/firefox keepalive (6.77/0/0) tcp 0 0 10.48.183.38:58522 151.188.217.148:443 ESTABLISHED 3660/firefox keepalive (8.76/0/0) tcp 0 0 10.48.183.38:58524 151.188.217.148:443 ESTABLISHED 3660/firefox keepalive (8.76/0/0) tcp 0 0 10.48.183.38:58518 151.188.217.148:443 ESTABLISHED 3660/firefox keepalive (8.76/0/0) tcp 0 0 10.48.183.38:48360 216.239.32.20:443 ESTABLISHED 3660/firefox off (0.00/0/0) tcp 0 0 10.48.183.38:55728 151.101.32.133:443 ESTABLISHED 3660/firefox keepalive (2.63/0/0) tcp 0 0 10.48.183.38:55762 151.101.32.133:443 ESTABLISHED 3660/firefox keepalive (6.39/0/0) tcp 0 0 10.48.183.38:55730 151.101.32.133:443 ESTABLISHED 3660/firefox keepalive (2.63/0/0) tcp 0 0 10.48.183.38:58530 151.188.217.148:443 ESTABLISHED 3660/firefox keepalive (8.76/0/0) tcp 0 0 10.48.183.38:55720 151.101.32.133:443 ESTABLISHED 3660/firefox keepalive (6.51/0/0) tcp 0 0 10.48.183.38:55760 151.101.32.133:443 ESTABLISHED 3660/firefox keepalive (6.39/0/0) tcp 0 0 10.48.183.38:55756 151.101.32.133:443 ESTABLISHED 3660/firefox keepalive (6.39/0/0) tcp 0 0 10.48.183.38:55732 151.101.32.133:443 ESTABLISHED 3660/firefox keepalive (2.63/0/0) tcp 0 0 10.48.183.38:55758 151.101.32.133:443 ESTABLISHED 3660/firefox keepalive (6.54/0/0) tcp 0 0 10.48.183.38:51152 34.231.238.102:443 ESTABLISHED 3660/firefox keepalive (2.54/0/0) tcp 0 0 10.48.183.38:51102 34.231.238.102:443 ESTABLISHED 3660/firefox keepalive (6.77/0/0) tcp 0 0 10.48.183.38:34292 192.30.253.124:443 ESTABLISHED 3660/firefox keepalive (572.70/0/0) tcp 0 0 10.48.183.38:40034 216.58.217.138:443 ESTABLISHED 3660/firefox off (0.00/0/0) tcp 0 0 10.48.183.38:43056 174.129.18.27:443 TIME_WAIT - timewait (0.00/0/0) tcp 0 0 10.48.183.38:55682 151.101.32.133:443 ESTABLISHED 3660/firefox keepalive (2.63/0/0) tcp 0 0 10.48.183.38:55722 151.101.32.133:443 ESTABLISHED 3660/firefox keepalive (6.52/0/0) tcp 0 0 10.48.183.38:37694 188.40.96.245:80 TIME_WAIT - timewait (6.70/0/0) tcp 0 0 10.48.183.38:55686 151.101.32.133:443 ESTABLISHED 3660/firefox keepalive (6.51/0/0) tcp 0 0 10.48.183.38:39724 34.209.2.245:443 ESTABLISHED 3660/firefox keepalive (3.90/0/0) tcp 0 0 10.48.183.38:49102 69.196.230.170:80 TIME_WAIT - timewait (26.67/0/0) tcp 0 0 10.48.183.38:58528 151.188.217.148:443 ESTABLISHED 3660/firefox keepalive (8.76/0/0) tcp 0 0 10.48.183.38:55764 151.101.32.133:443 ESTABLISHED 3660/firefox keepalive (6.52/0/0) tcp 0 0 10.48.183.38:55668 151.101.32.133:443 ESTABLISHED 3660/firefox keepalive (6.52/0/0) tcp 0 0 10.48.183.38:55766 151.101.32.133:443 ESTABLISHED 3660/firefox keepalive (6.52/0/0) tcp6 0 0 :::53 :::* LISTEN 3161/dnsmasq off (0.00/0/0) udp 0 0 0.0.0.0:53 0.0.0.0:* 3161/dnsmasq off (0.00/0/0) udp 0 0 0.0.0.0:68 0.0.0.0:* 3384/dhclient off (0.00/0/0) udp6 0 0 :::53 :::* 3161/dnsmasq off (0.00/0/0)

@montive I have preinstalled Faraday via Kali Linux. I will paste in ~/.faraday/config

ghost commented 6 years ago

Didn't work. Same output for preinstalled Faraday.

For git version I got this output: 2018-05-10 13:08:59,058 - faraday-server.__main__ - INFO - Checking dependencies... 2018-05-10 13:08:59,059 - faraday-server.__main__ - INFO - Dependencies met 2018-05-10 13:08:59,898 - faraday-server.server.importer - INFO - Setting up workspace api 2018-05-10 13:08:59,923 - faraday-server.server.importer - INFO - Creating database for workspace api Traceback (most recent call last): File "faraday-server.py", line 138, in <module> main() File "faraday-server.py", line 122, in main import_workspaces() File "faraday-server.py", line 56, in import_workspaces server.importer.import_workspaces() File "/root/faraday-dev/server/importer.py", line 25, in import_workspaces import_workspace_into_database(workspace_name, couchdb_server_conn=couchdb_server_conn) File "/root/faraday-dev/server/importer.py", line 51, in import_workspace_into_database import_on_new_database(db_conn, couchdb_conn) File "/root/faraday-dev/server/importer.py", line 64, in import_on_new_database _create_and_import_db(db_conn, couchdb_conn) File "/root/faraday-dev/server/importer.py", line 79, in _create_and_import_db db_conf.set_last_seq(couchdb_conn.get_last_seq()) File "/root/faraday-dev/server/couchdb.py", line 69, in get_last_seq return self.__workspace.info().get('update_seq', 0) # 'update_seq' / 'committed_update_seq' File "/usr/lib/python2.7/dist-packages/couchdbkit/client.py", line 280, in info return self.res.get().json_body File "/usr/lib/python2.7/dist-packages/restkit/resource.py", line 114, in get params_dict=params_dict, **params) File "/usr/lib/python2.7/dist-packages/couchdbkit/resource.py", line 111, in request payload=payload, headers=headers, **params) File "/usr/lib/python2.7/dist-packages/restkit/resource.py", line 210, in request response=resp) restkit.errors.RequestFailed: {"error":"{{case_clause,{{badmatch,{error,eacces}},\n [{couch_file,init,1,[{file,\"couch_file.erl\"},{line,314}]},\n {gen_server,init_it,6,[{file,\"gen_server.erl\"},{line,306}]},\n {proc_lib,init_p_do_apply,3,\n [{file,\"proc_lib.erl\"},{line,237}]}]}},\n [{couch_server,handle_info,2,[{file,\"couch_server.erl\"},{line,442}]},\n {gen_server,try_dispatch,4,[{file,\"gen_server.erl\"},{line,593}]},\n {gen_server,handle_msg,5,[{file,\"gen_server.erl\"},{line,659}]},\n {proc_lib,init_p_do_apply,3,[{file,\"proc_lib.erl\"},{line,237}]}]}","reason":"{gen_server,call,\n [couch_server,\n {open,<<\"api\">>,\n [{user_ctx,\n {user_ctx,null,\n [<<\"_admin\">>],\n <<\"{couch_httpd_auth, default_authentication_handler}\">>}}]},\n infinity]}"}

ghost commented 6 years ago

I get this in CouchDB: {"error":"illegal_database_name","reason":"Name: '_api'. Only lowercase characters (a-z), digits (0-9), and any of the characters _, $, (, ), +, -, and / are allowed. Must begin with a letter."}

WinnaZ commented 6 years ago

don't go to http://127.0.0.1:5984/_ui go to http://127.0.0.1:5985/_ui on couchdb

WinnaZ commented 6 years ago

Hi there, Could you make it work?

ghost commented 6 years ago

It worked, but with the update from Kali repo, NOT from the advice here.

montive commented 6 years ago

Great! I'll close this ticket then.