Ravindra BagaleCourses & study guides English

tcpdump आणि Linux Network Troubleshooting: Packets capture करा आणि Connection problems step by step सोडवा

कधी कधी प्रत्येक tool 'ठीक' म्हणतो पण users ना errors दिसतात. तेव्हा खरे packets बघावे लागतात. tcpdump interface वरचा traffic capture करतो म्हणजे request पोहोचली का, reply गेली का, आणि काय चुकलं ते सिद्ध करता येतं. हा chapter tcpdump step by step (interfaces, filters, files मधे save, TCP flags वाचणं) आणि मग ip, ss, dig, curl, nc आणि firewall checks सोबत पूर्ण network troubleshooting पद्धत शिकवतो.

या chapter मध्ये तुम्ही काय शिकाल

  • tcpdump ने safely packets capture
  • host, port आणि protocol ने filters
  • pcap files save आणि read
  • TCP flags वाचा: SYN, ACK, RST, FIN
  • Firewalls तपासा: firewalld, iptables, nftables
  • पूर्ण troubleshooting पद्धत

1. रोजचं उदाहरण: दुकानाच्या दारावरचा CCTV

हे का लागतं?

Customer म्हणतो 'मी दुकानात आलो आणि कोणी serve केलं नाही'. Staff म्हणतो 'कोणी आलंच नाही'. तुम्ही दारावरचा CCTV बघता: customer आत आला का? Staff त्याच्याकडे गेला का? तो रागावून गेला का? Video ने निकाल लागतो.

हे काय आहे?

दार = network interface. CCTV = tcpdump. Customer आत = SYN. Staff चं स्वागत = SYN-ACK. Shutter खाली = RST. Owner ला दाखवायचं recording = .pcap file.

कसं करायचं (step by step)

Packets मधे TCP connectionClient SYN पाठवतो (flag S)Server SYN-ACK (S.)Client ACK (.) : connectedData PSH-ACK (P.) नेकोणतीही बाजू बंद करायला FIN (F.)RST (R) म्हणजे 'नाही' किंवा hard abort
SYN ला reply नाही = dropped. SYN मग RST = listener नाही.

2. tcpdump basics: -i, -n, -c

हे का लागतं?

चुकीच्या interface वर, किंवा name lookups चालू ठेवून capture केल्यास output नाही किंवा slow.

हे काय आहे?

Root लागतो. -D interfaces list, -i IFACE एक निवडा (any = सगळे), -n DNS नाही (-nn port names पण नाही), -c N N packets नंतर थांबा, -v/-vv जास्त detail. Busy servers वर नेहमी filter.

कसं करायचं (step by step)

  1. Interfaces.
sudo tcpdump -D

Output:

1.eth0 [Up, Running]
2.any (Pseudo-device that captures on all interfaces)
3.lo [Up, Running, Loopback]

याचा अर्थ: eth0 किंवा any.

  1. दहा packets.
sudo tcpdump -i eth0 -nn -c 10

Output:

10:01:02.1 IP 10.0.1.25.22 > 203.0.113.9.51514: Flags [P.], length 108
10 packets captured

याचा अर्थ: बहुतेक तुमचं SSH.

  1. सापडलं नाही.
tcpdump -i eth0

Output:

tcpdump: eth0: You don't have permission to capture on that device

याचा अर्थ: sudo वापरा.

3. Filters: host, net, port, protocol

हे का लागतं?

Busy server second ला हजारो packets पाठवतो. Filters फक्त महत्त्वाचं दाखवतात.

हे काय आहे?

BPF filters शेवटी: host IP, src host / dst host, net 10.0.3.0/24, port 443, portrange 8000-8100, tcp/udp/icmp. and, or, not, आणि quotes मधे brackets ने जोडा. स्वतःला capture करू नका म्हणून 'not port 22'.

Filterअर्थ
host 10.0.3.40या IP कडे किंवा कडून
src host Xफक्त X कडून
port 5432दोन्ही बाजूचा हा port
tcp / udp / icmpProtocol
not port 22SSH लपवा
net 10.0.3.0/24एक subnet

कसं करायचं (step by step)

  1. Database traffic.
sudo tcpdump -i eth0 -nn host 10.0.3.40 and port 5432

Output:

IP 10.0.1.25.40110 > 10.0.3.40.5432: Flags [S]
IP 10.0.3.40.5432 > 10.0.1.25.40110: Flags [S.]

याचा अर्थ: Handshake ठीक.

  1. फक्त pings.
sudo tcpdump -i any -nn icmp

Output:

IP 10.0.1.25 > 8.8.8.8: ICMP echo request
IP 8.8.8.8 > 10.0.1.25: ICMP echo reply

याचा अर्थ: Request आणि reply.

  1. DNS queries.
sudo tcpdump -i any -nn udp port 53

Output:

IP 10.0.1.25.38211 > 10.0.0.2.53: 4411+ A? shop.example.com.
IP 10.0.0.2.53 > 10.0.1.25.38211: 4411 1/0/0 A 93.184.216.34

याचा अर्थ: प्रश्न आणि उत्तर.

  1. जोडा.
sudo tcpdump -i eth0 -nn 'tcp and (port 80 or port 443) and not host 10.0.1.5'

Output:

(packets)

याचा अर्थ: Brackets भोवती quotes.

4. tcpdump output मधे TCP flags वाचा

हे का लागतं?

Flags नेमकं connection का fail होतं ते सांगतात: dropped, refused किंवा reset.

हे काय आहे?

[S] SYN, [S.] SYN-ACK, [.] ACK, [P.] data, [F.] FIN, [R] किंवा [R.] reset. परत परत [S] आणि काही परत नाही = firewall drop किंवा route नाही. [S] मग [R.] = port closed. Data मग [R] = app ने abort. फक्त SYNs filter: 'tcp[tcpflags] & tcp-syn != 0'.

Flagनावअर्थ
[S]SYNसुरुवात
[S.]SYN-ACKServer तयार
[P.]PUSH-ACKData
[F.]FINनम्र बंद
[R.]RSTनकार/abort

कसं करायचं (step by step)

  1. Firewall ने drop.
sudo tcpdump -i eth0 -nn port 6379

Output:

IP 10.0.1.25.5001 > 10.0.3.41.6379: Flags [S]
IP 10.0.1.25.5001 > 10.0.3.41.6379: Flags [S]
IP 10.0.1.25.5001 > 10.0.3.41.6379: Flags [S]

याचा अर्थ: Retries, उत्तर नाही: timeout.

  1. Refused.
sudo tcpdump -i eth0 -nn port 6380

Output:

IP 10.0.1.25.5002 > 10.0.3.41.6380: Flags [S]
IP 10.0.3.41.6380 > 10.0.1.25.5002: Flags [R.]

याचा अर्थ: Host up, listener नाही.

  1. फक्त नवे connections.
sudo tcpdump -i eth0 -nn 'tcp[tcpflags] & tcp-syn != 0 and tcp[tcpflags] & tcp-ack == 0'

Output:

Flags [S] lines only

याचा अर्थ: Connection attempts मोजा.

5. -w आणि -r: pcap files save आणि read

हे का लागतं?

Incident वेळी capture करून नंतर analyse, किंवा network team किंवा Wireshark ला पाठवायला.

हे काय आहे?

-w file.pcap raw packets लिहितो (screen output नाही). -r file.pcap वाचतो, वाचताना filters जोडता येतात. -C 100 -W 5 पाच 100 MB files rotate. -s 0 full packets (आजचा default). -A ASCII payload, -X hex+ASCII.

कसं करायचं (step by step)

  1. File मधे capture.
sudo tcpdump -i eth0 -nn -c 2000 -w /tmp/api.pcap port 443

Output:

tcpdump: listening on eth0
2000 packets captured

याचा अर्थ: Save झालं.

  1. Read आणि filter.
tcpdump -nn -r /tmp/api.pcap 'tcp[tcpflags] & tcp-rst != 0' | head -3

Output:

IP 10.0.1.25.443 > 198.51.100.7.60211: Flags [R.]

याचा अर्थ: Resets शोधा.

  1. Ring buffer.
sudo tcpdump -i eth0 -nn -C 100 -W 5 -w /var/tmp/ring.pcap port 5432

Output:

(runs until stopped)

याचा अर्थ: Disk कधी भरत नाही.

  1. HTTP text.
sudo tcpdump -i lo -nn -A -c 20 port 8000

Output:

GET /health HTTP/1.1
Host: 127.0.0.1:8000

याचा अर्थ: फक्त plain HTTP; HTTPS encrypted.

6. Firewalls: firewalld

हे का लागतं?

Port listening आणि host आत reachable असू शकतो, तरी host firewall ने blocked.

हे काय आहे?

firewall-cmd --state, --list-all zone, services आणि ports. --add-port=8080/tcp --permanent मग --reload टिकवतो. --add-service=http नावं वापरतो. Ubuntu बहुतेक ufw (ufw status, ufw allow 8080/tcp).

कसं करायचं (step by step)

  1. काय open?
sudo firewall-cmd --list-all

Output:

public (active)
  services: dhcpv6-client ssh
  ports:

याचा अर्थ: फक्त SSH.

  1. 8080 open.
sudo firewall-cmd --add-port=8080/tcp --permanent && sudo firewall-cmd --reload

Output:

success
success

याचा अर्थ: आता allowed.

  1. ufw.
sudo ufw allow 8080/tcp && sudo ufw status

Output:

8080/tcp ALLOW Anywhere

याचा अर्थ: Ubuntu पद्धत.

7. Firewalls: iptables आणि nftables

हे का लागतं?

Docker, Kubernetes आणि जुने servers raw iptables/nft rules जोडतात. वाचता यायला हवं.

हे काय आहे?

iptables -L -n -v --line-numbers counters सह rules; test करताना DROP rule चा counter वाढताना बघा. नव्या systems वर nft list ruleset सगळं. वाढणारे counters rule match झाल्याचं सिद्ध करतात.

कसं करायचं (step by step)

  1. Counters सह.
sudo iptables -L INPUT -n -v --line-numbers

Output:

num pkts bytes target prot source destination
1   9123 1.1M ACCEPT tcp  0.0.0.0/0 0.0.0.0/0 tcp dpt:22
2   41   2.4K DROP   tcp  0.0.0.0/0 0.0.0.0/0 tcp dpt:6379

याचा अर्थ: 6379 वर 41 packets drop.

  1. nftables.
sudo nft list ruleset | head -8

Output:

table inet filter {
  chain input {
    tcp dport 22 accept

याचा अर्थ: नवीन format.

8. Cloud layers: security groups आणि NACLs

हे का लागतं?

Cloud मधे packets server ला पोहोचण्याआधीच block होऊ शकतात. मग server वर tcpdump काहीच दाखवत नाही.

हे काय आहे?

नियम: target वर tcpdump ला SYN दिसला नाही तर block host च्या आधी (security group, NACL, route table, on-prem firewall). SYN दिसतो आणि SYN-ACK जातो पण client ला मिळत नाही तर return path. VPC flow logs ACCEPT/REJECT.

कसं करायचं (step by step)

  1. काही पोहोचत नाही.
sudo tcpdump -i eth0 -nn port 5432 and host 10.0.1.25

Output:

(no packets while client retries)

याचा अर्थ: Security group fix.

  1. AWS CLI ने.
aws ec2 describe-security-groups --group-ids sg-0abc --query 'SecurityGroups[0].IpPermissions[].FromPort'

Output:

[22, 443]

याचा अर्थ: 5432 allowed नाही.

9. पूर्ण troubleshooting पद्धत

हे का लागतं?

लिहिलेली पद्धत शांत ठेवते आणि इतर teams ना स्पष्ट पुरावा देते.

हे काय आहे?

1 Define: कोण काय पोहोचू शकत नाही, कधीपासून. 2 Client: IP, route, DNS (getent, dig). 3 Path: mtr. 4 Port: nc -zv. 5 Server: ss -tulpn, app logs. 6 Firewall: host आणि cloud. 7 Packets: दोन्ही टोकांना एकाच वेळी tcpdump. 8 Fix, मग retest आणि लिहून ठेवा.

कसं करायचं (step by step)

  1. Client बाजू summary.
getent hosts db.internal; nc -zv -w 3 db.internal 5432

Output:

10.0.3.40 db.internal
Ncat: TIMEOUT.

याचा अर्थ: नाव ठीक, port timeout.

  1. Server बाजू.
sudo ss -ltnp | grep 5432; sudo tcpdump -i eth0 -nn -c 5 port 5432

Output:

LISTEN 0.0.0.0:5432
(no packets)

याचा अर्थ: Listening, पण काही येत नाही: cloud firewall.

  1. Fix नंतर.
nc -zv -w 3 db.internal 5432

Output:

Ncat: Connected to 10.0.3.40:5432.

याचा अर्थ: सिद्ध.

10. MTU आणि slow-पण-चालतं problems

हे का लागतं?

छोट्या requests चालतात, मोठे uploads अडकतात. VPNs किंवा tunnels वर बहुतेक MTU problem.

हे काय आहे?

ping -M do -s 1472 HOST fragment न होणारा 1500-byte packet. तो fail पण -s 1372 चालतो तर path MTU कमी. Interface MTU कमी करा (ip link set eth0 mtu 1400) किंवा router वर MSS clamping.

कसं करायचं (step by step)

  1. पूर्ण size fail.
ping -c2 -M do -s 1472 10.8.0.20

Output:

ping: local error: message too long, mtu=1400

याचा अर्थ: Path MTU 1400.

  1. छोटा चालतो.
ping -c2 -M do -s 1372 10.8.0.20

Output:

2 received

याचा अर्थ: Confirmed.

  1. MTU कमी.
sudo ip link set eth0 mtu 1400

Output:

(no output)

याचा अर्थ: तात्पुरतं; network config मधे permanent.

11. Network issues वेळी logs वाचा

हे का लागतं?

Kernel आणि services drops, resets आणि timeouts log करतात जे कारणाकडे नेतात.

हे काय आहे?

journalctl -k kernel messages (link down, conntrack table full). App बाजूसाठी journalctl -u nginx --since '10 min ago'. Driver issues साठी dmesg -T | grep -i eth. Retransmits साठी nstat किंवा ss -s.

कसं करायचं (step by step)

  1. conntrack full.
journalctl -k --since '1 hour ago' | grep -i conntrack

Output:

nf_conntrack: table full, dropping packet

याचा अर्थ: nf_conntrack_max वाढवा.

  1. Link flapping.
dmesg -T | grep -i 'link is'

Output:

eth0: Link is Down
eth0: Link is Up

याचा अर्थ: Cable किंवा NIC issue.

  1. Retransmits.
nstat -az TcpRetransSegs

Output:

TcpRetransSegs 18822

याचा अर्थ: पटकन वाढतं = packet loss.

12. अनेक industries मधली खरी उदाहरणं

हे का लागतं?

तेच Linux skill प्रत्येक प्रकारच्या company मध्ये लागतं. वेगवेगळ्या ठिकाणी पाहिलं की लक्षात राहतं.

हे काय आहे?

प्रत्येक row म्हणजे एक काल्पनिक team. कोण हे वापरतं आणि कसं ते दाखवते.

कसं करायचं (step by step)

Team आणि शहरते कसं वापरतातCommand
Shruti, payments, PuneIncidents वेळी दोन्ही टोकांना capturesudo tcpdump -i eth0 -nn -w /tmp/pay.pcap port 443
Tom, SaaS, DublinAPI servers वर ring bufferstcpdump -C 100 -W 5 -w ring.pcap
Mei, e-sports, ShanghaiVPN links वर MTU issuesping -M do -s 1472 HOST
Joseph, NGO, Kampalaiptables countersiptables -L -n -v
Ana, airline, Madridconntrack messagesjournalctl -k | grep conntrack
Rahul, college lab, Aurangabadtcpdump ने TCP flags शिकवतोtcpdump -nn port 8000

13. नेहमीच्या errors आणि त्यांचे fixes

हे का लागतं?

हे errors सगळ्यांना येतात. कारण माहीत असलं की तास वाचतात.

हे काय आहे?

आधी नेमका message वाचा. मग खालच्या row शी जुळवा.

कसं करायचं (step by step)

दिसणारा errorका होतंFix कसा करायचा
tcpdump: permission deniedRoot नाहीsudo.
sudo tcpdump -D
tcpdump: eth0: No such device existsचुकीचं interface नावInterfaces list.
sudo tcpdump -D
0 packets capturedचुकीचा interface/filter, किंवा आधीच blocked-i any आणि मोठा filter.
sudo tcpdump -i any -nn host IP
syntax error in filter expressionBrackets quoted नाहीत किंवा typoपूर्ण filter quote.
sudo tcpdump -nn 'port 80 or port 443'
Flags [S] repeated, no replyFirewall ने drop किंवा route नाहीFirewall layers.
sudo firewall-cmd --list-all
Flags [R.] after SYNPort closedService start किंवा port fix.
sudo ss -ltnp
nf_conntrack: table full, dropping packetखूप tracked connectionsLimit वाढवा आणि कारण शोधा.
sudo sysctl net.netfilter.nf_conntrack_max
ping: local error: message too longDF सह MTU पेक्षा मोठा packetPath MTU शोधा.
tracepath HOST
No space left on device (pcap)Capture ने disk भरली-c किंवा -C/-W ring buffer.
sudo tcpdump -C 100 -W 5 -w ring.pcap
FirewallD is not runningfirewalld बंद (कदाचित iptables/nft)कोणता firewall active.
sudo nft list ruleset | head

14. Troubleshooting step by step

हे का लागतं?

दोन्ही टोकांना packets ने सिद्ध करा.

हे काय आहे?

वरून खाली जा. ज्या step ला problem दिसतो तिथे थांबा.

कसं करायचं (step by step)

  1. Client port test.
nc -zv -w 3 HOST PORT
  1. Server listening?
sudo ss -ltnp
  1. SYN पोहोचतो?
sudo tcpdump -i eth0 -nn -c 5 port PORT
  1. Host firewall.
sudo firewall-cmd --list-all
  1. Kernel drops.
journalctl -k -n 50
  1. MTU.
ping -M do -s 1472 HOST

15. Lab 1: Handshake आणि refusal बघा

हे का लागतं?

Open आणि closed port ला connect करताना lo वर capture.

हे काय आहे?

पूर्ण hands-on lab. प्रत्येक step test Linux machine वर करा (EC2 instance, VM किंवा WSL).

कसं करायचं (step by step)

  1. Server सुरू.
python3 -m http.server 8000 --bind 127.0.0.1 &

Output:

Serving HTTP
  1. Capture सुरू.
sudo tcpdump -i lo -nn 'port 8000 or port 8009'

Output:

listening on lo
  1. Open port.
curl -s -o /dev/null http://127.0.0.1:8000/

Output:

Flags [S], [S.], [.], [P.] ...
  1. Closed port.
curl http://127.0.0.1:8009/

Output:

Flags [S] then [R.]
  1. थांबवा.
Ctrl+C

Output:

N packets captured

16. Lab 2: Capture save, read आणि filter

हे का लागतं?

DNS traffic save करून फक्त answers वाचा.

हे काय आहे?

पूर्ण hands-on lab. प्रत्येक step test Linux machine वर करा (EC2 instance, VM किंवा WSL).

कसं करायचं (step by step)

  1. Background capture.
sudo tcpdump -i any -nn -c 20 -w /tmp/dns.pcap udp port 53 &

Output:

listening
  1. Queries.
for n in example.com github.com; do dig +short $n; done

Output:

93.184.216.34 ...
  1. Read.
tcpdump -nn -r /tmp/dns.pcap

Output:

A? example.com. ... A 93.184.216.34
  1. फक्त replies.
tcpdump -nn -r /tmp/dns.pcap 'src port 53'

Output:

... 1/0/0 A ...
  1. साफ.
sudo rm /tmp/dns.pcap

Output:

(no output)

Ravindra Bagale's Tip

Run tcpdump on both the client and the server at the same time. If the client sends SYN and the server never sees it, the problem is in between (firewall, security group, route). If the server sees it and answers, look at the return path. This one test ends most blame games.

17. नेहमी विचारले जाणारे प्रश्न

प्र. Production वर tcpdump safe?

Filters, -c किंवा ring buffers सह हो; सगळं capture टाळा.

प्र. HTTPS content दिसेल?

नाही, encrypted; IPs, ports, sizes आणि TLS handshake दिसतात.

प्र. tcpdump vs Wireshark?

tcpdump servers वर capture; GUI साठी pcap Wireshark मधे.

प्र. -nn म्हणजे?

Host आणि port name lookups नाहीत.

प्र. -i any का?

कोणत्या interface वर traffic ते माहीत नसताना.

प्र. Captures मधे secrets?

असू शकतात (plain HTTP मधे tokens). pcaps सांभाळा आणि delete.

प्र. कोणता firewall?

firewalld state, ufw status, किंवा nft list ruleset.

प्र. RST vs timeout?

RST म्हणजे active 'नाही'; timeout म्हणजे शांतता (drop).

18. मुलाखत प्रश्न आणि उत्तरं

Beginner level

प्र. eth0 वर 10 packets?

sudo tcpdump -i eth0 -c 10.

प्र. Port 443 filter?

tcpdump port 443.

प्र. File मधे save?

tcpdump -w file.pcap.

प्र. Firewall open ports?

firewall-cmd --list-all.

Mid level level

प्र. SYN ला reply नाही म्हणजे?

Packets drop: firewall किंवा route.

प्र. pcap मधून फक्त resets?

tcpdump -r f.pcap 'tcp[tcpflags] & tcp-rst != 0'.

प्र. firewalld मधे 8080 permanent?

--add-port=8080/tcp --permanent मग --reload.

प्र. Captures ने disk भरू नये?

-C आणि -W ring buffer.

Senior level

प्र. API ला कधी कधी timeouts: plan?

mtr reports, दोन्ही टोकांना tcpdump ring buffer, retransmit counters, conntrack, वेळा correlate.

प्र. VPN वर मोठे uploads अडकतात?

MTU/MSS issue; ping -M do ने test करून MTU fix किंवा MSS clamp.

प्र. Server SYN बघतो, SYN-ACK पाठवतो, client timeout?

Return path: asymmetric routing, NACL egress, किंवा reverse firewall.

प्र. Capture safely share?

गरजेचा traffic filter, trim, secrets तपासा, secure transfer.

घरी करून बघा

  1. तुमचा ping आणि curl traffic capture करा, save करा, आणि दिसणारा प्रत्येक flag समजवा.
  2. प्रत्येक step ला एक command असलेली तुमची 8-step troubleshooting checklist लिहा.

सराव Tasks

या scenario बद्दल

Amravati Agro Market हा अमरावती मधला शेती व्यवसाय आहे. Anjali Thakre त्यांचं IT व cloud काम पाहतात. त्यांचे पैसे INR मध्ये मोजले जातात आणि AWS resources ap-south-1 Region मध्ये चालतात. खालच्या tasks मध्ये तुम्ही या lesson मध्ये शिकलेलं वापरून त्यांची खरी कामं करता. सगळी नावं, account IDs, IP addresses व numbers सरावासाठी काल्पनिक आहेत.

0 / 17

सोपं Interfaces list

का: Network incident मधे packets हा पुरावा.

काय करायचं: tcpdump capture करू शकतो ते interfaces.

कसं करायचं:
  1. हे काम करणारा Linux command शोधा.
  2. Task ला लागणारे options (उदा. -r, -h) जोडा.
  3. File नावं, folders किंवा users योग्य क्रमाने लिहा.
  4. System files/users बदलत असाल तर sudo वापरा. Check answer दाबा.

सोपं पाच packets

का: Network incident मधे packets हा पुरावा.

काय करायचं: ens5 वर name lookups शिवाय 5 packets.

कसं करायचं:
  1. हे काम करणारा Linux command शोधा.
  2. Task ला लागणारे options (उदा. -r, -h) जोडा.
  3. File नावं, folders किंवा users योग्य क्रमाने लिहा.
  4. System files/users बदलत असाल तर sudo वापरा. Check answer दाबा.

सोपं एक port

का: Network incident मधे packets हा पुरावा.

काय करायचं: ens5 वर port 3306 traffic, numeric.

कसं करायचं:
  1. हे काम करणारा Linux command शोधा.
  2. Task ला लागणारे options (उदा. -r, -h) जोडा.
  3. File नावं, folders किंवा users योग्य क्रमाने लिहा.
  4. System files/users बदलत असाल तर sudo वापरा. Check answer दाबा.

सोपं फक्त ICMP

का: Network incident मधे packets हा पुरावा.

काय करायचं: ens5 वर फक्त ICMP, numeric.

कसं करायचं:
  1. हे काम करणारा Linux command शोधा.
  2. Task ला लागणारे options (उदा. -r, -h) जोडा.
  3. File नावं, folders किंवा users योग्य क्रमाने लिहा.
  4. System files/users बदलत असाल तर sudo वापरा. Check answer दाबा.

सोपं Capture read

का: Network incident मधे packets हा पुरावा.

काय करायचं: Name lookups शिवाय /tmp/tls.pcap वाचा.

कसं करायचं:
  1. हे काम करणारा Linux command शोधा.
  2. Task ला लागणारे options (उदा. -r, -h) जोडा.
  3. File नावं, folders किंवा users योग्य क्रमाने लिहा.
  4. System files/users बदलत असाल तर sudo वापरा. Check answer दाबा.

सोपं Firewall rules

का: Network incident मधे packets हा पुरावा.

काय करायचं: public zone च्या सगळ्या firewalld settings.

कसं करायचं:
  1. हे काम करणारा Linux command शोधा.
  2. Task ला लागणारे options (उदा. -r, -h) जोडा.
  3. File नावं, folders किंवा users योग्य क्रमाने लिहा.
  4. System files/users बदलत असाल तर sudo वापरा. Check answer दाबा.

सोपं Firewall reload

का: Network incident मधे packets हा पुरावा.

काय करायचं: State सह firewalld पूर्ण reload.

कसं करायचं:
  1. हे काम करणारा Linux command शोधा.
  2. Task ला लागणारे options (उदा. -r, -h) जोडा.
  3. File नावं, folders किंवा users योग्य क्रमाने लिहा.
  4. System files/users बदलत असाल तर sudo वापरा. Check answer दाबा.

सोपं nftables rules

का: Network incident मधे packets हा पुरावा.

काय करायचं: inet family ची फक्त filter table.

कसं करायचं:
  1. हे काम करणारा Linux command शोधा.
  2. Task ला लागणारे options (उदा. -r, -h) जोडा.
  3. File नावं, folders किंवा users योग्य क्रमाने लिहा.
  4. System files/users बदलत असाल तर sudo वापरा. Check answer दाबा.

मध्यम एक host

का: Network incident मधे packets हा पुरावा.

काय करायचं: कोणत्याही interface वर 10.0.7.21 कडे किंवा कडून traffic, numeric.

कसं करायचं:
  1. हे काम करणारा Linux command शोधा.
  2. Task ला लागणारे options (उदा. -r, -h) जोडा.
  3. File नावं, folders किंवा users योग्य क्रमाने लिहा.
  4. System files/users बदलत असाल तर sudo वापरा. Check answer दाबा.

मध्यम SSH लपवा

का: Network incident मधे packets हा पुरावा.

काय करायचं: ens5 वर, numeric, port 22 सोडून सगळं.

कसं करायचं:
  1. हे काम करणारा Linux command शोधा.
  2. Task ला लागणारे options (उदा. -r, -h) जोडा.
  3. File नावं, folders किंवा users योग्य क्रमाने लिहा.
  4. System files/users बदलत असाल तर sudo वापरा. Check answer दाबा.

मध्यम फक्त host कडून

का: Network incident मधे packets हा पुरावा.

काय करायचं: फक्त 10.0.7.21 कडून येणारे packets, ens5 वर, numeric.

कसं करायचं:
  1. हे काम करणारा Linux command शोधा.
  2. Task ला लागणारे options (उदा. -r, -h) जोडा.
  3. File नावं, folders किंवा users योग्य क्रमाने लिहा.
  4. System files/users बदलत असाल तर sudo वापरा. Check answer दाबा.

मध्यम Capture save

का: Network incident मधे packets हा पुरावा.

काय करायचं: ens5 वर port 8443 /tmp/tls.pcap मधे.

कसं करायचं:
  1. हे काम करणारा Linux command शोधा.
  2. Task ला लागणारे options (उदा. -r, -h) जोडा.
  3. File नावं, folders किंवा users योग्य क्रमाने लिहा.
  4. System files/users बदलत असाल तर sudo वापरा. Check answer दाबा.

मध्यम ASCII payload

का: Network incident मधे packets हा पुरावा.

काय करायचं: lo port 9000 वर ASCII payload सह 15 packets, numeric.

कसं करायचं:
  1. हे काम करणारा Linux command शोधा.
  2. Task ला लागणारे options (उदा. -r, -h) जोडा.
  3. File नावं, folders किंवा users योग्य क्रमाने लिहा.
  4. System files/users बदलत असाल तर sudo वापरा. Check answer दाबा.

मध्यम Port open

का: Network incident मधे packets हा पुरावा.

काय करायचं: firewalld मधे TCP 9443 permanent open.

कसं करायचं:
  1. हे काम करणारा Linux command शोधा.
  2. Task ला लागणारे options (उदा. -r, -h) जोडा.
  3. File नावं, folders किंवा users योग्य क्रमाने लिहा.
  4. System files/users बदलत असाल तर sudo वापरा. Check answer दाबा.

मध्यम iptables counters

का: Network incident मधे packets हा पुरावा.

काय करायचं: INPUT rules numeric counters आणि rule numbers सह.

कसं करायचं:
  1. हे काम करणारा Linux command शोधा.
  2. Task ला लागणारे options (उदा. -r, -h) जोडा.
  3. File नावं, folders किंवा users योग्य क्रमाने लिहा.
  4. System files/users बदलत असाल तर sudo वापरा. Check answer दाबा.

अवघड Ring buffer

का: Network incident मधे packets हा पुरावा.

काय करायचं: ens5 वर port 443 /var/tmp/r.pcap ला प्रत्येकी 50 MB च्या 3 files.

कसं करायचं:
  1. हे काम करणारा Linux command शोधा.
  2. Task ला लागणारे options (उदा. -r, -h) जोडा.
  3. File नावं, folders किंवा users योग्य क्रमाने लिहा.
  4. System files/users बदलत असाल तर sudo वापरा. Check answer दाबा.

अवघड MTU test

का: Network incident मधे packets हा पुरावा.

काय करायचं: 10.9.0.4 ला दोनदा 1400-byte payload आणि fragmentation शिवाय ping.

कसं करायचं:
  1. हे काम करणारा Linux command शोधा.
  2. Task ला लागणारे options (उदा. -r, -h) जोडा.
  3. File नावं, folders किंवा users योग्य क्रमाने लिहा.
  4. System files/users बदलत असाल तर sudo वापरा. Check answer दाबा.

थोडक्यात सांगायचं तर

  1. Filter सह tcpdump -i, -nn, -c.
  2. Filters: host, port, net, protocol, and/or/not.
  3. Flags: S, S., ., P., F., R.
  4. -w save, -r read, -C/-W rotate.
  5. Host आणि cloud firewalls.
  6. Packets कुठे थांबतात ते शोधायला दोन्ही टोकांना capture.

उजळणी, तुलना आणि मुलाखत cards

हा lesson काही मिनिटांत revise करा. Cards phone वर save करा किंवा PNG download करा. प्रत्येक card वरचा QR हा lesson उघडतो.

4 steps मधे tcpdump. खरे packets बघा. -i interface, -nn numbers. Filter: host, port, icmp. एक port.
उजळणी card: 4 steps मधे tcpdump · PNG download करा · Card page उघडा
Network debug order. Layer by layer. Link, IP, route, DNS. Port, firewall, app. Port test.
उजळणी card: Network debug order · PNG download करा · Card page उघडा
refused vs timeout. Host RST देतो. / काहीच reply नाही.
तुलना: refused vs timeout · PNG download करा · Card page उघडा
firewalld vs security group. Server आत. / बाहेर, cloud मधे.
तुलना: firewalld vs security group · PNG download करा · Card page उघडा
tcpdump कधी?. Logs जुळत नसतील. Packets येतात का ते सिद्ध. Capture.
मुलाखत card: tcpdump कधी? · PNG download करा · Card page उघडा
Refused vs timeout?. Refused: host up, कोणी listen नाही. Timeout: firewall drop. Listener तपासा.
मुलाखत card: Refused vs timeout? · PNG download करा · Card page उघडा
Local open, बाहेरून block?. Host firewall. Cloud security group. Rules.
मुलाखत card: Local open, बाहेरून block? · PNG download करा · Card page उघडा
छोट्या requests चालतात, मोठ्या hang?. बहुतेक MTU. DF bit ने test. Test.
मुलाखत card: छोट्या requests चालतात, मोठ्या hang? · PNG download करा · Card page उघडा

अजून cards: Ravi Sir's Cards.