SlideShare une entreprise Scribd logo
1  sur  22
Télécharger pour lire hors ligne
26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa
file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 1/22
SECRETS OF A LINUX NINJA
Created by /Mark Clarke @mxc4
26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa
file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 2/22
LESSON 1: SSH! A NINJA IS SILENT!
26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa
file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 3/22
Access lan based services via incoming SSH access,
Get external SSH access even if its not enabled,
Forward X sessions over SSH,
Bypass web proxy restrictions
“Take things as they are. Punch when you have to punch. Kick
when you have to kick.”
26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa
file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 4/22
LAB SET UP
Micro-server represents lan. Laptop virtual machine represents external host. Laptop host
machine is gateway
Lan Net:192.168.1.0/24
External Net:192.168.122.0/24
Gateway:192.168.1.4/192.168.122.1
Lan Host:192.168.1.3
External Host:192.168.122.192
26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa
file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 5/22
ACCESS A LAN BASED SERVICE WITH INCOMING SSH
ACCESS
Scenario:
You have ssh access to the lan but no VPN access,
You need to access a web application running on the lan.
Web App: http://192.168.1.3/ninja.html
26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa
file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 6/22
GET EXTERNAL SSH ACCESS EVEN IF ITS NOT ENABLED
Scenario:
You have no external ssh access to network
You can connect to external ssh servers from the lan
26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa
file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 7/22
FORWARD X SESSIONS OVER SSH
Scenario:
XDMCP is disabled,
You have SSH access,
XForwarding is enabled in sshd config file,
26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa
file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 8/22
BYPASS WEB PROXY RESTRICTIONS
Scenario:
Your offices uses a web proxy which restricts traffic to sites with vital information,
You have external SSH access,
26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa
file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 9/22
LESSON 2: NINJA MOVES
26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa
file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 10/22
Transferring files over SSH
Resuming partial transfers over SSH
Mounting a share over SSH
Transferring files with netcat
“Do not pray for an easy life, pray for the strength to endure a
difficult one.”
26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa
file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 11/22
TRANSFERRING FILES OVER SSH
Scenario:
You have no ftp/NFS/Samba share access on the server.
You need to copy over a file.
You have SSH access.
26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa
file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 12/22
RESUMING PARTIAL TRANSFERS OVER SSH
Scenario:
You are using scp to copy files,
Your download 60 minute download interrupts after 40 minutes and you want to
resume.
26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa
file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 13/22
MOUNTING A SHARE OVER SSH
Scenario:
You want to mount a remote folder on a server,
You have no share access,
Only have SSH access
26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa
file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 14/22
TRANSFERRING FILES WITH NETCAT
Scenario:
You need to transfer a file and have no SSH access.
26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa
file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 15/22
LESSON 3: A NINJA OBSERVES
26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa
file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 16/22
Monitoring disks for signs of failure
Command line tools: iotop,vmstat,iostat,psacct
“I fear not the man who has practiced 10,000 kicks once, but I
fear the man who has practiced one kick 10,000 times.”
26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa
file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 17/22
MONITORING DISKS FOR SIGNS OF FAILURE
Scenario:
You know your disks will fail. You just don't know when.
Use smartctl to monitor your disks.
26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa
file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 18/22
COMMAND LINE TOOLS
Scenario:
What process is grinding your disks? - iotop
Where is the bottle neck - disk io, memory or network - vmstat
Which user or system account is using all your resources - psacct
Your server crashes and you don't know why - sar
26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa
file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 19/22
LESSON 4: A CLEAN KILL
26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa
file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 20/22
Using regular expressions to kill
Who is preventing you from unmounting a block device?
“Take things as they are. Punch when you have to punch. Kick
when you have to kick.”
26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa
file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 21/22
USING REGULAR EXPRESSIONS TO KILL
Scenario:
You have a process to kill often and it a mission to get its pid all the time
pkill
killall -r
26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa
file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 22/22
WHO IS PREVENTING YOU FROM UNMOUNTING A BLOCK
DEVICE?
Scenario:
You trying to unmount a device but you can't because a process/user is accessing it
fuser

