SlideShare a Scribd company logo
1 of 25
Download to read offline













 # freebsd-update

 # pkg upgrade

 # portsnap fetch update
 # portmaster -a



 # pkg audit -F





/etc/rc.conf
pf_enable="YES" # PF ( )
pf_rules="/etc/pf.conf" # PF
pf_flags="" # pfctl
pflog_enable="YES" # pflogd(8)
pflog_logfile="/var/log/pflog" # pflogd
pflog_flags="" # pflogd
/etc/pf.conf
ext_if="em0"
table <ncu_addr> {140.115.0.0/16}
block in on $ext_if proto tcp from any to any port 1 >< 1023
block in quick on $ext_if proto tcp from any to any port = 139
block in quick on $ext_if proto tcp from any to any port = 445
block in quick on $ext_if proto udp from any to any port 137 >< 138
block in all
pass in on $ext_if proto tcp from <ncu_addr> to $ext_if port 22 keep
state
pass in on $ext_if proto tcp from any to $ext_if port 22 keep state
pass in on $ext_if proto tcp from any to any port = 80
pass in on $ext_if proto tcp from any to any port = 443

 /usr/share/examples/pf/pf.conf


 # pfctl -vnf /etc/pf.conf
References:
http://www.openbsd.org/faq/pf/filter.html
http://daemonforums.org/showthread.php?t=8145
http://undeadly.org/cgi?action=article&sid=20060927091645








 # touch /etc/hosts.deniedssh
 /etc/hosts.allow
 sshd : /etc/hosts.deniedssh : deny
ALL : ALL : allow

 /usr/local/etc/fail2ban/jail.conf
 /etc/pf.conf
 table <fail2ban> persist block quick proto tcp from
<fail2ban> to $ext_if port ssh


 phpMyAdmin





 http://dns.gov.ph/process/connection.php~
 http://dns.gov.ph/ajaxResponse/modReqs.php~

 http://<my_personal_blog>/wordpress.tar.gz
 http://example.com/.git/
Reference:
http://kawsing.blogspot.tw/2013/05/dnsweb-httpblog.html
http://denny0223.github.io/MOPCON-2014-LT-Slide/#1
 /var/log
 messages
 auth.log
 mail.log
 httpd-error.log
 httpd-access.log
 /etc/syslog.conf

 Logwatch /w crontab


 # ps -aux
 # top
 # netstat -a
 # sockstat
 # fstat /path/to/some/file (lsof)


 crontab




主機自保指南

More Related Content

What's hot

Killing any security product … using a Mimikatz undocumented feature
Killing any security product … using a Mimikatz undocumented featureKilling any security product … using a Mimikatz undocumented feature
Killing any security product … using a Mimikatz undocumented feature
Cyber Security Alliance
 
Wireshark.ethereal
Wireshark.etherealWireshark.ethereal
Wireshark.ethereal
gh02
 
Advanced cfg bypass on adobe flash player 18 defcon russia 23
Advanced cfg bypass on adobe flash player 18 defcon russia 23Advanced cfg bypass on adobe flash player 18 defcon russia 23
Advanced cfg bypass on adobe flash player 18 defcon russia 23
DefconRussia
 
Os Practical Assignment 1
Os Practical Assignment 1Os Practical Assignment 1
Os Practical Assignment 1
Emmanuel Garcia
 

What's hot (20)

App secforum2014 andrivet-cplusplus11-metaprogramming_applied_to_software_obf...
App secforum2014 andrivet-cplusplus11-metaprogramming_applied_to_software_obf...App secforum2014 andrivet-cplusplus11-metaprogramming_applied_to_software_obf...
App secforum2014 andrivet-cplusplus11-metaprogramming_applied_to_software_obf...
 
Killing any security product … using a Mimikatz undocumented feature
Killing any security product … using a Mimikatz undocumented featureKilling any security product … using a Mimikatz undocumented feature
Killing any security product … using a Mimikatz undocumented feature
 
Как HeadHunter удалось безопасно нарушить RFC 793 (TCP) и обойти сетевые лову...
Как HeadHunter удалось безопасно нарушить RFC 793 (TCP) и обойти сетевые лову...Как HeadHunter удалось безопасно нарушить RFC 793 (TCP) и обойти сетевые лову...
Как HeadHunter удалось безопасно нарушить RFC 793 (TCP) и обойти сетевые лову...
 
Как HeadHunter удалось безопасно нарушить RFC 793 (TCP) и обойти сетевые лову...
Как HeadHunter удалось безопасно нарушить RFC 793 (TCP) и обойти сетевые лову...Как HeadHunter удалось безопасно нарушить RFC 793 (TCP) и обойти сетевые лову...
Как HeadHunter удалось безопасно нарушить RFC 793 (TCP) и обойти сетевые лову...
 
Wireshark.ethereal
Wireshark.etherealWireshark.ethereal
Wireshark.ethereal
 
Timer Listings
Timer ListingsTimer Listings
Timer Listings
 
