Thursday, May 21, 2015

tcpdump wirte to screen and file

Basic form:
tcpdump -i interface OPTIONS -w - | tee outputFile | tcpdump -r -

-w - : write data to stdout
tee : write data to file and its own stdout
-r - : read data from stdin

Example:
tcpdump -i enp3s0 udp and port 53 -w - | tee packet.pcap | tcpdump -nn -r -

Tuesday, May 5, 2015

Use iptables for CentOS 7 instead of firewalld

CentOS 7 is now using firewalld instead of iptables. To use iptables, here are the steps:

1. Disable firewalld
systemctrl disable firewalld

2. Stop firewalld
systemctrl stop firewalld

3. Install iptables-services
yum install iptables-services

4. Enable iptables
systemctl enable iptables

5. Start iptables
systemctl start iptables

 6. Configure iptables as usual (/etc/sysconfig/iptables)

Monday, May 4, 2015

Check clients which connect to Mac OS X Wi-Fi Internet Sharing

arp -i bridge100 -a bridge100 may be different on your Mac OSX