Question: Open server listening ports, running instances SimpleHTTPServer, and added IP aliases can add extra overhead and are a potential threat to the system. Thus, in
Open server listening ports, running instances SimpleHTTPServer, and added IP aliases can add extra overhead and are a potential threat to the system. Thus, in this section, we are going to do a little housekeeping and undo everything that we did in this lab.
Type gedit labcleanUppy to open the script cleanuppy into the gedit text editor. Press Enter.
sysadmin@ubuntu:~$ gedit labcleanUppy
Note: the code must be typed exactly right with the needed capitalization for the command to work.
imagejpg
Within the script lines to we are using the del argument to the Popen function to remove the aliased interfaces and deleting the IP addresses specified within the range function to Also, further down on line we can see that once again we are using the Popen function with killall and python arguments to terminate all instances of the SimpleHTTPServer.
imagejpg
Click the close button to exit gedit.
imagejpg
Type labcleanUppy to execute the script. Press Enter.
sysadmin@ubuntu:~$ labcleanUppy
imagejpg
CHALLENGE #
Incorrect Please try again or skip the challenge.
What is last command that is show on the output?
ossystemps efgrey python"
Skip
Note: Press the STOP button to complete the lab.
Conclusion
Python uses inheritance and modules as a way to organize code, where child classes inherit all properties and methods from the parent class and modules are scripts that essentially consist of any number of things classes methods, variables, etc. and can be made available via the import statement. Python also has the ability to interact with other programming languages, such as Bash. The lab illustrated how both languages can perform automation, where Python has a big stake in the future.
Discussion Questions
In this lab, we used a method connectexhostport for establishing a connection to a remote port. Why the double parentheses is used?
In this lab, we used the responsesubprocess.Popenstdoutstdout.read What is stored in response if we dont use stdout.read
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
