Question: Your job is to modify the C++ Script below (or Python Script if preferred to start from scratch) with Linux Bash script commands to enable

Your job is to modify the C++ Script below (or Python Script if preferred to start from scratch) with Linux Bash script commands to enable you to block outgoing traffic by the URL. If necessary, refer to reading this web site to get a basic understanding of iptables Linux commands: https://fedoraproject.org/wiki/How_to_edit_iptables_rules

You will submit the following:

1. Your C++ source file named HW3_Yourlastname.cpp

2. Screenshot of the output after your run your .cpp file saved into an image file named HW3_image.png

Note: To block all traffic on HTTP protocol for your outgoing traffic in your PC, you will type: iptables -A OUTPUT -p tcp --dport 80 -j DROP

Here is the C++ Script, you will need to complete it. It is not complete:

==========

#include #include #include #include using namespace std; int main() { char option; cout << "Network Security Commands" << endl; cout << "=========================" << endl; cout << "1. Display Current firewall Configuration" << endl; cout << "2. Block All Outgoing traffic by protocol port Number" << endl; cout << "Enter an option" << endl; cin >> option; switch (option) { case '1': system("iptables -L"); break; case '2': int portnumber; cout << "Enter the Protocol Port Number" << endl; cin >> portnumber; string mystring = string(itoa(portnumber)); system("iptables -A OUTPUT -p tcp --dport " + mystring + " -j DROP"); break; } return 0; }

==========

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!