SlideShare a Scribd company logo
Linux 系統管理與安全:進階系統管理系統防駭與資訊安全
•
•
•
•
Linux 系統管理與安全:進階系統管理系統防駭與資訊安全
•
root:log/  #  ls  -­‐F
anaconda/    btmp dmesg httpd/      mariadb/    ppp/                      secure        tuned/
audit/          chrony/    dmesg.old lastlog messages    sa/                        spooler      wtmp
boot.log      cron grubby          maillog php-­‐fpm/    sa-­‐update.log    tallylog yum.log

Recommended for you

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

Although GnuPG 2 has been around for nearly 15 years, the old 1.4 version was still in wide use. With Debian and others making 2.1 the default, many interesting things can now be done. In this talk he will explain the advantages of modern key algorithms, like ed25519, and why gpg relaxed some of its more paranoid defaults. The new –quick commands of gpg for easily scriptable key management will be described as well as the new key discovery methods. Finally hints for integration of gpg into other programs will be given. Werner Koch, g10code

securitysignaturegpg
SSH: Seguranca no Acesso Remoto
SSH: Seguranca no Acesso RemotoSSH: Seguranca no Acesso Remoto
SSH: Seguranca no Acesso Remoto

Apresentação na Pós-Graduação em Segurança da Informação: - Sniffer de senhas em plain text; - Ataque de brute-force no SSH; - Proteção: Firewall, IPS e/ou TCP Wrappers; - Segurança básica no sshd_config; - Chaves RSA/DSA para acesso remoto; - SSH buscando chaves no LDAP; - Porque previnir o acesso: Fork Bomb

sshsegurançafork
Getting started with RDO Havana
Getting started with RDO HavanaGetting started with RDO Havana
Getting started with RDO Havana

Getting started with RDO on Fedora 19. A presentation on installing and configuring OpenStack using RDO Havana

openstack rdo havana fedora
• kernel  message  buffer kernel  
• kernel  
$  dmesg
• /var/log/dmesg
•
•
•
•
•
• /var/log/messages
•
• syslog  
Feb  14  00:01:50  localhost  kernel:  smpboot:  CPU0:  Intel(R)  Celeron(R)  CPU                
E3400    @  2.60GHz  (fam:  06,  model:  17,  stepping:  0a)
Feb  14  00:01:50  localhost  kernel:  Performance  Events:  unsupported  p6  CPU  model  23  no  
PMU  driver,  software  events  only.
Feb  14  00:01:50  localhost  kernel:  Brought  up  1  CPUs
Feb  14  00:01:50  localhost  kernel:  smpboot:  Total  of  1  processors  activated  (5202.48  
BogoMIPS)
• /var/log/cron
• cron
Apr    2  09:01:01  localhost  run-­‐parts(/etc/cron.hourly)[528]:  starting  0yum-­‐hourly.cron
Apr    2  09:01:01  localhost  run-­‐parts(/etc/cron.hourly)[544]:  finished  0yum-­‐hourly.cron

Recommended for you

Capital onehadoopclass
Capital onehadoopclassCapital onehadoopclass
Capital onehadoopclass

The document describes setting up Hadoop in pseudo-distributed mode on a CentOS virtual machine instance. It details steps like creating a user account, installing Java and Hadoop, formatting the namenode, starting HDFS and YARN daemons, creating HDFS directories, and running a sample Pi estimation MapReduce job.

bigtopcentoscapital one
Analysis of Compromised Linux Server
Analysis of Compromised Linux ServerAnalysis of Compromised Linux Server
Analysis of Compromised Linux Server

The document summarizes an analysis of compromised Linux servers. The author detected intrusion after logging in and seeing a previous login from an Italian IP address. Further investigation revealed unauthorized login attempts from other countries. Logs showed the intruder accessed the servers repeatedly over weeks. Processes and open ports indicated the presence of rootkits and backdoors. User accounts for the intruder were also found on the servers.

Crash_Report_Mechanism_In_Tizen
Crash_Report_Mechanism_In_TizenCrash_Report_Mechanism_In_Tizen
Crash_Report_Mechanism_In_Tizen

This document discusses the crash reporting mechanism in Tizen. It describes the crash client, which handles crash signals and generates crash reports. It covers Samsung's crash-work-sdk and Intel's corewatcher crash clients. It also discusses the crash server that receives reports and the CrashDB web interface. Finally, it mentions crash reason location algorithms.

