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

More fixes and compatibility #2

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

Conversation

KhasMek
Copy link
Contributor

@KhasMek KhasMek commented Oct 17, 2017

The summary of these commits is as follows

  • Use more native code over os.system calls
  • Import organization
  • More compatibility with PEP8 standards
  • Smarter output sorting
  • update ignored files/dirs
  • general housekeeping

  -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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant