SlideShare a Scribd company logo
Chapter1
Introduction to Command Line
1
Dr. Hadeel Alazzam
Scripting Programming
1
2
• Textbook
• The Command Line
• Why Bash?
• Command-Line Illustrations
• Running Linux and bash on Windows
• Command-Line Basics
• Practical Examples
Outline
3
Text Book
• Paul Troncone (2019). Cybersecurity Ops with bash:
Attack, Defend, and Analyze from the Command Line,
First Edition
4
Command Line
• The command line is a text interface for your computer.
• Like Windows Explorer on Windows or Finder on Mac OSX it lets you navigate through the files
and folders of your computer, but it is completely text based.
• A computer’s command-line interface (CLI) gives you an intimate
connection with its operating system (OS).
• Command-line interfaces are also called command-line user
interfaces, console user interfaces and character user interfaces.
• The command line is a powerful tool that can significantly speed up
your workflow but can also irreversibly harm your computer so make
sure you use it responsibly.
Why Command Line?
• The ability to effectively use the command line is a critical skill for
security practitioners and administrators.
• Many tools of the trade such as Metasploit, Nmap, and Snort require
command-line proficiency simply to use them.
• During penetration testing, your only option may be to use a command-
line interface when interacting with a target system, particularly in the
early stages of an intrusion.
5
Dr.AryafAl-adwan,AutonomousSystemsDept 5
Command Line Primer
6
Dr. Aryaf Al-adwan, Autonomous
Systems Dept
• The term command line is used to refer to all of the
various non-GUI executables installed with an operating
system, along with, and especially, the built-ins,
keywords, and scripting capabilities available from the
shell — its command-line interface.
• To effectively utilize the command line, you need two
things:
• An understanding of the features and options of the existing
commands.
• A way to sequence commands together by using a scripting
language.
6
Command Line Primer
7
Dr. Aryaf Al-adwan, Autonomous
Systems Dept
• In this course, we introduce more than 40 commands
that span both the Linux and Windows operating
systems, as well as a variety of shell built-ins and
keywords.
• Most of the commands introduced originate from the
Linux environment, but as you will see, there are
multiple methods for running them on Windows
platforms.
7
Why Bash?
8
Dr. Aryaf Al-adwan, Autonomous
Systems Dept
• For scripting purposes, we choose the bash shell and
command language.
• The bash shell has been around for decades.
• Bash is available in nearly every version of Linux, and
has even permeated the Windows operating system
(Cross-platform).
• The proliferation of bash gives offensive operators and
penetration testers a particular advantage.
• Because in many cases there is no additional supporting
infrastructure or interpreters to install on a target system.
8
Command-Line Illustrations
9
Dr. Aryaf Al-adwan, Autonomous
Systems Dept
• A single-line command illustration will appear as follows:
• If the single-line command illustration also displays output, it will
appear as follows:
• The leading $ character is not part of the command, but is meant to
represent the simple prompt of the shell command line.
• It is shown to help you differentiate between the command (as you
would type it) and its output to the terminal.
9
Running Linux and bash on
Windows
1
0
Dr. Aryaf Al-adwan, Autonomous
Systems Dept
• The four options to run Linux and bash on Windows:
• Git Bash
• Cygwin
• The Windows Subsystem for Linux,
• Windows Command Prompt and PowerShell.
10
Git Bash
1
1
Dr. Aryaf Al-adwan, Autonomous
Systems Dept
• You can run many standard Linux commands
and the bash shell in the Windows environment
if you have installed Git, which includes a port
of bash.
• You can download Git from Git Website here.
• Once it’s installed, you can run bash by right-
clicking on the desktop or in a folder and
selecting Git Bash Here.
• https://gitforwindows.org/
11
Git Bash
1
2
Dr. Aryaf Al-adwan, Autonomous
Systems Dept
12
Cygwin
1
3
Dr. Aryaf Al-adwan, Autonomous
Systems Dept
• Cygwin is a full-featured Linux emulator that
also includes the ability to install a variety of
packages.
• It is similar to Git Bash in that it allows calling
many native Windows commands in addition to
the standard Linux commands.
• Cygwin can be downloaded from the project
website.
• https://www.cygwin.com/
13
Command-Line Basics
1
4
Dr. Aryaf Al-adwan, Autonomous
Systems Dept
• One of the basic operations of bash is to execute a command — that
is, to run another program.
• When several words appear on the command line, bash assumes that the first
word is the name of the program to run and the remaining words are the
arguments to the command.
• For example, to have bash run the command called mkdir and to pass it two
arguments -p and /tmp/scratch/garble, you would type this:
mkdir -p /tmp/scratch/garble
• By convention, programs generally have their options located first, and have
them begin with a leading -, as is the case here with the -p option.
• This particular command is being told to create a directory called
/tmp/scratch/garble.
• The -p option indicates that no errors will be reported and any intervening directories
will be created (or attempted) as needed
• (e.g., if only /tmp exists, then mkdir will first create /tmp/scratch before
attempting to create /tmp/scratch/garble).
14
Commands, Arguments, Built-ins, and
Keywords
1
5
Dr. Aryaf Al-adwan, Autonomous
Systems Dept
• The pwd command prints out the current directory you are in.
• The ls command prints out the contents of a directory.
• ls –a list hidden files
• ls –l  list files in current directory with permissions.
• The cd command allows you to move between directories.
• The mkdir creates directories.
• The touch used to create files.
• Don’t forget to specify what kind of file you are creating: for
example, touch index.html
• You can use the type command to identify whether a word is a
keyword, a built- in, a command, or none of those.
• The -t option keeps the output to a single word:
15
Commands, Arguments, Built-ins, and
Keywords
1
6
Dr. Aryaf Al-adwan, Autonomous
Systems Dept
• You can use the compgen command to determine what commands,
built-ins, and keywords are available to you.
• Use the -c option to list commands, -b for built- ins, and -k for
keywords.
16
Standard Input/Output/Error
1
7
Dr. Aryaf Al-adwan, Autonomous
Systems Dept
• A running program is called, in operating systems, a process.
• Every process in the Unix/Linux/POSIX (and thus Windows)
environment has three distinct input/output file descriptors:
• standard input (or stdin)
• Standard output (stdout)
• Standard error (stderr)
17
Redirection and Piping
1
8
Dr. Aryaf Al-adwan, Autonomous
Systems Dept
• If you have a program called handywork that reads its input from stdin
and writes its results to stdout, you can change its behavior as simply
as this:
• This will run handywork but will have the input come not from the
keyboard but instead from the data file called data.in
• Similarly, the output is being sent not to the screen but into a file called
results.out
• The file will be created if it doesn’t exist and overwritten if it does
• This technique is called redirection because we are redirecting input
to come from a different place and redirecting output to go somewhere
other than the screen.
18
Stderr
1
9
Dr. Aryaf Al-adwan, Autonomous
Systems Dept
• We have to distinguish between stdout and stderr when redirecting data
coming out of the program.
• We make this distinction through the use of the file descriptor
numbers:
• stdin is file descriptor 0
• stdout is file descriptor 1
• stderr is file descriptor 2
• You can redirect error messages as follows:
• This redirects only stderr and sends any such error message output to
a file we call err.msgs
• Of course, we can do all three on the same line:
19
Redirection and Piping
2
0
Dr. Aryaf Al-adwan, Autonomous
Systems Dept
• If you want the error messages combined with the normal output, you can
do this with the following syntax:
• You can use the shorthand command as follows:
• If you want to discard standard output, you can redirect it to a special
file called /dev/null as follows:
• To view output on the command line and simultaneously redirect that
same output to a file, use the tee command.
20
Redirection and Piping
2
1
Dr. Aryaf Al-adwan, Autonomous
Systems Dept
• Use the -a option on the tee command to append to its output file rather
than overwrite it.
• The | character is known as a pipe.
• It allows you to take the output from one command or script and
provide it as input into another command.
• In this example, the output of handywork is piped into the tee
command for further processing.
• A file will be created or truncated (i.e., content discarded) when output
is redirected using the single greater-than (>) sign.
• If you want to preserve the file’s existing content, you can, instead,
append to the file by using a double greater- than (>>) sign, like this:
21
Redirection and Piping
2
2
Dr. Aryaf Al-adwan, Autonomous
Systems Dept
• If you want appends both stdout and stderr to the file results.out rather
than overwriting its existing content.
22
Running Commands in the Background
2
3
Dr. Aryaf Al-adwan, Autonomous
Systems Dept
• In this course, we will be going beyond one-line commands and will be
building complex scripts.
• Some of these scripts can take a significant amount of time to execute, so
that you may not want to spend time waiting for them to complete.
• Instead, you can run any command or script in the background by using
the & operator.
• The script will continue to run, but you can continue to use the shell to
issue other commands and/or run other scripts.
• You will likely want to redirect both standard output and/or standard
error to a file when sending tasks to the background:
23
Running Commands in the Background
2
4
Dr. Aryaf Al-adwan, Autonomous
Systems Dept
• You can use the jobs command to list any tasks currently running in the
background:
• Use the fg command and the corresponding job number to bring the task
back into the foreground:
• If your task is currently executing in the foreground, you can use Ctrl-Z to
suspend the process and then bg to continue the process in the
background.
• From there, you can use jobs and fg as described previously.
24
From Command Line to Script
2
5
Dr. Aryaf Al-adwan, Autonomous
Systems Dept
• A shell script is just a file that contains the same commands that you
could type on the command line.
• Put one or more commands into a file and you have a shell script.
• If you called your file myscript, you can run that script by typing bash
myscript or you can give it execute permission(e.g.,chmod 755 myscript).
• You can invoke it directly to run the script: ./myscript
• We often include the following line as the first line of the script, which
tells the operating system which scripting language we are using:
• Of course, this assumes that bash is located in the /bin directory.
• If your script needs to be more portable, you could use this approach
instead:
• It uses the env command to look up the location of bash and is
considered the standard way to address the portability problem.
25
Lab Exercises
2
6
Dr. Aryaf Al-adwan, Autonomous
Systems Dept
26
End
27
Dr. Aryaf Al-adwan, Autonomous Systems Dept 27