• /var/log/secure
•
•
Apr    1  16:12:16  localhost  login:  pam_unix(login:session):  session  opened  for  
user  root  by  LOGIN(uid=0)
Apr    1  16:12:16  localhost  login:  ROOT  LOGIN  ON  tty1
Mar  29  07:43:34  yuki sshd[18247]:  pam_unix(sshd:auth):  authentication  
failure;  logname=  uid=0  euid=0            tty=ssh ruser=  rhost=183.136.216.6    
user=root
Mar  29  07:43:36  yuki sshd[18247]:  Failed  password  for  root  from  
183.136.216.6  port  45215  ssh2
•
•
•
• daily weekly monthly yearly
• anacron
•
/etc/cron.daily/logrotate
• /etc/logrotate.d/httpd
/var/log/httpd/*log  {
daily #  
minsize 1M #   1MB  
missingok #  
rotate  14 #   14
compress #   gzip
delaycompress #  
notifempty #  
create  640  root  adm #  
sharedscripts #  
postrotate #  
/bin/systemctl reload  httpd.service >  /dev/null  2>/dev/null  ||  true
endscript
prerotate #  
#  do  nothing
endscript
}
$  man  logrotate

Recommended for you

Linux Commands - 3
Linux Commands - 3Linux Commands - 3
Linux Commands - 3

This document provides a summary of basic Linux commands including: - ls lists files and directories - cp copies files and directories - mv moves or renames files and directories - rm removes files or directories - touch creates empty files - cat outputs the contents of files - mkdir creates directories - grep searches for patterns in files - ps displays currently running processes - top displays active processes and system resources

/etc/rc.d配下とかのリーディング勉強会
/etc/rc.d配下とかのリーディング勉強会/etc/rc.d配下とかのリーディング勉強会
/etc/rc.d配下とかのリーディング勉強会

This document describes the network configuration and management scripts used in Scientific Linux release 6.1. It discusses the main scripts and files used like /etc/rc.d/init.d/network, /etc/sysconfig/network, and /etc/sysconfig/network-scripts. It provides details on how the network script starts and stops network interfaces, and brings interfaces up at boot time using files in /etc/sysconfig/network-scripts. It also summarizes some of the functions available in the network-functions file.

linux
Triangle OpenStack meetup 09 2013
Triangle OpenStack meetup 09 2013Triangle OpenStack meetup 09 2013
Triangle OpenStack meetup 09 2013

The document provides instructions for deploying Red Hat OpenStack on Red Hat Enterprise Linux using PackStack. It describes starting two virtual machines for the RDO control and compute nodes. It then discusses using PackStack to install OpenStack on the nodes in an interactive or automated way. Finally, it outlines exploring the OpenStack dashboard and services like Keystone, Glance, Nova, Cinder, and Swift after installation.

red hatmeetuprdo
Linux 系統管理與安全:進階系統管理系統防駭與資訊安全
Linux 系統管理與安全:進階系統管理系統防駭與資訊安全
•
•
• 192.168.1.10  -­‐>  11000000  10101000  00000001  00001010
•
•
•
•

Recommended for you

Importance of sshfp and configuring sshfp for network devices
Importance of sshfp and configuring sshfp for network devicesImportance of sshfp and configuring sshfp for network devices
Importance of sshfp and configuring sshfp for network devices

SSHFP records provide a secure method of distributing host public keys via DNS. The document discusses: 1) How SSHFP records store fingerprints of host public keys in DNS to validate connections, rather than distributing keys directly. 2) The process of generating fingerprints from router public keys, creating SSHFP records, and configuring DNS to distribute them securely via DNSSEC. 3) How an SSH client can validate connections to a host by looking up its SSHFP records and fingerprints in DNS, preventing man-in-the-middle attacks.

sshfpapricot2018
Importance of SSHFP for Network Devices
Importance of SSHFP for Network DevicesImportance of SSHFP for Network Devices
Importance of SSHFP for Network Devices

SSHFP records provide a secure method of distributing host public keys via DNS. The document discusses: 1) How SSHFP records store the fingerprint of a host's public key in DNS, allowing clients to validate the key via DNS lookup rather than trusting the host directly. 2) Instructions for generating SSHFP records for network devices that may not support all SSH commands, including extracting public keys and generating fingerprints. 3) Configuration details for distributing the SSHFP records in DNS and validating them during SSH connections using DNSSEC, avoiding the need to manually accept host keys.

apricot2018sshfp
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

Talk by Brendan Gregg at Kernel Recipes 2017 (Paris): "The in-kernel Berkeley Packet Filter (BPF) has been enhanced in recent kernels to do much more than just filtering packets. It can now run user-defined programs on events, such as on tracepoints, kprobes, uprobes, and perf_events, allowing advanced performance analysis tools to be created. These can be used in production as the BPF virtual machine is sandboxed and will reject unsafe code, and are already in use at Netflix. Beginning with the bpf() syscall in 3.18, enhancements have been added in many kernel versions since, with major features for BPF analysis landing in Linux 4.1, 4.4, 4.7, and 4.9. Specific capabilities these provide include custom in-kernel summaries of metrics, custom latency measurements, and frequency counting kernel and user stack traces on events. One interesting case involves saving stack traces on wake up events, and associating them with the blocked stack trace: so that we can see the blocking stack trace and the waker together, merged in kernel by a BPF program (that particular example is in the kernel as samples/bpf/offwaketime). This talk will discuss the new BPF capabilities for performance analysis and debugging, and demonstrate the new open source tools that have been developed to use it, many of which are in the Linux Foundation iovisor bcc (BPF Compiler Collection) project. These include tools to analyze the CPU scheduler, TCP performance, file system performance, block I/O, and more."

bpflinuxlinux performance tracing
•
•
• 192.168.1.100
• 192.168.1.100 -­‐>  11000000 10101000 00000001 01100100
• 255.255.255.224
• 255.255.255.224 -­‐>  11111111 11111111 11111111 11100000
• 11000000 10101000 00000001 01100000
• 192.168.1.96
•
255.255.255.224 -­‐>  11111111 11111111 11111111 11100000
• 11100000  -­‐>  3   1  -­‐>  2^3  -­‐>  8   subnet
• 256  /  8  =  32
• 32   IP  
• 192.168.1.96  ~  192.168.1.127
• 192.168.1.127   broadcast
•
• class netmask subnet   id  
• 255.255.224.0  
11111111 11111111 11111111 11100000 27   1
• -­‐>   a.b.c.d/27
• 192.168.1.96/27
•
• 140.115.0.0/16  
140.115.1.1   ~  140.115.255.255   ( 255.255.0.0)
• 192.168.1.0/24  
192.168.1.1   ~  192.168.1.255   ( 255.255.255.0)
Q 140.115.1.0/32  
•
• #  netstat –r / route
• #  ip route
#  netstat -­‐r
Kernel  IP  routing  table
Destination          Gateway                  Genmask Flags  Metric  Ref        Use  Iface
default                  192.168.1.1          0.0.0.0                  UG        0            0                0  eth0
10.8.0.0                10.8.0.2                255.255.255.0      UG        0            0                0  tun0
10.8.0.2                *                              255.255.255.255  UH        0            0                0  tun0
link-­‐local            *                              255.255.0.0          U          1000      0                0  eth0
192.168.1.0          *                              255.255.255.0      U          0            0                0  eth0
10.8.0.0~10.8.0.255   IP tun0   10.8.0.2   gateway
10.8.0.2   IP  
192.168.1.0~192.168.1.255   IP eth0   192.168.1.1   gateway

Recommended for you

Proxy arp
Proxy arpProxy arp
Proxy arp

The document discusses using proxy ARP to allow multiple containers and VMs to share a single network interface on the host machine. It notes some limitations of alternative approaches like Linux bridges, Open vSwitch, and MACVLAN. It also describes some issues with proxy ARP like stealing MAC addresses and requiring static routing. The proposed solution is to use arptables to selectively allow ARP requests from specific IP addresses to prevent MAC address conflicts while enabling network access for containers and VMs.

routingarpproxy_arp
Debugging Ruby Systems
Debugging Ruby SystemsDebugging Ruby Systems
Debugging Ruby Systems

Aman Gupta's presentation about debugging ruby systems. To view the full recording of his talk, visit: http://www.engineyard.com/video/16710570

Debugging Ruby
Debugging RubyDebugging Ruby
Debugging Ruby

This document provides information on various debugging and profiling tools that can be used for Ruby including: - lsof to list open files for a process - strace to trace system calls and signals - tcpdump to dump network traffic - google perftools profiler for CPU profiling - pprof to analyze profiling data It also discusses how some of these tools have helped identify specific performance issues with Ruby like excessive calls to sigprocmask and memcpy calls slowing down EventMachine with threads.

debugginggdbperftools
• gateway
#  route  add  default  gw 192.168.1.1
• IP  
#  route  add  -­‐net  192.168.115.0  netmask
255.255.255.0  -­‐dev  eth1
• IP
#  ifconfig eth0  192.168.1.1  netmask 255.255.255.0
•
•
•
#  arp
Address                        HWtype HWaddress Flags  Mask       Iface
192.168.56.1         ether      08:00:27:00:c4:7a      C                     enp0s8
10.0.2.2                 ether      52:54:00:12:35:02      C                       enp0s3
• ARP  
#  arp -­‐s  192.168.1.1  AA:BB:CC:DD:EE:FF
• ARP  
# arp -­‐d  192.168.1.1
•
•
•
•
•
•
•
•

Recommended for you

Source Code of Building Linux IPv6 DNS Server (Complete Sourcecode)
Source Code of Building Linux IPv6 DNS Server (Complete Sourcecode)Source Code of Building Linux IPv6 DNS Server (Complete Sourcecode)
Source Code of Building Linux IPv6 DNS Server (Complete Sourcecode)

This document discusses building a Linux IPv6 DNS server. It includes shell scripts and C source code files to perform tasks like checking system details, ensuring root user privileges, cleaning directories, building kernel images, backing up source directories, and adding members to a server via a GUI. The scripts and programs work together to configure, build, and run an IPv6-enabled Linux DNS server.

sourcednsserver
Hadoop Installation
Hadoop InstallationHadoop Installation
Hadoop Installation

To know more, Register for Online Hadoop Training at WizIQ. Click here : http://www.wiziq.com/course/21308-hadoop-big-data-training A complete guide to Hadoop Installation that will help you when ever you face problems while installing Hadoop !!

hadoophadoop installationinstallation
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

The document discusses reverse engineering the firmware of Swisscom's Centro Grande modems. It identifies several vulnerabilities found, including a command overflow issue that allows complete control of the device by exceeding the input buffer, and multiple buffer overflow issues that can be exploited to execute code remotely by crafting specially formatted XML files. Details are provided on the exploitation techniques and timeline of coordination with Swisscom to address the vulnerabilities.

infosecsecuritycybsec16
•
• enp0s8  
#  tcpdump -­‐i enp0s8
• port   ASCII  
#  tcpdump -­‐A  -­‐i enp0s8  'port  21'
#  tcpdump -­‐A  -­‐i enp0s8  'tcp and  port  21  and  host  
192.168.1.1'
22:03:44.870107  IP  localhost.localdomain.54068  >  adl-­‐
12.csie.ncu.edu.tw.http:  Flags  [P.],  seq 1:17,  ack 1,  win  
14600,  length  16
E..8..@.@...
....s5..4.P...x.t6.P.9.....GET  /  HTTP/1.1
• telnet sparc11.cc.ncu.edu.tw
tcpdump
Linux 系統管理與安全:進階系統管理系統防駭與資訊安全
•
•

Recommended for you

Debugging linux issues with eBPF
Debugging linux issues with eBPFDebugging linux issues with eBPF
Debugging linux issues with eBPF

Presented at LISA18: https://www.usenix.org/conference/lisa18/presentation/babrou This is a technical dive into how we used eBPF to solve real-world issues uncovered during an innocent OS upgrade. We'll see how we debugged 10x CPU increase in Kafka after Debian upgrade and what lessons we learned. We'll get from high-level effects like increased CPU to flamegraphs showing us where the problem lies to tracing timers and functions calls in the Linux kernel. The focus is on tools what operational engineers can use to debug performance issues in production. This particular issue happened at Cloudflare on a Kafka cluster doing 100Gbps of ingress and many multiple of that egress.

ebpflinux
Linux networking
Linux networkingLinux networking
Linux networking

This document provides a summary of common Linux network tools including ifconfig, netstat, route, ping, traceroute, iptables, netcat, rinetd, tcpdump, and tcpreplay. It describes what each tool is used for at a high level, such as configuring network interfaces, displaying network status, manipulating network routes, testing network connectivity, implementing firewalls, and capturing/replaying network traffic. The document also provides basic introductions to IPv4 and IPv6 addressing and routing concepts.

networkinglinux
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)

The document discusses various Linux performance analysis tools including lsof to list open files, strace to trace system calls, tcpdump to dump network traffic, perftools from Google for profiling CPU usage, and a Ruby library called perftools.rb for profiling Ruby code. Examples are provided for using these tools to analyze memory usage, slow queries, Ruby interpreter signals, thread scheduling overhead, and identifying hot spots in Ruby web applications.

highload 2011
• #  yum  install  logwatch
• #  cp /usr/share/logwatch/default.conf/logwatch.conf
/etc/logwatch/conf/logwatch.conf
• /etc/cron.daily/0logwatch  
• #  vim  /etc/logwatch/conf/logwatch.conf
#   stdout mail   file
Output  =  mail
#   Html
Format  =  text
#   email  
MailTo =  root
MailFrom =  Logwatch
#   log  
Range  =  yesterday
#   log  level Low,  Med,  High
Detail  =  Low
#   /usr/share/logwatch/default.conf/services  
Service  =  All
•
#  logwatch -­‐-­‐detail  Low  -­‐-­‐output  stdout -­‐-­‐service  
all  -­‐-­‐range  today
•
#  logwatch -­‐-­‐detail  Low  -­‐-­‐output  mail  -­‐-­‐mailto  
sntc06@gmail.com  -­‐-­‐service  all  -­‐-­‐range  yesterday
•

Recommended for you

Honeypots - November 8th Misec presentation
Honeypots - November 8th Misec presentationHoneypots - November 8th Misec presentation
Honeypots - November 8th Misec presentation

A low-interaction honeypot was deployed in multiple cloud environments. Various malware samples were captured, including Conficker and other viruses. Analysis of IP addresses and packet captures revealed attempts to exploit Microsoft SQL Server, Windows shares, and RDP ports. The diverse environments allowed collection of malware from around the world.

honeypots
Hacking the swisscom modem
Hacking the swisscom modemHacking the swisscom modem
Hacking the swisscom modem

The document discusses hacking the Swisscom modem by exploiting default credentials to gain access. Upon login, the author runs commands to investigate the system such as viewing configuration files and mapping the internal network. Various system details are discovered including the Linux kernel version and software components.

OSDC 2017 - Werner Fischer - Linux performance profiling and monitoring
OSDC 2017 - Werner Fischer - Linux performance profiling and monitoringOSDC 2017 - Werner Fischer - Linux performance profiling and monitoring
OSDC 2017 - Werner Fischer - Linux performance profiling and monitoring

Nowadays system administrators have great choices when it comes down to Linux performance profiling and monitoring. The challenge is to pick the appropriate tools and interpret their results correctly. This talk is a chance to take a tour through various performance profiling and benchmarking tools, focusing on their benefit for every sysadmin. More than 25 different tools are presented. Ranging from well known tools like strace, iostat, tcpdump or vmstat to new features like Linux tracepoints or perf_events. You will also learn which tools can be monitored by Icinga and which monitoring plugins are already available for that. At the end the goal is to gather reference points to look at, whenever you are faced with performance problems. Take the chance to close your knowledge gaps and learn how to get the most out of your system.

osdc 2017
Linux 系統管理與安全:進階系統管理系統防駭與資訊安全
•
• /etc/cron.d/sysstat
#  sar |  head  -­‐n  5
Linux  3.10.0-­‐123.20.1.el7.x86_64  (localhost.localdomain)
00 00 01 CPU          %user          %nice      %system      %iowait %steal          %idle
00 10 01 all            0.02            0.00            0.05            0.01            0.00          99.92
00 20 01 all            0.02            0.00            0.05            0.00            0.00          99.93
#  Run  system  activity  accounting  tool  every  10  minutes
*/10  *  *  *  *  root  /usr/lib64/sa/sa1  1  1
#  0  *  *  *  *  root  /usr/lib64/sa/sa1  600  6  &
#  Generate  a  daily  summary  of  process  accounting  at  23:53
53  23  *  *  *  root  /usr/lib64/sa/sa2  -­‐A
•
• $  uptime
18:20:06  up  220  days,  19:46,    2  users,    load  
average:  0.00,  0.01,  0.05
•
•
•
•
•
•
$  free  -­‐h
total              used              free          shared        buffers          cached
Mem:                    7.8G              7.6G              193M                42M              111M              3.3G
-­‐/+  buffers/cache:              4.2G              3.6G
2.0G                38M              2.0G
#  vmstat -­‐S  MB
procs -­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐memory-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐ -­‐-­‐-­‐swap-­‐-­‐ -­‐-­‐-­‐-­‐-­‐io-­‐-­‐-­‐-­‐ -­‐system-­‐-­‐ -­‐-­‐-­‐-­‐-­‐-­‐cpu-­‐-­‐-­‐-­‐-­‐
r    b      swpd free      buff    cache      si so        bi        bo in      cs us  sy id  wa st
1    0          38        191        116      3395        0        0          8          6      15        1    2    0  98    0    0