DDAA FPGA - Multiplexor De Numeros en Display 7 Segmentos En Tiempo
DDAA   FPGA - Multiplexor De Numeros en Display 7 Segmentos En TiempoDDAA   FPGA - Multiplexor De Numeros en Display 7 Segmentos En Tiempo
DDAA FPGA - Multiplexor De Numeros en Display 7 Segmentos En Tiempo
 
Ir remote kit_blink.pde
Ir remote kit_blink.pdeIr remote kit_blink.pde
Ir remote kit_blink.pde
 
Ahmed vic
Ahmed vicAhmed vic
Ahmed vic
 
GNU Parallel și GNU Stow
GNU Parallel și GNU StowGNU Parallel și GNU Stow
GNU Parallel și GNU Stow
 
Advanced cfg bypass on adobe flash player 18 defcon russia 23
Advanced cfg bypass on adobe flash player 18 defcon russia 23Advanced cfg bypass on adobe flash player 18 defcon russia 23
Advanced cfg bypass on adobe flash player 18 defcon russia 23
 
ハイパフォーマンスブラウザネットワーキング2
ハイパフォーマンスブラウザネットワーキング2ハイパフォーマンスブラウザネットワーキング2
ハイパフォーマンスブラウザネットワーキング2
 
A little systemtap
A little systemtapA little systemtap
A little systemtap
 
Reverse engineering Swisscom's Centro Grande Modem
Reverse engineering Swisscom's Centro Grande ModemReverse engineering Swisscom's Centro Grande Modem
Reverse engineering Swisscom's Centro Grande Modem
 
C-spirit reborn: why Go was bound to be created
C-spirit reborn: why Go was bound to be createdC-spirit reborn: why Go was bound to be created
C-spirit reborn: why Go was bound to be created
 
Pres
PresPres
Pres
 
Exploit Research and Development Megaprimer: Win32 Egghunter
Exploit Research and Development Megaprimer: Win32 EgghunterExploit Research and Development Megaprimer: Win32 Egghunter
Exploit Research and Development Megaprimer: Win32 Egghunter
 
Os Practical Assignment 1
Os Practical Assignment 1Os Practical Assignment 1
Os Practical Assignment 1
 
Rop and it's friends
Rop and it's friendsRop and it's friends
Rop and it's friends
 
Specializing the Data Path - Hooking into the Linux Network Stack
Specializing the Data Path - Hooking into the Linux Network StackSpecializing the Data Path - Hooking into the Linux Network Stack
Specializing the Data Path - Hooking into the Linux Network Stack
 

Viewers also liked

Development of academic portal
Development of academic portalDevelopment of academic portal
Development of academic portal
guest4e0cc4a
 
Punjab : a state presentation
Punjab : a state presentationPunjab : a state presentation
Punjab : a state presentation
surabhi agarwal
 
Education systems in pakistan
Education systems in  pakistanEducation systems in  pakistan
Education systems in pakistan
Anum Malik
 
Educational standard in pakistan
Educational standard in pakistanEducational standard in pakistan
Educational standard in pakistan
Talha Khan
 

Viewers also liked (9)

academic calendar 2016 2017
 academic calendar 2016  2017 academic calendar 2016  2017
academic calendar 2016 2017
 
Development of academic portal
Development of academic portalDevelopment of academic portal
Development of academic portal
 
Jkbose 10th date sheet 2016
Jkbose 10th date sheet 2016Jkbose 10th date sheet 2016
Jkbose 10th date sheet 2016
 
Leeds school calendar 2016 2017
Leeds school calendar 2016 2017Leeds school calendar 2016 2017
Leeds school calendar 2016 2017
 
Punjab : a state presentation
Punjab : a state presentationPunjab : a state presentation
Punjab : a state presentation
 
Education systems in pakistan
Education systems in  pakistanEducation systems in  pakistan
Education systems in pakistan
 
Educational standard in pakistan
Educational standard in pakistanEducational standard in pakistan
Educational standard in pakistan
 
The 50 Most Influential Education Brands on LinkedIn
The 50 Most Influential Education Brands on LinkedInThe 50 Most Influential Education Brands on LinkedIn
The 50 Most Influential Education Brands on LinkedIn
 
Engaging Learners with Technology
Engaging Learners with TechnologyEngaging Learners with Technology
Engaging Learners with Technology
 

Similar to 主機自保指南

netfilter and iptables
netfilter and iptablesnetfilter and iptables
netfilter and iptables
Kernel TLV
 
ভিবিন্ন DEVISE AND AR PORT NUMBER
ভিবিন্ন DEVISE  AND AR PORT NUMBERভিবিন্ন DEVISE  AND AR PORT NUMBER
ভিবিন্ন DEVISE AND AR PORT NUMBER
md shariful eng
 
Unit 6
Unit 6Unit 6
Unit 6
siddr
 
Error Control in Multimedia Communications using Wireless Sensor Networks report
Error Control in Multimedia Communications using Wireless Sensor Networks reportError Control in Multimedia Communications using Wireless Sensor Networks report
Error Control in Multimedia Communications using Wireless Sensor Networks report
Muragesh Kabbinakantimath
 
