2014-01-28

OpenVAS on BlackArch Linux: Installation Notes

OpenVAS can be tricky to set up. Once OpenVAS packages are installed, there's a bunch of steps you need to perform, and in a pretty specific order, to turn it into a working vulnerability scanner. There are four parts to OpenVAS: The Scanner service, the Manager service, the Administrator service, and then some front-end client. In this case, I'm demonstrating Greenbone Security Assistant, which is yet another service, an SSL web UI that you can access locally, or from another computer, for managing OpenVAS.

I recommend using sudo instead of doing everything as root, but you're obviously not obliged to do it that way. These instructions presume you are using sudo, though. Sudo isn't in the Arch base distribution, but you can add it with:

[root@spx ~]# pacman -S sudo

First, install all the packages. gsa is the web UI, while gsd is a graphical client that runs under X11. You don't need to install both of them, but I usually do. A bunch of dependencies will be added with these packages. Stuff in bold is what I typed. Everything else is terminal output. Most of the really verbose output is truncated and noted with my own commentary in ellipses.


[axon@spx ~]$ sudo pacman -S openvas-administrator openvas-manager openvas-scanner gsa gsd
resolving dependencies...

Packages (75): alsa-lib-1.0.27.2-1  cmake-2.8.12.1-3  damageproto-1.2.1-2
   ...
   ...
               openvas-administrator-1.3.2-4  openvas-manager-4.0.4-3
               openvas-scanner-3.4.0-5

Total Download Size:    73.21 MiB
Total Installed Size:   338.56 MiB

:: Proceed with installation? [Y/n] y
:: Retrieving packages ...


Next, download all the OpenVAS NVT scripts. These are updated frequently. By default, OpenVAS doesn't ship with any scripts, so you need to download them. If there are no NVTs, OpenVAS scanner service doesn't like to start.


[axon@spx ~]$ sudo openvas-nvt-sync
... lots of text while the NVT scripts download ...
zyxel_pwd.nasl.asc
[i] Download complete
[i] Checking dir: ok
[i] Checking MD5 checksum: ok


Next, make the SSL Cert for OpenVAS with this handy script:

[axon@spx ~]$ sudo openvas-mkcert
 
Answer each prompt if you want, but as this is a private-use certificate, I usually just hit enter at all the prompts to accept the defaults. We also need to make a Client Cert for OpenVAS-Manager (om) like this:  

[axon@spx ~]$ sudo openvas-mkcert-client -n om -i
...
Write out database with 1 new entries
Data Base Updated
User om added to OpenVAS.





Start the OpenVAS Scanner service. This can take a really long time, and consumes a lot of RAM.

[axon@spx ~]$ sudo openvassd
Loading the OpenVAS plugins...base gpgme-Message: Setting GnuPG homedir to '/etc/openvas/gnupg'
base gpgme-Message: Using OpenPGP engine version '2.0.22'
Loading the plugins... 1887 (out of 33836)




The OpenVAS Manager service requires an SQLite database, but none is created during package installation. Use the following command to create the database. It will sit there for a few minutes and return to the command line without saying anything. This is normal. 
[axon@spx ~]$ sudo openvasmd --rebuild
 

Start the OpenVAS Manager service. This runs quickly. 
[axon@spx ~]$ sudo openvasmd





Add a user to OpenVAS. You'll log into OpenVAS with these credentials. Pick a strong password, not the one I use here.
[axon@spx ~]$ sudo openvasad -c 'add_user' -n adminusername -w adminpassword
ad   main:MESSAGE:4484:2014-01-28 14h31.41 CST: No rules file provided, the new user will have no restrictions.
ad   main:MESSAGE:4484:2014-01-28 14h31.41 CST: User adminusername has been successfully created.


Start the OpenVAS Administrator service.
[axon@spx ~]$ sudo openvasad




I'm usually paranoid, and at this step, I check the process list for "openvas" services. You should see openvassd, openvasad and openvasmd all running. If not, look at the logs in /var/log/openvas to give you some hints, or check to make sure you performed each step necessay. If that all checks out, start a client, such as Greenbone Security Assistant.


[axon@spx ~]$ sudo gsad

Now just browse to https://localhost (or your BlackArch's network IP). You'll need to accept the self-signed certificate. Generating a new SSL cert for GSA is beyond the scope of this article.

2014-01-27

Introducing: BlackArch Linux

I've always admired Arch Linux, the spartan and light-weight Linux distro with its rolling release and clever package management system. At the same time, a lot of the security tools I know and love are difficult to compile, and found in few package repositories outside of Kali Linux, the Debian-derived distro that comes packed with pretty much every open-source security and penetration-testing tool that's relevant to today's researchers... and that's part of the problem. It's fun to play with new tools on occasion, but I rarely want or need all that stuff installed at once. Also, while I've spent more than enough time on Debian-family Linux distros thanks to a job managing Ubuntu LTS servers and hand-holding various friends and family through Ubuntu on desktops, it never quite felt like home as much as Arch does.

Enter BlackArch Linux, a package repository for arming your Arch Linux box to the teeth with all our favorite tools. There's also a collection of Live images to play with if that's more your style, but this relatively young project offers an appealing choice to those who prefer Arch. Getting BlackArch up and running is pretty straightforward.

I prefer to start with a basic Arch Linux installation. For the command-line adept and those familiar with Arch, the Arch Installation Guide is a no-nonsense checklist of things you need to do, while the Beginners' Guide offers a bit more hand-holding. I used both when getting back into Arch Linux a while ago. You'll need to partition your drive, format the filesystems, pacstrap it, set up the network, add a user, and some other basic things that are outlined in the guides. Installation difficulty is on par with OpenBSD, but with a little less guidance from a dedicated install script. Don't forget to set up a boot loader!

