freeCodeCamp/CurriculumExpansion

Port Scanner (Certification Project)

Closed this issue ยท 12 comments

Create project from the Python information security certification.

I think these is a Grammatical error in the Description
I guess it should be

In the port_scanner.py file, ............... port_range is a list of two numbers indicating the first and last numbers of the range of ports to be checked.

https://repl.it/@ArieRS/fcc-port-scanner

Maybe, the readme is more clearly if you give en example of the parameter of get_open_ports. Thanks

"In the port_scanner.py file, create a function called get_open_ports that takes a target argument and a port_range argument. target can be a URL or IP address. port_range is a list of two numbers indicating the first and last numbers of the range of ports to check. For example ("209.216.230.240", [440, 445]) or ("www.stackoverflow.com", [79, 82])."

After reading the README, I got the impression that we should check the ports in the port_range including the last number.

However, once I completed this project and checked the solution. I found that the solution does not check the last number of the port_range.

If the last number in the port_range is excluded on purpose, it should be clearly stated in the README.

Thanks everyone for your review. We'll clean up the grammar and consider including examples of both the input and expected output in the README.

Good catch on the solution not checking the last port in the range @adamdune. I always forget that range is exclusive and missed that in my initial review. Keep in mind that the solution code will not be included when the projects are launched, though, and we hope for learners to account for that in their own code. Perhaps we should adjust one of the tests or include a new tests where the open port is the second number in the port_range list to account for this.

https://repl.it/@erezhazan1/fcc-port-scanner

It wasn't clear to me if there is any need for input validation,
and if there is any special request for this as I started learning this topic I noticed that there are so many options to do it (but maybe it's only me..)

I made a lot of the recommended changes. Thanks for your suggestions.

@adamdune I updated the solution code so it checks every port in the provided range inclusive of both numbers. That was a mistake to not check the final number in the range.

@erezhazan1 We are not requiring input validation for this challenge.

Clear instructions (by the time I got here). Link to my solution.
Cheers!

@jdelarubia, awesome, thank you for your input. Your solution looks great ๐Ÿ‘ ๐Ÿ‘

Got stuck on socket.setdefaulttimeout() as I was not familiar with the socket package so staring at a blinking cursor after running had me confused if my tests were failing or the socket connection was failing.

Other than that clear instructions and gave just enough info to get Googling around to learn about the socket package.

Link to solution

Great, thank you for your feedback @natea123 and for posting a link to your solution. I believe others have mentioned that setdefaulttimeout() threw them off as well. That might be something we can mention in the README to prevent learners from getting stuck.

Hi there!

To solve this project, first I tried to get the open ports list working and I left the verbose output for the final part.

I had the same problem as @natea123, I wasn't familiar with the socket package. Until I managed to deal with the socket timeout and the opening and closing socket connections, I suffered a bit.

Once I got that part done, and I headed to create the verbose part. When I started to test the final code, I realized that I had assumed that all the ip addresses were correct, but it wasn't so. It took me a bit to get it, but I knew that I had a detail missing.

However, I think that instructions for this project are clear and sufficient. I also agree to give a hint about how to manage the socket connection time.

I hope this feedback is helpful.

My solution below:
https://repl.it/@casraysa/fcc-port-scanner