Recommended for you

DPDK layer for porting IPS-IDS
DPDK layer for porting IPS-IDSDPDK layer for porting IPS-IDS
DPDK layer for porting IPS-IDS

Step by Step look into bottlenecks and performance affecting in porting IDS/IPS application to run with DPDK multi-core VNF environment.

idsipsdpdk
Fine grained monitoring
Fine grained monitoringFine grained monitoring
Fine grained monitoring

One of the great challenges of of monitoring any large cluster is how much data to collect and how often to collect it. Those responsible for managing the cloud infrastructure want to see everything collected centrally which places limits on how much and how often. Developers on the other hand want to see as much detail as they can at as high a frequency as reasonable without impacting the overall cloud performance. To address what seems to be conflicting requirements, we've chosen a hybrid model at HP. Like many others, we have a centralized monitoring system that records a set of key system metrics for all servers at the granularity of 1 minute, but at the same time we do fine-grained local monitoring on each server of hundreds of metrics every second so when there are problems that need more details than are available centrally, one can go to the servers in question to see exactly what was going on at any specific time. The tool of choice for this fine-grained monitoring is the open source tool collectl, which additionally has an extensible api. It is through this api that we've developed a swift monitoring capability to not only capture the number of gets, put, etc every second, but using collectl's colmux utility, we can also display these in a top-like formact to see exactly what all the object and/or proxy servers are doing in real-time. We've also developer a second cability that allows one to see what the Virtual Machines are doing on each compute node in terms of CPU, disk and network traffic. This data can also be displayed in real-time with colmux. This talk will briefly introduce the audience to collectl's capabilities but more importantly show how it's used to augment any existing centralized monitoring infrastructure. Speakers Mark Seger