Contenu connexe

Tendances

Defcon Moscow #0x0A - Oleg Kupreev "Uncommon MiTM in uncommon conditions"
Defcon Moscow #0x0A - Oleg Kupreev "Uncommon MiTM in uncommon conditions"Defcon Moscow #0x0A - Oleg Kupreev "Uncommon MiTM in uncommon conditions"
Defcon Moscow #0x0A - Oleg Kupreev "Uncommon MiTM in uncommon conditions"
Defcon Moscow
 

Tendances (16)

Internet Of Things: Hands on: YOW! night
Internet Of Things: Hands on: YOW! nightInternet Of Things: Hands on: YOW! night
Internet Of Things: Hands on: YOW! night
 
Programming esp8266
Programming esp8266Programming esp8266
Programming esp8266
 
Programando o ESP8266 com Python
Programando o ESP8266 com PythonProgramando o ESP8266 com Python
Programando o ESP8266 com Python
 
Home Automation by ESP8266
Home Automation by ESP8266Home Automation by ESP8266
Home Automation by ESP8266
 
lwM2M OTA for ESP8266
lwM2M OTA for ESP8266lwM2M OTA for ESP8266
lwM2M OTA for ESP8266
 
Backtrack
BacktrackBacktrack
Backtrack
 
Gadgets
GadgetsGadgets
Gadgets
 
Backtrack os 5
Backtrack os 5Backtrack os 5
Backtrack os 5
 
Backtrack
BacktrackBacktrack
Backtrack
 
Build WiFi gadgets using esp8266
Build WiFi gadgets using esp8266Build WiFi gadgets using esp8266
Build WiFi gadgets using esp8266
 
Nodemcu - introduction
Nodemcu - introductionNodemcu - introduction
Nodemcu - introduction
 
Wispi: Mini Karma Router For Pentester - Rama Tri Nanda
Wispi: Mini Karma Router For Pentester - Rama Tri NandaWispi: Mini Karma Router For Pentester - Rama Tri Nanda
Wispi: Mini Karma Router For Pentester - Rama Tri Nanda
 
Defcon Moscow #0x0A - Oleg Kupreev "Uncommon MiTM in uncommon conditions"
Defcon Moscow #0x0A - Oleg Kupreev "Uncommon MiTM in uncommon conditions"Defcon Moscow #0x0A - Oleg Kupreev "Uncommon MiTM in uncommon conditions"
Defcon Moscow #0x0A - Oleg Kupreev "Uncommon MiTM in uncommon conditions"
 
Firmware hacking, slash the pineapple for fun
Firmware hacking, slash the pineapple for funFirmware hacking, slash the pineapple for fun
Firmware hacking, slash the pineapple for fun
 
Suricata
SuricataSuricata
Suricata
 
[English] BackBox Linux and Metasploit: A practical demonstration of the Shel...
[English] BackBox Linux and Metasploit: A practical demonstration of the Shel...[English] BackBox Linux and Metasploit: A practical demonstration of the Shel...
[English] BackBox Linux and Metasploit: A practical demonstration of the Shel...
 

En vedette

이준희 소개자료
이준희 소개자료이준희 소개자료
이준희 소개자료
Lee JunHee
 

En vedette (6)

Google Glass in a Programmer's View
Google Glass in a Programmer's ViewGoogle Glass in a Programmer's View
Google Glass in a Programmer's View
 
Google Glass What Is it
Google Glass What Is itGoogle Glass What Is it
Google Glass What Is it
 
SELinux Johannesburg Linux User Group (JoziJUg)
SELinux Johannesburg Linux User Group (JoziJUg)SELinux Johannesburg Linux User Group (JoziJUg)
SELinux Johannesburg Linux User Group (JoziJUg)
 
