Question: To begin writing your Perl script, open a command prompt window and switch to the C:Perl directory. Type notepad Win32.pl and press Enter . Click

To begin writing your Perl script, open a command prompt window and switch to the C:\Perl directory. Type notepad Win32.pl and press Enter. Click Yes when prompted to create a new file.

11.

In the new Notepad document, type # Win32.pl on the first line and press Enter.

12.

Use what youve learned in this chapter to write comments for documenting the program. Be sure to enter the author name, date, and a brief description of what the program does, such as the functions it accesses from the Win32 API.

13.

After your lines of documentation, press Enter several times to create blank lines for separating your comments from the program code. Then type use win32; and press Enter. (Note: Dont forget the semicolon.)

14.

You need five pieces of information (noted in the bulleted list before this activity) from the Win32 API. Attempt to write the code for getting this information, and then save the program. If you need assistance, use the following steps.

15.

Type $login = Win32::LoginName(); and press Enter. This line populates the $login variable with the information gathered from LoginName().

16.

Next, type the following lines to populate the other variables needed to complete the task, pressing Enter after each line:

17.

The following variables need to be displayed onscreen. Type the lines of code as shown, pressing Enter after each line. When youre done, your window should look similar to Figure 7-14.

Figure 7-14

Using the Win32 API from a Perl script

18.

After typing all the code, save the program, run it, and debug any errors. Figure 7-15 shows the output. Whats wrong with this report?

Figure 7-15

Running the win32.pl Perl script

19.

Spend time improving the reports formatting so that anyone reading the output could understand its meaning.

20.

Are there any improvements your group thinks should be made to the script? Explain. What other information might be beneficial for a security professional to get from this report?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!