Closed lmcthbe closed 6 years ago
Would you please send us the result of running:
netstat -onaput
Also, we have already released the version 3 of Faraday.
It has a lot of improvements, i invite you to try it out :)
root@kali:~# netstat -onaput 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:5984 0.0.0.0: LISTEN 2644/beam.smp off (0.00/0/0) tcp 0 0 127.0.0.1:5985 0.0.0.0: LISTEN 2687/python2.7 off (0.00/0/0) tcp 0 0 10.152.11.186:54070 172.217.13.110:80 ESTABLISHED 2740/firefox-esr keepalive (5.48/0/0) tcp 0 0 127.0.0.1:5985 127.0.0.1:53900 TIME_WAIT - timewait (0.53/0/0) tcp 0 0 10.152.11.186:37450 151.101.0.133:443 ESTABLISHED 2740/firefox-esr keepalive (0.57/0/0) tcp 0 0 10.152.11.186:34208 192.30.253.125:443 ESTABLISHED 2740/firefox-esr keepalive (508.70/0/0) tcp 0 0 10.152.11.186:37458 151.101.0.133:443 ESTABLISHED 2740/firefox-esr keepalive (0.57/0/0) tcp 0 0 10.152.11.186:55684 52.38.215.55:443 TIME_WAIT - timewait (10.95/0/0) tcp 0 0 10.152.11.186:37478 151.101.0.133:443 ESTABLISHED 2740/firefox-esr keepalive (0.57/0/0) tcp 0 0 10.152.11.186:39730 65.52.1.21:443 ESTABLISHED 2740/firefox-esr keepalive (0.32/0/0) tcp 0 0 10.152.11.186:35676 34.215.13.51:443 TIME_WAIT - timewait (9.51/0/0) tcp 0 0 127.0.0.1:5984 127.0.0.1:60504 ESTABLISHED 2644/beam.smp off (0.00/0/0) tcp 0 0 10.152.11.186:37464 151.101.0.133:443 ESTABLISHED 2740/firefox-esr keepalive (0.57/0/0) tcp 0 0 10.152.11.186:37476 151.101.0.133:443 ESTABLISHED 2740/firefox-esr keepalive (0.57/0/0) tcp 0 0 10.152.11.186:47616 66.130.62.186:80 TIME_WAIT - timewait (59.16/0/0) tcp 0 0 10.152.11.186:37466 151.101.0.133:443 ESTABLISHED 2740/firefox-esr keepalive (0.57/0/0) tcp 0 0 10.152.11.186:34362 54.68.24.18:443 TIME_WAIT - timewait (8.80/0/0) tcp 0 0 10.152.11.186:39690 172.217.13.110:443 ESTABLISHED 2740/firefox-esr off (0.00/0/0) tcp 0 0 10.152.11.186:55998 13.107.18.11:443 ESTABLISHED 2740/firefox-esr off (0.00/0/0) tcp 0 0 10.152.11.186:37454 151.101.0.133:443 ESTABLISHED 2740/firefox-esr keepalive (0.57/0/0) tcp 0 0 10.152.11.186:38728 50.17.30.248:443 TIME_WAIT - timewait (29.30/0/0) tcp 0 0 10.152.11.186:37468 151.101.0.133:443 ESTABLISHED 2740/firefox-esr keepalive (0.57/0/0) tcp 0 0 10.152.11.186:48620 192.30.253.117:443 TIME_WAIT - timewait (23.67/0/0) tcp 0 0 10.152.11.186:48984 72.21.91.29:80 ESTABLISHED 2740/firefox-esr keepalive (0.37/0/0) tcp 0 0 10.152.11.186:37474 151.101.0.133:443 ESTABLISHED 2740/firefox-esr keepalive (0.57/0/0) tcp 0 0 10.152.11.186:48986 72.21.91.29:80 ESTABLISHED 2740/firefox-esr keepalive (5.49/0/0) tcp 0 0 127.0.0.1:60504 127.0.0.1:5984 ESTABLISHED 2687/python2.7 off (0.00/0/0) tcp 0 0 10.152.11.186:42840 52.84.93.43:443 ESTABLISHED 2740/firefox-esr keepalive (2.40/0/0) tcp 0 0 10.152.11.186:44998 34.210.48.174:443 ESTABLISHED 2740/firefox-esr keepalive (0.46/0/0) tcp 0 0 10.152.11.186:56768 24.200.120.17:80 TIME_WAIT - timewait (54.16/0/0) tcp 0 0 10.152.11.186:37452 151.101.0.133:443 ESTABLISHED 2740/firefox-esr keepalive (0.57/0/0) tcp 0 0 10.152.11.186:37460 151.101.0.133:443 ESTABLISHED 2740/firefox-esr keepalive (0.57/0/0) tcp 0 0 10.152.11.186:36494 192.30.253.113:443 TIME_WAIT - timewait (35.27/0/0) udp 0 0 0.0.0.0:68 0.0.0.0:* 1127/dhclient off (0.00/0/0)
I noticed in ~/.faraday/config/user.xml that
Hi @lmcthbe , Could you set the user.xml options to this values and start faraday.py with --debug ?
<api_con_info_host>localhost</api_con_info_host>
<api_con_info_port>9876</api_con_info_port>
<api_restful_con_info_port>9977</api_restful_con_info_port>
Then, could you send us the information that the faraday.py outputs to the terminal or the file ~/.faraday/logs/faraday.log ?
Thanks
I have updated Kali and now I got Faraday-3.0.1 but the server failed to start because of 500 internal error
python-faraday.service - python-faraday Server Loaded: loaded (/lib/systemd/system/python-faraday.service; disabled; vendor preset: disabled) Active: failed (Result: exit-code) since Wed 2018-09-05 09:18:33 EDT; 3s ago Process: 8693 ExecStartPre=/bin/sh -c if ! su postgres -c "psql -lqt" | cut -d | -f 1 | grep -qw faraday; then cd /usr/share/python-faraday && python manage Main PID: 2687 (code=exited, status=0/SUCCESS)
● postgresql.service - PostgreSQL RDBMS Loaded: loaded (/lib/systemd/system/postgresql.service; disabled; vendor preset: disabled) Active: active (exited) since Wed 2018-09-05 09:10:28 EDT; 10min ago Main PID: 3404 (code=exited, status=0/SUCCESS) Tasks: 0 (limit: 4915) Memory: 0B CGroup: /system.slice/postgresql.service
Hi, Could you send us the error of the server? The log is located at ~/.faraday/logs/faraday-server.log, you should see a trace back with an error if the server returned a 500 error.
Thanks
The trace are related before the upgrade to v3 2018-09-05 08:42:27,328 - faraday-server.server.couchdb - DEBUG - Pushing Reports DB into CouchDB 2018-09-05 08:42:27,680 - faraday-server.server.importer - INFO - Setting up workspace cdx-test 2018-09-05 08:42:27,777 - faraday-server.server.importer - INFO - Setting up workspace cdx-test-nmap 2018-09-05 08:42:27,805 - faraday-server.server.importer - INFO - Setting up workspace openvas-test 2018-09-05 08:42:27,827 - faraday-server.server.importer - INFO - Setting up workspace test 2018-09-05 08:42:27,847 - faraday-server.server.importer - INFO - Setting up workspace udn-de 2018-09-05 08:42:27,872 - faraday-server.server.importer - INFO - Setting up workspace udn-prod-nmap 2018-09-05 08:42:28,405 - faraday-server.main - INFO - Faraday Server is ready 2018-09-05 08:42:44,684 - faraday-server.server.web - DEBUG - -> CouchDB: GET /
But I got this backtrace by starting the server manually
root@kali:/usr/share/python-faraday# ./faraday-server.py -h
Traceback (most recent call last):
File "./faraday-server.py", line 20, in
Sep 05 09:18:33 kali sh[8693]: File "/usr/local/lib/python2.7/dist-packages/flask/blueprints.py", line 399, in
I think you have some depencies old. Which is the output of "pip freeze | grep Flask"
Can you try to update the dependencies with:
pip install -r requirements_server.txt -U
pip freeze | grep Flask Warning: cannot find svn location for chirp===daily-20180815 Flask==0.10.1 Flask-BabelEx==0.9.3 Flask-Classful==0.14.1 Flask-Login==0.4.1 Flask-Mail==0.9.1 Flask-Principal==0.4.0 Flask-Security==3.0.0 Flask-Session==0.3.1 Flask-SQLAlchemy==2.1 Flask-WTF==0.14.2
With Kali, there is no requirements file for Faraday so I cannot update the dependencies that way
It seems that your python libraries are old.
make a backup just in case with:
pip freeze > python_lib_versions.txt
Then download the requirements_server.txt file and update using pip:
wget https://raw.githubusercontent.com/infobyte/faraday/master/requirements_server.txt
pip install -r requirements_server.txt -U
It helps but failed on something else
root@kali:/usr/share/python-faraday# systemctl status python-faraday ● python-faraday.service - python-faraday Server Loaded: loaded (/lib/systemd/system/python-faraday.service; disabled; vendor preset: disabled) Active: failed (Result: exit-code) since Wed 2018-09-05 13:42:37 EDT; 1min 50s ago Process: 11040 ExecStartPre=/bin/sh -c if ! su postgres -c "psql -lqt" | cut -d | -f 1 | grep -qw faraday; then cd /usr/share/python-faraday && python manag Main PID: 2687 (code=exited, status=0/SUCCESS)
Sep 05 13:42:35 kali systemd[1]: Starting python-faraday Server... Sep 05 13:42:35 kali su[11041]: (to postgres) root on none Sep 05 13:42:35 kali su[11041]: pam_unix(su:session): session opened for user postgres by (uid=0) Sep 05 13:42:35 kali su[11041]: pam_unix(su:session): session closed for user postgres Sep 05 13:42:37 kali sh[11040]: Database section already found. Do you want to reconfigure database? (yes/no) Sep 05 13:42:37 kali sh[11040]: Aborted! Sep 05 13:42:37 kali systemd[1]: python-faraday.service: Control process exited, code=exited status=1 Sep 05 13:42:37 kali systemd[1]: python-faraday.service: Failed with result 'exit-code'. Sep 05 13:42:37 kali systemd[1]: Failed to start python-faraday Server.
root@kali:/usr/share/python-faraday# ./faraday-server.py
Traceback (most recent call last):
File "./faraday-server.py", line 189, in
Can you show me the contents of "/lib/systemd/system/python-faraday.service", I think you are calling manage.py and this is not required.
There seems to be an error on your connection_string at the [database] section of the file ~/.faraday/config/server.ini.
Did you follow install steps at the wiki? you need to execute "python manage.py initdb" the first time to configure the database.
Ran python manage.py initdb and Faraday Server has started.
Lost couchDB as Kali removed it in the process but Faraday is up and running.
Case can be closed. Thanks
You are welcome! We are happy that the issue was resolved! If couchdb files are still in your hardrive you can mount a docker instance (instructions on the wiki) and then you can execute:
python manage.py import_from_couchdb
I spoke too fast I still have the same issue with v3
2018-09-05 14:01:53,539 - faraday - INFO [api.py:110 - _setUpAPIServer() ] XMLRPC API server configured on ('localhost', 9876) There was an error while starting Faraday: No ports available! 2018-09-05 14:01:53,551 - faraday - INFO [api.py:489 - log() ] Closing Faraday...
Did you try to set this values on the user.xml?
<api_con_info_host>localhost</api_con_info_host>
<api_con_info_port>9876</api_con_info_port>
<api_restful_con_info_port>9977</api_restful_con_info_port>
yes and after it failed api_restful_con_info_port is set back to 65535 and debug does not give much
2018-09-05 14:07:59,946 - faraday - DEBUG [api.py:495 - devlog() ] Starting application... 2018-09-05 14:07:59,946 - faraday - DEBUG [api.py:495 - devlog() ] Setting up remote API's... 2018-09-05 14:07:59,947 - faraday - DEBUG [api.py:495 - devlog() ] starting XMLRPCServer with api_conn_info = ('localhost', 9876) 2018-09-05 14:07:59,947 - faraday - INFO [api.py:110 - _setUpAPIServer() ] XMLRPC API server configured on ('localhost', 9876) 2018-09-05 14:07:59,947 - faraday - DEBUG [api.py:495 - devlog() ] Starting model controller daemon... 2018-09-05 14:07:59,947 - faraday - DEBUG [api.py:495 - devlog() ] starting xmlrpc api server... There was an error while starting Faraday: No ports available! 2018-09-05 14:09:36,279 - faraday - INFO [api.py:489 - log() ] Closing Faraday... 2018-09-05 14:09:36,280 - faraday - DEBUG [api.py:495 - devlog() ] stopping model controller thread... 2018-09-05 14:09:36,280 - faraday - DEBUG [api.py:495 - devlog() ] server stopping... 2018-09-05 14:09:36,280 - faraday - DEBUG [api.py:495 - devlog() ] called stop on xmlrpc server 2018-09-05 14:09:38,042 - faraday - DEBUG [api.py:495 - devlog() ] server forever stopped by flag 2018-09-05 14:09:38,042 - faraday - DEBUG [api.py:495 - devlog() ] serve_forever ended 2018-09-05 14:09:38,042 - faraday - DEBUG [api.py:495 - devlog() ] xmlrpc thread joined 2018-09-05 14:09:39,958 - faraday - DEBUG [api.py:495 - devlog() ] Waiting for controller threads to end...
Ok one last try, instead of localhost use 127.0.0.1:
<api_con_info_host>127.0.0.1</api_con_info_host>
<api_con_info_port>9876</api_con_info_port>
<api_restful_con_info_port>9977</api_restful_con_info_port>
It worked :-)
Thanks for the help and BTW the new UI is really nice
Using Kali rolling-update with Faraday 2.7.2, the REST API server failed to start with the error below. couchdb and faraday-server are OK
2018-08-31 13:33:22,911 - faraday.launcher - INFO - Starting Faraday IDE. 2018-08-31 13:33:22,911 - faraday.launcher - INFO - Checking configuration. 2018-08-31 13:33:22,911 - faraday.launcher - INFO - Setting up plugins. 2018-08-31 13:33:22,911 - faraday.launcher - INFO - Removing old plugins folder. 2018-08-31 13:33:22,936 - faraday.launcher - INFO - Setting up ZSH integration. 2018-08-31 13:33:22,936 - faraday.launcher - INFO - Setting up user configuration. 2018-08-31 13:33:22,936 - faraday.launcher - INFO - Copying default configuration from project. 2018-08-31 13:33:22,940 - faraday.launcher - INFO - Setting up icons for GTK interface. 2018-08-31 13:33:22,945 - faraday.launcher - INFO - Setting configuration. 2018-08-31 13:33:23,034 - faraday.launcher - INFO - All done. Opening environment. 2018-08-31 13:33:23,168 - faraday.launcher - INFO - Main application ExceptHook enabled. 2018-08-31 13:33:23,168 - faraday.launcher - INFO - Starting main application.
Make sure you got couchdb up and running. If couchdb is up, point your browser to: [http://127.0.0.1:5985/_ui]
2018-08-31 13:33:23,169 - faraday - INFO - XMLRPC API server configured on ('localhost', 9876) There was an error while starting Faraday
Traceback (most recent call last): File "/usr/share/python-faraday/model/application.py", line 145, in start CONF.getApiRestfulConInfoPort() File "/usr/share/python-faraday/apis/rest/api.py", line 67, in startAPIs raise Exception("No ports available!") Exception: No ports available!
root@kali:~# systemctl status python-faraday ● python-faraday.service - python-faraday Server Loaded: loaded (/lib/systemd/system/python-faraday.service; disabled; vendor preset: disabled) Active: active (running) since Fri 2018-08-31 13:33:02 EDT; 11min ago Main PID: 12423 (faraday-server.) Tasks: 8 (limit: 4915) Memory: 62.7M CGroup: /system.slice/python-faraday.service └─12423 /usr/bin/python2.7 /usr/share/python-faraday/faraday-server.py
Aug 31 13:33:02 kali systemd[1]: Started python-faraday Server. Aug 31 13:33:02 kali faraday-server.py[12423]: 2018-08-31 13:33:02,338 - faraday-server.server.config - INFO - Local faraday-server configuration created at /r Aug 31 13:33:02 kali faraday-server.py[12423]: 2018-08-31 13:33:02,441 - faraday-server.server.importer - INFO - Setting up workspace cdx-test Aug 31 13:33:02 kali faraday-server.py[12423]: 2018-08-31 13:33:02,494 - faraday-server.server.importer - INFO - Setting up workspace cdx-test-nmap Aug 31 13:33:02 kali faraday-server.py[12423]: 2018-08-31 13:33:02,500 - faraday-server.server.importer - INFO - Setting up workspace openvas-test Aug 31 13:33:02 kali faraday-server.py[12423]: 2018-08-31 13:33:02,507 - faraday-server.server.importer - INFO - Setting up workspace test Aug 31 13:33:02 kali faraday-server.py[12423]: 2018-08-31 13:33:02,515 - faraday-server.server.importer - INFO - Setting up workspace udn-de Aug 31 13:33:02 kali faraday-server.py[12423]: 2018-08-31 13:33:02,522 - faraday-server.server.importer - INFO - Setting up workspace udn-prod-nmap Aug 31 13:33:02 kali faraday-server.py[12423]: 2018-08-31 13:33:02,683 - faraday-server.main - INFO - Faraday Server is ready Aug 31 13:41:23 kali faraday-server.py[12423]: No handlers could be found for logger "sqlalchemy.pool.NullPool" root@kali:~# systemctl status couchdb ● couchdb.service - Couchdb service Loaded: loaded (/lib/systemd/system/couchdb.service; disabled; vendor preset: disabled) Active: active (running) since Fri 2018-08-31 13:22:55 EDT; 22min ago Main PID: 4931 (beam.smp) Tasks: 14 (limit: 4915) Memory: 47.0M CGroup: /system.slice/couchdb.service ├─4931 /usr/lib/erlang/erts-6.3/bin/beam.smp -Bd -K true -A 4 -- -root /usr/lib/erlang -progname erl -- -home /var/lib/couchdb -- -noshell -noinput └─4959 sh -s disksup
Aug 31 13:45:23 kali couchdb[4931]: [info] [<0.1747.0>] 127.0.0.1 - - GET /udn-de/udn-de 200 Aug 31 13:45:23 kali couchdb[4931]: [info] [<0.1748.0>] 127.0.0.1 - - GET /_all_dbs 200 Aug 31 13:45:23 kali couchdb[4931]: [info] [<0.1749.0>] 127.0.0.1 - - GET /cdx-test/cdx-test 200 Aug 31 13:45:23 kali couchdb[4931]: [info] [<0.1750.0>] 127.0.0.1 - - GET /cdx-test-nmap/cdx-test-nmap 200 Aug 31 13:45:23 kali couchdb[4931]: [info] [<0.1751.0>] 127.0.0.1 - - GET /openvas-test/openvas-test 200 Aug 31 13:45:23 kali couchdb[4931]: [info] [<0.1812.0>] 127.0.0.1 - - GET /test/test 200 Aug 31 13:45:23 kali couchdb[4931]: [info] [<0.1813.0>] 127.0.0.1 - - GET /udn-de/udn-de 200 Aug 31 13:45:23 kali couchdb[4931]: [info] [<0.1814.0>] 127.0.0.1 - - GET /udn-prod-nmap/udn-prod-nmap 200 Aug 31 13:45:23 kali couchdb[4931]: [info] [<0.1815.0>] 127.0.0.1 - - GET /udn-de/udn-de 200 Aug 31 13:45:23 kali couchdb[4931]: [info] [<0.1816.0>] 127.0.0.1 - - GET /udn-de 200
2018-08-31 13:35:55,099 - faraday - INFO - Closing Faraday... root@kali:~# /usr/share/python-faraday/faraday.py -v Faraday v2.7.2
root@kali:~# netstat -nlp | grep -vi unix Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:5984 0.0.0.0: LISTEN 4931/beam.smp
tcp 0 0 127.0.0.1:5985 0.0.0.0: LISTEN 12423/python2.7