You'll probably want to customize your Arch Linux install, which may include setting up X11, a Display Manager and a Window Manager or Desktop Environment (handy for using a graphical web browser or GUI-driven tools such as BurpSuite). That's all covered in the Beginners' guide as well. I'm pretty fond of OpenBox with Conky, so I ended up with a pretty minimalist desktop, shown here.


Once you have Arch installed and a comfortable userland configured, you'll want to make sure it's up to date by running "pacman -Syu" and then you should install wget before moving on to installing BlackArch, if you haven't already:

pacman -S wget 

From there, you can simply follow the instructions on the BlackArch Download page. This will just add the repositories to your Arch Linux installation, and doesn't actually install the packages. You can opt to install all the packages at once with:

pacman -S blackarch

But in my opinion, the fact that you can pick and choose which tools to install makes it quite nice for devices like netbooks or other machines that you really don't want bogged down with hundreds of tools you don't need. The BlackArch download page outlines how to peruse their repository for the stuff you want, or installing groups of similar packages, such as "blackarch-scanner" and "blackarch-networking"

In my next post, I'll explain how to configure OpenVAS, and get it up and running on BlackArch. I frequently set this up in my security lab when introducing interns to vulnerability scanning, and it's usually a bit tricky to get running for the first time.

2014-01-24

I am really tired of this 'eco-friendly' (and useless) gas can.

A few years ago, I bought a new gas can. I noticed it doesn't have a ventilation hole, but I figured there was some magic in the bizarre spout design that made ventilation unnecessary. I figured wrong. It takes several minutes to empty two gallons into a vehicle. I got tired of it today.

Step 1: Acquire useless gas can.
Step 2: Drill a small pilot hole in the handle, somewhere that won't leak when the can is full or in use.
Step 3: Plug said hole with a thumscrew, wing bolt or other suitable, secure device.

Loosely illustrated in attached photos. This works much better, but 1) might not be as safe for transporting gasoline, 2) might get you in trouble with some all-seeing government agency. As always: We're not responsible for problems caused by people who try this at home.

2013-11-05

OpenBSD 5.4 Released. OAMP/ONMP walk-throughs updated

OpenBSD 5.4 was released on November 1st. Some new features include:
  • Support for BeagleBone and BB Black
  • Some much-needed improvements to dhclient
  • OpenSSH 6.3 with some new features
Of course, the nginx and Apache MySQL/PHP walk-throughs have been updated and tested. Enjoy:

OpenBSD/Apache/MySQL/PHP guide
OpenBSD/nginx/MySQL/PHP guide

2013-10-10

Breaking in (to the information security field)

Much has been written about how to get started in InfoSec. Last week, I happened across this excellent post with guidance for college students interested in security. The fact is, most of his points are relevant for anyone, student or not, that feels like security is their calling. Of particular note that you really need to love this field to make a career of it without getting burned out in the first few months.

Landing an internship is a good start. I've worked with some brilliant interns from high school and college, but internships are usually only available to students. Most security industry internships are not only paid, but paid quite well compared to many entry-level part-time jobs. Like most internships, you stand a pretty good chance of finding a job in the field if you excel at your work.

Brian Krebs has also sought advice from various high-profile folks in the industry. Most of their sentiments line up: Be curious. Learn. Tinker. Show it off. Crafting excellent write-ups shows potential employers that you're an effective communicator, and that you have the skill to really dig into and understand a topic. These traits matter through your entire career. Even now, with nearly half my life spent in the information security field, I still can't resist the urge to get my hands dirty in the lab. As for how to show off your findings and get involved with the community,  try setting up a blog, hanging out in /r/netsec and visiting local gatherings such as CitySec, ISACA, OWASP, yes, even 2600. If you get a chance, big security conferences can be a lot of fun, but I'd argue they're less useful for getting your foot in the door, and more useful for getting to know others in the field from all over the world.

It's worth reiterating how unfathomably broad the field of information security is. If you're looking to get started, it's best to pick one or two subjects to really focus on. Many of the "fun" topics make use of both offensive and defensive skills. You might need to Google some of the sub-topics, but to name a few I can arbitrarily think of off the top of my head:

  • Network Security (Firewalls, IDS/IPS, WAF and penetration testing)
  • Software Security (Fuzzing, OWASP Top 10, code review, malware analysis, vulnerability exploitation)
  • Endpoint security (Desktop security, FDE, Group policies,  NAC, anti-virus)
  • Cryptography (Implementation, design, analysis and cracking)
  • Disaster Recovery (data backup/restoration/replication, RAID, UPS, hot-sites)
  • Authentication, Authorization and Accounting (Passwords, tokens, logging)
  • Security architecture and policy design
  • Governance, Risk Management, Compliance, Legal and Regulatory matters (GRC)
  • Physical and Operational security (surveillance, risk assessment, lock picking, social engineering)

2013-07-22

Lots of security content: July 2013 BSD Magazine

Yes, you have to give them your e-mail address. And yes, like many publications, there are a bunch of advertisements. Every once in a while, BSDMag covers a lot of security-related topics, and this is one of those. Click below to get the latest issue.

 

2013-06-23

A UNIX System! I know this!

I warned you all. I was going to do it.

When I was a kid that actually knew and used UNIX (AT&T and AIX at the time), I knew in my heart of hearts that there was no video-game-like flying graphical file manager for UNIX. A lot of us made fun of the computer scenes in Jurassic Park. Well, I was wrong. All of us were. Here's the 20+ year-old Fusion (fsn) file manager running on a 20-year old computer.