AWS re:Invent 2016: Making Every Packet Count (NET404)
AWS re:Invent 2016: Making Every Packet Count (NET404)AWS re:Invent 2016: Making Every Packet Count (NET404)
AWS re:Invent 2016: Making Every Packet Count (NET404)

Many applications are network I/O bound, including common database-based applications and service-based architectures. But operating systems and applications are often untuned to deliver high performance. This session uncovers hidden issues that lead to low network performance, and shows you how to overcome them to obtain the best network performance possible.

reinvent2016networkingamazon web services
•
• $  netstat
• -­‐n   IP  
• -­‐a   socket  ( )
• -­‐p   port   root  
• -­‐r  
•
• LISTEN SYN_RECV SYN_SENT ESTABLISHED
FIN_WAIT1…
• $  man  netstat
#  netstat -­‐nap
Active  Internet  connections  (servers  and  established)
Proto  Recv-­‐Q  Send-­‐Q  Local  Address                      Foreign  Address                  State              PID/Program  name
tcp 0            0  0.0.0.0:9091                        0.0.0.0:*                              LISTEN            906/transmission-­‐da
tcp 0            0  127.0.0.1:3306                    0.0.0.0:*                              LISTEN            1758/mysqld
tcp 0            0  127.0.0.1:6379                    0.0.0.0:*                              LISTEN            1841/redis-­‐server  1
tcp 0            0  0.0.0.0:21                            0.0.0.0:*                              LISTEN            1379/vsftpd
tcp 0            0  127.0.0.1:3350                    0.0.0.0:*                              LISTEN            2030/xrdp-­‐sesman
tcp 0            0  0.0.0.0:22                            0.0.0.0:*                              LISTEN            1569/sshd
tcp 0            0  192.168.1.200:64414          203.177.28.183:15044        SYN_RECV        -­‐
tcp 0            0  192.168.1.200:64414          117.211.86.108:258            SYN_RECV        -­‐
tcp 0            0  192.168.1.200:57429          82.78.229.223:8325            TIME_WAIT      -­‐
tcp 0            1  192.168.1.200:55339          79.112.227.120:6881          SYN_SENT        906/transmission-­‐da
tcp 0            1  192.168.1.200:56382          36.230.128.108:8290          SYN_SENT        906/transmission-­‐da
tcp 0            0  192.168.1.200:22                36.231.168.75:5091            ESTABLISHED  29422/sshd:  sntc06
tcp 0            0  192.168.1.200:64414          61.58.102.97:55302            ESTABLISHED  906/transmission-­‐da
tcp 0            0  127.0.0.1:3306                    127.0.0.1:42814                  ESTABLISHED  1758/mysqld
•
• iostat [ ]  [< >[< >]]
•   %util  
$  iostat -­‐d  -­‐x  1
Device:                  rrqm/s      wrqm/s          r/s          w/s        rkB/s        
wkB/s  avgrq-­‐sz avgqu-­‐sz await  r_await w_await svctm %util
sda 0.00          0.00        0.00      16.00          0.00      
188.00        23.50          0.00        0.00        0.00        0.00      0.00      0.00
•
•
•
•
•
#  yum  install  munin munin-­‐node
#  systemctl enable  munin-­‐node
• (   epel   )

Recommended for you

dokumen.tips_linux-networking-commands.ppt
dokumen.tips_linux-networking-commands.pptdokumen.tips_linux-networking-commands.ppt
dokumen.tips_linux-networking-commands.ppt

This document provides an overview of common Linux networking commands including ifconfig, route, ping, traceroute, nslookup, arp, dig, netstat, and dmesg. It describes what each command is used for and provides examples of basic syntax and usage. Key points covered include using ifconfig to configure network interfaces, route to view and manage routing tables, and netstat to view network connections and traffic.

LISA2019 Linux Systems Performance
LISA2019 Linux Systems PerformanceLISA2019 Linux Systems Performance
LISA2019 Linux Systems Performance

Talk by Brendan Gregg for USENIX LISA 2019: Linux Systems Performance. Abstract: " Systems performance is an effective discipline for performance analysis and tuning, and can help you find performance wins for your applications and the kernel. However, most of us are not performance or kernel engineers, and have limited time to study this topic. This talk summarizes the topic for everyone, touring six important areas of Linux systems performance: observability tools, methodologies, benchmarking, profiling, tracing, and tuning. Included are recipes for Linux performance analysis and tuning (using vmstat, mpstat, iostat, etc), overviews of complex areas including profiling (perf_events) and tracing (Ftrace, bcc/BPF, and bpftrace/BPF), and much advice about what is and isn't important to learn. This talk is aimed at everyone: developers, operations, sysadmins, etc, and in any environment running Linux, bare metal or the cloud."

linuxperformanceperformance tuning
test
testtest
test

This document provides an overview of Linux performance monitoring tools including mpstat, top, htop, vmstat, iostat, free, strace, and tcpdump. It discusses what each tool measures and how to use it to observe system performance and diagnose issues. The tools presented provide visibility into CPU usage, memory usage, disk I/O, network traffic, and system call activity which are essential for understanding workload performance on Linux systems.

pizza
• /etc/crontab
• /etc/httpd/conf.d/munin.conf
*/5  *  *  *  *          munin  test  -­‐x  /usr/bin/munin-­‐cron  &&  /usr/bin/munin-­‐cron
<Directory  /var/cache/munin/www>
Order  allow,deny
Allow  from  127.0.0.0/8  140.115.0.0/16  ::1
#  Require  ip 140.115
#if  apache  2.4
Options  None
</Directory>
•
#  htpasswd -­‐c  /etc/munin/munin-­‐htpasswd < >
• /etc/munin/munin.conf
[local.example.com]
address 127.0.0.1
use_node_name yes
•
• $  ls  /etc/munin/plugins
•
• Q
cpu if_err_enp0s3                mysql_innodb_bpool_act mysql_qcache_mem postfix_mailvolume
df if_err_enp0s8                mysql_innodb_insert_buf mysql_replication processes
df_inode interrupts                      mysql_innodb_io mysql_select_types proc_pri
diskstats irqstats mysql_innodb_io_pend mysql_slow swap
entropy                          load                                  mysql_innodb_log mysql_sorts threads
forks                              memory                              mysql_innodb_rows mysql_table_locks uptime
fw_conntrack mysql_bin_relay_log mysql_innodb_semaphores mysql_tmp_tables users
fw_forwarded_local mysql_commands mysql_innodb_tnx netstat vmstat
fw_packets mysql_connections mysql_myisam_indexes open_files
if_enp0s3                      mysql_files_tables mysql_network_traffic open_inodes
if_enp0s8                      mysql_innodb_bpool mysql_qcache postfix_mailqueue
•
•
•
• #  munin-­‐node-­‐configure  -­‐-­‐shell  
-­‐-­‐snmp <snmp_device>  -­‐-­‐snmpversion <ver>  
-­‐-­‐snmpcommunity <comm>

