Matt-London / Install-Armitage-on-Linux

This is a program that will install Metasploit-Framework and Armitage on to any Debian-based Linux Distro (it can also be adapted to work on Mac). This was made possible using a combination of my own code, darkoperator's, and a nightly Metasploit installer from rapid7.
MIT License
58 stars 47 forks source link

"Setup postgres server" step fails #2

Closed Pesoen closed 3 years ago

Pesoen commented 4 years ago

The two commands it executes here, fail to execute with the error: sudo: createuser msf -P -S -R -D: command not found sudo: createdb -O msf msf: command not found The rest of the install has no errors, so i assume that part works. uname -a output: Linux Pesoen-Thinkpad 4.9.0-11-amd64 #1 SMP Debian 4.9.189-3+deb9u2 (2019-11-11) x86_64 GNU/Linux

Pesoen commented 4 years ago

starting armitage reveals it not being able to find database.yml

Pesoen commented 4 years ago

metasploit starts, but also cannot see any database. have not tested how much of it works yet.

NullDev commented 4 years ago

Same issue for me

Matt-London commented 4 years ago

Sorry for the delay. I will write another program that should remedy this problem and will post it before this Friday. Thank you for bringing this to my attention

Pesoen commented 4 years ago

you are welcome :) and it's okay it took a while, as long as it gets fixed i don't mind 👍

Matt-London commented 4 years ago

Sorry taking longer than expected. Haven't found the time. Once I sit down and do it it'll only take around 10 minutes. I have a fix in mind. If not by tonight expect it by the end of the weekend. Thank you for understanding.

NullDev commented 4 years ago

No rush! Thank you for looking into it :) I haven't had time to debug myself and I'm out of town till Monday. Do you know what causes the issue? If you don't have time, I could look at it and send a PR on Monday.

I've tried to generate a new database with MSF itself (db_init). Works like a charm. Was able to generate a valid database.yml for Armitage as well but a but it seems like the SQL instructions still timeout.

Matt-London commented 4 years ago

Alright try this before I change the code. Basically run this in a root shell:

echo "production:\nadapter: postgresql\ndatabase: msf\nusername: msf\npassword: root\nhost: 127.0.0.1\nport: 5432\npool: 75\ntimeout: 5" > /opt/metasploit-framework/config/database.yml

Sorry for the delay. Let me know how it works.

Pesoen commented 4 years ago

file already exist for me, but running the command seems to complete without anything wrong..

Pesoen commented 4 years ago

quick update, made it work by manually running the "msfdb init" command, and copying the database it creates in my home folder to the root folder. now it works and connects to the database correctly, and seems to work, need to run a test with armitage, but it looks to be working after this.

Pesoen commented 4 years ago

No complaints from armitage, though the network i am currently on is protected, and i cannot find any computers by scanning, it seems to be working as expected.

Pesoen commented 4 years ago

just tested it. my fix with copying the database.yml file created by running msfdb init works as a workaround.

Matt-London commented 3 years ago

Yikes, I'm sorry I never noticed your replies. Glad it works. Let me know if there's anything else you need! I'll close this issue.