Networking Linux Command for Hacker
Introduction to Networking Linux Commands
In this section, the speaker introduces a powerful networking Linux command that is essential for hackers, whether beginners or experienced professionals.
Command: ifconfig
- The
ifconfigcommand configures network interfaces on Unix and Linux systems. It provides information about active network interfaces, including IP addresses and MAC addresses.
- To activate a network interface, use
ifconfig interface up, and to deactivate it, useifconfig interface down.
- Changing the MAC address can be done with
ifconfig interface HW ether, but remember to deactivate the interface before making changes.
Command: IP Command
- The IP Command is replacing
ifconfigin modern Linux distributions. It allows for advanced network configurations such as assigning IP addresses, configuring routing tables, and managing virtual interfaces.
Command: iwconfig
iwconfigconfigures wireless network interfaces on Unix and Linux systems. It provides details about wireless interfaces like names, standards, signal strength, etc.
- Common uses include setting ESSID with
iwconfig wireless interface essidand changing operating modes with commands likeiwconfig wlan0 mode managed.
Command: Ping
- The Ping command tests host reachability on an IP network by sending ICMP Echo request packets. It measures round trip time and can be customized for packet number, time intervals, specific network interfaces, and timeouts.
Command: net discover
- Net discover is a network scanning tool in Linux used to find devices on a local network by sending ARP requests. It displays active devices along with their IP and MAC addresses.
Essential Networking Commands on Linux
In this section, the speaker introduces the "trace route" command in Linux, explaining its purpose and how it helps trace the path packets take to reach a destination host on a network.
Trace Route Command
- The trace route command in Linux is used to trace the route that packets take to reach a destination host on a network. It helps discover the routers or hops that a packet traverses from the source to the destination.
- Basic usage involves sending packets to a specified destination and displaying the list of routers or devices that the packets traverse along with round trip times for each hop. Common options include displaying hop addresses as IP addresses instead of resolving them to host names.
- Additional options for trace route include setting the number of queries to send to each hop and specifying the maximum number of hops before giving up. An example includes sending five queries per hop and limiting the maximum number of hops to 20.
Networking Commands Continued
This section delves into another networking command, "netstat," which provides information about network connections, routing tables, interface statistics, masquerade connections, and multicast memberships.
Netstat Command
- Netstat in Linux displays network-related information such as network connections, routing tables, interface statistics, masquerade connections, and multicast memberships. Despite being deprecated on many distributions in favor of SS and IP commands, netstat remains available on various systems.
- Common uses of netstat include displaying all active network connections (metat -a), showing listening ports (nitat -L), providing network statistics (netstat -S), and displaying routing tables (netstat -R). Output may vary based on versions and distributions; exploring SS and IP commands is recommended for more up-to-date information.
TCP Dump Command Overview
The TCP dump command is introduced as a powerful tool for capturing and analyzing network traffic by displaying TCP, UDP, and other packets transmitted or received over an attached network.
TCP Dump Command Usage
- TCP dump is a command-line packet analyzer tool used for capturing and analyzing network traffic by displaying TCP, UDP, and other packets transmitted or received over an attached network interface. It offers various filtering options like capturing packets on specific interfaces by protocol or IP address.
- Examples include capturing packets on specific interfaces (pseudo TCP dump -i interface) requiring superuser privileges for certain operations like saving captured packets to files named output.pcap for later analysis with tools like Wireshark. TCP dump's detailed output aids in troubleshooting Network issues but requires understanding networking protocols for interpretation while emphasizing responsible usage due to privacy concerns.