#### Overview of this book

The CompTIA PenTest+ Study Guide: Exam PT0-001 offers comprehensive preparation for the newest intermediate cybersecurity certification exam. With expert coverage of Exam PT0-001 objectives, this book is your ideal companion throughout all stages of study; whether youâ€™re just embarking on your certification journey or finalizing preparations for the big day, this invaluable resource helps you solidify your understanding of essential skills and concepts. The book shows how to perform security assessments on desktops, mobile devices, cloud, IoT, as well as industrial and embedded systems. You'll learn how to identify security weaknesses and manage system vulnerabilities. As you progress, you'll learn methods to ensure that existing cybersecurity practices, configurations, and policies conform with current best practices. You'll assess your knowledge by simulating cyber attacks to pinpoint security weaknesses in operating systems, networks, and applications. By the end of the book, you'll have all the resources you need to prepare for the exam - identify what you already know, learn what you donâ€™t know, and face the exam with full confidence.
Free Chapter
Acknowledgments
Introduction
Assessment Test
Chapter 1 Penetration Testing
Chapter 2 Planning and Scoping Penetration Tests
Chapter 3 Information Gathering
Chapter 4 Vulnerability Scanning
Chapter 5 Analyzing Vulnerability Scans
Chapter 6 Exploit and Pivot
Chapter 7 Exploiting Network Vulnerabilities
Chapter 8 Exploiting Physical and Social Vulnerabilities
Chapter 9 Exploiting Application Vulnerabilities
Chapter 10 Exploiting Host Vulnerabilities
Chapter 11 Scripting for Penetration Testing
Chapter 12 Reporting and Communication
Index

# String Operations

In addition to basic comparisons, developers writing scripts also must often manipulate strings in other ways. Concatenation is the most common string operation; it allows the developer to combine two strings together. For example, imagine that we have the following variables:

````first = "Mike"`
`last = "Chapple"`
```

We might want to combine these names into a single string to make it easier to manipulate. We can do this by concatenating the two strings. Here’s some pseudocode using the + operator for concatenation:

````name = first + last`
```

This would result in the following value:

````MikeChapple`
```

Of course, We’d like a space in between those values, so I can just concatenate it into the string

````name = first + " " + last`
```

which would result in the value

````Mike Chapple`
```

We also might need to concatenate a string and an integer together. Here’s some pseudocode that performs string and integer concatenation by first converting the integer...