Saturday, December 27, 2014

How to create a new Postgresql database and new user to work with Metasploit Framework


 
  In this tutorial, I'm going to share on how to create a new Postgresql database and new user to work with Metasploit Framework .This tutorial might be useful to those who have problems connecting to pre install Metasploit Framework either when you are running on Backtrack or Kali Linux.

In this tutorial,I will create a new database name "msf" and create a user name "msf" with password "metasploit". You will need to use this information when configure "database.yml" file . If you plan to use different database and user name please remember the details

Tutorial rundown

1) Run Postgresql service
2) Create new Postgresql user and database
3) Edit "database.yml" file
4) Run Metasploit service
5)Run the metasploit framework and check the connected database.


Steps

1) Run Postgresql service by typing

orca@omura:~$sudo service postgresql start






2) Create new Postgresql user and database

2.1) Create new user in Postgresql by login to postgres in root

orca@omura:~$sudo -su postgres
postgres@omura:/home/orca$ createuser msf -P -S -R -D
Enter password for new role :
Enter it again:



2.2) Create new database in Postgresql

postgres@omura:/home/orca$ createdb -o msf msf
postgres@omura:/home/orca$ exit



3) Edit "database.yml" file

3.1) Copy "database.yml" file from /opt/metasploit/apps/pro/ui/config/database.yml to home/.msf4 folder

orca@omura:~$sudo cp /opt/metasploit/apps/pro/ui/config/database.yml  /home/orca/.msf4





NOTE :If you already have database.yml file in /home/.msf4 folder , you can skip this step.


3.2)Change the file permission and edit database.yml file details


orca@omura:~/.msf4$sudo chmod 755 database.yml 



3.3)Edit  "database.yml" file with the information that you use to create user and database.

production:
  adapter :"postgresql"
  database: "msf"
  username: "msf"
  password:"metasploit"
  port:5432
  host: "localhost"
  pool:256
  timeout:5



4) Run Metasploit service

orca@omura:~$sudo service metasploit start 




5)Run the metasploit framework and check the connected database

5.1) Click "Applications>Kali Linux >Top 10 tools> Metasploit Framework "



5.2)Check the connected database

msf> db_status









Saturday, December 13, 2014

How to run metasploit (missing database.yml) and make postgresql,metasploit run at startup


    In this tutorial, I'm going to share on How to run metasploit (missing database.yml) and make Postgresql,Metasploit to run at startup. For official documentation on running Metasploit in Kali Linux, please visit here.


Steps

1) Run postgresql and metasploit service on the machine by typing

orca@omura:~$sudo service postgresql start

orca@omura:~$sudo service metasploit start

Starting postgresql and Metasploit service

2)Run Metasploit framework by going  to Applications>Kali Linux>Top 10 security tools>Metasploit framework

 
Run Metasploit Framework




3) Once Metasploit finished loading, check the database connection by typing
 
msf>db_status



No connected database.

4)If metasploit does not connect to postgresql database, check for "database.yml" file in .msf4 file in home directory


No database.yml file

4.1)Copy database.yml file from opt directory by typing


orca@omura:~$sudo cp /opt/metasploit/apps/pro/ui/config/database.yml /home/orca/.msf4  


Copy file from /opt

4.2) Change file permission by typing

orca@omura:~/.msf4$ sudo chmod 755 database.yml

Change file permission

5)Run Metasploit framework by going  to Applications>Kali Linux>Top 10 security tools>Metasploit framework and check database connection status

Check the database connection
(If it is not connected, you can try to create a new database and new user to make it work with metasploit . I will share in my future tutorial on how to do this)

6)Make postgresql and metasploit service to run at startup by typing

orca@omura:~/.msf4$ sudo update-rc.d postgresql enable

orca@omura:~/.msf4$ sudo update-rc.d metasploit enable



Updating Postgresql and Metasploit service to run at startup

 7)Reboot your machine and try to run Metasploit framework straight after you log on.

System reboot





Monday, November 10, 2014

How to add non root user in using Kali Linux Wireshark


 

  In this tutorial I'm going to share on How to add non root user in using Kali Linux Wireshark .In order for Wireshark to capture packet, it need to use dumpcap file. You will get  "There are no interfaces on which capture can be done "error if you don't configure the  new user to use dumpcap file.

No interface to capture

1)Add group that will use dump cap file and add user in the group.
In this example, I create a group called wireshark.

1.1) creater a group
orca@omura:~$sudo groupadd wireshark


1.2) add user in the group

orca@omura:~$sudo usermod -a -G wireshark orca


Add group and add user

