Announcement

Collapse
No announcement yet.

Some useful commands in cmd

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Some useful commands in cmd

    First thing you need to know is some very helpfull commands to use on CMD(Command Prompt).

    In case you don't know how to get CMD open in your box, then click on Start, then Run, then type "cmd" (no quotes, off course... you know the drill).


    In case you don't know some of them, then just type the command on CMD and hit enter. A little help will show up in your screen. Read it and understand what the command does.

    Lets start easy...

    1) ping : This command will allow you to know if the host you pinging is alive, which means if it is up at the time of executing the "ping" command.

    ping x.x.x.x (x is the IP address)

    or

    ping http://www.whatever.com (http://www.whatever.com is the website you want to ping, but you don't know the IP)

    OBS: Keep in mind that if the host you pinging is blocking ICMP packets, then the result will be host down. Oct 11 AnUj
    nslookup
    2) nslookup : This command has many functionalities.
    One is for resolving DNS into IP.
    Lets say you know the website URL but you don't know its IP(and you want to find out).

    nslookup
    Code:
    http://www.whatever.com
    (http://www.whatever.com is the website you want to find out the IP)

    Now, another really nice function of nslookup is to find out IP of specific Mail Severs.

    nslookup (enter)
    set type=mx (enter)
    yahoo.com

    This command will give you the mail server IP of yahoo.com. You can use whatever server you want and if it is listed on DNS, then you get the IP. Simple, isn't it?

    OK, now why would you want to have an IP of a mail server?
    To send spoofed mail to your friends or even for SE. Oct 11 AnUj
    tracert
    3) tracert : This command will give you the hops that a packet will travel to reach its final destination.

    OBS: This command is good to know the route a packet takes before it goes to the target box.

    tracert x.x.x.x (x is the IP address)

    or

    tracert http://www.whatever.com (http://www.whatever.com is the website you don't know the IP) Oct 11 AnUj
    arp
    This command will show you the arp table. This is good to know if someone is doing arp poisoning in your LAN.

    arp -a Oct 11 AnUj
    route
    This command will show you the routing table, gateway, interface and metric.

    route print Oct 11 AnUj
    ipconfig
    This command will show tons of very helpful things.
    Your IP, gateway, dns in use.

    ipconfig Oct 11 AnUj
    netstat
    This command will show you connection to your box.

    netstat

    or

    netstat -a (this will show you all the listening ports and connection with DNS names)
    netstat -n (this will show you all the open connection with IP addresses)
    netstat -an (this will combined both of the above) Oct 11 AnUj
    nbtstat
    This command will show you the netbios name of the target box.

    nbtstat -A x.x.x.x (x is the IP address)

    nbtstat -a computername


    net view x.x.x.x or computername (will list the available sharing folders on the target box)


    Now some hints:

    net use \ipaddressipc$ "" /user:administrator
    (this command will allow you to connect to the target box as administrator)

    Now if you want to connect to the target box and browse the entire C drive, then use this command:

    net use K: \computernameC$ (this will create a virtual drive on your "my computer" fold Oct 11 AnUj
    And least but not last, the "help" command.

    whatevercommand /help

    or

    whatevercommand /?
Working...
X