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

Multiple syntax issues in config file #12

Open
deadbits opened this issue Jan 4, 2019 · 9 comments
Open

Multiple syntax issues in config file #12

deadbits opened this issue Jan 4, 2019 · 9 comments

Comments

@deadbits
Copy link

deadbits commented Jan 4, 2019

It seems there's multiple issues with either the config file or its use with ConfigParser (or the ConfigParser version?)

Using the default config and editing it to add my keys throws this exception:

  File "myconf.conf", line 2
    City_Path: ./data/GeoLite2-City.mmdb
             ^
SyntaxError: invalid syntax

I've tried this using just data/GeoLite2-City.mmdb and it has the same problem. Won't run at all due to the vague Exception of "invalid syntax". I think pinning the version of ConfigParser in autorequirements.txt would help since typically ConfigParser takes = instead of :, at least from my experience. I changed this myself in the config but hit another exception with my username for PassiveTotal

  File "myconf.conf", line 8
    Username = [redacted]@[redacted].com
                      ^
SyntaxError: invalid syntax

Putting quotes around my email address then yields this exception:

aswanda:: Research/osint/hostintel ‹master*› » python2 myconf.conf system-list.txt --all
  File "myconf.conf", line 9
    PublicAPI = [REDACTED]
                        ^

Any help here would be greatly appreciated 👍

@keithjjones
Copy link
Owner

I haven't had to use this tool since I wrote it, but I'll try my best. What platform are you using? What version of Python?

@deadbits
Copy link
Author

deadbits commented Jan 4, 2019

Yeah I just noticed when the last commit was. I probably wouldn't have added this issue if I noticed that beforehand tbh :)
Anyhow, I'm using Python 2.7.15 and macOS 10.14.2

@keithjjones
Copy link
Owner

It's no problem. It's probably something simple.

I wonder if it has something to do with the underscore in the value name?

https://github.com/keithjjones/hostintel/blob/master/sampleconfig.conf#L2

That's the only one that has one in that config file. You could test it by changing the code and the config file.

@keithjjones
Copy link
Owner

@deadbits
Copy link
Author

deadbits commented Jan 4, 2019

Cool, thanks for the info. I'll do some debugging and get back to you - not super urgent on my end so no worries. If I figure out a solution I'll just post it here and close out the ticket

@deadbits
Copy link
Author

deadbits commented Jan 4, 2019

Putting certain config values in quotes fixed in the syntax error problem, now I'm hitting this:

hostintel ‹master*› » python2 myconf.conf system-list.txt --all                                                                           1 ↵
Traceback (most recent call last):
  File "myconf.conf", line 1, in <module>
    [GeoIP2]
NameError: name 'GeoIP2' is not defined

It very much does exist though. This is turning into a rabbit hole :p

@keithjjones
Copy link
Owner

A recent issue was posted here with configparser. I wonder if it's related.

@keithjjones
Copy link
Owner

Any developments with this one?

@deadbits
Copy link
Author

deadbits commented Jun 7, 2019

I actually haven't looked at this recently since my last comment much, I'll check it out again this weekend and send an update. I'll likely re-clone the repo and start from scratch in a venv just to make sure nothing external interferes

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

No branches or pull requests

2 participants