Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

another Port sniffer #12

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

another Port sniffer #12

wants to merge 14 commits into from

Conversation

andrewsan13
Copy link

If you get tired of reading the code or something is not clear, ask, I will try to answer all your questions

@andrewsan13
Copy link
Author

There where regex use for the first time, it works incorrectly. I try to check host, and if "host" looks like a 123.123.123.123 or google.com.ua then "host" is correct, but addresses like a 1.2.3.4.5 pass too, I have no idea, why

@OleksiyRudenko
Copy link
Member

There where regex use for the first time, it works incorrectly. I try to check host, and if "host" looks like a 123.123.123.123 or google.com.ua then "host" is correct, but addresses like a 1.2.3.4.5 pass too, I have no idea, why

Regexp returns true when any part of the input matches the pattern.
You may want explicitly indicate both start and end of string. E.g. /foo/ will match "123foo456", while /^foo$/ will match "foo" only.

@andrewsan13
Copy link
Author

Done! Check it, please, and tell me if something wrong.

Copy link

@rekusha rekusha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python temp.py --host i.ua --ports 78-82
Host "i.ua" have no open ports in range 78 to 82

in i.ua port 80 is open

@andrewsan13
Copy link
Author

python temp.py --host i.ua --ports 78-82
Host "i.ua" have no open ports in range 78 to 82

in i.ua port 80 is open

time to take answer is 0.3 sec

Copy link

@rekusha rekusha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python temp.py --host 127.0.0.1 --ports 8900-8902
.
8901 ports are open
^^^^^
your code say 'port open' only if remote server respond on your 'hello' - it's wrong
i.ua don't respond for empty query and your script does not see open ports

python temp.py --host localhost --ports 8900-8902
IP or Domain in wrong format
regexp powerful tool but try 'socket' package from python library

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants