SlideShare a Scribd company logo
GET THE ROOT
GET THE ROOT
TRY
root@vm :# dhclient eth0
• dhclient, provides a means for configuring one or more network interfaces using the
Dynamic Host Configuration Protocol
ANOTHER WAY
root@vm :# ip a add dev <interface> <cidr>
• <interface> – interface currently connected to the network, usually eth0
• <cidr> – IP address and mask in a CIDR form, e.g. 10.13.203.77/24
root@vm :# ip r add <subnet> via <gateway>
• <subnet> – subnet address in CIDR form, e.g. 10.13.0.0/16
• <gateway> – gateway that will be used to access that subnet, e.g. 192.168.203.1
SCRIPT EXAMPLE
root@vm :# ./network.sh eth0 77
• Example of script that can be used on classic CTF trainings
• Download link https://transfer.sh/3Irqv/network.sh
SSH
root@vm :# apt-get install openssh-server
• Install SHH server if it was not installed
• SSH is a cryptographic(encrypted) network protocol to allow remote login and other
network services to operate securely over an insecure network.
root@vm :# vim /etc/ssh/sshd_config
• Permit root login
any_user@any_shell :$ ssh root@10.13.203.77
• User it!
SCP
• Secure copy or SCP is a means of securely transferring computer files between a local
host and a remote host or between two remote hosts. It is based on the Secure
Shell (SSH) protocol.
user@shell :$ scp some_file user2@any_host:/some/path
• Usage
OR JUST
SHELL
• find - search for files which names matches the <pattern> in a directory
hierarchy starting from <directory>
user@shell :$ find /var/log -name *apache*
Looking for something
user@shell :$ find <directory> -name <pattern>
• grep searches the named input <file>s (or standard input if no files are
named) match to the given <pattern>. By default, grep prints the matching
lines.
user@shell :$ dmesg | grep error
user@shell :$ grep <pattern> <file>
> I need a file
> I need file’s content
SHELL
• ss is used to dump socket statistics. It allows showing information similar to
netstat. It can display more TCP and state informations than other tools.
user@shell :$ ss –nlp | grep 31337
Collecting system information
user@shell :$ ss
• ps displays information about a selection of the active processes.
user@shell :$ ps aux | grep python
user@shell :$ ps
> I need open sockets
> I need running processes
SHELL
Collecting system information
user@shell :$ glances
> I need MOAR information
• glances is a free (LGPL) cross-platform curses-based monitoring tool which
aims to present a maximum of information in a minimum of space, ideally to fit
in a classical 80x24 terminal or higher to have additionnal information. Glances
can adapt dynamically the displayed information depending on the terminal
size. It can also work in a client/server mode for remote monitoring.
SHELL
• head - output the first part of files
 -c K: print the first K bytes of each file
 -n K: print the first K lines of each file
• tail - output the last part of files
 same as head
root@shell :# tail /var/log/auth.log -n 11 | grep yalegko
Parsing output.
user@shell :$ head [options] <file>
> I want only part of file or output
user@shell :$ tail[options] <file>
user@shell :$ ps aux | head -n 2
SHELL
• awk - pattern scanning and processing language
 print $n – prints n-th column of input
Parsing output.
user@shell :$ awk ‘{<commands>}’
> I want only some fields
user@shell :$ ps aux | grep rude_server | awk ‘{ print $2 }’
• sed - stream editor for filtering and transforming text
 s/old_word/new_word/ - substitute old_word to new_word
user@shell :$ sed [options] <script>
> I want to change something in input
user@shell :$ ps aux | grep yalegko | sed 's/yalegko/guest/'
SHELL
• kill - send a signal to a process
user@shell :$ kill –s TERM 25880
Restart that damn service!
user@shell :$ kill [options] <pid>
• service runs a System V init script or upstart job.
root@shell :# service nginx restart
root@shell :# service <service_name> [command]
> I want to kill existing process
> I want to stop/restart service
SHELL
More information can be found in man
user@shell :$ man <command>
NETWORKS
• -i eth0 : Listen on the eth0 interface.
• -q : Be less verbose (more quiet) with your output.
• -s : Define the snaplength (size) of the capture in bytes. Use -s0 to get
everything, unless you are intentionally capturing less.
• -w <capture_file> : Save the result to file
• -С <size> : Only <size> mbytes in one capture
• -G <nseconds> : New file name every <n_seconds> (use %H for hour, %M
for minute and so on)
• dst port 389 : capture only on specified port
• tcp and not dst port 22: another expression example
I need some pcaping!
user@shell :$ tcpdump [options] [expression]
root@shell :# tcpdump -i eth0 -s0 -C 10 -w ‘trace_p31337_’ port 31337
root@shell :# tcpdump -i eth0 -s0 -G 60 -w "trace_%H:%M:%S.pcap" port 3000
NETWORKS
• -i eth0 : Listen on the eth0 interface.
• -f : Set capture filter (WireShark syntax!)
• -w <capture_file> : Save the result to file
• -b <capture ring buffer option> :
 duration:value - switch to the next file after value seconds have elapsed,