More Related Content

PPTX
Linux week 2
PDF
Linux: Everyting-as-a-service
PPTX
ITCP PRACTICAL-1.pptx
PPTX
Linux Administrator - The Linux Course on Eduonix
PPTX
Linux Desktop Operation - Session 1
PPTX
LINUX (1).pptxtytyyyyyyuuuuuuuuuuurttttttrrrrrr
PPTX
PPTX
Design Like a Pro: Scripting Best Practices
Linux week 2
Linux: Everyting-as-a-service
ITCP PRACTICAL-1.pptx
Linux Administrator - The Linux Course on Eduonix
Linux Desktop Operation - Session 1
LINUX (1).pptxtytyyyyyyuuuuuuuuuuurttttttrrrrrr
Design Like a Pro: Scripting Best Practices

Similar to Chapter 1: Introduction to Command Line (20)

PPTX
Design Like a Pro: Scripting Best Practices
PDF
Linux Day2
PPTX
UNIX/Linux training
PPTX
Linuxtraining 130710022121-phpapp01
PPT
PPTX
Os lectures
PPTX
Linux Basics.pptx
PPTX
Linux System Programming - File I/O
PDF
The Ultimate IBM and Lotus on Linux Workshop for Windows Admins
PDF
PPTX
Introduction to Python Programming
PDF
202110 SESUG 49 UNIX X Command Tips and Tricks
PPTX
Chapter 2: Introduction to Bash Scripting
PDF
Linux basic
PPT
Red Hart Linux
PPTX
THE BASIC TOOLS
PPTX
Operating Systems & Applications
PDF
linux_internals_2.3 (1).pdf àaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
PDF
.NET Core, ASP.NET Core Course, Session 2
PPT
Purdue CS354 Operating Systems 2008
Design Like a Pro: Scripting Best Practices
Linux Day2
UNIX/Linux training
Linuxtraining 130710022121-phpapp01
Os lectures
Linux Basics.pptx
Linux System Programming - File I/O
The Ultimate IBM and Lotus on Linux Workshop for Windows Admins
Introduction to Python Programming
202110 SESUG 49 UNIX X Command Tips and Tricks
Chapter 2: Introduction to Bash Scripting
Linux basic
Red Hart Linux
THE BASIC TOOLS
Operating Systems & Applications
linux_internals_2.3 (1).pdf àaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
.NET Core, ASP.NET Core Course, Session 2
Purdue CS354 Operating Systems 2008
Ad

