SlideShare a Scribd company logo
1 of 48
Как HeadHunter удалось
безопасно нарушить RFC 793 (TCP)
и обойти сетевые ловушки
сервисной архитектуры
Андрей Шорин
замдиректора эксплуатации
hh.ru
# 0 - no source validation
net.ipv4.conf.all.rp_filter=0
# 2 - always use the best local address for this target
net.ipv4.conf.all.arp_announce=2
# 1 - reply only if the target IP address is local
# address configured on the incoming interface
net.ipv4.conf.all.arp_ignore=1
ip sla 1
tcp-connect 192.168.1.11 80 control disable
timeout 1000
threshold 1000
frequency 1
tag balancer1
ip sla schedule 1 life forever start-time now
ip route 10.1.1.1 255.255.255.255 192.168.1.11 track 1
track 1 ip sla 1 reachability
ip route 10.1.1.1 255.255.255.255 192.168.1.12 track 2
track 2 ip sla 2 reachability
ip cef load-sharing algorithm
include-ports source destination
routing-options {
static {
route 10.1.1.1/32 {
next-hop [ 192.168.1.11 192.168.1.12 ];
}
}
}
routing-options {
static {
route 10.1.1.1/32 {
next-hop [ 192.168.1.11 192.168.1.12 ];
bfd-liveness-detection {
minimum-interval 300;
multiplier 2;
no-adaptation;
}
}
}
routing-options {
ppm;
forwarding-table {
export per-flow-lb;
}
}
policy-options {
policy-statement per-flow-lb {
then {
load-balance per-packet;
}
}
https://github.com/ashorin/OpenBFDD/tree/debianize
/etc/default/openbfdd:
OPENBFDD_CONTROL=
"$CONTROL_COMMAND load /etc/openbfdd.conf"
/etc/openbfdd.conf:
connect local 192.168.1.11 remote 192.168.1.1
session all set mintx 100 ms
session all set minrx 100 ms
session all set multi 2
Monit:
check program gw_ready with path /usr/local/bin/bfdd.sh
if status != 0 then alert
check process openbfdd with pidfile /var/run/openbfdd.pid
start program = "/sbin/start openbfdd"
stop program = "/sbin/stop openbfdd"
mode active
/usr/local/bin/bfdd.sh:
check_nginx_up() {
wget -qO /dev/null --timeout=1 —tries=1 http://127.0.0.1:80/nginx-satus
}
retval=0
if ! check_nginx_up; then
echo nginx is down >&2
retval=3
fi
if [ $retval -eq 0 ]; then
/usr/bin/pgrep bfdd-beacon || /usr/bin/monit -c /etc/monit/monitrc start openbfdd
else
/usr/bin/pgrep bfdd-beacon && /usr/bin/monit -c /etc/monit/monitrc stop openbfdd
fi
103 k pkt/sec
10 k pkt/sec
# Name: UDP/TCP source port
# mode: streaming
# port flows octets packets
1006 468 4201193 2703
1007 466 4165639 2692
1008 416 3491145 2377
1009 411 3412711 2352
39748 2 27240572 523730
39751 1 66627663 1281258
# Name: UDP/TCP source port
# mode: streaming
# port flows octets packets
1006 468 4201193 2703
1007 466 4165639 2692
1008 416 3491145 2377
1009 411 3412711 2352
39748 2 27240572 523730
39751 1 66627663 1281258
# Name: UDP/TCP source port
# mode: streaming
# port flows octets packets
1006 468 4201193 2703
1007 466 4165639 2692
1008 416 3491145 2377
1009 411 3412711 2352
39748 2 27240572 523730
39751 1 66627663 1281258
`
# Name: UDP/TCP source port
# mode: streaming
# port flows octets packets
1006 468 4201193 2703
1007 466 4165639 2692
1008 416 3491145 2377
1009 411 3412711 2352
39748 2 27240572 523730
39751 1 66627663 1281258
`
# Name: UDP/TCP source port
# mode: streaming
# port flows octets packets
1006 468 4201193 2703
1007 466 4165639 2692
1008 416 3491145 2377
1009 411 3412711 2352
39748 2 27240572 523730
39751 1 66627663 1281258
`
÷
3491145 2377
3412711 2352
27240572 523730
66627663 1281258
÷
÷
≈ 1460
= 52
sudo tcpdump -ni eth0 host ( 10.1.1.1 or 192.168.1.11 )
and len == 66 -w 52b-%Y-%m-%d_%H-%M.pcap -G 60
sudo tcpdump -ni eth0 host ( 10.1.1.1 or 192.168.1.11 )
and len == 66 -w 52b-%Y-%m-%d_%H-%M.pcap -G 60
# 8 часов
* * * * * root find /var/flow/intbal-pcap -maxdepth 1
-type f -mmin +480 -delete
-rw-r--r-- 1 root root 401381030 Sep 10 11:39 52b-2014-09-10_11-38.pcap
-rw-r--r-- 1 root root 400369068 Sep 10 11:40 52b-2014-09-10_11-39.pcap
-rw-r--r-- 1 root root 517185620 Sep 10 11:41 52b-2014-09-10_11-40.pcap
-rw-r--r-- 1 root root 1803984614 Sep 10 11:42 52b-2014-09-10_11-41.pcap
-rw-r--r-- 1 root root 1982921976 Sep 10 11:43 52b-2014-09-10_11-42.pcap
-rw-r--r-- 1 root root 461025642 Sep 10 11:44 52b-2014-09-10_11-43.pcap
-rw-r--r-- 1 root root 401152356 Sep 10 11:45 52b-2014-09-10_11-44.pcap
-rw-r--r-- 1 root root 402100506 Sep 10 11:46 52b-2014-09-10_11-45.pcap
`
tshark -r 52b-2014-09-10_11-42.pcap
-w 52b-2014-09-10_11-42-logic3-33813.pcap
-R "ip.addr==192.168.2.39 and tcp.port==33813"
Sep 10 13:41:01 switch 1y43w: %TRACKING-5-STATE:
3 ip sla 3 reachability Up->Down
Sep 10 11:42:11 switch 1y43w: %TRACKING-5-STATE:
3 ip sla 3 reachability Down->Up
exp-12295-nginx1 IN A 192.168.2.182
exp-12295-nginx2 IN A 192.168.2.183
exp-12295-client1 IN A 192.168.2.184
exp-12295-shared IN A 192.168.2.186
ip ro l 192.168.2.186
192.168.2.186 via 192.168.2.183 dev eth0 metric 10
192.168.2.186 via 192.168.2.182 dev eth0 metric 20
` `
mkfifo backpipe
nc -l 8082 0<backpipe |
nc -p 19999 192.168.2.186 80 1>backpipe
wget -O/dev/null http://127.0.0.1:8082/long-file
Nginx:
listen 80 default so_keepalive=1s:1s:1;
Nginx:
listen 80 default so_keepalive=1s:1s:1;
Cisco:
track 1 ip sla 1 reachability
delay up 3
Nginx:
listen 80 default so_keepalive=1s:1s:1;
Cisco:
track 1 ip sla 1 reachability
delay up 3
Juniper:
holddown-interval 2500;
Андрей Шорин
замдиректора эксплуатации hh.ru
linkedin.com/in/andshorin
Балансировка балансировщиков
на коммутаторах:
bit.ly/switch-balancing

More Related Content

What's hot

Plan 9カーネルにおけるTCP/IP実装(未完)
Plan 9カーネルにおけるTCP/IP実装(未完)Plan 9カーネルにおけるTCP/IP実装(未完)
Plan 9カーネルにおけるTCP/IP実装(未完)
Ryousei Takano
 
Packet sniffing in switched LANs
Packet sniffing in switched LANsPacket sniffing in switched LANs
Packet sniffing in switched LANs
Ishraq Al Fataftah
 
The Next Linux Superpower: eBPF Primer
The Next Linux Superpower: eBPF PrimerThe Next Linux Superpower: eBPF Primer
The Next Linux Superpower: eBPF Primer
Sasha Goldshtein
 
Kernel Recipes 2017: Performance Analysis with BPF
Kernel Recipes 2017: Performance Analysis with BPFKernel Recipes 2017: Performance Analysis with BPF
Kernel Recipes 2017: Performance Analysis with BPF
Brendan Gregg
 

What's hot (20)

The Spectre of Meltdowns
The Spectre of MeltdownsThe Spectre of Meltdowns
The Spectre of Meltdowns
 
Plan 9カーネルにおけるTCP/IP実装(未完)
Plan 9カーネルにおけるTCP/IP実装(未完)Plan 9カーネルにおけるTCP/IP実装(未完)
Plan 9カーネルにおけるTCP/IP実装(未完)
 
20141106 asfws unicode_hacks
20141106 asfws unicode_hacks20141106 asfws unicode_hacks
20141106 asfws unicode_hacks
 
Prezentacja zimowisko 2014
Prezentacja zimowisko 2014Prezentacja zimowisko 2014
Prezentacja zimowisko 2014
 
Kernel Recipes 2017 - Modern Key Management with GPG - Werner Koch
Kernel Recipes 2017 - Modern Key Management with GPG - Werner KochKernel Recipes 2017 - Modern Key Management with GPG - Werner Koch
Kernel Recipes 2017 - Modern Key Management with GPG - Werner Koch
 
Offline bruteforce attack on wi fi protected setup
Offline bruteforce attack on wi fi protected setupOffline bruteforce attack on wi fi protected setup
Offline bruteforce attack on wi fi protected setup
 
LF_OVS_17_OVS-DPDK Installation and Gotchas
LF_OVS_17_OVS-DPDK Installation and GotchasLF_OVS_17_OVS-DPDK Installation and Gotchas
LF_OVS_17_OVS-DPDK Installation and Gotchas
 
DMVPN
DMVPNDMVPN
DMVPN
 
IL: 失われたプロトコル
IL: 失われたプロトコルIL: 失われたプロトコル
IL: 失われたプロトコル
 
OVS-NFV Tutorial
OVS-NFV TutorialOVS-NFV Tutorial
OVS-NFV Tutorial
 
Packet sniffing in switched LANs
Packet sniffing in switched LANsPacket sniffing in switched LANs
Packet sniffing in switched LANs
 
Hacking the swisscom modem
Hacking the swisscom modemHacking the swisscom modem
Hacking the swisscom modem
 
Meet cute-between-ebpf-and-tracing
Meet cute-between-ebpf-and-tracingMeet cute-between-ebpf-and-tracing
Meet cute-between-ebpf-and-tracing
 
Nmap not only a port scanner by ravi rajput comexpo security awareness meet
Nmap not only a port scanner by ravi rajput comexpo security awareness meet Nmap not only a port scanner by ravi rajput comexpo security awareness meet
Nmap not only a port scanner by ravi rajput comexpo security awareness meet
 
The Next Linux Superpower: eBPF Primer
The Next Linux Superpower: eBPF PrimerThe Next Linux Superpower: eBPF Primer
The Next Linux Superpower: eBPF Primer
 
Wdt Test
Wdt TestWdt Test
Wdt Test
 
IPv6 for Pentesters
IPv6 for PentestersIPv6 for Pentesters
IPv6 for Pentesters
 
Metasploitable
MetasploitableMetasploitable
Metasploitable
 
Kernel Recipes 2017: Performance Analysis with BPF
Kernel Recipes 2017: Performance Analysis with BPFKernel Recipes 2017: Performance Analysis with BPF
Kernel Recipes 2017: Performance Analysis with BPF
 
Linux seccomp(2) vs OpenBSD pledge(2)
Linux seccomp(2) vs OpenBSD pledge(2)Linux seccomp(2) vs OpenBSD pledge(2)
Linux seccomp(2) vs OpenBSD pledge(2)
 

Viewers also liked

How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015
How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015
How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015
PostgreSQL-Consulting
 

Viewers also liked (11)

Tuning Linux for your database FLOSSUK 2016
Tuning Linux for your database FLOSSUK 2016Tuning Linux for your database FLOSSUK 2016
Tuning Linux for your database FLOSSUK 2016
 
Opslag van long tail producten in e-warehouse
Opslag van long tail producten in e-warehouseOpslag van long tail producten in e-warehouse
Opslag van long tail producten in e-warehouse
 
Deep dive into PostgreSQL statistics.
Deep dive into PostgreSQL statistics.Deep dive into PostgreSQL statistics.
Deep dive into PostgreSQL statistics.
 
PostgreSQL Meetup Berlin at Zalando HQ
PostgreSQL Meetup Berlin at Zalando HQPostgreSQL Meetup Berlin at Zalando HQ
PostgreSQL Meetup Berlin at Zalando HQ
 
PostgreSQL Troubleshoot On-line, (RITfest 2015 meetup at Moscow, Russia).
PostgreSQL Troubleshoot On-line, (RITfest 2015 meetup at Moscow, Russia).PostgreSQL Troubleshoot On-line, (RITfest 2015 meetup at Moscow, Russia).
PostgreSQL Troubleshoot On-line, (RITfest 2015 meetup at Moscow, Russia).
 
Autovacuum, explained for engineers, new improved version PGConf.eu 2015 Vienna
Autovacuum, explained for engineers, new improved version PGConf.eu 2015 ViennaAutovacuum, explained for engineers, new improved version PGConf.eu 2015 Vienna
Autovacuum, explained for engineers, new improved version PGConf.eu 2015 Vienna
 
How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015
How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015
How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015
 
Streaming replication in practice
Streaming replication in practiceStreaming replication in practice
Streaming replication in practice
 
GitLab PostgresMortem: Lessons Learned
GitLab PostgresMortem: Lessons LearnedGitLab PostgresMortem: Lessons Learned
GitLab PostgresMortem: Lessons Learned
 
Deep dive into PostgreSQL statistics.
Deep dive into PostgreSQL statistics.Deep dive into PostgreSQL statistics.
Deep dive into PostgreSQL statistics.
 
PostgreSQL: Advanced features in practice
PostgreSQL: Advanced features in practicePostgreSQL: Advanced features in practice
PostgreSQL: Advanced features in practice
 

Similar to Как HeadHunter удалось безопасно нарушить RFC 793 (TCP) и обойти сетевые ловушки сервисной архитектуры

Performance tweaks and tools for Linux (Joe Damato)
Performance tweaks and tools for Linux (Joe Damato)Performance tweaks and tools for Linux (Joe Damato)
Performance tweaks and tools for Linux (Joe Damato)
Ontico
 
Go with the Flow-v2
Go with the Flow-v2Go with the Flow-v2
Go with the Flow-v2
Zobair Khan
 
Puppet Camp Boston 2014: Network Automation with Puppet and Arista (Beginner)
Puppet Camp Boston 2014: Network Automation with Puppet and Arista (Beginner) Puppet Camp Boston 2014: Network Automation with Puppet and Arista (Beginner)
Puppet Camp Boston 2014: Network Automation with Puppet and Arista (Beginner)
Puppet
 

Similar to Как HeadHunter удалось безопасно нарушить RFC 793 (TCP) и обойти сетевые ловушки сервисной архитектуры (20)

[오픈소스컨설팅] Linux Network Troubleshooting
[오픈소스컨설팅] Linux Network Troubleshooting[오픈소스컨설팅] Linux Network Troubleshooting
[오픈소스컨설팅] Linux Network Troubleshooting
 
Debugging Ruby
Debugging RubyDebugging Ruby
Debugging Ruby
 
OpenStack networking juno l3 h-a, dvr
OpenStack networking   juno l3 h-a, dvrOpenStack networking   juno l3 h-a, dvr
OpenStack networking juno l3 h-a, dvr
 
Linux 系統管理與安全:進階系統管理系統防駭與資訊安全
Linux 系統管理與安全:進階系統管理系統防駭與資訊安全Linux 系統管理與安全:進階系統管理系統防駭與資訊安全
Linux 系統管理與安全:進階系統管理系統防駭與資訊安全
 
Network Security Best Practice (BCP38 & 140)
Network Security Best Practice (BCP38 & 140) Network Security Best Practice (BCP38 & 140)
Network Security Best Practice (BCP38 & 140)
 
Debugging Ruby Systems
Debugging Ruby SystemsDebugging Ruby Systems
Debugging Ruby Systems
 
IPv6 for Pentesters
IPv6 for PentestersIPv6 for Pentesters
IPv6 for Pentesters
 
/etc/rc.d配下とかのリーディング勉強会
/etc/rc.d配下とかのリーディング勉強会/etc/rc.d配下とかのリーディング勉強会
/etc/rc.d配下とかのリーディング勉強会
 
Watching And Manipulating Your Network Traffic
Watching And Manipulating Your Network TrafficWatching And Manipulating Your Network Traffic
Watching And Manipulating Your Network Traffic
 
Type of DDoS attacks with hping3 example
Type of DDoS attacks with hping3 exampleType of DDoS attacks with hping3 example
Type of DDoS attacks with hping3 example
 
Performance tweaks and tools for Linux (Joe Damato)
Performance tweaks and tools for Linux (Joe Damato)Performance tweaks and tools for Linux (Joe Damato)
Performance tweaks and tools for Linux (Joe Damato)
 
Tutorial of SF-TAP Flow Abstractor
Tutorial of SF-TAP Flow AbstractorTutorial of SF-TAP Flow Abstractor
Tutorial of SF-TAP Flow Abstractor
 
Handy Networking Tools and How to Use Them
Handy Networking Tools and How to Use ThemHandy Networking Tools and How to Use Them
Handy Networking Tools and How to Use Them
 
Containers for sysadmins
Containers for sysadminsContainers for sysadmins
Containers for sysadmins
 
Services
ServicesServices
Services
 
Go with the Flow
Go with the Flow Go with the Flow
Go with the Flow
 
Go with the Flow-v2
Go with the Flow-v2Go with the Flow-v2
Go with the Flow-v2
 
MPLS LAB Practice Vol.1.pdf
MPLS LAB Practice Vol.1.pdfMPLS LAB Practice Vol.1.pdf
MPLS LAB Practice Vol.1.pdf
 
Puppet Camp Boston 2014: Network Automation with Puppet and Arista (Beginner)
Puppet Camp Boston 2014: Network Automation with Puppet and Arista (Beginner) Puppet Camp Boston 2014: Network Automation with Puppet and Arista (Beginner)
Puppet Camp Boston 2014: Network Automation with Puppet and Arista (Beginner)
 
Linux networking
Linux networkingLinux networking
Linux networking
 

Recently uploaded

Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Monica Sydney
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
ayvbos
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
ayvbos
 
一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书
一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书
一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书
c6eb683559b3
 
一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理
一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理
一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理
apekaom
 
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi EscortsRussian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Monica Sydney
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
JOHNBEBONYAP1
 

Recently uploaded (20)

Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
 
Local Call Girls in Seoni 9332606886 HOT & SEXY Models beautiful and charmin...
Local Call Girls in Seoni  9332606886 HOT & SEXY Models beautiful and charmin...Local Call Girls in Seoni  9332606886 HOT & SEXY Models beautiful and charmin...
Local Call Girls in Seoni 9332606886 HOT & SEXY Models beautiful and charmin...
 
一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书
一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书
一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
 
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
 
一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理
一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理
一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
 
Washington Football Commanders Redskins Feathers Shirt
Washington Football Commanders Redskins Feathers ShirtWashington Football Commanders Redskins Feathers Shirt
Washington Football Commanders Redskins Feathers Shirt
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
 
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac RoomVip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
 
💚 Call Girls Bahraich 9332606886 High Profile Call Girls You Can Get The S...
💚 Call Girls Bahraich   9332606886  High Profile Call Girls You Can Get The S...💚 Call Girls Bahraich   9332606886  High Profile Call Girls You Can Get The S...
💚 Call Girls Bahraich 9332606886 High Profile Call Girls You Can Get The S...
 
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi EscortsRussian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
 
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime BalliaBallia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
 
Mira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
Mira Road Housewife Call Girls 07506202331, Nalasopara Call GirlsMira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
Mira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
 
Dubai Call Girls First Class O525547819 Call Girls Dubai Hot New Girlfriend
Dubai Call Girls First Class O525547819 Call Girls Dubai Hot New GirlfriendDubai Call Girls First Class O525547819 Call Girls Dubai Hot New Girlfriend
Dubai Call Girls First Class O525547819 Call Girls Dubai Hot New Girlfriend
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
 

Как HeadHunter удалось безопасно нарушить RFC 793 (TCP) и обойти сетевые ловушки сервисной архитектуры

  • 1. Как HeadHunter удалось безопасно нарушить RFC 793 (TCP) и обойти сетевые ловушки сервисной архитектуры Андрей Шорин замдиректора эксплуатации hh.ru
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8. # 0 - no source validation net.ipv4.conf.all.rp_filter=0 # 2 - always use the best local address for this target net.ipv4.conf.all.arp_announce=2 # 1 - reply only if the target IP address is local # address configured on the incoming interface net.ipv4.conf.all.arp_ignore=1
  • 9.
  • 10. ip sla 1 tcp-connect 192.168.1.11 80 control disable timeout 1000 threshold 1000 frequency 1 tag balancer1 ip sla schedule 1 life forever start-time now
  • 11. ip route 10.1.1.1 255.255.255.255 192.168.1.11 track 1 track 1 ip sla 1 reachability ip route 10.1.1.1 255.255.255.255 192.168.1.12 track 2 track 2 ip sla 2 reachability
  • 12. ip cef load-sharing algorithm include-ports source destination
  • 13.
  • 14. routing-options { static { route 10.1.1.1/32 { next-hop [ 192.168.1.11 192.168.1.12 ]; } } }
  • 15. routing-options { static { route 10.1.1.1/32 { next-hop [ 192.168.1.11 192.168.1.12 ]; bfd-liveness-detection { minimum-interval 300; multiplier 2; no-adaptation; } } }
  • 16. routing-options { ppm; forwarding-table { export per-flow-lb; } } policy-options { policy-statement per-flow-lb { then { load-balance per-packet; } }
  • 17.
  • 19. /etc/default/openbfdd: OPENBFDD_CONTROL= "$CONTROL_COMMAND load /etc/openbfdd.conf" /etc/openbfdd.conf: connect local 192.168.1.11 remote 192.168.1.1 session all set mintx 100 ms session all set minrx 100 ms session all set multi 2
  • 20. Monit: check program gw_ready with path /usr/local/bin/bfdd.sh if status != 0 then alert check process openbfdd with pidfile /var/run/openbfdd.pid start program = "/sbin/start openbfdd" stop program = "/sbin/stop openbfdd" mode active
  • 21. /usr/local/bin/bfdd.sh: check_nginx_up() { wget -qO /dev/null --timeout=1 —tries=1 http://127.0.0.1:80/nginx-satus } retval=0 if ! check_nginx_up; then echo nginx is down >&2 retval=3 fi if [ $retval -eq 0 ]; then /usr/bin/pgrep bfdd-beacon || /usr/bin/monit -c /etc/monit/monitrc start openbfdd else /usr/bin/pgrep bfdd-beacon && /usr/bin/monit -c /etc/monit/monitrc stop openbfdd fi
  • 22.
  • 23.
  • 24.
  • 25.
  • 26. 103 k pkt/sec 10 k pkt/sec
  • 27. # Name: UDP/TCP source port # mode: streaming # port flows octets packets 1006 468 4201193 2703 1007 466 4165639 2692 1008 416 3491145 2377 1009 411 3412711 2352 39748 2 27240572 523730 39751 1 66627663 1281258
  • 28. # Name: UDP/TCP source port # mode: streaming # port flows octets packets 1006 468 4201193 2703 1007 466 4165639 2692 1008 416 3491145 2377 1009 411 3412711 2352 39748 2 27240572 523730 39751 1 66627663 1281258
  • 29. # Name: UDP/TCP source port # mode: streaming # port flows octets packets 1006 468 4201193 2703 1007 466 4165639 2692 1008 416 3491145 2377 1009 411 3412711 2352 39748 2 27240572 523730 39751 1 66627663 1281258 `
  • 30. # Name: UDP/TCP source port # mode: streaming # port flows octets packets 1006 468 4201193 2703 1007 466 4165639 2692 1008 416 3491145 2377 1009 411 3412711 2352 39748 2 27240572 523730 39751 1 66627663 1281258 `
  • 31. # Name: UDP/TCP source port # mode: streaming # port flows octets packets 1006 468 4201193 2703 1007 466 4165639 2692 1008 416 3491145 2377 1009 411 3412711 2352 39748 2 27240572 523730 39751 1 66627663 1281258 ` ÷
  • 32. 3491145 2377 3412711 2352 27240572 523730 66627663 1281258 ÷ ÷ ≈ 1460 = 52
  • 33. sudo tcpdump -ni eth0 host ( 10.1.1.1 or 192.168.1.11 ) and len == 66 -w 52b-%Y-%m-%d_%H-%M.pcap -G 60
  • 34. sudo tcpdump -ni eth0 host ( 10.1.1.1 or 192.168.1.11 ) and len == 66 -w 52b-%Y-%m-%d_%H-%M.pcap -G 60 # 8 часов * * * * * root find /var/flow/intbal-pcap -maxdepth 1 -type f -mmin +480 -delete
  • 35. -rw-r--r-- 1 root root 401381030 Sep 10 11:39 52b-2014-09-10_11-38.pcap -rw-r--r-- 1 root root 400369068 Sep 10 11:40 52b-2014-09-10_11-39.pcap -rw-r--r-- 1 root root 517185620 Sep 10 11:41 52b-2014-09-10_11-40.pcap -rw-r--r-- 1 root root 1803984614 Sep 10 11:42 52b-2014-09-10_11-41.pcap -rw-r--r-- 1 root root 1982921976 Sep 10 11:43 52b-2014-09-10_11-42.pcap -rw-r--r-- 1 root root 461025642 Sep 10 11:44 52b-2014-09-10_11-43.pcap -rw-r--r-- 1 root root 401152356 Sep 10 11:45 52b-2014-09-10_11-44.pcap -rw-r--r-- 1 root root 402100506 Sep 10 11:46 52b-2014-09-10_11-45.pcap `
  • 36. tshark -r 52b-2014-09-10_11-42.pcap -w 52b-2014-09-10_11-42-logic3-33813.pcap -R "ip.addr==192.168.2.39 and tcp.port==33813"
  • 37.
  • 38.
  • 39.
  • 40.
  • 41. Sep 10 13:41:01 switch 1y43w: %TRACKING-5-STATE: 3 ip sla 3 reachability Up->Down Sep 10 11:42:11 switch 1y43w: %TRACKING-5-STATE: 3 ip sla 3 reachability Down->Up
  • 42. exp-12295-nginx1 IN A 192.168.2.182 exp-12295-nginx2 IN A 192.168.2.183 exp-12295-client1 IN A 192.168.2.184 exp-12295-shared IN A 192.168.2.186
  • 43. ip ro l 192.168.2.186 192.168.2.186 via 192.168.2.183 dev eth0 metric 10 192.168.2.186 via 192.168.2.182 dev eth0 metric 20 ` `
  • 44. mkfifo backpipe nc -l 8082 0<backpipe | nc -p 19999 192.168.2.186 80 1>backpipe wget -O/dev/null http://127.0.0.1:8082/long-file
  • 45. Nginx: listen 80 default so_keepalive=1s:1s:1;
  • 46. Nginx: listen 80 default so_keepalive=1s:1s:1; Cisco: track 1 ip sla 1 reachability delay up 3
  • 47. Nginx: listen 80 default so_keepalive=1s:1s:1; Cisco: track 1 ip sla 1 reachability delay up 3 Juniper: holddown-interval 2500;
  • 48. Андрей Шорин замдиректора эксплуатации hh.ru linkedin.com/in/andshorin Балансировка балансировщиков на коммутаторах: bit.ly/switch-balancing