even if the current file is not completely filled up.
 filesize:value - switch to the next file after it reaches a size of value kB.
I need some pcaping!
user@shell :$ tshark [options]
root@shell :# tshark- i eth0 -w ‘trace_p31337_’ -f ‘dst port eq 31337’ -b filesize:1000
root@shell :# tshark -i wlan0 -Y 'http.request.method == POST and tcp contains
"password"' | grep password
FUTURE READING
• OpenSSH
• Glances
• A tcpdump Primer with Examples
• How to Use Wireshark to Capture, Filter and Inspect
Packets
• The Basics of Using the Sed Stream Editor to
Manipulate Text in Linux
yalegko@sibears :$ echo “Thanx”

More Related Content

What's hot

Basics of unix
Basics of unixBasics of unix
Basics of unix
Deepak Singhal
 
Redis & ZeroMQ: How to scale your application
Redis & ZeroMQ: How to scale your applicationRedis & ZeroMQ: How to scale your application
Redis & ZeroMQ: How to scale your application
rjsmelo
 
Subversion To Mercurial
Subversion To MercurialSubversion To Mercurial
Subversion To Mercurial
Ladislav Prskavec
 
Basic unix commands
Basic unix commandsBasic unix commands
Basic unix commands
swtjerin4u
 
Nginx-lua
Nginx-luaNginx-lua
Centralized Logging with syslog
Centralized Logging with syslogCentralized Logging with syslog
Centralized Logging with syslog
amiable_indian
 
Linux-Fu for PHP Developers
Linux-Fu for PHP DevelopersLinux-Fu for PHP Developers
Linux-Fu for PHP Developers
Lorna Mitchell
 
Using ngx_lua in UPYUN
Using ngx_lua in UPYUNUsing ngx_lua in UPYUN
Using ngx_lua in UPYUN
Cong Zhang
 
Lua tech talk
Lua tech talkLua tech talk
Lua tech talk
Locaweb
 
HaskellとDebianの辛くて甘い関係
HaskellとDebianの辛くて甘い関係HaskellとDebianの辛くて甘い関係
HaskellとDebianの辛くて甘い関係
Kiwamu Okabe
 
Course 102: Lecture 7: Simple Utilities
Course 102: Lecture 7: Simple Utilities Course 102: Lecture 7: Simple Utilities
Course 102: Lecture 7: Simple Utilities
Ahmed El-Arabawy
 
Linux tech talk
Linux tech talkLinux tech talk
Linux tech talk
Prince Raj
 
Centralized + Unified Logging
Centralized + Unified LoggingCentralized + Unified Logging
Centralized + Unified Logging
Gabor Kozma
 
Ansible for Beginners
Ansible for BeginnersAnsible for Beginners
Ansible for Beginners
Arie Bregman
 
Tomáš Čorej - OpenSSH
Tomáš Čorej - OpenSSHTomáš Čorej - OpenSSH
Tomáš Čorej - OpenSSH
webelement
 
Commit2015 kharchenko - python generators - ext
Commit2015   kharchenko - python generators - extCommit2015   kharchenko - python generators - ext
Commit2015 kharchenko - python generators - ext
Maxym Kharchenko
 
(Practical) linux 104
(Practical) linux 104(Practical) linux 104
(Practical) linux 104
Arie Bregman
 
Awk primer and Bioawk
Awk primer and BioawkAwk primer and Bioawk
Awk primer and Bioawk
Hoffman Lab
 
Unix Shell Scripting Basics
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting Basics
Sudharsan S
 