IPv6 How To Set Up a Linux IPv6 Lan
IPv6 How To Set Up  a Linux IPv6 LanIPv6 How To Set Up  a Linux IPv6 Lan
IPv6 How To Set Up a Linux IPv6 Lan
 
M-Learning application development with open source
M-Learning application development with open sourceM-Learning application development with open source
M-Learning application development with open source
 
이준희 소개자료
이준희 소개자료이준희 소개자료
이준희 소개자료
 

Similaire à Secrets of a linux ninja Software Freedom Day 2013 Johannesburg, South Africa

Mirage: Extreme Specialization Of Cloud Appliances
Mirage: Extreme Specialization Of Cloud AppliancesMirage: Extreme Specialization Of Cloud Appliances
Mirage: Extreme Specialization Of Cloud Appliances
The Linux Foundation
 
20131015_demo_oshk
20131015_demo_oshk20131015_demo_oshk
20131015_demo_oshk
Jeff Yang
 
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Opersys inc.
 

Similaire à Secrets of a linux ninja Software Freedom Day 2013 Johannesburg, South Africa (20)

Mirage: Extreme Specialization Of Cloud Appliances
Mirage: Extreme Specialization Of Cloud AppliancesMirage: Extreme Specialization Of Cloud Appliances
Mirage: Extreme Specialization Of Cloud Appliances
 
Mirage - Extreme specialization of cloud appliances (OSCON 2013)
Mirage - Extreme specialization of cloud appliances (OSCON 2013)Mirage - Extreme specialization of cloud appliances (OSCON 2013)
Mirage - Extreme specialization of cloud appliances (OSCON 2013)
 
Attacking IoT Devices from a Web Perspective - Linux Day
Attacking IoT Devices from a Web Perspective - Linux Day Attacking IoT Devices from a Web Perspective - Linux Day
Attacking IoT Devices from a Web Perspective - Linux Day
 
stackconf 2020 | Speeding up Linux disk encryption by Ignat Korchagin
stackconf 2020 | Speeding up Linux disk encryption by Ignat Korchaginstackconf 2020 | Speeding up Linux disk encryption by Ignat Korchagin
stackconf 2020 | Speeding up Linux disk encryption by Ignat Korchagin
 
Don't Get Hacked on Hostile WiFi
Don't Get Hacked on Hostile WiFiDon't Get Hacked on Hostile WiFi
Don't Get Hacked on Hostile WiFi
 
Polstra 44con2012
Polstra 44con2012Polstra 44con2012
Polstra 44con2012
 
Hacking and Forensics on the Go - 44CON 2012
Hacking and Forensics on the Go - 44CON 2012Hacking and Forensics on the Go - 44CON 2012
Hacking and Forensics on the Go - 44CON 2012
 
Embedded Android Workshop part I ESC SV 2012
Embedded Android Workshop part I ESC SV 2012Embedded Android Workshop part I ESC SV 2012
Embedded Android Workshop part I ESC SV 2012
 
Fail2ban - the system security for green hand -on linux os
Fail2ban  - the system security  for green hand -on linux osFail2ban  - the system security  for green hand -on linux os
Fail2ban - the system security for green hand -on linux os
 
Linux GUI Applications on Windows Subsystem for Linux
Linux GUI Applications on Windows Subsystem for LinuxLinux GUI Applications on Windows Subsystem for Linux
Linux GUI Applications on Windows Subsystem for Linux
 
Sicurezza informatica
Sicurezza informaticaSicurezza informatica
Sicurezza informatica
 
20131015_demo_oshk
20131015_demo_oshk20131015_demo_oshk
20131015_demo_oshk
 
Summer of Fuzz: macOS
Summer of Fuzz: macOSSummer of Fuzz: macOS
Summer of Fuzz: macOS
 
