DB MSF Readme

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 3

nokay i made this sepreatly bcz of the db in msf mainly i will cover the db in this

one as it's name suggest

msf can work with 2 data base 1. mysql and 2. postgreSQL

we will cover the postgresql bcz it is the default one we will stick with this one.

first we will start the db okay here are two way the first way is with the system
init.d script which is in this book

and the second one is with the systemctl cmd

way one:- `/etc/init.d/postgresql-8.3 start` copy paste this in console

and my way or 2 `systemctl start postgresql `

after this the service will start and it will through some detail where and what
shit/lib in use

main point we have to connect the db with msf and this require a username password
and host db name and all

same here two things come in play here

username is postgres with the password


toor,msfbook as the database name
WAY ONE:- db_connect postgres:[email protected]/msfbook

-----------------------------------------------------
====================================================

WAY 2 :- `root@kali:~# msfdb init


Creating database user 'msf'
Enter password for new role:
Enter it again:
Creating databases 'msf' and 'msf_test'
Creating configuration file in /usr/share/metasploit-framework/config/database.yml
Creating initial database schema`
==================================================

and now same cmd or way for both

`db_status` to check the sb and making sure we are connected

okay ***// NOTE //*** *the second have work with the lastest version of msf on date
19, july 2021 6:26 pm*

next cmd will be workspace it have some defaults that will be printed on the screen

if you want to delete any of the defaults use the cmd `workspace -a and -d (-a for
creating and -d for delete)`

always use the `-h` for the more info

db_import will be the to import the data you can do this with two ways take example
of nmap scan you can save your scan in `.xml` and then import it or db_import
/root/msfu/nmapscan "the file will be auto-detected"

use the hosts cmd to see the import file and to confirm for sure.
you can use the db_nmap for the same scan that you do with the nmap and with nmap
cmd/flag

BACKING UP OUR DATA OUT OF THE MSF

you can do it very easily with `db_export` command

and that all for the dataa store hope if next will be their you will see this down

hosts cmd services cmd will be used with db if it is too big and help us to narrow
down the search result and help us to exploit

===> services cmd is the one of the most cmd used in the db for checking database
with different ways example

like we have a nmap scan that have some port listed and services in it so we only
want the tcp or http port
so the cmd will go like `services -c name,info -S http` and this will show all the
http ports in all the live hosts
check the help or man page

NOTE:- EVERY FLAG CANNOT BE EXPLAINED OVER HERE CHECK THE HELP/MAN PAGE I KNOW I AM
RIGHTING IT BUT STILL

the result will be seprated it will not be overwritten and you can tell the path
and ask it to save their with this ext`.csv`

creds cmd will show any credentials found if nmap did it.
It will auto saved to the cred and can be seen with creds cmd -u for user and -P
for password for the user to store it

loot -h
this cmd will show any hash dump we did or it have.
same with this it will auto save the hash in it and can be seen with simple loot
cmd

end.....

========================================================
========================================================
that all for the db
now the host and the modules
you can let it your host or bunch of ip and ask other program or moudle to do some
shitty work for you

we have a option to narrow down our search result with the os taste
okay we can scan all the ips with same module at a same time with selecting the
module and the hosts cmd giving it its need

You might also like