-----------------------------------------------------CPU.java------.pdf
 -----------------------------------------------------CPU.java------.pdf -----------------------------------------------------CPU.java------.pdf
-----------------------------------------------------CPU.java------.pdf
annikasarees
 

Similar to 主機自保指南 (20)

netfilter and iptables
netfilter and iptablesnetfilter and iptables
netfilter and iptables
 
PL/Perl - New Features in PostgreSQL 9.0
PL/Perl - New Features in PostgreSQL 9.0PL/Perl - New Features in PostgreSQL 9.0
PL/Perl - New Features in PostgreSQL 9.0
 
OpenVPN
OpenVPNOpenVPN
OpenVPN
 
/etc/rc.d配下とかのリーディング勉強会
/etc/rc.d配下とかのリーディング勉強会/etc/rc.d配下とかのリーディング勉強会
/etc/rc.d配下とかのリーディング勉強会
 
Bare metal performance in Elixir
Bare metal performance in ElixirBare metal performance in Elixir
Bare metal performance in Elixir
 
PL/Perl - New Features in PostgreSQL 9.0 201012
PL/Perl - New Features in PostgreSQL 9.0 201012PL/Perl - New Features in PostgreSQL 9.0 201012
PL/Perl - New Features in PostgreSQL 9.0 201012
 
Using the Power to Prove
Using the Power to ProveUsing the Power to Prove
Using the Power to Prove
 
FreeBSD ports
FreeBSD portsFreeBSD ports
FreeBSD ports
 
ভিবিন্ন Devise and ar port number
ভিবিন্ন Devise  and ar port numberভিবিন্ন Devise  and ar port number
ভিবিন্ন Devise and ar port number
 
ভিবিন্ন DEVISE AND AR PORT NUMBER
ভিবিন্ন DEVISE  AND AR PORT NUMBERভিবিন্ন DEVISE  AND AR PORT NUMBER
ভিবিন্ন DEVISE AND AR PORT NUMBER
 
Unit 6
Unit 6Unit 6
Unit 6
 
True stories on the analysis of network activity using Python
True stories on the analysis of network activity using PythonTrue stories on the analysis of network activity using Python
True stories on the analysis of network activity using Python
 
Linux Serial Driver
Linux Serial DriverLinux Serial Driver
Linux Serial Driver
 
Overloading Perl OPs using XS
Overloading Perl OPs using XSOverloading Perl OPs using XS
Overloading Perl OPs using XS
 
Containers for sysadmins
Containers for sysadminsContainers for sysadmins
Containers for sysadmins
 
Error Control in Multimedia Communications using Wireless Sensor Networks report
Error Control in Multimedia Communications using Wireless Sensor Networks reportError Control in Multimedia Communications using Wireless Sensor Networks report
Error Control in Multimedia Communications using Wireless Sensor Networks report
 
Opendaylight app development
Opendaylight app developmentOpendaylight app development
Opendaylight app development
 
Pasteur deep seq_analysis_theory_2016
Pasteur deep seq_analysis_theory_2016Pasteur deep seq_analysis_theory_2016
Pasteur deep seq_analysis_theory_2016
 
High Availability Server Clustering without ILB(Internal Load Balancer) (MEMO)
High Availability Server Clustering without ILB(Internal Load Balancer) (MEMO)High Availability Server Clustering without ILB(Internal Load Balancer) (MEMO)
High Availability Server Clustering without ILB(Internal Load Balancer) (MEMO)
 
-----------------------------------------------------CPU.java------.pdf
 -----------------------------------------------------CPU.java------.pdf -----------------------------------------------------CPU.java------.pdf
-----------------------------------------------------CPU.java------.pdf
 

More from 維泰 蔡 (6)

Linux 系統管理與安全:系統防駭與資訊安全
Linux 系統管理與安全:系統防駭與資訊安全Linux 系統管理與安全:系統防駭與資訊安全
Linux 系統管理與安全:系統防駭與資訊安全
 
Linux 系統管理與安全:進階系統管理系統防駭與資訊安全
Linux 系統管理與安全:進階系統管理系統防駭與資訊安全Linux 系統管理與安全:進階系統管理系統防駭與資訊安全
Linux 系統管理與安全:進階系統管理系統防駭與資訊安全
 
Linux 系統管理與安全:基本 Linux 系統知識
Linux 系統管理與安全:基本 Linux 系統知識Linux 系統管理與安全:基本 Linux 系統知識
Linux 系統管理與安全:基本 Linux 系統知識
 
Google drive on linux
Google drive on linuxGoogle drive on linux
Google drive on linux
 
DevStack
DevStackDevStack
DevStack
 
Proxmox: 建立自己的虛擬主機
Proxmox: 建立自己的虛擬主機Proxmox: 建立自己的虛擬主機
Proxmox: 建立自己的虛擬主機
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 

主機自保指南