2) Make  dumpcap file to work with wireshark group.and configure the network

2.1)Make dumpcap file to work with "wireshark group" and change file permission


orca@omura:~$sudo chgrp wireshark /usr/bin/dumpcap

orca@omura:~$sudo chmod 750 /usr/bin/dumpcap


2.2) Set network privileges for dumpcap


orca@omura:~$sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/dumpcap


setting network privileges for dumpcap


3) reboot  system

orca@omura:~$sudo reboot   




System reboot


4)Log in with the new user account and try to capture using Wireshark


Wireshark should able to work




Thursday, October 30, 2014

How to add user in Kali Linux using Graphical User Interface GUI


   

  In this post, I'm going to share how to add user in Kali Linux using Graphical User Interface or GUI


Steps


1.In Kali Linux, click Applications>System tools> Preferences> System Settings

Kali Linux system settings

2.)Once the application pop up,search for "User Accounts"  and click to run the application

User accounts


3.)Click the  "+" sign on the bottom of left hand side to add new user


Add new user


4)Type in "Full name" , "Username" and  "Account type" to create new account



5)Once the account has been created , Click the new user and  set user password.


Set new user password


 6)Set new user password and click "Change" for it to take effect.


Choose a strong and easy to remember password

7)To test the new user, Click "Switch User" in Kali Linux panel.

Switch User

 8)You will be prompt with new user login. Login with your new user id to test .









Friday, September 26, 2014

How to make sudo password display as asterisk in Linux terminal



  
    In this tutorial, I'm going to share on how to make password display as asterisk in the terminal.Normally when we type our password in the terminal, nothing is display. This simple tips will help you not to delete all the characters when you misspell your sudo password. :)

      To do this , you need to edit sudoer file in /etc directory. Please make sure that you  use visudo command to edit this file. visudo command has  the function to edit the file and checking it syntax upon saving. You will not want to mess with this file as if something goes wrong, you will having problem in getting root privilege.

Steps

1)Run Visudo command to edit  /etc/sudoers file

Run visudo command

2)Edit the file and save.

2.1 ) Add "Defaults" and "pwfeedback" to the file 



2.2) Press "Ctrl -X" and press "Y" to save the file .

3)Exit current terminal and open new one for it to take effect.

run any sudo command and see the asterisk for password


Friday, September 5, 2014

How to add Kali Linux repos,Guest addition and share folder with host in Ubuntu Virtualbox




  In this post, I'm going to share how to  add Kali Linux repositories, guest addition and share folder with host in Ubuntu virtualbox.  Please visit here for Kali Linux official guide.

   I was having problem with my linux header file to install on my system and I think, this is the easiest way to get it done. I will share the video later on my channel .


STEPS

1)Adding reposistories Steps

1.1) Check your repositories at "etc/apt/sources.list" file and edit it if needed. By default it should have below  link . Please read  on Kali Linux page for more details .

deb http://http.kali.org/kali kali main non-free contrib
deb http://security.kali.org/kali-security kali/updates main contrib non-free
deb-src http://http.kali.org/kali kali main non-free contrib
deb-src http://security.kali.org/kali-security kali/updates main contrib non-free

1.2)Open the terminal and  type 



root@Positive-Space:~$  cat etc/apt/sources.list



check the sources.list


1.3) Edit the list if needed

root@Positive-Space:~$  vi etc/apt/sources.list


to insert in vi , press i and  add above link in the file . After finished edit sources.list file , press Esc  followed with :wq! to write,save and exit vi editor.

edit the file





2)Adding Kali Linux Guest addition 

2.1) Run in terminal
root@Positive-Space:~$  apt-get install virtualbox-guest-x11



apt-get install virtualbox-guest-x11

 2.2) Choose "No" for keeping  default version




2.3)Reboot Kali Linux to activate the new setting.



2.4) Kali Linux will be in full screen after reboot.

Full screen setting 


3)Adding share folder with host 

3.1)Create a new folder in your host




3.2) Go to Virtualbox Kali Linux "settings" and go to shared folders




3.3)Right click and add a "shared folder" by choosing the newly created folder



add shared folder

Choose other

Select folder location
 3.4) Tick  "Auto mount" and "make permanent" selection

tick auto mount and make permanent box

Added folder


3.5) Go to Kali Linux and reboot the system.



3.6) Once rebooted, Click Place> and look under media  for newly shared folder

shared folder
 3.7)Click the folder  and add it to Bookmarks by clicking  "Bookmarks>Add bookmark"


add bookmark

3.8) Bookmark will be added on left hand panel

Bookmark folder will appear on left hand corner