Author Topic: Armitage  (Read 18813 times)

casper

  • Newbie
  • *
  • Posts: 8
    • View Profile
on: October 16, 2012, 10:01:07 PM
Hi, this is my first time using BackBox and it's nice to see there is a lively community. The issue I'm having is with Armitage, I'm currently using VMWare, I've also read the FAQ regarding how to fix it but the issue I'm having I can't fix.
 
The FAQ runs you though a few commands to run through as root to create the database. When I insert this line:

Code: [Select]
/etc/init.d/framework-postgres start
 
I get the following error:
 
Code: [Select]
/etc/init.d/framework-postgres: line 1: /opt/metasploit-4.1.4/postgresql/scripts/ctl.sh: No such file or directory
 
This is an issue since since it requires you to delete certain files in order to get it to run (link to support site http://www.fastandeasyhacking.com/start), I would by no means consider myself a Linux expert but I can't seem to find where the directory is to create it.
 
Anyway, appreciate the help  :)



ZEROF

  • Hero Member
  • *****
  • Posts: 1247
    • View Profile
    • Pen Tester
Reply #1 on: October 17, 2012, 02:56:35 AM
Hi man,

We have nice wiki too. Check this 2 posts :

http://wiki.backbox.org/index.php/Metasploit#Database_installation
http://wiki.backbox.org/index.php/Armitage

And if you check, MSF folder is /opt/msf, to go to this folder cd /opt/msf, to see what you looking for, type ls or l, then you will see the other files.

I'm sure that this will help you ;).
« Last Edit: October 17, 2012, 03:01:56 AM by ZEROF »


