Skip to content

Commit

Permalink
Added NMAP cmd generator
Browse files Browse the repository at this point in the history
  • Loading branch information
drakylar committed Jan 3, 2022
1 parent 5e47751 commit f062ba8
Show file tree
Hide file tree
Showing 5 changed files with 1,743 additions and 1 deletion.
23 changes: 23 additions & 0 deletions routes/ui/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,29 @@ def filter_host_port_issues(project_id, current_project, current_user):
return json.dumps(result)


@routes.route('/project/<uuid:project_id>/issues/hosts_hostnames_list',
methods=['GET'])
@requires_authorization
@check_session
@check_project_access
@send_log_data
def hosts_hostnames_list(project_id, current_project, current_user):
hosts_hostnames = db.select_project_hosts_hostnames(current_project['id'])

return json.dumps(hosts_hostnames)


@routes.route('/project/<uuid:project_id>/issues/networks_list',
methods=['GET'])
@requires_authorization
@check_session
@check_project_access
@send_log_data
def networks_list(project_id, current_project, current_user):
hosts_hostnames = [{'network':'{}/{}'.format(x['ip'], x['mask'])} for x in db.select_project_networks(current_project['id'])]
return json.dumps(hosts_hostnames)


@routes.route('/project/<uuid:project_id>/issue/<uuid:issue_id>/',
methods=['POST'])
@requires_authorization
Expand Down
11 changes: 11 additions & 0 deletions routes/ui/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -5264,3 +5264,14 @@ def nuclei_page_form(project_id, current_project, current_user):
return render_template('project/tools/import/nuclei.html',
current_project=current_project,
tab_name='Nuclei')


@routes.route('/project/<uuid:project_id>/tools/nmap-helper/', methods=['GET'])
@requires_authorization
@check_session
@check_project_access
@send_log_data
def nmap_helper_page(project_id, current_project, current_user):
return render_template('project/tools/helpers/nmap-helper.html',
current_project=current_project,
tab_name='Nmap Helper')
10 changes: 10 additions & 0 deletions system/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -2533,6 +2533,16 @@ def select_project_pair_host_port(self, project_id):
result = self.return_arr_dict()
return result

def select_project_hosts_hostnames(self, project_id):
self.execute(
'''SELECT ip as host, id FROM Hosts WHERE project_id=?
UNION
SELECT hostname as host, id FROM Hostnames WHERE host_id IN (SELECT id FROM Hosts WHERE project_id=?)''',
(project_id, project_id)
)
result = self.return_arr_dict()
return result

def select_project_pair_hostname_port(self, project_id):
self.execute(
'''SELECT Ports.id as port_id,
Expand Down
Loading

0 comments on commit f062ba8

Please sign in to comment.