How can OpenNebula fit your needs - OpenNebulaConf 2013
How can OpenNebula fit your needs - OpenNebulaConf 2013 How can OpenNebula fit your needs - OpenNebulaConf 2013
How can OpenNebula fit your needs - OpenNebulaConf 2013
 
Implementing Active Security with Sysdig Falco - Barcelona Software Crafters
Implementing Active Security with Sysdig Falco - Barcelona Software CraftersImplementing Active Security with Sysdig Falco - Barcelona Software Crafters
Implementing Active Security with Sysdig Falco - Barcelona Software Crafters
 
[DockerCon 2020] Hardening Docker daemon with Rootless Mode
[DockerCon 2020] Hardening Docker daemon with Rootless Mode[DockerCon 2020] Hardening Docker daemon with Rootless Mode
[DockerCon 2020] Hardening Docker daemon with Rootless Mode
 
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
 
DevOpSec_DockerNPodMan-20230220.pdf
DevOpSec_DockerNPodMan-20230220.pdfDevOpSec_DockerNPodMan-20230220.pdf
DevOpSec_DockerNPodMan-20230220.pdf
 
[DockerCon 2019] Hardening Docker daemon with Rootless mode
[DockerCon 2019] Hardening Docker daemon with Rootless mode[DockerCon 2019] Hardening Docker daemon with Rootless mode
[DockerCon 2019] Hardening Docker daemon with Rootless mode
 
DCSF19 Hardening Docker daemon with Rootless mode
DCSF19 Hardening Docker daemon with Rootless modeDCSF19 Hardening Docker daemon with Rootless mode
DCSF19 Hardening Docker daemon with Rootless mode
 

Plus de Jumping Bean

IPv6 - Jozi Linux User Group Presentation
IPv6  - Jozi Linux User Group PresentationIPv6  - Jozi Linux User Group Presentation
IPv6 - Jozi Linux User Group Presentation
Jumping Bean
 

Plus de Jumping Bean (12)

DevOpsDaysCPT Ansible Infrastrucutre as Code 2017
DevOpsDaysCPT Ansible Infrastrucutre as Code 2017DevOpsDaysCPT Ansible Infrastrucutre as Code 2017
DevOpsDaysCPT Ansible Infrastrucutre as Code 2017
 
Postgrtesql as a NoSQL Document Store - The JSON/JSONB data type
Postgrtesql as a NoSQL Document Store - The JSON/JSONB data typePostgrtesql as a NoSQL Document Store - The JSON/JSONB data type
Postgrtesql as a NoSQL Document Store - The JSON/JSONB data type
 
React - The JavaScript Library for User Interfaces
React - The JavaScript Library for User InterfacesReact - The JavaScript Library for User Interfaces
React - The JavaScript Library for User Interfaces
 
HTML 5 & The Modern Web
HTML 5 & The Modern WebHTML 5 & The Modern Web
HTML 5 & The Modern Web
 
Building games-with-libgdx
Building games-with-libgdxBuilding games-with-libgdx
Building games-with-libgdx
 
Linux Containers & Docker
Linux Containers & DockerLinux Containers & Docker
Linux Containers & Docker
 
Introduction to Web Sockets
Introduction to Web SocketsIntroduction to Web Sockets
Introduction to Web Sockets
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
 
Glassfish An Introduction
Glassfish An IntroductionGlassfish An Introduction
Glassfish An Introduction
 
Java logging
Java loggingJava logging
Java logging
 
IPv6 - Jozi Linux User Group Presentation
IPv6  - Jozi Linux User Group PresentationIPv6  - Jozi Linux User Group Presentation
IPv6 - Jozi Linux User Group Presentation
 

Dernier

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Dernier (20)

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
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
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
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 - 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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 

