Exploiting the FTP PASV Vulnerability
by Russ Rogers - 10/2/99
The easiest way to learn to program is to cheat!
To be a hacker, you need to know how to program. Learning to program requires grasping some concepts that might seem alien to you.
To ease this transition, I've come up with another simple tutorial. There are three scripts that we will look at. The object is
learning how to create random numbers from within PERL. Once you learn to do this sort of thing in one programming language, it will
be easy to learn the same structure in other languages.
We've got a client who has decided that they want some instant lotto number generators for their business web site. kewl! They need
scripts for the "Pick 3", "Pick 5" and "Pick 6". There can be no repeat numbers for each "generation" and the numbers have to be
within a certain range of numbers.
You can see the sample scripts in action at the following sites:
* The Pick 3 Generator
* The Pick 5 Generator
* The Pick 6 Generator
As you look at the following sample scripts, keep in mind what our goals are.
* We need true randomness within a certain range of numbers (per the lottery rules)
* It needs to be simple to use
* We want a dynamic .html document returned with an easy to read output of the numbers
* There can be no repeat numbers per "script-run"
With those goals in mind, let's look at the actual sample scripts:
* 3digit.pl
* 5digit.pl
* 6digit.pl
We are using a 'FOR' loop. We assume that the variable k has been initialized to the index number of the final element of our array,
in other words the size of the array. The For loop initialized i to the integer value 1. 'To k' means that as long as i has a value
smaller than k the loop is to continue. Step 1 tells the program how much to increment i each time through the loop.