Recommended for you

(NET404) Making Every Packet Count
(NET404) Making Every Packet Count(NET404) Making Every Packet Count
(NET404) Making Every Packet Count

Many applications are network I/O bound, including common database-based applications and service-based architectures. But operating systems and applications are often untuned to deliver high performance. This session uncovers hidden issues that lead to low network performance, and shows you how to overcome them to obtain the best network performance possible.

net404awsamazon web services
Using Libtracecmd to Analyze Your Latency and Performance Troubles
Using Libtracecmd to Analyze Your Latency and Performance TroublesUsing Libtracecmd to Analyze Your Latency and Performance Troubles
Using Libtracecmd to Analyze Your Latency and Performance Troubles

Trying to figure out why your application is responding late can be difficult, especially if it is because of interference from the operating system. This talk will briefly go over how to write a C program that can analyze what in the Linux system is interfering with your application. It will use trace-cmd to enable kernel trace events as well as tracing lock functions, and it will then go over a quick tutorial on how to use libtracecmd to read the created trace.dat file to uncover what is the cause of interference to you application.

Linux Systems Performance 2016
Linux Systems Performance 2016Linux Systems Performance 2016
Linux Systems Performance 2016

Talk for PerconaLive 2016 by Brendan Gregg. Video: https://www.youtube.com/watch?v=CbmEDXq7es0 . "Systems performance provides a different perspective for analysis and tuning, and can help you find performance wins for your databases, applications, and the kernel. However, most of us are not performance or kernel engineers, and have limited time to study this topic. This talk summarizes six important areas of Linux systems performance in 50 minutes: observability tools, methodologies, benchmarking, profiling, tracing, and tuning. Included are recipes for Linux performance analysis and tuning (using vmstat, mpstat, iostat, etc), overviews of complex areas including profiling (perf_events), static tracing (tracepoints), and dynamic tracing (kprobes, uprobes), and much advice about what is and isn't important to learn. This talk is aimed at everyone: DBAs, developers, operations, etc, and in any environment running Linux, bare-metal or the cloud."

•
•
•

More Related Content

What's hot

What is suid, sgid and sticky bit
What is suid, sgid and sticky bit  What is suid, sgid and sticky bit
What is suid, sgid and sticky bit
Meenu Chopra
 
Opendaylight app development
Opendaylight app developmentOpendaylight app development
Opendaylight app development
vjanandr
 
IPv6 for Pentesters
IPv6 for PentestersIPv6 for Pentesters
IPv6 for Pentesters
camsec
 
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
Anne Nicolas
 
SSH: Seguranca no Acesso Remoto
SSH: Seguranca no Acesso RemotoSSH: Seguranca no Acesso Remoto
SSH: Seguranca no Acesso Remoto
Tiago Cruz
 
Getting started with RDO Havana
Getting started with RDO HavanaGetting started with RDO Havana
Getting started with RDO Havana
Dan Radez
 
Capital onehadoopclass
Capital onehadoopclassCapital onehadoopclass
Capital onehadoopclass
Doug Chang
 
Analysis of Compromised Linux Server
Analysis of Compromised Linux ServerAnalysis of Compromised Linux Server
Analysis of Compromised Linux Server
anandvaidya
 
Crash_Report_Mechanism_In_Tizen
Crash_Report_Mechanism_In_TizenCrash_Report_Mechanism_In_Tizen
Crash_Report_Mechanism_In_Tizen
Lex Yu
 
Linux Commands - 3
Linux Commands - 3Linux Commands - 3
Linux Commands - 3
Kanchilug
 
/etc/rc.d配下とかのリーディング勉強会
/etc/rc.d配下とかのリーディング勉強会/etc/rc.d配下とかのリーディング勉強会
/etc/rc.d配下とかのリーディング勉強会
Naoya Nakazawa
 
Triangle OpenStack meetup 09 2013
Triangle OpenStack meetup 09 2013Triangle OpenStack meetup 09 2013
Triangle OpenStack meetup 09 2013
Dan Radez
 
Importance of sshfp and configuring sshfp for network devices
Importance of sshfp and configuring sshfp for network devicesImportance of sshfp and configuring sshfp for network devices
Importance of sshfp and configuring sshfp for network devices
Muhammad Moinur Rahman
 
Importance of SSHFP for Network Devices
Importance of SSHFP for Network DevicesImportance of SSHFP for Network Devices
Importance of SSHFP for Network Devices
APNIC
 
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
 
Proxy arp
Proxy arpProxy arp
Proxy arp
Marian Marinov
 
Debugging Ruby Systems
Debugging Ruby SystemsDebugging Ruby Systems
Debugging Ruby Systems
Engine Yard
 
Debugging Ruby
Debugging RubyDebugging Ruby
Debugging Ruby
Aman Gupta
 
Source Code of Building Linux IPv6 DNS Server (Complete Sourcecode)
Source Code of Building Linux IPv6 DNS Server (Complete Sourcecode)Source Code of Building Linux IPv6 DNS Server (Complete Sourcecode)
Source Code of Building Linux IPv6 DNS Server (Complete Sourcecode)
Hari
 
Hadoop Installation
Hadoop InstallationHadoop Installation
Hadoop Installation
mrinalsingh385
 

What's hot (20)

What is suid, sgid and sticky bit
What is suid, sgid and sticky bit  What is suid, sgid and sticky bit
What is suid, sgid and sticky bit
 
Opendaylight app development
Opendaylight app developmentOpendaylight app development
Opendaylight app development
 
IPv6 for Pentesters
IPv6 for PentestersIPv6 for Pentesters
IPv6 for Pentesters
 
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
 
SSH: Seguranca no Acesso Remoto
SSH: Seguranca no Acesso RemotoSSH: Seguranca no Acesso Remoto
SSH: Seguranca no Acesso Remoto
 
Getting started with RDO Havana
Getting started with RDO HavanaGetting started with RDO Havana
Getting started with RDO Havana
 
Capital onehadoopclass
Capital onehadoopclassCapital onehadoopclass
Capital onehadoopclass
 
Analysis of Compromised Linux Server
Analysis of Compromised Linux ServerAnalysis of Compromised Linux Server
Analysis of Compromised Linux Server
 
Crash_Report_Mechanism_In_Tizen
Crash_Report_Mechanism_In_TizenCrash_Report_Mechanism_In_Tizen
Crash_Report_Mechanism_In_Tizen
 
Linux Commands - 3
Linux Commands - 3Linux Commands - 3
Linux Commands - 3
 
/etc/rc.d配下とかのリーディング勉強会
/etc/rc.d配下とかのリーディング勉強会/etc/rc.d配下とかのリーディング勉強会
/etc/rc.d配下とかのリーディング勉強会
 
Triangle OpenStack meetup 09 2013
Triangle OpenStack meetup 09 2013Triangle OpenStack meetup 09 2013
Triangle OpenStack meetup 09 2013
 