Recently uploaded (20)

PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
PPTX
Cloud computing and distributed systems.
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
REPORT: Heating appliances market in Poland 2024
PDF
Newfamily of error-correcting codes based on genetic algorithms
PDF
Chapter 2 Digital Image Fundamentals.pdf
PDF
Reimagining Insurance: Connected Data for Confident Decisions.pdf
PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PPTX
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
PDF
Advanced IT Governance
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
CIFDAQ's Market Wrap: Ethereum Leads, Bitcoin Lags, Institutions Shift
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
madgavkar20181017ppt McKinsey Presentation.pdf
PDF
Smarter Business Operations Powered by IoT Remote Monitoring
PPTX
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
NewMind AI Weekly Chronicles - August'25 Week I
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
Cloud computing and distributed systems.
20250228 LYD VKU AI Blended-Learning.pptx
REPORT: Heating appliances market in Poland 2024
Newfamily of error-correcting codes based on genetic algorithms
Chapter 2 Digital Image Fundamentals.pdf
Reimagining Insurance: Connected Data for Confident Decisions.pdf
GamePlan Trading System Review: Professional Trader's Honest Take
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
Advanced IT Governance
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
CIFDAQ's Market Wrap: Ethereum Leads, Bitcoin Lags, Institutions Shift
“AI and Expert System Decision Support & Business Intelligence Systems”
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
CIFDAQ's Market Insight: SEC Turns Pro Crypto
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
madgavkar20181017ppt McKinsey Presentation.pdf
Smarter Business Operations Powered by IoT Remote Monitoring
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
Ad