Secrets of a linux ninja Software Freedom Day 2013 Johannesburg, South Africa

  • 1. 26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 1/22 SECRETS OF A LINUX NINJA Created by /Mark Clarke @mxc4
  • 2. 26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 2/22 LESSON 1: SSH! A NINJA IS SILENT!
  • 3. 26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 3/22 Access lan based services via incoming SSH access, Get external SSH access even if its not enabled, Forward X sessions over SSH, Bypass web proxy restrictions “Take things as they are. Punch when you have to punch. Kick when you have to kick.”
  • 4. 26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 4/22 LAB SET UP Micro-server represents lan. Laptop virtual machine represents external host. Laptop host machine is gateway Lan Net:192.168.1.0/24 External Net:192.168.122.0/24 Gateway:192.168.1.4/192.168.122.1 Lan Host:192.168.1.3 External Host:192.168.122.192
  • 5. 26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 5/22 ACCESS A LAN BASED SERVICE WITH INCOMING SSH ACCESS Scenario: You have ssh access to the lan but no VPN access, You need to access a web application running on the lan. Web App: http://192.168.1.3/ninja.html
  • 6. 26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 6/22 GET EXTERNAL SSH ACCESS EVEN IF ITS NOT ENABLED Scenario: You have no external ssh access to network You can connect to external ssh servers from the lan
  • 7. 26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 7/22 FORWARD X SESSIONS OVER SSH Scenario: XDMCP is disabled, You have SSH access, XForwarding is enabled in sshd config file,
  • 8. 26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 8/22 BYPASS WEB PROXY RESTRICTIONS Scenario: Your offices uses a web proxy which restricts traffic to sites with vital information, You have external SSH access,
  • 9. 26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 9/22 LESSON 2: NINJA MOVES
  • 10. 26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 10/22 Transferring files over SSH Resuming partial transfers over SSH Mounting a share over SSH Transferring files with netcat “Do not pray for an easy life, pray for the strength to endure a difficult one.”
  • 11. 26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 11/22 TRANSFERRING FILES OVER SSH Scenario: You have no ftp/NFS/Samba share access on the server. You need to copy over a file. You have SSH access.
  • 12. 26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 12/22 RESUMING PARTIAL TRANSFERS OVER SSH Scenario: You are using scp to copy files, Your download 60 minute download interrupts after 40 minutes and you want to resume.
  • 13. 26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 13/22 MOUNTING A SHARE OVER SSH Scenario: You want to mount a remote folder on a server, You have no share access, Only have SSH access
  • 14. 26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 14/22 TRANSFERRING FILES WITH NETCAT Scenario: You need to transfer a file and have no SSH access.
  • 15. 26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 15/22 LESSON 3: A NINJA OBSERVES
  • 16. 26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 16/22 Monitoring disks for signs of failure Command line tools: iotop,vmstat,iostat,psacct “I fear not the man who has practiced 10,000 kicks once, but I fear the man who has practiced one kick 10,000 times.”
  • 17. 26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 17/22 MONITORING DISKS FOR SIGNS OF FAILURE Scenario: You know your disks will fail. You just don't know when. Use smartctl to monitor your disks.
  • 18. 26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 18/22 COMMAND LINE TOOLS Scenario: What process is grinding your disks? - iotop Where is the bottle neck - disk io, memory or network - vmstat Which user or system account is using all your resources - psacct Your server crashes and you don't know why - sar
  • 19. 26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 19/22 LESSON 4: A CLEAN KILL
  • 20. 26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 20/22 Using regular expressions to kill Who is preventing you from unmounting a block device? “Take things as they are. Punch when you have to punch. Kick when you have to kick.”
  • 21. 26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 21/22 USING REGULAR EXPRESSIONS TO KILL Scenario: You have a process to kill often and it a mission to get its pid all the time pkill killall -r
  • 22. 26/09/2013 Secrets of a Linux Ninja - SFD 2013 Johannesburg, South Africa file:///home/mark/Documents/presentations/linux-ninja/index.html#/ 22/22 WHO IS PREVENTING YOU FROM UNMOUNTING A BLOCK DEVICE? Scenario: You trying to unmount a device but you can't because a process/user is accessing it fuser