What is a MAC Address
* MAC stands for Media Access Control.
* It's a unique number assigned to each network interface card (NIC).
* Also called physical address, hardware address, network adapter address
* Used in media access control protocol sublayer.
How to Find a Machine MAC Address
Most Unix Machines
* /sbin/ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:30:A6:C0:1F:C0
eth1 Link encap:Ethernet HWaddr 00:30:B6:C0:F7:FA
Windows Machines
* ipconfig /all
Ethernet adapter Local Area Connection:
Media State . . . . . . . . . . . : Media disconnected
Description . . . . . . . . . . . : Broadcom NetXtreme 57xx Gigabit Cont
roller
Physical Address. . . . . . . . . : 00-1F-23-1D-00-3D
Ethernet adapter Wireless Network Connection:
Connection-specific DNS Suffix . : home
Description . . . . . . . . . . . : Intel(R) PRO/Wireless 3945ABG Networ
k Connection
Physical Address. . . . . . . . . : 00-1F-AE-23-28-67
Reference
* http://en.wikipedia.org/wiki/MAC_address
* http://www.coffer.com/mac_info/locate-unix.html
Filed under: Linux, WinOS, unix | |Comments off
Application Commands
ACCWIZ.EXE - Accessibility Wizard
BCKGZM.EXE - Backgammon
CALC.EXE - Calculator
CHARMAP.EXE - Character Map
CHKRZM.EXE - Checkers
CLEANMGR.EXE - Disk Space Cleanup Manager
CLICONFG.EXE - SQL Client Configuration Utility
CLIPBRD.EXE - Clipbook Viewer
CLSPACK.EXE - Class Package Export Tool
CMD.EXE - Command Line
CMSTP.EXE - Connection Manager Profile Installer
CONF.EXE - NetMeeting
CONTROL.EXE - Control Panel
DCOMCNFG.EXE - Component Services
DDESHARE.EXE - DDE Share
DIALER.EXE - Phone Dialer
DRWATSON.EXE - Doctor Watson v1.00b
DRWTSN32.EXE - Doctor Watson Settings
DVDPLAY.EXE - DVD Player
DXDIAG.EXE - DirectX Diagnostics
EUDCEDIT.EXE - Private Character Editor
EVENTVWR.EXE - Event Viewer
EXPLORER.EXE - Windows Explorer
FREECELL.EXE - Free Cell
FXSCLNT.EXE - Fax Console
FXSCOVER.EXE - Fax Cover Page Editor
FXSEND.EXE - MS Fax Send Note Utility
HELPCTR.EXE - Help and Support
HRTZZM.EXE - Internet Hearts
HYPERTRM.EXE - HyperTerminal
ICWCONN1.EXE - Internet Connection Wizard
IEXPLORE.EXE - Internet Explorer
IEXPRESS.EXE - IExpress 2.0
INETWIZ.EXE - Setup Your Internet Connection
INSTALL.EXE - User’s Folder
LOGOFF.EXE - System Logoff
MAGNIFY.EXE - Microsoft Magnifier
MIGWIZ.EXE - File and Settings Transfer Wizard
MMC.EXE - Microsoft Management Console
MOBSYNC.EXE - Microsoft Synchronization Manager
MOVIEMK.EXE - Windows Movie Maker
MPLAY32.EXE - Windows Media Player version 5.1
MPLAYER2.EXE - Windows Media Player Version 6.4.09.1120
MSCONFIG.EXE - System Configuration Utility
MSHEARTS.EXE - Hearts
MSIMN.EXE - Outlook Express
MSINFO32.EXE - System Information
MSMSGS.EXE - Windows Messenger
MSN6.EXE - MSN Explorer
MSPAINT.EXE - Paint
MSTSC.EXE - Remote Desktop Connection
NARRATOR.EXE - Microsoft Narrator
NETSETUP.EXE - Network Setup Wizard
NOTEPAD.EXE - Notepad
NSLOOKUP.EXE - NSLookup Application
NTSD.EXE - Symbolic Debugger for Windows 2000
ODBCAD32.EXE - ODBC Data Source Administrator
OSK.EXE - On Screen Keyboard
OSUNINST.EXE - Windows Uninstall Utility
PACKAGER.EXE - Object Packager
PBRUSH.EXE - Paint
PERFMON.EXE - Performance Monitor
PINBALL.EXE - Pinball
PROGMAN.EXE - Program Manager
RASPHONE.EXE - Remote Access Phonebook
REGEDIT.EXE - Registry Editor
REGEDT32.EXE - Registry Editor
RESET.EXE - Resets Session
RSTRUI.EXE - System Restore
RTCSHARE.EXE - RTC Application Sharing
RVSEZM.EXE - Reversi
SFC.EXE - System File Checker
SHRPUBW.EXE - Create Shared Folder
SHUTDOWN.EXE - System Shutdown
SHVLZM.EXE - Spades
SIGVERIF.EXE - File Signature Verification
SNDREC32.EXE - Sound Recorder
SNDVOL32.EXE - Sound Volume
SOL.EXE - Solitaire
SPIDER.EXE - Spider Solitaire
SYNCAPP.EXE - Create A Briefcase
SYSEDIT.EXE - System Configuration Editor
SYSKEY.EXE - SAM Lock Tool
TABLE30.EXE - User’s Folder
TASKMGR.EXE - Task Manager
TELNET.EXE - MS Telnet Client
TOURSTART.EXE - Windows Tour Launcher
TSSHUTDN.EXE - System Shutdown
USERINIT.EXE - My Documents
UTILMAN.EXE - System Utility Manager
VERIFIER.EXE - Driver Verifier Manager
WAB.EXE - Windows Address Book
WABMIG.EXE - Address Book Import Tool
WIAACMGR.EXE - Scanner and Camera Wizard
WINCHAT.EXE - Windows for Workgroups Chat
WINHELP.EXE - Windows Help Engine
WINHLP32.EXE - Help
WINMINE.EXE - Minesweeper
WINNT32.EXE - User’s Folder
WINVER.EXE - Windows Version Information
WMPLAYER.EXE - Windows Media Player
WRITE.EXE - Wordpad
WRITE.EXE - WordPad
WSCRIPT.EXE - Windows Script Host Settings
WUPDMGR.EXE - Windows Update
Control Panel Applets
ACCESS.CPL - Accessibility Options
APPWIZ.CPL - Add or Remove Programs
DESK.CPL - Display Properties
HDWWIZ.CPL - Add Hardware Wizard
INETCPL.CPL - Internet Explorer Properties
INTL.CPL - Regional and Language Options
JOY.CPL - Game Controllers
MAIN.CPL - Mouse Properties
MMSYS.CPL - Sounds and Audio Device Properties
NCPA.CPL - Network Connections
NUSRMGR.CPL - User Accounts
ODBCCP32.CPL - ODBC Data Source Administrator
POWERCFG.CPL - Power Options Properties
SYSDM.CPL - System Properties
TELEPHON.CPL - Phone and Modem Options
TIMEDATE.CPL - Date and Time Properties
Management Consoles
CERTMGR.MSC - Certificates
CIADV.MSC - Indexing Service
COMPMGMT.MSC - Computer Management
DEVMGMT.MSC - Device Manager
DFRG.MSC - Disk Defragmenter
DISKMGMT.MSC - Disk Management
EVENTVWR.MSC - Event Viewer
FSMGMT.MSC - Shared Folders
LUSRMGR.MSC - Local Users and Groups
NTMSMGR.MSC - Removable Storage
NTMSOPRQ.MSC - Removable Storage Operator Requests
PERFMON.MSC - Performance Monitor
SERVICES.MSC - Services
WMIMGMT.MSC - Windows Management Infrastructure
Other Run Line Commands
CONTROL USERPASSWORDS2 - Conventional User Account Interface
References
http://www.listikal.com/windows-xp-professional-and-home-command-line-commands-run-line-commands/
Filed under: WinOS | |Comments off
Netfilter
Rules
* INPUT
* FORWARD
* OUTPUT
ipchains
* For Linux 2.2 kernels
* Packets destined for locally running daemons: input.
* Packets from remote and destined for locally running daemons: input, forward, output.
* Packets from locally running daemons: output.
iptables
* For Linux 2.4 or later kernels.
* /sbin, /etc/init.d, /etc/sysconfig.
* Packets destined for locally running daemons: input.
* Packets from remote and destined for locally running daemons: forward
* Packets from locally running daemons: output.
# clear all rules
iptables -F
# Default all inputs to drop
iptables -P INPUT DROP
# Allow FTP
iptables \
-A INPUT \ # add new rule to input filter
-i eth0 \ # applies only to eth0
-p tcp \ # applies to tcp protocol
-s any/0 \ # applies to all sources
--sport 1024:65535 \ # applies to all sources and source port from 1024 to 65535
-d MY.NET.IP.ADDR \ # destined for IP
--dport 21 \ # destine for port 21
-j ACCEPT \ # if packet matches, allow it otherwise use default rule
# same for FTP port 20
iptables -A INPUT -i eth0 -p tcp -s any/0 --sport 1024:65535 -d MY.NET.IP.ADDR
--dport 20 -j ACCEPT
# Allow passive FTP
iptables -A INPUT -i eth0 -p tcp -s any/0 --sport 1024:65535 -d MY.NET.IP.ADDR
--dport 1024:65535 -j ACCEPT
# Allow DNS
iptables -A INPUT -i eth0 -p udp -s any/0 --sport 1024:65535 -d MY.NET.IP.ADDR
--dport 53 -j ACCEPT
iptables -A INPUT -i eth0 -p tcp -s any/0 --sport 1024:65535 -d MY.NET.IP.ADDR
--dport 53 -j ACCEPT
# Allow Telnet
iptables -A INPUT -i eth0 -p tcp -s 209.100.100.10 --sport 1024:65535
-d MY.NETWORK.IP.ADDR --dport 23 -j ACCEPT
# Allow SSH
iptables -A INPUT -i eth0 -p tcp -s 209.200.200.10 --sport 1024:65535
-d MY.NETWORK.IP.ADDR --dport 22 -j ACCEPT
# Allow Email
iptables -A INPUT -i eth0 -p tcp ! --syn -s EMAIL.NET.IP.ADDR --sport 25
-d MY.NETWORK.IP.ADDR --dport 1024:65535 -j ACCEPT
# Allow HTTP
iptables -A INPUT -i eth0 -p tcp -d MY.NETWORK.IP.ADDR --dport 80 -j ACCEPT
# Allow HTTPS
iptables -A INPUT -i eth0 -p tcp -d MY.NETWORK.IP.ADDR --dport 443 -j ACCEPT
# Allow ICMP
iptables -A INPUT -i eth0 -p icmp -d MY.NETWORK.IP.ADDR -j ACCEPT
# List all rules
iptables -L -n
# Save rules
/etc/init.d/iptables save
# Start iptables
service iptables start
service iptables stop
Routing Tables
* Configuration is memory only. Need to use script to be permanent.
# Added by system when install a NIC to route all packets to eth0
/sbin/route add --net 209.100.100.0 netmask 255.255.0.0 dev eth0
# Forward packets (acting as router)
/bin/echo 1 > /proc/sys/net/ipv4/ip_forward
# Force all packets destined to 192.168.150.33 to gateway whose ip is 172.24.150.1
/sbin/route add -host 192.168.150.33 gw 172.24.150.1
# Force all packets destined to 192.168.150 network to gate way whose ip is 172.24.150.1
/sbin/route add --net 192.168.150.0 netmask 255.255.255.0 gw 172.24.150.1
# Unmatched packets will be sent to gateway
/sbin/route add --default gw 172.24.150.1
# List routing rules
netstat -rn
route -n
ip route list
Sample Routing Script
#!/bin/bash
#
# Packet Handling Service
#
# chkconfig 2345 55 45
# description: Starts or stops iptables rules and routing
case "$1" in
start)
# Flush (or erase) the current iptables rules
/sbin/iptables -F
/sbin/iptables --table nat -flush
/sbin/iptables --table nat --delete-chain
# Enable the loopback device for all types of packets
# (Normally for packets created by local daemons for delivery
# to local daemons)
/sbin/iptables -A INPUT -i lo -p all -j ACCEPT
/sbin/iptables -A OUTPUT -o lo -p all -j ACCEPT
/sbin/iptables -A FORWARD -o lo -p all -j ACCEPT
# Set the default policies
/sbin/iptables -P INPUT DROP
/sbin/iptables -P FORWARD DROP
/sbin/iptables -P OUTPUT ACCEPT
# NAT
/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
# Allow inbound packets from our private network
/sbin/iptables -A INPUT -i eth1 -j ACCEPT
/sbin/iptables -A FORWARD -i eth1 -j ACCEPT
# Allow packets back in from conversations we initiated
# from the private network.
/sbin/iptables -A FORWARD -i eth0 --match state --state ESTABLISHED,RELATED -j ACCEPT
/sbin/iptables -A INPUT --match state --state ESTABLISHED,RELATED -j ACCEPT
# Allow Sendmail and POP (from anywhere, but really what we
# are allowing here is inbound connections on the eth0 interface).
# (Sendmail and POP are running locally on this machine).
/sbin/iptables -A INPUT --protocol tcp --destination-port 25 -j ACCEPT
/sbin/iptables -A INPUT --protocol tcp --destination-port 110 -j ACCEPT
# Routing Rules --
# Route packets destined for the 192.168.150.0 network using the internal
# gateway machine 172.24.150.1
/sbin/route add -net 192.168.150.0 netmask 255.255.255.0 gw 172.24.150.1
# By default, if we don't know where a packet should be sent we
# assume it should be sent to the Internet router.
/sbin/route add default gw 209.100.100.1
# Now that everything is in place we allow packet forwarding.
echo 1 > /proc/sys/net/ipv4/ip_forward
;;
stop)
# Flush (or erase) the current iptables rules
/sbin/iptables -F
# Set the default policies back to ACCEPT
# (This is not a secure configuration.)
/sbin/iptables -P INPUT ACCEPT
/sbin/iptables -P FORWARD ACCEPT
/sbin/iptables -P OUTPUT ACCEPT
# Remove our routing rules.
/sbin/route del -net 192.168.150.0 netmask 255.255.255.0 gw 172.24.150.1
/sbin/route del default gw 209.100.100.1
# Disable packet forwarding
echo 0 > /proc/sys/net/ipv4/ip_forward
;;
status)
enabled=`/bin/cat /proc/sys/net/ipv4/ip_forward`
if [ "$enabled" -eq 1 ]; then
echo "Running"
else
echo "Down"
fi
;;
*)
echo "Requires start, stop or status"
;;
esac
References
The Linux Enterprise Cluster by Karl Kopper
Filed under: Linux | |Comments off