Importance of sshfp and configuring sshfp for network devices
Importance of sshfp and configuring sshfp for network devicesImportance of sshfp and configuring sshfp for network devices
Importance of sshfp and configuring sshfp for network devices
 
Importance of SSHFP for Network Devices
Importance of SSHFP for Network DevicesImportance of SSHFP for Network Devices
Importance of SSHFP for Network Devices
 
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
 
Proxy arp
Proxy arpProxy arp
Proxy arp
 
Debugging Ruby Systems
Debugging Ruby SystemsDebugging Ruby Systems
Debugging Ruby Systems
 
Debugging Ruby
Debugging RubyDebugging Ruby
Debugging Ruby
 
Source Code of Building Linux IPv6 DNS Server (Complete Sourcecode)
Source Code of Building Linux IPv6 DNS Server (Complete Sourcecode)Source Code of Building Linux IPv6 DNS Server (Complete Sourcecode)
Source Code of Building Linux IPv6 DNS Server (Complete Sourcecode)
 
Hadoop Installation
Hadoop InstallationHadoop Installation
Hadoop Installation
 

Similar to Linux 系統管理與安全:進階系統管理系統防駭與資訊安全

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
Cyber Security Alliance
 
Debugging linux issues with eBPF
Debugging linux issues with eBPFDebugging linux issues with eBPF
Debugging linux issues with eBPF
Ivan Babrou
 
Linux networking
Linux networkingLinux networking
Linux networking
Armando Reis
 
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
 
Honeypots - November 8th Misec presentation
Honeypots - November 8th Misec presentationHoneypots - November 8th Misec presentation
Honeypots - November 8th Misec presentation
Tazdrumm3r
 
Hacking the swisscom modem
Hacking the swisscom modemHacking the swisscom modem
Hacking the swisscom modem
Cyber Security Alliance
 
OSDC 2017 - Werner Fischer - Linux performance profiling and monitoring
OSDC 2017 - Werner Fischer - Linux performance profiling and monitoringOSDC 2017 - Werner Fischer - Linux performance profiling and monitoring
OSDC 2017 - Werner Fischer - Linux performance profiling and monitoring
NETWAYS
 
DPDK layer for porting IPS-IDS
DPDK layer for porting IPS-IDSDPDK layer for porting IPS-IDS
DPDK layer for porting IPS-IDS
Vipin Varghese
 
Fine grained monitoring
Fine grained monitoringFine grained monitoring
Fine grained monitoring
Iben Rodriguez
 
AWS re:Invent 2016: Making Every Packet Count (NET404)
AWS re:Invent 2016: Making Every Packet Count (NET404)AWS re:Invent 2016: Making Every Packet Count (NET404)
AWS re:Invent 2016: Making Every Packet Count (NET404)
Amazon Web Services
 
dokumen.tips_linux-networking-commands.ppt
dokumen.tips_linux-networking-commands.pptdokumen.tips_linux-networking-commands.ppt
dokumen.tips_linux-networking-commands.ppt
ThorOdinson55
 
LISA2019 Linux Systems Performance
LISA2019 Linux Systems PerformanceLISA2019 Linux Systems Performance
LISA2019 Linux Systems Performance
Brendan Gregg
 
test
testtest
(NET404) Making Every Packet Count
(NET404) Making Every Packet Count(NET404) Making Every Packet Count
(NET404) Making Every Packet Count
Amazon Web Services
 
Using Libtracecmd to Analyze Your Latency and Performance Troubles
Using Libtracecmd to Analyze Your Latency and Performance TroublesUsing Libtracecmd to Analyze Your Latency and Performance Troubles
Using Libtracecmd to Analyze Your Latency and Performance Troubles
ScyllaDB
 
Linux Systems Performance 2016
Linux Systems Performance 2016Linux Systems Performance 2016
Linux Systems Performance 2016
Brendan Gregg
 
C&C Botnet Factory
C&C Botnet FactoryC&C Botnet Factory
C&C Botnet Factory
Nullbyte Security Conference
 
hacking-embedded-devices.pptx
hacking-embedded-devices.pptxhacking-embedded-devices.pptx
hacking-embedded-devices.pptx
ssuserfcf43f
 
Percona Live UK 2014 Part III
Percona Live UK 2014  Part IIIPercona Live UK 2014  Part III
Percona Live UK 2014 Part III
Alkin Tezuysal
 
