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

RunAsync function with supporting struct changes #26

Merged
merged 14 commits into from
Sep 6, 2019
Merged

RunAsync function with supporting struct changes #26

merged 14 commits into from
Sep 6, 2019

Conversation

TerminalFi
Copy link
Collaborator

@TerminalFi TerminalFi commented Sep 4, 2019

This PR contains code changes to support RunAsync methods to allow for real time updates from the NMAP process. It is currently able to spit out XML results to the screen.

Fixes #6

TESTS

Still need to be created.

BUG
When running in Async if you hit enter, it pulls a progress update from the the Nmap command. This is not intentional. I need to research into whether is is due to using bufio some how or what is cause this.

If scanner.GetStdout or scanner.GetStderr or scanner.Wait are called before the command scanner.RunAsync is ran, errors will occur. This may be the reason channels are a better approach.

@Ullaakut Thoughts?

FUTURE
Look into creating a custom XML Decoder to read XML as it is received. This would allow realtime updates to be converted into structs for better manipulation.

nmap.go Outdated Show resolved Hide resolved
nmap.go Outdated Show resolved Hide resolved
examples/basic_scan_async/main.go Show resolved Hide resolved
examples/basic_scan_async/main.go Outdated Show resolved Hide resolved
examples/basic_scan_async/main.go Outdated Show resolved Hide resolved
examples/basic_scan_async/main.go Outdated Show resolved Hide resolved
examples/basic_scan_async/main.go Outdated Show resolved Hide resolved
nmap.go Outdated Show resolved Hide resolved
nmap.go Outdated Show resolved Hide resolved
nmap.go Outdated Show resolved Hide resolved
nmap.go Outdated Show resolved Hide resolved
nmap.go Outdated Show resolved Hide resolved
@Ullaakut Ullaakut added the enhancement New feature or request label Sep 4, 2019
TerminalFi and others added 9 commits September 4, 2019 11:10
Formatting errs as suggested

Co-Authored-By: Brendan Le Glaunec <brendan.le-glaunec@epitech.eu>
Formatting errs as suggested

Co-Authored-By: Brendan Le Glaunec <brendan.le-glaunec@epitech.eu>
Spelling/Grammer Fixes

Co-Authored-By: Brendan Le Glaunec <brendan.le-glaunec@epitech.eu>
Spelling/Grammer Fixes

Co-Authored-By: Brendan Le Glaunec <brendan.le-glaunec@epitech.eu>
Code formatting fixes

Co-Authored-By: Brendan Le Glaunec <brendan.le-glaunec@epitech.eu>
Moving var definitions into groups

Co-Authored-By: Brendan Le Glaunec <brendan.le-glaunec@epitech.eu>
Code formatting fixes

Co-Authored-By: Brendan Le Glaunec <brendan.le-glaunec@epitech.eu>
Code formatting fixes. Updating import statements for lowercasing standards

Co-Authored-By: Brendan Le Glaunec <brendan.le-glaunec@epitech.eu>
nmap.go Outdated Show resolved Hide resolved
@Ullaakut Ullaakut merged commit ec6a14f into Ullaakut:master Sep 6, 2019
@TerminalFi TerminalFi deleted the nmap_run_async branch September 6, 2019 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add RunAsync() method
3 participants