Chapter 1: Introduction to Command Line

  • 1. Chapter1 Introduction to Command Line 1 Dr. Hadeel Alazzam Scripting Programming 1
  • 2. 2 • Textbook • The Command Line • Why Bash? • Command-Line Illustrations • Running Linux and bash on Windows • Command-Line Basics • Practical Examples Outline
  • 3. 3 Text Book • Paul Troncone (2019). Cybersecurity Ops with bash: Attack, Defend, and Analyze from the Command Line, First Edition
  • 4. 4 Command Line • The command line is a text interface for your computer. • Like Windows Explorer on Windows or Finder on Mac OSX it lets you navigate through the files and folders of your computer, but it is completely text based. • A computer’s command-line interface (CLI) gives you an intimate connection with its operating system (OS). • Command-line interfaces are also called command-line user interfaces, console user interfaces and character user interfaces. • The command line is a powerful tool that can significantly speed up your workflow but can also irreversibly harm your computer so make sure you use it responsibly.
  • 5. Why Command Line? • The ability to effectively use the command line is a critical skill for security practitioners and administrators. • Many tools of the trade such as Metasploit, Nmap, and Snort require command-line proficiency simply to use them. • During penetration testing, your only option may be to use a command- line interface when interacting with a target system, particularly in the early stages of an intrusion. 5 Dr.AryafAl-adwan,AutonomousSystemsDept 5
  • 6. Command Line Primer 6 Dr. Aryaf Al-adwan, Autonomous Systems Dept • The term command line is used to refer to all of the various non-GUI executables installed with an operating system, along with, and especially, the built-ins, keywords, and scripting capabilities available from the shell — its command-line interface. • To effectively utilize the command line, you need two things: • An understanding of the features and options of the existing commands. • A way to sequence commands together by using a scripting language. 6
  • 7. Command Line Primer 7 Dr. Aryaf Al-adwan, Autonomous Systems Dept • In this course, we introduce more than 40 commands that span both the Linux and Windows operating systems, as well as a variety of shell built-ins and keywords. • Most of the commands introduced originate from the Linux environment, but as you will see, there are multiple methods for running them on Windows platforms. 7
  • 8. Why Bash? 8 Dr. Aryaf Al-adwan, Autonomous Systems Dept • For scripting purposes, we choose the bash shell and command language. • The bash shell has been around for decades. • Bash is available in nearly every version of Linux, and has even permeated the Windows operating system (Cross-platform). • The proliferation of bash gives offensive operators and penetration testers a particular advantage. • Because in many cases there is no additional supporting infrastructure or interpreters to install on a target system. 8
  • 9. Command-Line Illustrations 9 Dr. Aryaf Al-adwan, Autonomous Systems Dept • A single-line command illustration will appear as follows: • If the single-line command illustration also displays output, it will appear as follows: • The leading $ character is not part of the command, but is meant to represent the simple prompt of the shell command line. • It is shown to help you differentiate between the command (as you would type it) and its output to the terminal. 9
  • 10. Running Linux and bash on Windows 1 0 Dr. Aryaf Al-adwan, Autonomous Systems Dept • The four options to run Linux and bash on Windows: • Git Bash • Cygwin • The Windows Subsystem for Linux, • Windows Command Prompt and PowerShell. 10
  • 11. Git Bash 1 1 Dr. Aryaf Al-adwan, Autonomous Systems Dept • You can run many standard Linux commands and the bash shell in the Windows environment if you have installed Git, which includes a port of bash. • You can download Git from Git Website here. • Once it’s installed, you can run bash by right- clicking on the desktop or in a folder and selecting Git Bash Here. • https://gitforwindows.org/ 11
  • 12. Git Bash 1 2 Dr. Aryaf Al-adwan, Autonomous Systems Dept 12
  • 13. Cygwin 1 3 Dr. Aryaf Al-adwan, Autonomous Systems Dept • Cygwin is a full-featured Linux emulator that also includes the ability to install a variety of packages. • It is similar to Git Bash in that it allows calling many native Windows commands in addition to the standard Linux commands. • Cygwin can be downloaded from the project website. • https://www.cygwin.com/ 13
  • 14. Command-Line Basics 1 4 Dr. Aryaf Al-adwan, Autonomous Systems Dept • One of the basic operations of bash is to execute a command — that is, to run another program. • When several words appear on the command line, bash assumes that the first word is the name of the program to run and the remaining words are the arguments to the command. • For example, to have bash run the command called mkdir and to pass it two arguments -p and /tmp/scratch/garble, you would type this: mkdir -p /tmp/scratch/garble • By convention, programs generally have their options located first, and have them begin with a leading -, as is the case here with the -p option. • This particular command is being told to create a directory called /tmp/scratch/garble. • The -p option indicates that no errors will be reported and any intervening directories will be created (or attempted) as needed • (e.g., if only /tmp exists, then mkdir will first create /tmp/scratch before attempting to create /tmp/scratch/garble). 14
  • 15. Commands, Arguments, Built-ins, and Keywords 1 5 Dr. Aryaf Al-adwan, Autonomous Systems Dept • The pwd command prints out the current directory you are in. • The ls command prints out the contents of a directory. • ls –a list hidden files • ls –l  list files in current directory with permissions. • The cd command allows you to move between directories. • The mkdir creates directories. • The touch used to create files. • Don’t forget to specify what kind of file you are creating: for example, touch index.html • You can use the type command to identify whether a word is a keyword, a built- in, a command, or none of those. • The -t option keeps the output to a single word: 15
  • 16. Commands, Arguments, Built-ins, and Keywords 1 6 Dr. Aryaf Al-adwan, Autonomous Systems Dept • You can use the compgen command to determine what commands, built-ins, and keywords are available to you. • Use the -c option to list commands, -b for built- ins, and -k for keywords. 16
  • 17. Standard Input/Output/Error 1 7 Dr. Aryaf Al-adwan, Autonomous Systems Dept • A running program is called, in operating systems, a process. • Every process in the Unix/Linux/POSIX (and thus Windows) environment has three distinct input/output file descriptors: • standard input (or stdin) • Standard output (stdout) • Standard error (stderr) 17
  • 18. Redirection and Piping 1 8 Dr. Aryaf Al-adwan, Autonomous Systems Dept • If you have a program called handywork that reads its input from stdin and writes its results to stdout, you can change its behavior as simply as this: • This will run handywork but will have the input come not from the keyboard but instead from the data file called data.in • Similarly, the output is being sent not to the screen but into a file called results.out • The file will be created if it doesn’t exist and overwritten if it does • This technique is called redirection because we are redirecting input to come from a different place and redirecting output to go somewhere other than the screen. 18
  • 19. Stderr 1 9 Dr. Aryaf Al-adwan, Autonomous Systems Dept • We have to distinguish between stdout and stderr when redirecting data coming out of the program. • We make this distinction through the use of the file descriptor numbers: • stdin is file descriptor 0 • stdout is file descriptor 1 • stderr is file descriptor 2 • You can redirect error messages as follows: • This redirects only stderr and sends any such error message output to a file we call err.msgs • Of course, we can do all three on the same line: 19
  • 20. Redirection and Piping 2 0 Dr. Aryaf Al-adwan, Autonomous Systems Dept • If you want the error messages combined with the normal output, you can do this with the following syntax: • You can use the shorthand command as follows: • If you want to discard standard output, you can redirect it to a special file called /dev/null as follows: • To view output on the command line and simultaneously redirect that same output to a file, use the tee command. 20
  • 21. Redirection and Piping 2 1 Dr. Aryaf Al-adwan, Autonomous Systems Dept • Use the -a option on the tee command to append to its output file rather than overwrite it. • The | character is known as a pipe. • It allows you to take the output from one command or script and provide it as input into another command. • In this example, the output of handywork is piped into the tee command for further processing. • A file will be created or truncated (i.e., content discarded) when output is redirected using the single greater-than (>) sign. • If you want to preserve the file’s existing content, you can, instead, append to the file by using a double greater- than (>>) sign, like this: 21
  • 22. Redirection and Piping 2 2 Dr. Aryaf Al-adwan, Autonomous Systems Dept • If you want appends both stdout and stderr to the file results.out rather than overwriting its existing content. 22
  • 23. Running Commands in the Background 2 3 Dr. Aryaf Al-adwan, Autonomous Systems Dept • In this course, we will be going beyond one-line commands and will be building complex scripts. • Some of these scripts can take a significant amount of time to execute, so that you may not want to spend time waiting for them to complete. • Instead, you can run any command or script in the background by using the & operator. • The script will continue to run, but you can continue to use the shell to issue other commands and/or run other scripts. • You will likely want to redirect both standard output and/or standard error to a file when sending tasks to the background: 23
  • 24. Running Commands in the Background 2 4 Dr. Aryaf Al-adwan, Autonomous Systems Dept • You can use the jobs command to list any tasks currently running in the background: • Use the fg command and the corresponding job number to bring the task back into the foreground: • If your task is currently executing in the foreground, you can use Ctrl-Z to suspend the process and then bg to continue the process in the background. • From there, you can use jobs and fg as described previously. 24
  • 25. From Command Line to Script 2 5 Dr. Aryaf Al-adwan, Autonomous Systems Dept • A shell script is just a file that contains the same commands that you could type on the command line. • Put one or more commands into a file and you have a shell script. • If you called your file myscript, you can run that script by typing bash myscript or you can give it execute permission(e.g.,chmod 755 myscript). • You can invoke it directly to run the script: ./myscript • We often include the following line as the first line of the script, which tells the operating system which scripting language we are using: • Of course, this assumes that bash is located in the /bin directory. • If your script needs to be more portable, you could use this approach instead: • It uses the env command to look up the location of bash and is considered the standard way to address the portability problem. 25
  • 26. Lab Exercises 2 6 Dr. Aryaf Al-adwan, Autonomous Systems Dept 26
  • 27. End 27 Dr. Aryaf Al-adwan, Autonomous Systems Dept 27

Editor's Notes

  • #6: Nmap allows you to scan your network and discover not only everything connected to it, but also a wide variety of information about what's connected, what services each host is operating, and so on. The Metasploit framework is a very powerful tool which can be used by cybercriminals as well as ethical hackers to probe systematic vulnerabilities on networks and servers
  • #9: What is Bash? Bash is the shell, or command language interpreter, for the GNU operating system. The name is an acronym for the ' Bourne-Again SHell
  • #10: The line begin with the file or directory permission, owner and group name, file size, created/modified date and time, file/folder name as some of the attributes. The blank line separating the command from its output in these examples will not appear when you run the command. Again, this is to separate the command from the output of the command. -1 You will see the file permissions, the number of links, owner name, owner group, file size, time of last modification, and the file or directory name
  • #26: The first two characters, called a “shebang” (#!)
  • #27: Ifconfig >> ipaddress.txt cp -R /etc/a /etc/b 2>copyerror.log ls|more ./mytask & fg 2