Как понять, что происходит на сервере? / Александр Крижановский (NatSys Lab.,...
Как понять, что происходит на сервере? / Александр Крижановский (NatSys Lab.,...Как понять, что происходит на сервере? / Александр Крижановский (NatSys Lab.,...
Как понять, что происходит на сервере? / Александр Крижановский (NatSys Lab.,...
Ontico
 

Similar to Linux 系統管理與安全:進階系統管理系統防駭與資訊安全 (20)

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
 
Debugging linux issues with eBPF
Debugging linux issues with eBPFDebugging linux issues with eBPF
Debugging linux issues with eBPF
 
Linux networking
Linux networkingLinux networking
Linux networking
 
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)
 
Honeypots - November 8th Misec presentation
Honeypots - November 8th Misec presentationHoneypots - November 8th Misec presentation
Honeypots - November 8th Misec presentation
 
Hacking the swisscom modem
Hacking the swisscom modemHacking the swisscom modem
Hacking the swisscom modem
 
OSDC 2017 - Werner Fischer - Linux performance profiling and monitoring
OSDC 2017 - Werner Fischer - Linux performance profiling and monitoringOSDC 2017 - Werner Fischer - Linux performance profiling and monitoring
OSDC 2017 - Werner Fischer - Linux performance profiling and monitoring
 
DPDK layer for porting IPS-IDS
DPDK layer for porting IPS-IDSDPDK layer for porting IPS-IDS
DPDK layer for porting IPS-IDS
 
Fine grained monitoring
Fine grained monitoringFine grained monitoring
Fine grained monitoring
 
AWS re:Invent 2016: Making Every Packet Count (NET404)
AWS re:Invent 2016: Making Every Packet Count (NET404)AWS re:Invent 2016: Making Every Packet Count (NET404)
AWS re:Invent 2016: Making Every Packet Count (NET404)
 
dokumen.tips_linux-networking-commands.ppt
dokumen.tips_linux-networking-commands.pptdokumen.tips_linux-networking-commands.ppt
dokumen.tips_linux-networking-commands.ppt
 
LISA2019 Linux Systems Performance
LISA2019 Linux Systems PerformanceLISA2019 Linux Systems Performance
LISA2019 Linux Systems Performance
 
test
testtest
test
 
(NET404) Making Every Packet Count
(NET404) Making Every Packet Count(NET404) Making Every Packet Count
(NET404) Making Every Packet Count
 
Using Libtracecmd to Analyze Your Latency and Performance Troubles
Using Libtracecmd to Analyze Your Latency and Performance TroublesUsing Libtracecmd to Analyze Your Latency and Performance Troubles
Using Libtracecmd to Analyze Your Latency and Performance Troubles
 
Linux Systems Performance 2016
Linux Systems Performance 2016Linux Systems Performance 2016
Linux Systems Performance 2016
 
C&C Botnet Factory
C&C Botnet FactoryC&C Botnet Factory
C&C Botnet Factory
 
hacking-embedded-devices.pptx
hacking-embedded-devices.pptxhacking-embedded-devices.pptx
hacking-embedded-devices.pptx
 
Percona Live UK 2014 Part III
Percona Live UK 2014  Part IIIPercona Live UK 2014  Part III
Percona Live UK 2014 Part III
 
Как понять, что происходит на сервере? / Александр Крижановский (NatSys Lab.,...
Как понять, что происходит на сервере? / Александр Крижановский (NatSys Lab.,...Как понять, что происходит на сервере? / Александр Крижановский (NatSys Lab.,...
Как понять, что происходит на сервере? / Александр Крижановский (NatSys Lab.,...
 

Recently uploaded

Advanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly DetectionAdvanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly Detection
Bert Blevins
 
How RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptxHow RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptx
SynapseIndia
 
How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf
HackersList
 
Calgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptxCalgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptx
ishalveerrandhawa1
 
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
Kief Morris
 
How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx
Adam Dunkels
 
The Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU CampusesThe Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU Campuses
Larry Smarr
 
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdfBT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
Neo4j
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
jackson110191
 
Implementations of Fused Deposition Modeling in real world
Implementations of Fused Deposition Modeling  in real worldImplementations of Fused Deposition Modeling  in real world
Implementations of Fused Deposition Modeling in real world
Emerging Tech
 
WPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide DeckWPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide Deck
Lidia A.
 
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
Mark Billinghurst
 
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyyActive Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
RaminGhanbari2
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
Safe Software
 
Measuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at TwitterMeasuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at Twitter
ScyllaDB
 
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
Yevgen Sysoyev
 
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Bert Blevins
 
Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...
BookNet Canada
 
Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024
BookNet Canada
 

Recently uploaded (20)

Advanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly DetectionAdvanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly Detection
 
How RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptxHow RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptx
 
How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf
 
Calgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptxCalgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptx
 
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
 
How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx
 
The Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU CampusesThe Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU Campuses
 
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdfBT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
 
Implementations of Fused Deposition Modeling in real world
Implementations of Fused Deposition Modeling  in real worldImplementations of Fused Deposition Modeling  in real world
Implementations of Fused Deposition Modeling in real world
 
WPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide DeckWPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide Deck
 
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
 
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyyActive Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
 
Measuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at TwitterMeasuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at Twitter
 
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
 
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
 
Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...
 
Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024
 

Linux 系統管理與安全:進階系統管理系統防駭與資訊安全

  • 4. • root:log/  #  ls  -­‐F anaconda/    btmp dmesg httpd/      mariadb/    ppp/                      secure        tuned/ audit/          chrony/    dmesg.old lastlog messages    sa/                        spooler      wtmp boot.log      cron grubby          maillog php-­‐fpm/    sa-­‐update.log    tallylog yum.log
  • 5. • kernel  message  buffer kernel   • kernel   $  dmesg • /var/log/dmesg • •
  • 7. • /var/log/messages • • syslog   Feb  14  00:01:50  localhost  kernel:  smpboot:  CPU0:  Intel(R)  Celeron(R)  CPU                 E3400    @  2.60GHz  (fam:  06,  model:  17,  stepping:  0a) Feb  14  00:01:50  localhost  kernel:  Performance  Events:  unsupported  p6  CPU  model  23  no   PMU  driver,  software  events  only. Feb  14  00:01:50  localhost  kernel:  Brought  up  1  CPUs Feb  14  00:01:50  localhost  kernel:  smpboot:  Total  of  1  processors  activated  (5202.48   BogoMIPS)
  • 8. • /var/log/cron • cron Apr    2  09:01:01  localhost  run-­‐parts(/etc/cron.hourly)[528]:  starting  0yum-­‐hourly.cron Apr    2  09:01:01  localhost  run-­‐parts(/etc/cron.hourly)[544]:  finished  0yum-­‐hourly.cron
  • 9. • /var/log/secure • • Apr    1  16:12:16  localhost  login:  pam_unix(login:session):  session  opened  for   user  root  by  LOGIN(uid=0) Apr    1  16:12:16  localhost  login:  ROOT  LOGIN  ON  tty1 Mar  29  07:43:34  yuki sshd[18247]:  pam_unix(sshd:auth):  authentication   failure;  logname=  uid=0  euid=0            tty=ssh ruser=  rhost=183.136.216.6     user=root Mar  29  07:43:36  yuki sshd[18247]:  Failed  password  for  root  from   183.136.216.6  port  45215  ssh2
  • 11. • daily weekly monthly yearly • anacron • /etc/cron.daily/logrotate
  • 12. • /etc/logrotate.d/httpd /var/log/httpd/*log  { daily #   minsize 1M #   1MB   missingok #   rotate  14 #   14 compress #   gzip delaycompress #   notifempty #   create  640  root  adm #   sharedscripts #   postrotate #   /bin/systemctl reload  httpd.service >  /dev/null  2>/dev/null  ||  true endscript prerotate #   #  do  nothing endscript } $  man  logrotate
  • 15. • • • 192.168.1.10  -­‐>  11000000  10101000  00000001  00001010
  • 17. • • • 192.168.1.100 • 192.168.1.100 -­‐>  11000000 10101000 00000001 01100100 • 255.255.255.224 • 255.255.255.224 -­‐>  11111111 11111111 11111111 11100000 • 11000000 10101000 00000001 01100000 • 192.168.1.96
  • 18. • 255.255.255.224 -­‐>  11111111 11111111 11111111 11100000 • 11100000  -­‐>  3   1  -­‐>  2^3  -­‐>  8   subnet • 256  /  8  =  32 • 32   IP   • 192.168.1.96  ~  192.168.1.127 • 192.168.1.127   broadcast
  • 19. • • class netmask subnet   id   • 255.255.224.0   11111111 11111111 11111111 11100000 27   1 • -­‐>   a.b.c.d/27 • 192.168.1.96/27 • • 140.115.0.0/16   140.115.1.1   ~  140.115.255.255   ( 255.255.0.0) • 192.168.1.0/24   192.168.1.1   ~  192.168.1.255   ( 255.255.255.0) Q 140.115.1.0/32  
  • 20. • • #  netstat –r / route • #  ip route #  netstat -­‐r Kernel  IP  routing  table Destination          Gateway                  Genmask Flags  Metric  Ref        Use  Iface default                  192.168.1.1          0.0.0.0                  UG        0            0                0  eth0 10.8.0.0                10.8.0.2                255.255.255.0      UG        0            0                0  tun0 10.8.0.2                *                              255.255.255.255  UH        0            0                0  tun0 link-­‐local            *                              255.255.0.0          U          1000      0                0  eth0 192.168.1.0          *                              255.255.255.0      U          0            0                0  eth0 10.8.0.0~10.8.0.255   IP tun0   10.8.0.2   gateway 10.8.0.2   IP   192.168.1.0~192.168.1.255   IP eth0   192.168.1.1   gateway
  • 21. • gateway #  route  add  default  gw 192.168.1.1 • IP   #  route  add  -­‐net  192.168.115.0  netmask 255.255.255.0  -­‐dev  eth1 • IP #  ifconfig eth0  192.168.1.1  netmask 255.255.255.0
  • 22. • • • #  arp Address                        HWtype HWaddress Flags  Mask       Iface 192.168.56.1         ether      08:00:27:00:c4:7a      C                     enp0s8 10.0.2.2                 ether      52:54:00:12:35:02      C                       enp0s3
  • 23. • ARP   #  arp -­‐s  192.168.1.1  AA:BB:CC:DD:EE:FF • ARP   # arp -­‐d  192.168.1.1
  • 25. • • enp0s8   #  tcpdump -­‐i enp0s8 • port   ASCII   #  tcpdump -­‐A  -­‐i enp0s8  'port  21' #  tcpdump -­‐A  -­‐i enp0s8  'tcp and  port  21  and  host   192.168.1.1' 22:03:44.870107  IP  localhost.localdomain.54068  >  adl-­‐ 12.csie.ncu.edu.tw.http:  Flags  [P.],  seq 1:17,  ack 1,  win   14600,  length  16 E..8..@.@... ....s5..4.P...x.t6.P.9.....GET  /  HTTP/1.1
  • 29. • #  yum  install  logwatch • #  cp /usr/share/logwatch/default.conf/logwatch.conf /etc/logwatch/conf/logwatch.conf • /etc/cron.daily/0logwatch  
  • 30. • #  vim  /etc/logwatch/conf/logwatch.conf #   stdout mail   file Output  =  mail #   Html Format  =  text #   email   MailTo =  root MailFrom =  Logwatch #   log   Range  =  yesterday #   log  level Low,  Med,  High Detail  =  Low #   /usr/share/logwatch/default.conf/services   Service  =  All
  • 31. • #  logwatch -­‐-­‐detail  Low  -­‐-­‐output  stdout -­‐-­‐service   all  -­‐-­‐range  today • #  logwatch -­‐-­‐detail  Low  -­‐-­‐output  mail  -­‐-­‐mailto   sntc06@gmail.com  -­‐-­‐service  all  -­‐-­‐range  yesterday
  • 32.
  • 34. • • /etc/cron.d/sysstat #  sar |  head  -­‐n  5 Linux  3.10.0-­‐123.20.1.el7.x86_64  (localhost.localdomain) 00 00 01 CPU          %user          %nice      %system      %iowait %steal          %idle 00 10 01 all            0.02            0.00            0.05            0.01            0.00          99.92 00 20 01 all            0.02            0.00            0.05            0.00            0.00          99.93 #  Run  system  activity  accounting  tool  every  10  minutes */10  *  *  *  *  root  /usr/lib64/sa/sa1  1  1 #  0  *  *  *  *  root  /usr/lib64/sa/sa1  600  6  & #  Generate  a  daily  summary  of  process  accounting  at  23:53 53  23  *  *  *  root  /usr/lib64/sa/sa2  -­‐A
  • 35. • • $  uptime 18:20:06  up  220  days,  19:46,    2  users,    load   average:  0.00,  0.01,  0.05 • • • •
  • 36. • • $  free  -­‐h total              used              free          shared        buffers          cached Mem:                    7.8G              7.6G              193M                42M              111M              3.3G -­‐/+  buffers/cache:              4.2G              3.6G 2.0G                38M              2.0G #  vmstat -­‐S  MB procs -­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐memory-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐ -­‐-­‐-­‐swap-­‐-­‐ -­‐-­‐-­‐-­‐-­‐io-­‐-­‐-­‐-­‐ -­‐system-­‐-­‐ -­‐-­‐-­‐-­‐-­‐-­‐cpu-­‐-­‐-­‐-­‐-­‐ r    b      swpd free      buff    cache      si so        bi        bo in      cs us  sy id  wa st 1    0          38        191        116      3395        0        0          8          6      15        1    2    0  98    0    0
  • 37. • • $  netstat • -­‐n   IP   • -­‐a   socket  ( ) • -­‐p   port   root   • -­‐r  
  • 38. • • LISTEN SYN_RECV SYN_SENT ESTABLISHED FIN_WAIT1… • $  man  netstat #  netstat -­‐nap Active  Internet  connections  (servers  and  established) Proto  Recv-­‐Q  Send-­‐Q  Local  Address                      Foreign  Address                  State              PID/Program  name tcp 0         ��  0  0.0.0.0:9091                        0.0.0.0:*                              LISTEN            906/transmission-­‐da tcp 0            0  127.0.0.1:3306                    0.0.0.0:*                              LISTEN            1758/mysqld tcp 0            0  127.0.0.1:6379                    0.0.0.0:*                              LISTEN            1841/redis-­‐server  1 tcp 0            0  0.0.0.0:21                            0.0.0.0:*                              LISTEN            1379/vsftpd tcp 0            0  127.0.0.1:3350                    0.0.0.0:*                              LISTEN            2030/xrdp-­‐sesman tcp 0            0  0.0.0.0:22                            0.0.0.0:*                              LISTEN            1569/sshd tcp 0            0  192.168.1.200:64414          203.177.28.183:15044        SYN_RECV        -­‐ tcp 0            0  192.168.1.200:64414          117.211.86.108:258            SYN_RECV        -­‐ tcp 0            0  192.168.1.200:57429          82.78.229.223:8325            TIME_WAIT      -­‐ tcp 0            1  192.168.1.200:55339          79.112.227.120:6881          SYN_SENT        906/transmission-­‐da tcp 0            1  192.168.1.200:56382          36.230.128.108:8290          SYN_SENT        906/transmission-­‐da tcp 0            0  192.168.1.200:22                36.231.168.75:5091            ESTABLISHED  29422/sshd:  sntc06 tcp 0            0  192.168.1.200:64414          61.58.102.97:55302            ESTABLISHED  906/transmission-­‐da tcp 0            0  127.0.0.1:3306                    127.0.0.1:42814                  ESTABLISHED  1758/mysqld
  • 39. • • iostat [ ]  [< >[< >]] •  %util   $  iostat -­‐d  -­‐x  1 Device:                  rrqm/s      wrqm/s          r/s          w/s        rkB/s         wkB/s  avgrq-­‐sz avgqu-­‐sz await  r_await w_await svctm %util sda 0.00          0.00        0.00      16.00          0.00       188.00        23.50          0.00        0.00        0.00        0.00      0.00      0.00
  • 40. • • • • • #  yum  install  munin munin-­‐node #  systemctl enable  munin-­‐node • (  epel   )
  • 41. • /etc/crontab • /etc/httpd/conf.d/munin.conf */5  *  *  *  *          munin  test  -­‐x  /usr/bin/munin-­‐cron  &&  /usr/bin/munin-­‐cron <Directory  /var/cache/munin/www> Order  allow,deny Allow  from  127.0.0.0/8  140.115.0.0/16  ::1 #  Require  ip 140.115 #if  apache  2.4 Options  None </Directory>
  • 42. • #  htpasswd -­‐c  /etc/munin/munin-­‐htpasswd < > • /etc/munin/munin.conf [local.example.com] address 127.0.0.1 use_node_name yes
  • 43. • • $  ls  /etc/munin/plugins • • Q cpu if_err_enp0s3                mysql_innodb_bpool_act mysql_qcache_mem postfix_mailvolume df if_err_enp0s8                mysql_innodb_insert_buf mysql_replication processes df_inode interrupts                      mysql_innodb_io mysql_select_types proc_pri diskstats irqstats mysql_innodb_io_pend mysql_slow swap entropy                          load                                  mysql_innodb_log mysql_sorts threads forks                              memory                              mysql_innodb_rows mysql_table_locks uptime fw_conntrack mysql_bin_relay_log mysql_innodb_semaphores mysql_tmp_tables users fw_forwarded_local mysql_commands mysql_innodb_tnx netstat vmstat fw_packets mysql_connections mysql_myisam_indexes open_files if_enp0s3                      mysql_files_tables mysql_network_traffic open_inodes if_enp0s8                      mysql_innodb_bpool mysql_qcache postfix_mailqueue
  • 44. • • • • #  munin-­‐node-­‐configure  -­‐-­‐shell   -­‐-­‐snmp <snmp_device>  -­‐-­‐snmpversion <ver>   -­‐-­‐snmpcommunity <comm>