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

err: Not initialize(d) yet.. #16

Closed
pyed opened this issue Apr 9, 2016 · 11 comments
Closed

err: Not initialize(d) yet.. #16

pyed opened this issue Apr 9, 2016 · 11 comments

Comments

@pyed
Copy link

pyed commented Apr 9, 2016

I faced the following error, no idea what went wrong.

pyed@Debian7:~$ vuls prepare
INFO[0000] Begin Preparing (config: /home/pyed/config.toml) 
[Apr  9 14:50:21]  INFO [localhost] Detecting OS... 
[Apr  9 14:50:21]  INFO [localhost] Installing...
[Apr  9 14:50:21]  INFO [localhost] Success
pyed@Debian7:~$ vuls scan
INFO[0000] Begin scannig (config: /home/pyed/config.toml) 
[Apr  9 14:50:29]  INFO [localhost] Validating Config...
[Apr  9 14:50:29]  INFO [localhost] Detecting OS... 
[Apr  9 14:50:29]  INFO [localhost] Scanning vulnerabilities... 
[Apr  9 14:50:29] ERROR [localhost] Failed to scan. err: Not initialize yet..
pyed@Debian7:~$ 
@JvGinkel
Copy link

I have exactly the same running on Centos 6. Anyone have a idea why this err message appears?

@kotakanbe
Copy link
Member

It seems the config file is wrong.
Please paste the config file with password masking.
(I think the error message is bad. I will improve the message)

@kotakanbe
Copy link
Member

You can run with -debug option to get more detail information.

@pyed
Copy link
Author

pyed commented Apr 10, 2016

pyed@Debian7:~$ vuls scan -debug
INFO[0000] Begin scannig (config: /home/pyed/config.toml) 
[Apr 10 19:05:54]  INFO [localhost] Validating Config...
[http] 2016/04/10 19:05:54 HTTP Request: GET /health HTTP/1.1
Host: 127.0.0.1:1323

time=2016-04-10T19:05:54+03:00, remote_ip=127.0.0.1, method=GET, uri=/health, status=200, took=160.442µs, sent=0 bytes
[http] 2016/04/10 19:05:54 HTTP Response: HTTP/1.1 200 OK
Content-Type: text/plain; charset=utf-8
Date: Sun, 10 Apr 2016 16:05:54 GMT
Content-Length: 0

[Apr 10 19:05:54]  INFO [localhost] Detecting OS... 
[Apr 10 19:05:54] DEBUG [localhost] []scan.osTypeInterface{}
[Apr 10 19:05:54]  INFO [localhost] Scanning vulnerabilities... 
[Apr 10 19:05:54] ERROR [localhost] Failed to scan. err: Not initialize yet..
pyed@Debian7:~$ 

config.toml:

[servers]

[176.X.XXX.XXX]
host = "176.X.XXX.XXX"
port = "54XXX"
user = "pyed"                                                                                                                                                                                                                                             
keyPath = "/home/pyed/.ssh/id_rsa"

@kotakanbe
Copy link
Member

@pyed @JvGinkel

Try this config :-)

[servers]

[servers.176-X-XXX-XXX]
...

@pyed
Copy link
Author

pyed commented Apr 11, 2016

pyed@Debian7:~$ vuls scan                                                                                                                                                
INFO[0000] Begin scannig (config: /home/pyed/config.toml) 
[Apr 11 18:49:07]  INFO [localhost] Validating Config...
time=2016-04-11T18:49:07+03:00, remote_ip=127.0.0.1, method=GET, uri=/health, status=200, took=156.496µs, sent=0 bytes
[Apr 11 18:49:07]  INFO [localhost] Detecting OS... 
WARN[0000] Faild to ssh @:. err: dial tcp :0: getsockopt: connection refused, Retrying in 552.330144ms... 
WARN[0000] Faild to ssh @:. err: dial tcp :0: getsockopt: connection refused, Retrying in 1.080381816s... 

not sure why it fails to connect, when I try the following it works

