Skip to Content
Kali Linux 2018: Windows Penetration Testing - Second Edition
book

Kali Linux 2018: Windows Penetration Testing - Second Edition

by Wolf Halton, Bo Weaver
October 2018
Intermediate to advanced
404 pages
8h 50m
English
Packt Publishing
Content preview from Kali Linux 2018: Windows Penetration Testing - Second Edition

Reviewing a while loop structure

A while loop is explicitly started and stopped by true/false choice points. These can look very complicated, but they resolve to a limited set of tests for a single condition:

X = 0 
Y = 20 
while (X != Y): print (X), X = X + 1 

This Python 3 loop will print the value of X over and over until it reaches 10, then stop. It would work exactly the same if we said while X < Y, because the loop structure is testing X as it is incremented. A more complicated loop, using a random number for the incrementor element, might go on for much longer (or not) before it randomly hits on a value of X that was the equivalent of Y:

It is obvious that the program is testing the looping condition each time. Here is an example of ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Kali Linux 2018: Assuring Security by Penetration Testing - Fourth Edition

Kali Linux 2018: Assuring Security by Penetration Testing - Fourth Edition

Shiva V. N. Parasram, Alex Samm, Damian Boodoo, Gerard Johansen, Lee Allen, Tedi Heriyanto, Shakeel Ali
Hands-On AWS Penetration Testing with Kali Linux

Hands-On AWS Penetration Testing with Kali Linux

Karl Gilbert Gupta, Benjamin Caudill

Publisher Resources

ISBN: 9781788997461Other