Nessus command line search

I’ve recently tired to do a nessus scan from an X-less gentoo machine. The task is quite simple, but there are a few quirks that are not obvious.

The easy part:

  1. emerge nessus
  2. nessus-mkcert
  3. nessus-user-add
  4. register at nessus website to get the actiovation code for plugin feeds (FYI: #GPL plugins: 1299, #registered plugins: 9575), so unless you register you get a very small subset of (probably outdated) scanners.
  5. nessus-fetch –register <activation-code>
  6. nessus-update-plugins (it probably makes sense to add it to cron).

Ok, now for scanning the most obvious choice is to run a nessus client with GTK interface. If we don’t want to do this we can either:

  • run the graphical console remotely
  • run a command-line interface.

The tricky part: Scanning using command line interface:

nessus -V -q 127.0.0.1 1241 <user> <password> <host file> <output file.nbe>

It works fine although generates a warning that “potentially unsafe plugins have been disabled”. While it makes sense for a big and critical network, you may also want to do the “unsafe” scan occasionally. How to enable it?

The first trick, is that nessus creates a “.nessusrc” file in your home directory. The first try — “safe_checks=no” – doesn’t help. Second, you figure out that there is also a nessus-wide file /etc/nessus/nessusd.conf”, which has the same option (overriding the local one) by default set to “yes”. Unfortuantely, no warning is generated when this happenes. Unfortunately, this doesn’t help either :-(

I found the solution analyzing the config file that was created after using nessus with a GUI (with all the plugins enabled). It turns out that such a file the following entry is being added:

begin(PLUGIN_SET)
 14250 = yes
 15094 = yes
 15185 = yes
...
end(PLUGIN_SET)

So all the plugins are explicitly enabled. Only then AND if both safe_checks in the global and local config files are set to “no”, unsafe plugins are executed. Unfortuantely, I don’t know how to set this option from the command line. Also as the new plugins are being instaled, the list would need to be kept updated (does nessus client do this?).

Another solution can be using Net::Nessus::ScanLite from CPAN (unfortunately it seems a bit outdated ~Dec 2003). I haven’t tried it, but it looks ok, and also it supports reading of plugins (so that we can enable/disable some) and also relieves us from parsing the NBE file. Problem: Net::Nessus::ScanLite uses Net:Nessus::Client, which doesn’t compile (for a number of reasons) and, moreover, is not aware that Nessus uses SSL. Surprisingly enough, ScanLite is aware of this and it somehow works around this. How — I don’t know.

36 Responses to “Nessus command line search”

  1. Spookstaz Says:

    Try using the option:

    nessus -c …

    Like this:

    nessus -c ~/.nessusrc -V -q 127.0.0.1 1241

  2. Spookstaz Says:

    Also, you must have in your config file:

    begin(SERVER_PREFS) … … safe_checks=no … … end(SERVER_PREFS)

  3. Pankaj Says:

    Hi Tadek came to your blog while searching for Nessus CLI. Could you help me a little, I am In India and working on a project to run Nessus and Metasploits from a customised front end so was keen to know how to run both of these thru a CLI and how to connect these commands to a Command button in GTK or Java etc Thanks a lot !! (I am not too good inprogramming so any help will be welcome) C ya Pankaj

  4. chat Says:

    Try using the option:

    nessus -c …

    Like this:

    nessus -c ~/.nessusrc -V -q 127.0.0.1 1241

    Thanks

  5. Sohbet Says:

    begin(SERVER_PREFS) … … safe_checks=no … … end(SERVER_PREFS)

  6. Kalpyeri Says:

    Thanks :)

  7. mirc Says:

    Thanks

  8. Sohbet Says:

    Surprisingly enough, ScanLite is aware of this and it somehow works around this. How — I don’t know.

  9. Sohbet odaları Says:

    interesting , good text Thanks !

  10. sohbet Says:

    Also, you must have in your config file:

    begin(SERVER_PREFS)

  11. Video Says:

    Try using the option:

    nessus -c …

    Like this:

    nessus -c ~/.nessusrc -V -q 127.0.0.1 1241

    Thanks

  12. komik Says:

    Surprisingly enough, ScanLite is aware of this and it somehow works around this. How — I don’t know.

  13. Chat Says:

    Thanx

  14. chat Says:

    begin(PLUGIN_SET) 14251 = yes 15092 = yes 15183 = yes … end(PLUGIN_SET)

  15. nessus über die konsole bedienen - Linux Forum Says:

    [...] hilft Dir das hier: http://tadek.pietraszek.org/blog/2005/10/12/nessus-command-line-search/Aber ich sach Dir gleich, sieh zu, dass Du irgendwie an ‘nen X kommst und den Client installieren [...]

  16. Tercüme Says:

    Thanks..

  17. porno Says:

    So all the plugins are explicitly enabled. Only then AND if both safe_checks in the global and local config files are set to “no”, unsafe plugins are executed. Unfortuantely, I don’t know how to set this option from the command line. Also as the new plugins are being instaled, the list would need to be kept updated (does nessus client do this?). quesiton?

  18. Bedava Says:

    Surprisingly enough, ScanLite is aware of this and it somehow works around this. How — I don’t know

  19. Komsu.net Says:

    thanks…. Surprisingly enough, ScanLite is aware of this and it somehow works around this. How — I don’t know

  20. penis büyütme Says:

    pietraszek.org/blog/2005/10/12/nessus-command-line-search/Aber ich sach Dir gleich, sieh zu, dass Du irgendwie an ‘nen X kommst und den Client installieren

  21. Peter Says:

    Good info. Thanks Tadek.

    Nessus is a great vulnerability scanning solution, running from the command line you can script it and that can increase productivity. :)

  22. kpss Says:

    Perfect templates. Thanks for the sharing.

  23. blog bloglar Says:

    Japanese carrier Softbank has announced a range of new phones, and the one that stands out is the 812SH Pantone series by Sharp, if only because it comes in colours other than Black

  24. sohpet Says:

    thanks a lot.

  25. Cappadocia Says:

    great

  26. Celebrity Pictures Says:

    fine

  27. Disney Movies Says:

    said

  28. Disney Pictures Says:

    pandaaa

  29. football Pictures Says:

    fine goal

  30. Seo Danışmanı Says:

    fine goals

  31. kpss Says:

    The Urban Monk aims to provide a free companion in your personal development journey inwards into yourself and outwards into the urban world – modern life, entwined with ancient spirituality.

  32. chat Says:

    tenlssss

  33. SohbeT Says:

    thanks…

  34. Camfrog Says:

    SpeciaL Thx To Admins

  35. SohbeT Says:

    thanks. admin

  36. sohbet Says:

    thanks