-
Notifications
You must be signed in to change notification settings - Fork 343
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #214 from jtpereyda/some-fixes
CLI open command
- Loading branch information
Showing
13 changed files
with
289 additions
and
250 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/env python | ||
from __future__ import print_function | ||
import logging | ||
import time | ||
|
||
import click | ||
from . import constants | ||
from . import sessions | ||
|
||
|
||
@click.group() | ||
def cli(): | ||
pass | ||
|
||
|
||
@cli.command(name='open') | ||
@click.option('--debug', help='Print debug info to console', is_flag=True) | ||
@click.option('--ui-port', | ||
help='Port on which to serve the web interface (default {0})'.format(constants.DEFAULT_PROCMON_PORT), | ||
type=int, default=constants.DEFAULT_WEB_UI_PORT) | ||
@click.option('--ui-addr', help='Address on which to serve the web interface (default localhost). Set to empty ' | ||
'string to serve on all interfaces.', type=str, default='localhost') | ||
@click.argument('filename') | ||
def open_file(debug, filename, ui_port, ui_addr): | ||
if debug: | ||
logging.basicConfig(level=logging.DEBUG) | ||
|
||
sessions.open_test_run(db_filename=filename, port=ui_port, address=ui_addr) | ||
|
||
print('Serving web page at http://{0}:{1}. Hit Ctrl+C to quit.'.format(ui_addr, ui_port)) | ||
while True: | ||
time.sleep(.001) | ||
|
||
|
||
def main(): | ||
cli() | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,21 @@ | ||
BIG_ENDIAN = ">" | ||
LITTLE_ENDIAN = "<" | ||
|
||
DEFAULT_WEB_UI_PORT = 26000 | ||
DEFAULT_PROCMON_PORT = 26002 | ||
|
||
RESULTS_DIR = 'boofuzz-results' | ||
|
||
ERR_CONN_FAILED_TERMINAL = "Cannot connect to target; target presumed down. Stopping test run. Note: This likely " \ | ||
"indicates a failure caused by the previous test case. " | ||
|
||
ERR_CONN_FAILED = "Cannot connect to target; target presumed down. Note: This likely " \ | ||
"indicates a failure caused by the previous test case. " | ||
|
||
ERR_CONN_ABORTED = "Target connection lost (socket error: {socket_errno} {socket_errmsg}): You may have a " \ | ||
"network issue, or an issue with firewalls or anti-virus. Try " \ | ||
"disabling your firewall." | ||
|
||
ERR_CONN_RESET = "Target connection reset." | ||
|
||
ERR_CONN_RESET_FAIL = "Target connection reset -- considered a failure case when triggered from post_send" |
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
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
Oops, something went wrong.