ssh -p 54XXX pyed@176.X.XXX.XXX

which means the ssh key is okay and exists in authorized_keys

@kotakanbe
Copy link
Member

@pyed Try this config !!

[servers]

[servers.176-X-XXX-XXX]
host = "176.X.XXX.XXX"
port = "54XXX"
user = "pyed"                                                                                                                                                                                                                                             
keyPath = "/home/pyed/.ssh/id_rsa"

@pyed
Copy link
Author

pyed commented Apr 11, 2016

I did not notice the dashes, now it seems to work but complains about not being able to use sudo, i tried to run prepare with root, but the same happened, it would be a lot better if you list the dependences rather than asking for root access

@pyed
Copy link
Author

pyed commented Apr 11, 2016

pyed@Debian7:~$ vuls scan
INFO[0000] Begin scannig (config: /home/pyed/config.toml) 
[Apr 11 20:46:38]  INFO [localhost] Validating Config...
time=2016-04-11T20:46:38+03:00, remote_ip=127.0.0.1, method=GET, uri=/health, status=200, took=151.101µs, sent=0 bytes
[Apr 11 20:46:38]  INFO [localhost] Detecting OS... 
[Apr 11 20:46:39]  INFO [localhost] Scanning vulnerabilities... 
[Apr 11 20:46:39]  INFO [localhost] Check required packages for scanning...
[Apr 11 20:46:40] ERROR [XXXXXXXXXXXXXXXXXXX] aptitude is not installed
[Apr 11 20:46:40] ERROR [localhost] Please execute with [prepare] subcommand to install required packages before scanning
[Apr 11 20:46:40] ERROR [localhost] Failed to scan. err: pyed@176.XXXXXXXXXXXXXXX: aptitude is not installed.
pyed@Debian7:~$ vuls prepare
INFO[0000] Begin Preparing (config: /home/pyed/config.toml) 
[Apr 11 20:46:58]  INFO [localhost] Detecting OS... 
[Apr 11 20:46:58]  INFO [localhost] Installing...
[Apr 11 20:46:58]  INFO [XXXXXXXXXXXXXXXXXXX] apt-get update...
[Apr 11 20:47:00] ERROR [XXXXXXXXXXXXXXXXXXX] Failed to apt-get update. status: 1, stdout: [sudo] password for pyed: Sorry, try again.
[sudo] password for pyed: 
sudo: 1 incorrect password attempt
, stderr: 
[Apr 11 20:47:00] ERROR [localhost] Failed: pyed@176.XXXXXXXXXXXXXXX: Failed to apt-get update. status: 1, stdout: [sudo] password for pyed: Sorry, try again.
[sudo] password for pyed: 
sudo: 1 incorrect password attempt
, stderr: .
pyed@Debian7:~$ su
Password: 
root@Debian7:/home/pyed# apt-get install aptitude
Reading package lists... Done
Building dependency tree       
Reading state information... Done
aptitude is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

it doesn't wait for me to type the password for that sudo command.

@kotakanbe
Copy link
Member

@pyed Thanks for reporting.

it would be a lot better if you list the dependences rather than asking for root access

The document of dependencies is here.
https://github.com/future-architect/vuls#usage-prepare

Currently, It's needed to define password If you want to ssh with sudo password,

[servers]

[servers.176-X-XXX-XXX]
host = "176.X.XXX.XXX"
port = "54XXX"
user = "pyed"                                                                                                                                                                                                                                             
password = "password"  # sudo password of pyed on the target server
keyPath = "/home/pyed/.ssh/id_rsa"

You can configure NOPASSWORD in /etc/sudoers on the target server If you don't want to write plain password in the config.
http://askubuntu.com/questions/334318/sudoers-file-enable-nopasswd-for-user-all-commands

In the near future, I am going to implement password-less option in the config.
(see #11 (comment) )

@kotakanbe
Copy link
Member

I implement -ask-sudo-password option and -ask-key-password option.
Now, you can avoid to define plain password in config.

see #35

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

3 participants