SCALE 15x Minimizing PostgreSQL Major Version Upgrade Downtime
SCALE 15x Minimizing PostgreSQL Major Version Upgrade DowntimeSCALE 15x Minimizing PostgreSQL Major Version Upgrade Downtime
SCALE 15x Minimizing PostgreSQL Major Version Upgrade Downtime
Jeff Frost
 

What's hot (20)

Basics of unix
Basics of unixBasics of unix
Basics of unix
 
Redis & ZeroMQ: How to scale your application
Redis & ZeroMQ: How to scale your applicationRedis & ZeroMQ: How to scale your application
Redis & ZeroMQ: How to scale your application
 
Subversion To Mercurial
Subversion To MercurialSubversion To Mercurial
Subversion To Mercurial
 
Basic unix commands
Basic unix commandsBasic unix commands
Basic unix commands
 
Nginx-lua
Nginx-luaNginx-lua
Nginx-lua
 
Centralized Logging with syslog
Centralized Logging with syslogCentralized Logging with syslog
Centralized Logging with syslog
 
Linux-Fu for PHP Developers
Linux-Fu for PHP DevelopersLinux-Fu for PHP Developers
Linux-Fu for PHP Developers
 
Using ngx_lua in UPYUN
Using ngx_lua in UPYUNUsing ngx_lua in UPYUN
Using ngx_lua in UPYUN
 
Lua tech talk
Lua tech talkLua tech talk
Lua tech talk
 
HaskellとDebianの辛くて甘い関係
HaskellとDebianの辛くて甘い関係HaskellとDebianの辛くて甘い関係
HaskellとDebianの辛くて甘い関係
 
Course 102: Lecture 7: Simple Utilities
Course 102: Lecture 7: Simple Utilities Course 102: Lecture 7: Simple Utilities
Course 102: Lecture 7: Simple Utilities
 
Linux tech talk
Linux tech talkLinux tech talk
Linux tech talk
 
Centralized + Unified Logging
Centralized + Unified LoggingCentralized + Unified Logging
Centralized + Unified Logging
 
Ansible for Beginners
Ansible for BeginnersAnsible for Beginners
Ansible for Beginners
 
Tomáš Čorej - OpenSSH
Tomáš Čorej - OpenSSHTomáš Čorej - OpenSSH
Tomáš Čorej - OpenSSH
 
Commit2015 kharchenko - python generators - ext
Commit2015   kharchenko - python generators - extCommit2015   kharchenko - python generators - ext
Commit2015 kharchenko - python generators - ext
 
(Practical) linux 104
(Practical) linux 104(Practical) linux 104
(Practical) linux 104
 
Awk primer and Bioawk
Awk primer and BioawkAwk primer and Bioawk
Awk primer and Bioawk
 
Unix Shell Scripting Basics
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting Basics
 
SCALE 15x Minimizing PostgreSQL Major Version Upgrade Downtime
SCALE 15x Minimizing PostgreSQL Major Version Upgrade DowntimeSCALE 15x Minimizing PostgreSQL Major Version Upgrade Downtime
SCALE 15x Minimizing PostgreSQL Major Version Upgrade Downtime
 

Viewers also liked

ИИ: Этические аспекты проблемы выбора
ИИ: Этические аспекты проблемы выбораИИ: Этические аспекты проблемы выбора
ИИ: Этические аспекты проблемы выбора
yalegko
 
How to Open School For Young Hackers
How to Open School For Young HackersHow to Open School For Young Hackers
How to Open School For Young Hackers
yalegko
 
How to make school CTF
How to make school CTFHow to make school CTF
How to make school CTF
yalegko
 
AOP and Inversion of Conrol
AOP and Inversion of ConrolAOP and Inversion of Conrol
AOP and Inversion of Conrol
yalegko
 
White-Box HMAC. Make your cipher secure to white-box attacks.
White-Box HMAC. Make your cipher secure to white-box attacks.White-Box HMAC. Make your cipher secure to white-box attacks.
White-Box HMAC. Make your cipher secure to white-box attacks.
yalegko
 
White box cryptography
White box cryptographyWhite box cryptography
White box cryptography
yalegko
 

Viewers also liked (6)

ИИ: Этические аспекты проблемы выбора
ИИ: Этические аспекты проблемы выбораИИ: Этические аспекты проблемы выбора
ИИ: Этические аспекты проблемы выбора
 
How to Open School For Young Hackers
How to Open School For Young HackersHow to Open School For Young Hackers
How to Open School For Young Hackers
 