Don't ask, read : http://wiki.backbox.org
or just run sudo rm -rf /*


casper

  • Newbie
  • *
  • Posts: 8
    • View Profile
Reply #2 on: October 17, 2012, 05:05:21 PM
Hi, thanks for the quick response  :), I had a look for the files but I couldn't see anything related I also went through your links and it looked promising till I got the new error
Code: [Select]
createuser: could not connect to database postgres: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

 
I went on google to see how to resolve it but I couldn't see anything that would help resolve this. Sad part is, if you get the error I've been having, all you have to is restart your Windows computer  :D



Stolas

  • Newbie
  • *
  • Posts: 45
    • View Profile
Reply #3 on: October 17, 2012, 06:15:19 PM
Basicly I am just shouting something in hope it works.
So, I can't nor will assure you that this works or is related enough.

But it sounds like the server just isnt started. Can you access the pgsql query thing?

Maybe this is your answer: http://ubuntuforums.org/showthread.php?t=869080

Whenever you think you can or can't your right.


casper

  • Newbie
  • *
  • Posts: 8
    • View Profile
Reply #4 on: October 17, 2012, 06:58:38 PM
Hi, thanks for the help, I tried what they said on the Ubuntu forum sadly it wasn't liking the
Code: [Select]
sudo su - posgresql command. I tried one of the tricks someone mentioned of starting msfgui then running armitage with the login details but this doesn't work because of the SSH. I have exhausted the support FAQ and its links regarding a fix for this. The main error I'm receiving is to do with directories, I also received the same errors as the person did in the Ubuntu forum except its version 8.4.
 
I saw on youtube that another BackBox user was having the same issue again it was due to the directories preventing the fix, normally its a case of creating the database and then adding a user to it and it works but clearly this isn't the case.
 
Has this issue cropped up before? I can't seem to find anything similar to it. Is there a hot-fix for this issue?
 
Appreciate the help  :)



ostendali

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 587
    • View Profile
Reply #5 on: October 17, 2012, 08:35:19 PM
Hi, thanks for the help, I tried what they said on the Ubuntu forum sadly it wasn't liking the
Code: [Select]
sudo su - posgresql command. I tried one of the tricks someone mentioned of starting msfgui then running armitage with the login details but this doesn't work because of the SSH. I have exhausted the support FAQ and its links regarding a fix for this. The main error I'm receiving is to do with directories, I also received the same errors as the person did in the Ubuntu forum except its version 8.4.
 
I saw on youtube that another BackBox user was having the same issue again it was due to the directories preventing the fix, normally its a case of creating the database and then adding a user to it and it works but clearly this isn't the case.
 
Has this issue cropped up before? I can't seem to find anything similar to it. Is there a hot-fix for this issue?
 
Appreciate the help  :)
hi there,
just a quick question, you didn't mentioned what distro you are using, is that backbox?
apart from this question, your problem is quite obvious, your database is not running....

Pls give further details in order to  be able to help.



casper

  • Newbie
  • *
  • Posts: 8
    • View Profile
Reply #6 on: October 17, 2012, 09:14:27 PM
Hi, I'm currently using the BackBox Linux 2.05 - i386 distro in VMWare with 2GB alloted to RAM and 20GB alloted to memory. Further details are that I've updated the metasploit framework and installed all other updates. 
 
The database part is where I'm having the issue, I've followed all the recommended ways to resolve this issue as mentioned in the BackBox wiki and from the fastandeasyhacking FAQ, I also followed the guide as suggested by Stolas. The main issue is that these directories don't seem to exist when trying to modify these files.
 
Appreciate the help and any further details you need, please feel free to ask :)



ostendali

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 587
    • View Profile
Reply #7 on: October 17, 2012, 09:56:12 PM
Hi, I'm currently using the BackBox Linux 2.05 - i386 distro in VMWare with 2GB alloted to RAM and 20GB alloted to memory. Further details are that I've updated the metasploit framework and installed all other updates. 
 
The database part is where I'm having the issue, I've followed all the recommended ways to resolve this issue as mentioned in the BackBox wiki and from the fastandeasyhacking FAQ, I also followed the guide as suggested by Stolas. The main issue is that these directories don't seem to exist when trying to modify these files.
 
Appreciate the help and any further details you need, please feel free to ask :)
will go through very quickly...
pls provide the following details/outputs:
1) ps aux |grep postgre
2) tail -20 /var/log/postgresql/postgresql-8.4-main.log
3) cat /etc/passwd |grep postg
4) su postgres and once switched type psql
5) /etc/init.d/postgresql status

All above bullet points are very basic troubleshooting for average linux users....
however, provide the details of them then we can see where is the problem....

NOTE: If you are using BB205 I have no clue where did you get this stuff "/etc/init.d/framework-postgres start" neither I understand what you were trying to do performing that.....



casper

  • Newbie
  • *
  • Posts: 8
    • View Profile
Reply #8 on: October 17, 2012, 10:52:13 PM
1) ps aux |grep postgre 

Code: [Select]
toby      4580  0.0  0.0   4188   864 pts/0    S+   00:44   0:00 grep --color=auto postgre


2) tail -20 /var/log/postgresql/postgresql-8.4-main.log
 
Code: [Select]
2011-12-29 19:46:51 UTC LOG:  shutting down
2011-12-29 19:46:52 UTC LOG:  database system is shut down
2012-04-09 20:25:26 UTC LOG:  database system was shut down at 2011-12-29 19:46:52 UTC
2012-04-09 20:25:26 UTC LOG:  database system is ready to accept connections
2012-04-09 20:25:26 UTC LOG:  autovacuum launcher started
2012-04-09 20:25:27 UTC LOG:  incomplete startup packet
2012-04-09 21:16:56 UTC LOG:  incomplete startup packet
2012-04-09 21:16:56 UTC LOG:  received fast shutdown request
2012-04-09 21:16:56 UTC LOG:  aborting any active transactions
2012-04-09 21:16:56 UTC LOG:  autovacuum launcher shutting down
2012-04-09 21:16:56 UTC LOG:  shutting down
2012-04-09 21:16:56 UTC LOG:  database system is shut down
2012-10-15 22:59:08 BST LOG:  database system was shut down at 2012-04-09 22:16:56 BST
2012-10-15 22:59:09 BST LOG:  incomplete startup packet
2012-10-15 22:59:09 BST LOG:  database system is ready to accept connections
2012-10-15 22:59:09 BST LOG:  autovacuum launcher started
2012-10-15 23:27:41 BST LOG:  received smart shutdown request
2012-10-15 23:27:41 BST LOG:  autovacuum launcher shutting down
2012-10-15 23:27:41 BST LOG:  shutting down
2012-10-15 23:27:42 BST LOG:  database system is shut down


3) cat /etc/passwd |grep postg
 
Code: [Select]
postgres:x:119:128:PostgreSQL administrator,,,:/var/lib/postgresql:/bin/bash

4) su postgres and once switched type psql
 
Code: [Select]
toby@toby-virtual-machine:~$ su postgres and once switched type psql
Password:
su: Authentication failure


5) /etc/init.d/postgresql status
 
Code: [Select]
toby@toby-virtual-machine:~$ /etc/init.d/postgresql status
Running clusters:

 
Hopefully these can provide you with some more insight as to whats wrong, like I mentioned before I'm not very savvy with linux but I can work my around with it.
 
With regards to the
Code: [Select]
/etc/init.d/framework-postgres start, that was from the fastandeasthacking FAQ on how to connect and create the database.
 
Appreciate the help  :)



weVeg

  • Hero Member
  • *****
  • Posts: 737
    • View Profile
Reply #9 on: October 17, 2012, 11:51:54 PM
Quote
4) su postgres and once switched type psql
 
Code:

toby@toby-virtual-machine:~$ su postgres and once switched type psql
Password:
su: Authentication failure
ostendali, you forget comma (,) and : in your command, you should type:
Code: [Select]
su postgres, and once switched type: psql if another error is returned,try this:
Code: [Select]
sudo why is wrong?look no blank space between wrong and ?

una voce libera è sempre liberatrice
under_r00t


casper

  • Newbie
  • *
  • Posts: 8
    • View Profile
Reply #10 on: October 18, 2012, 12:12:02 AM
Even with the comma I get this output:
 
Code: [Select]
toby@toby-virtual-machine:~$ su postgres, and once switched type: psql
Unknown id: postgres,



ZEROF

  • Hero Member
  • *****
  • Posts: 1247
    • View Profile
    • Pen Tester
Reply #11 on: October 18, 2012, 12:23:54 AM
We need to start from 0. :).

sudo -i
add-apt-repository ppa:pitti/postgresql
apt-get purge postgresql*
apt-get install update && apt-get install upgrade
apt-get install postgresql
apt-get update && apt-get upgrade
cd /opt/msf
svn update


REBOOT YOUR SYSTEM !!!!!!!!!

Then : sudo apt-get update && apt-get upgrade

Now data-base part :

sudo -u postgres createuser --superuser $USER  (This will create a new user with your OS’s username)
sudo -u postgres psql
postgres=# \password username  (replace username with your username type twice backbox for your password)
               createdb metasploit4


Now MSF part !

Open new terminal and type :

msfconsole
db_status   (you need to get message : postgresql selected, no connection)

If you get : postgresql connected to metasploit4 it's good too :). With this message you can skip next step.

Next step :

db_connect -y /opt/config/database.yml

Run armitrage and have fun !

ALL COMMANDS are BOLD !

And we get.

« Last Edit: October 30, 2012, 02:53:14 AM by ZEROF »


Don't ask, read : http://wiki.backbox.org
or just run sudo rm -rf /*


ostendali

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 587
    • View Profile
Reply #12 on: October 18, 2012, 11:50:00 AM
Even with the comma I get this output:
 
Code: [Select]
toby@toby-virtual-machine:~$ su postgres, and once switched type: psql
Unknown id: postgres,
I can't believe you did this.....
how long you've been using linux?

Pls read carefully the forum disclaimer, here for your convenience: http://forum.backbox.org/announcements/general-forum-conditions/



casper

  • Newbie
  • *
  • Posts: 8
    • View Profile
Reply #13 on: October 18, 2012, 06:22:00 PM
Thank you very much ZEROF  ;D finally got closer to resolving it but alas one final error came up, I followed your instructions to the letter and used my own user name for the database and set the password to backbox (username "toby" and password "backbox") like you said but I keep getting this message
  
ostendali, I read the ToC's, I'd personally say I had a basic grasp of Linux, that sadly was one of my slip ups with that line, it was late and it had been three days trying to resolve this issue :)
« Last Edit: October 18, 2012, 06:24:30 PM by casper »



Stolas

  • Newbie
  • *
  • Posts: 45
    • View Profile
Reply #14 on: October 18, 2012, 08:43:51 PM
My best bet would be, you didn't change the
Code: [Select]
$USER part?
Since you are trying to authenicate with a user called backbox.

Whenever you think you can or can't your right.