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

1.1.8 #1

Merged
merged 3 commits into from
Aug 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ test.py
/data
__pycache__
/test
*.csv
*.csv
*.txt
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pip3 install -r requirements.txt
```

```
usage: pyne.py [-h] [-s] [-f] [-v] [-S] nessusFiles [nessusFiles ...] writeFile
usage: pyne.py [-h] [-s] [-f] [-U] [-S] nessusFiles [nessusFiles ...] writeFile

______
(_____ \
Expand All @@ -29,7 +29,7 @@ usage: pyne.py [-h] [-s] [-f] [-v] [-S] nessusFiles [nessusFiles ...] writeFile
|_| \__ |_| |_|\____)
(____/

Pyne 1.1.7
Pyne 1.1.8

positional arguments:
nessusFiles nessus file
Expand All @@ -39,6 +39,6 @@ options:
-h, --help show this help message and exit
-s, --sort sort keys alphabetically
-f, --force force overwrite of write file
-v, --verbose verbose output
-U, --UID add unique id to each finding
-S, --SlowMode run slowly
```
11 changes: 8 additions & 3 deletions pyne.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ def main(args):
repItems = utils.getReportItems(reportHost, VARS)
for report in repItems:
report["filename"] = file.split("/")[-1] # Add Filename to Report
report["uid"] = report["pluginID"] + "-" + report["port"] + "-" + repHost["host-fqdn"]
if args.UID:
try:
report["uid"] = report["pluginID"] + "-" + report["port"] + "-" + repHost["host-fqdn"]
except KeyError:
report["uid"] = report["pluginID"] + "-" + report["port"] + "-" + repHost["host-ip"]
print("[WARNING] No host-fqdn found for", repHost["host-ip"], "Using host-ip, this may not be consistent if comparing multiple scans.")
reports.append(report | repHost)

# Get Default SORT.conf
Expand Down Expand Up @@ -72,7 +77,7 @@ def main(args):

if __name__ == "__main__":

__version__ = "1.1.7"
__version__ = "1.1.8"
NAME = "Pyne"
TITLE = pyfiglet.figlet_format(NAME, font="stop") + f"\n{NAME} {__version__}\n"

Expand All @@ -81,7 +86,7 @@ def main(args):
parser.add_argument('writeFile', help='path to write file')
parser.add_argument('-s', '--sort', action='store_true', help='sort keys alphabetically')
parser.add_argument('-f', '--force', action='store_true', help='force overwrite of write file')
parser.add_argument('-v', '--verbose', action='store_true', help='verbose output')
parser.add_argument('-U', '--UID', action='store_true', help='add unique id to each finding')
parser.add_argument('-S', '--SlowMode', action='store_true', help='run slowly')
args = parser.parse_args()

Expand Down