How to make school CTF
How to make school CTFHow to make school CTF
How to make school CTF
 
AOP and Inversion of Conrol
AOP and Inversion of ConrolAOP and Inversion of Conrol
AOP and Inversion of Conrol
 
White-Box HMAC. Make your cipher secure to white-box attacks.
White-Box HMAC. Make your cipher secure to white-box attacks.White-Box HMAC. Make your cipher secure to white-box attacks.
White-Box HMAC. Make your cipher secure to white-box attacks.
 
White box cryptography
White box cryptographyWhite box cryptography
White box cryptography
 

Similar to How to admin

DUG'20: 12 - DAOS in Lenovo’s HPC Innovation Center
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation CenterDUG'20: 12 - DAOS in Lenovo’s HPC Innovation Center
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation Center
Andrey Kudryavtsev
 
Why and How Powershell will rule the Command Line - Barcamp LA 4
Why and How Powershell will rule the Command Line - Barcamp LA 4Why and How Powershell will rule the Command Line - Barcamp LA 4
Why and How Powershell will rule the Command Line - Barcamp LA 4
Ilya Haykinson
 
101 3.2 process text streams using filters
101 3.2 process text streams using filters101 3.2 process text streams using filters
101 3.2 process text streams using filters
Acácio Oliveira
 
Session Server - Maintaing State between several Servers
Session Server - Maintaing State between several ServersSession Server - Maintaing State between several Servers
Session Server - Maintaing State between several Servers
Stephan Schmidt
 
101 3.2 process text streams using filters
101 3.2 process text streams using filters101 3.2 process text streams using filters
101 3.2 process text streams using filters
Acácio Oliveira
 
101 3.2 process text streams using filters
101 3.2 process text streams using filters101 3.2 process text streams using filters
101 3.2 process text streams using filters
Acácio Oliveira
 
Odoo command line interface
Odoo command line interfaceOdoo command line interface
Odoo command line interface
Jalal Zahid
 
3.2 process text streams using filters
3.2 process text streams using filters3.2 process text streams using filters
3.2 process text streams using filters
Acácio Oliveira
 
101 3.4 use streams, pipes and redirects
101 3.4 use streams, pipes and redirects101 3.4 use streams, pipes and redirects
101 3.4 use streams, pipes and redirects
Acácio Oliveira
 
linux_Commads
linux_Commadslinux_Commads
linux_Commads
tastedone
 
Miscelaneous Debris
Miscelaneous DebrisMiscelaneous Debris
Miscelaneous Debris
frewmbot
 
Doing QoS Before Ceph Cluster QoS is available - David Byte, Alex Lau
Doing QoS Before Ceph Cluster QoS is available - David Byte, Alex LauDoing QoS Before Ceph Cluster QoS is available - David Byte, Alex Lau
Doing QoS Before Ceph Cluster QoS is available - David Byte, Alex Lau
Ceph Community
 
CEPH中的QOS技术
CEPH中的QOS技术CEPH中的QOS技术
CEPH中的QOS技术
suncbing1
 
Summit demystifying systemd1
Summit demystifying systemd1Summit demystifying systemd1
Summit demystifying systemd1
Susant Sahani
 
A22 Introduction to DTrace by Kyle Hailey
A22 Introduction to DTrace by Kyle HaileyA22 Introduction to DTrace by Kyle Hailey
A22 Introduction to DTrace by Kyle Hailey
Insight Technology, Inc.
 
Linux 系統管理與安全:基本 Linux 系統知識
Linux 系統管理與安全:基本 Linux 系統知識Linux 系統管理與安全:基本 Linux 系統知識
Linux 系統管理與安全:基本 Linux 系統知識
維泰 蔡
 
Installing odoo v8 from github
Installing odoo v8 from githubInstalling odoo v8 from github
Installing odoo v8 from github
Antony Gitomeh
 
50 Most Frequently Used UNIX Linux Commands -hmftj
50 Most Frequently Used UNIX  Linux Commands -hmftj50 Most Frequently Used UNIX  Linux Commands -hmftj
50 Most Frequently Used UNIX Linux Commands -hmftj
LGS, GBHS&IC, University Of South-Asia, TARA-Technologies
 
