Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import CSV not detecting host #412

Open
sibwara opened this issue Sep 30, 2020 · 1 comment
Open

Import CSV not detecting host #412

sibwara opened this issue Sep 30, 2020 · 1 comment

Comments

@sibwara
Copy link

sibwara commented Sep 30, 2020

Issue Type

  • Bug Re port

Faraday version

Faraday 3.12

Component Name

faraday_csv

Steps to reproduce

I tried to upload host information through a CSV file with a "target" fieldname and it is not recognized.

test.txt

I followed the format displaed in the GUI:

Sans titre

# faraday-client --cli --workspace xxx --report /opt/audit_file/test.csv

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

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

2020-09-30T18:37:27+0200 - faraday_client.start_client - INFO {MainThread} [start_client.py:323 - printBanner()]  Starting Faraday IDE.
2020-09-30T18:37:27+0200 - faraday_client.start_client - INFO {MainThread} [start_client.py:435 - main()]  Dependencies met.
2020-09-30T18:37:27+0200 - faraday_client.start_client - INFO {MainThread} [start_client.py:279 - checkConfiguration()]  Checking configuration.
2020-09-30T18:37:27+0200 - faraday_client.start_client - INFO {MainThread} [start_client.py:280 - checkConfiguration()]  Setting up ZSH integration.
2020-09-30T18:37:27+0200 - faraday_client.start_client - INFO {MainThread} [start_client.py:282 - checkConfiguration()]  Setting up user configuration.
2020-09-30T18:37:27+0200 - faraday_client.start_client - INFO {MainThread} [start_client.py:268 - setupXMLConfig()]  Using custom user configuration.
2020-09-30T18:37:27+0200 - faraday_client.start_client - INFO {MainThread} [start_client.py:183 - setConf()]  Setting configuration.
2020-09-30T18:37:27+0200 - faraday_client.start_client - INFO {MainThread} [start_client.py:215 - start_faraday_client()]  All done. Opening environment.
2020-09-30T18:37:27+0200 - faraday_client.start_client - INFO {MainThread} [start_client.py:221 - start_faraday_client()]  Main application ExceptHook enabled.
2020-09-30T18:37:27+0200 - faraday_client.start_client - INFO {MainThread} [start_client.py:224 - start_faraday_client()]  Starting main application.

2020-09-30T18:37:27+0200 - faraday_client.model.api - INFO {MainThread} [api.py:117 - _setUpAPIServer()]  XMLRPC API server configured on ('localhost', 9876)
2020-09-30T18:37:27+0200 - faraday_client.apis.rest.api - INFO {MainThread} [api.py:66 - startAPIs()]  REST API server configured on ('localhost', 9977)
2020-09-30T18:37:27+0200 - faraday_client.managers.reports_managers - INFO {MainThread} [reports_managers.py:99 - sendReport()]  The file is /opt/audit_file/test.csv, faraday_csv
2020-09-30T18:37:27+0200 - faraday_client.plugins.controller - INFO {MainThread} [controller.py:256 - processReport()]  Processing report with plugin faraday_csv
ERROR:faraday.faraday_plugins.plugins.plugin.FaradayCSVPlugin:No host specified. Please, specify at least one host.
2020-09-30T18:37:27+0200 - faraday_client.plugins.controller - INFO {MainThread} [controller.py:139 - processOutput()]  Sent command duration 200
2020-09-30T18:37:27+0200 - faraday_client.model.api - INFO {MainThread} [api.py:499 - log()]  Closing Faraday...

I saw the source code of the plugin and the error "No host specified. Please, specify at least one host" occurs when the fieldnames "ip" and "target" are missing.
I tried to modify my file with an "ip" field, a "target" field and both of them with the same result.

Expected results

The file should be accepted

Please attach the result of:

pip freeze > requirements_freeze.txt
requirements_freeze.txt

OS

Linux 5.7.0-kali3-amd64 #1 SMP Debian 5.7.17-1kali1 (2020-08-26) x86_64 GNU/Linux

@hatiekinds
Copy link

I know that this is super old, but I came across it while doing my own research. I can at least confirm this is no longer an issue.

I tested the same exact parameters as your file in the gui and cli and it was able to parse. I posted the output I got from the cli below.

# faraday-plugins process-report --plugin_id faraday_csv faraday-csv-test.csv
{
    "hosts": [
        {
            "ip": "10.10.10.10",
            "os": "Windows 2019 STD X64",
            "hostnames": [
                "srv-adm208.xxx.dom"
            ],
            "description": "",
            "mac": null,
            "credentials": [],
            "services": [],
            "vulnerabilities": [],
            "tags": []
        }
    ],
    "command": {
        "tool": "faraday_csv",
        "command": "faraday_csv",
        "params": "faraday-csv-test.csv",
        "user": "user",
        "hostname": "",
        "start_date": "2024-10-01T20:06:49.204649",
        "duration": 608,
        "import_source": "report"
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants