-
Notifications
You must be signed in to change notification settings - Fork 2
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
More fixes and compatibility #2
Open
KhasMek
wants to merge
16
commits into
MSadekUni:master
Choose a base branch
from
KhasMek:dev
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-P0 is deprecated, lets use -Pn instead.
This increases portability among other things.
Using native python code to call nmap apposed to os will add portability increases clean operation by dropping the need to track PIDs in lieu of libnmap's built in background tracking/callback. Note: setting the safe_mode flag to false is necessary with the -oX option.
This will run 4 concurrent threads of nmap in order to cut down the overall scan time.
The combination of using -Pn/-P0 and accepting open|filtered ports as actually open will result in a large amount of false positives. Let's just assume open|filtered ports are either flapping or false positives.
This excludes the following from tracking - byte compiled/optimized files - additional config files in config/ (while including templates) - common virtualenv directory names - common ide config directories
This is also for pep8 compatibility
- Alphabetize - Condense - Switch to absolute imports from relative. Using relative works 99% of the time, but can cause import issues in rare edge cases.
Also, just call os.path.exists instead of CheckExist. CheckExist prints a misleading "error" message if nmap_dir doesn't exist. This entire check could be simplified by using os.makedirs(exist_ok=True), but that wouldn't create the log entry if the directory didn't exist.
- Only try to create backup file if an existing outfile is present - Use native code move csv to backup file Now this will only print "unsuccessfuly copied backup" if there is a file to backup that it fails to copy. If no file exists, there is no reason to complain about not backing it up.
These do nothing and are just dropped by the interpreter.
This reflects the updates and changes to using native libnmap instead of os.system.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The summary of these commits is as follows
os.system
calls