Cloud Storage Introduction ( CEPH )
Cloud Storage Introduction ( CEPH )  Cloud Storage Introduction ( CEPH )
Cloud Storage Introduction ( CEPH )
Alex Lau
 
Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...
Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...
Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...
Nagios
 

Similar to How to admin (20)

DUG'20: 12 - DAOS in Lenovo’s HPC Innovation Center
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation CenterDUG'20: 12 - DAOS in Lenovo’s HPC Innovation Center
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation Center
 
Why and How Powershell will rule the Command Line - Barcamp LA 4
Why and How Powershell will rule the Command Line - Barcamp LA 4Why and How Powershell will rule the Command Line - Barcamp LA 4
Why and How Powershell will rule the Command Line - Barcamp LA 4
 
101 3.2 process text streams using filters
101 3.2 process text streams using filters101 3.2 process text streams using filters
101 3.2 process text streams using filters
 
Session Server - Maintaing State between several Servers
Session Server - Maintaing State between several ServersSession Server - Maintaing State between several Servers
Session Server - Maintaing State between several Servers
 
101 3.2 process text streams using filters
101 3.2 process text streams using filters101 3.2 process text streams using filters
101 3.2 process text streams using filters
 
101 3.2 process text streams using filters
101 3.2 process text streams using filters101 3.2 process text streams using filters
101 3.2 process text streams using filters
 
Odoo command line interface
Odoo command line interfaceOdoo command line interface
Odoo command line interface
 
3.2 process text streams using filters
3.2 process text streams using filters3.2 process text streams using filters
3.2 process text streams using filters
 
101 3.4 use streams, pipes and redirects
101 3.4 use streams, pipes and redirects101 3.4 use streams, pipes and redirects
101 3.4 use streams, pipes and redirects
 
linux_Commads
linux_Commadslinux_Commads
linux_Commads
 
Miscelaneous Debris
Miscelaneous DebrisMiscelaneous Debris
Miscelaneous Debris
 
Doing QoS Before Ceph Cluster QoS is available - David Byte, Alex Lau
Doing QoS Before Ceph Cluster QoS is available - David Byte, Alex LauDoing QoS Before Ceph Cluster QoS is available - David Byte, Alex Lau
Doing QoS Before Ceph Cluster QoS is available - David Byte, Alex Lau
 
CEPH中的QOS技术
CEPH中的QOS技术CEPH中的QOS技术
CEPH中的QOS技术
 
Summit demystifying systemd1
Summit demystifying systemd1Summit demystifying systemd1
Summit demystifying systemd1
 
A22 Introduction to DTrace by Kyle Hailey
A22 Introduction to DTrace by Kyle HaileyA22 Introduction to DTrace by Kyle Hailey
A22 Introduction to DTrace by Kyle Hailey
 
Linux 系統管理與安全:基本 Linux 系統知識
Linux 系統管理與安全:基本 Linux 系統知識Linux 系統管理與安全:基本 Linux 系統知識
Linux 系統管理與安全:基本 Linux 系統知識
 
Installing odoo v8 from github
Installing odoo v8 from githubInstalling odoo v8 from github
Installing odoo v8 from github
 
50 Most Frequently Used UNIX Linux Commands -hmftj
50 Most Frequently Used UNIX  Linux Commands -hmftj50 Most Frequently Used UNIX  Linux Commands -hmftj
50 Most Frequently Used UNIX Linux Commands -hmftj
 
Cloud Storage Introduction ( CEPH )
Cloud Storage Introduction ( CEPH )  Cloud Storage Introduction ( CEPH )
Cloud Storage Introduction ( CEPH )
 
Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...
Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...
Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...
 

More from yalegko

SD-WAN Internet Census
SD-WAN Internet CensusSD-WAN Internet Census
SD-WAN Internet Census
yalegko
 
So Your WAF Needs a Parser
So Your WAF Needs a ParserSo Your WAF Needs a Parser
So Your WAF Needs a Parser
yalegko
 
WebGoat.SDWAN.Net in Depth
WebGoat.SDWAN.Net in DepthWebGoat.SDWAN.Net in Depth
WebGoat.SDWAN.Net in Depth
yalegko
 
[ISC] Docker + Swarm
[ISC] Docker + Swarm[ISC] Docker + Swarm
[ISC] Docker + Swarm
yalegko
 
Covert timing channels using HTTP cache headers
Covert timing channels using HTTP cache headersCovert timing channels using HTTP cache headers
Covert timing channels using HTTP cache headers
yalegko
 
Covert timing channels using HTTP cache headers
Covert timing channels using HTTP cache headersCovert timing channels using HTTP cache headers
Covert timing channels using HTTP cache headers
yalegko
 
Include and extend in Ruby
Include and extend in RubyInclude and extend in Ruby
Include and extend in Ruby
yalegko
 
Not a children in da web
Not a children in da webNot a children in da web
Not a children in da web
yalegko
 

More from yalegko (8)

SD-WAN Internet Census
SD-WAN Internet CensusSD-WAN Internet Census
SD-WAN Internet Census
 
So Your WAF Needs a Parser
So Your WAF Needs a ParserSo Your WAF Needs a Parser
So Your WAF Needs a Parser
 
WebGoat.SDWAN.Net in Depth
WebGoat.SDWAN.Net in DepthWebGoat.SDWAN.Net in Depth
WebGoat.SDWAN.Net in Depth
 
[ISC] Docker + Swarm
[ISC] Docker + Swarm[ISC] Docker + Swarm
[ISC] Docker + Swarm
 
Covert timing channels using HTTP cache headers
Covert timing channels using HTTP cache headersCovert timing channels using HTTP cache headers
Covert timing channels using HTTP cache headers
 
Covert timing channels using HTTP cache headers
Covert timing channels using HTTP cache headersCovert timing channels using HTTP cache headers
Covert timing channels using HTTP cache headers
 
Include and extend in Ruby
Include and extend in RubyInclude and extend in Ruby
Include and extend in Ruby
 
Not a children in da web
Not a children in da webNot a children in da web
Not a children in da web
 

Recently uploaded

RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
zuzanka
 
How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17
Celine George
 
adjectives.ppt for class 1 to 6, grammar
adjectives.ppt for class 1 to 6, grammaradjectives.ppt for class 1 to 6, grammar
adjectives.ppt for class 1 to 6, grammar
7DFarhanaMohammed
 
220711130088 Sumi Basak Virtual University EPC 3.pptx
220711130088 Sumi Basak Virtual University EPC 3.pptx220711130088 Sumi Basak Virtual University EPC 3.pptx
220711130088 Sumi Basak Virtual University EPC 3.pptx
Kalna College
 
How to Fix [Errno 98] address already in use
How to Fix [Errno 98] address already in useHow to Fix [Errno 98] address already in use
How to Fix [Errno 98] address already in use
Celine George
 
CIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdfCIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdf
blueshagoo1
 
Creative Restart 2024: Mike Martin - Finding a way around “no”
Creative Restart 2024: Mike Martin - Finding a way around “no”Creative Restart 2024: Mike Martin - Finding a way around “no”
Creative Restart 2024: Mike Martin - Finding a way around “no”
Taste
 
Bonku-Babus-Friend by Sathyajith Ray (9)
Bonku-Babus-Friend by Sathyajith Ray  (9)Bonku-Babus-Friend by Sathyajith Ray  (9)
Bonku-Babus-Friend by Sathyajith Ray (9)
nitinpv4ai
 
78 Microsoft-Publisher - Sirin Sultana Bora.pptx
78 Microsoft-Publisher - Sirin Sultana Bora.pptx78 Microsoft-Publisher - Sirin Sultana Bora.pptx
78 Microsoft-Publisher - Sirin Sultana Bora.pptx
Kalna College
 
Pharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brubPharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brub
danielkiash986
 
220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology
Kalna College
 
Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
nitinpv4ai
 
220711130100 udita Chakraborty Aims and objectives of national policy on inf...
220711130100 udita Chakraborty  Aims and objectives of national policy on inf...220711130100 udita Chakraborty  Aims and objectives of national policy on inf...
220711130100 udita Chakraborty Aims and objectives of national policy on inf...
Kalna College
 
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
Payaamvohra1
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
zuzanka
 
Information and Communication Technology in Education
Information and Communication Technology in EducationInformation and Communication Technology in Education
Information and Communication Technology in Education
MJDuyan
 
FinalSD_MathematicsGrade7_Session2_Unida.pptx
FinalSD_MathematicsGrade7_Session2_Unida.pptxFinalSD_MathematicsGrade7_Session2_Unida.pptx
FinalSD_MathematicsGrade7_Session2_Unida.pptx
JennySularte1
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
Nguyen Thanh Tu Collection
 
220711130083 SUBHASHREE RAKSHIT Internet resources for social science
220711130083 SUBHASHREE RAKSHIT  Internet resources for social science220711130083 SUBHASHREE RAKSHIT  Internet resources for social science
220711130083 SUBHASHREE RAKSHIT Internet resources for social science
Kalna College
 
How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17
Celine George
 

Recently uploaded (20)

RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
 
How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17
 
adjectives.ppt for class 1 to 6, grammar
adjectives.ppt for class 1 to 6, grammaradjectives.ppt for class 1 to 6, grammar
adjectives.ppt for class 1 to 6, grammar
 
220711130088 Sumi Basak Virtual University EPC 3.pptx
220711130088 Sumi Basak Virtual University EPC 3.pptx220711130088 Sumi Basak Virtual University EPC 3.pptx
220711130088 Sumi Basak Virtual University EPC 3.pptx
 
How to Fix [Errno 98] address already in use
How to Fix [Errno 98] address already in useHow to Fix [Errno 98] address already in use
How to Fix [Errno 98] address already in use
 
CIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdfCIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdf
 
Creative Restart 2024: Mike Martin - Finding a way around “no”
Creative Restart 2024: Mike Martin - Finding a way around “no”Creative Restart 2024: Mike Martin - Finding a way around “no”
Creative Restart 2024: Mike Martin - Finding a way around “no”
 
Bonku-Babus-Friend by Sathyajith Ray (9)
Bonku-Babus-Friend by Sathyajith Ray  (9)Bonku-Babus-Friend by Sathyajith Ray  (9)
Bonku-Babus-Friend by Sathyajith Ray (9)
 
78 Microsoft-Publisher - Sirin Sultana Bora.pptx
78 Microsoft-Publisher - Sirin Sultana Bora.pptx78 Microsoft-Publisher - Sirin Sultana Bora.pptx
78 Microsoft-Publisher - Sirin Sultana Bora.pptx
 
Pharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brubPharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brub
 
220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology
 
Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
 
220711130100 udita Chakraborty Aims and objectives of national policy on inf...
220711130100 udita Chakraborty  Aims and objectives of national policy on inf...220711130100 udita Chakraborty  Aims and objectives of national policy on inf...
220711130100 udita Chakraborty Aims and objectives of national policy on inf...
 
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
 
Information and Communication Technology in Education
Information and Communication Technology in EducationInformation and Communication Technology in Education
Information and Communication Technology in Education
 
FinalSD_MathematicsGrade7_Session2_Unida.pptx
FinalSD_MathematicsGrade7_Session2_Unida.pptxFinalSD_MathematicsGrade7_Session2_Unida.pptx
FinalSD_MathematicsGrade7_Session2_Unida.pptx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
 
220711130083 SUBHASHREE RAKSHIT Internet resources for social science
220711130083 SUBHASHREE RAKSHIT  Internet resources for social science220711130083 SUBHASHREE RAKSHIT  Internet resources for social science
220711130083 SUBHASHREE RAKSHIT Internet resources for social science
 
How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17
 

How to admin

  • 1.
  • 4. TRY root@vm :# dhclient eth0 • dhclient, provides a means for configuring one or more network interfaces using the Dynamic Host Configuration Protocol ANOTHER WAY root@vm :# ip a add dev <interface> <cidr> • <interface> – interface currently connected to the network, usually eth0 • <cidr> – IP address and mask in a CIDR form, e.g. 10.13.203.77/24 root@vm :# ip r add <subnet> via <gateway> • <subnet> – subnet address in CIDR form, e.g. 10.13.0.0/16 • <gateway> – gateway that will be used to access that subnet, e.g. 192.168.203.1
  • 5. SCRIPT EXAMPLE root@vm :# ./network.sh eth0 77 • Example of script that can be used on classic CTF trainings • Download link https://transfer.sh/3Irqv/network.sh
  • 6. SSH root@vm :# apt-get install openssh-server • Install SHH server if it was not installed • SSH is a cryptographic(encrypted) network protocol to allow remote login and other network services to operate securely over an insecure network. root@vm :# vim /etc/ssh/sshd_config • Permit root login any_user@any_shell :$ ssh root@10.13.203.77 • User it!
  • 7. SCP • Secure copy or SCP is a means of securely transferring computer files between a local host and a remote host or between two remote hosts. It is based on the Secure Shell (SSH) protocol. user@shell :$ scp some_file user2@any_host:/some/path • Usage
  • 9. SHELL • find - search for files which names matches the <pattern> in a directory hierarchy starting from <directory> user@shell :$ find /var/log -name *apache* Looking for something user@shell :$ find <directory> -name <pattern> • grep searches the named input <file>s (or standard input if no files are named) match to the given <pattern>. By default, grep prints the matching lines. user@shell :$ dmesg | grep error user@shell :$ grep <pattern> <file> > I need a file > I need file’s content
  • 10. SHELL • ss is used to dump socket statistics. It allows showing information similar to netstat. It can display more TCP and state informations than other tools. user@shell :$ ss –nlp | grep 31337 Collecting system information user@shell :$ ss • ps displays information about a selection of the active processes. user@shell :$ ps aux | grep python user@shell :$ ps > I need open sockets > I need running processes
  • 11. SHELL Collecting system information user@shell :$ glances > I need MOAR information • glances is a free (LGPL) cross-platform curses-based monitoring tool which aims to present a maximum of information in a minimum of space, ideally to fit in a classical 80x24 terminal or higher to have additionnal information. Glances can adapt dynamically the displayed information depending on the terminal size. It can also work in a client/server mode for remote monitoring.
  • 12.
  • 13. SHELL • head - output the first part of files  -c K: print the first K bytes of each file  -n K: print the first K lines of each file • tail - output the last part of files  same as head root@shell :# tail /var/log/auth.log -n 11 | grep yalegko Parsing output. user@shell :$ head [options] <file> > I want only part of file or output user@shell :$ tail[options] <file> user@shell :$ ps aux | head -n 2
  • 14. SHELL • awk - pattern scanning and processing language  print $n – prints n-th column of input Parsing output. user@shell :$ awk ‘{<commands>}’ > I want only some fields user@shell :$ ps aux | grep rude_server | awk ‘{ print $2 }’ • sed - stream editor for filtering and transforming text  s/old_word/new_word/ - substitute old_word to new_word user@shell :$ sed [options] <script> > I want to change something in input user@shell :$ ps aux | grep yalegko | sed 's/yalegko/guest/'
  • 15. SHELL • kill - send a signal to a process user@shell :$ kill –s TERM 25880 Restart that damn service! user@shell :$ kill [options] <pid> • service runs a System V init script or upstart job. root@shell :# service nginx restart root@shell :# service <service_name> [command] > I want to kill existing process > I want to stop/restart service
  • 16. SHELL More information can be found in man user@shell :$ man <command>
  • 17. NETWORKS • -i eth0 : Listen on the eth0 interface. • -q : Be less verbose (more quiet) with your output. • -s : Define the snaplength (size) of the capture in bytes. Use -s0 to get everything, unless you are intentionally capturing less. • -w <capture_file> : Save the result to file • -С <size> : Only <size> mbytes in one capture • -G <nseconds> : New file name every <n_seconds> (use %H for hour, %M for minute and so on) • dst port 389 : capture only on specified port • tcp and not dst port 22: another expression example I need some pcaping! user@shell :$ tcpdump [options] [expression] root@shell :# tcpdump -i eth0 -s0 -C 10 -w ‘trace_p31337_’ port 31337 root@shell :# tcpdump -i eth0 -s0 -G 60 -w "trace_%H:%M:%S.pcap" port 3000
  • 18. NETWORKS • -i eth0 : Listen on the eth0 interface. • -f : Set capture filter (WireShark syntax!) • -w <capture_file> : Save the result to file • -b <capture ring buffer option> :  duration:value - switch to the next file after value seconds have elapsed, even if the current file is not completely filled up.  filesize:value - switch to the next file after it reaches a size of value kB. I need some pcaping! user@shell :$ tshark [options] root@shell :# tshark- i eth0 -w ‘trace_p31337_’ -f ‘dst port eq 31337’ -b filesize:1000 root@shell :# tshark -i wlan0 -Y 'http.request.method == POST and tcp contains "password"' | grep password
  • 19. FUTURE READING • OpenSSH • Glances • A tcpdump Primer with Examples • How to Use Wireshark to Capture, Filter and Inspect Packets • The Basics of Using the Sed Stream Editor to Manipulate Text in Linux
  • 20. yalegko@sibears :$ echo “Thanx”