Skip to content

Commit

Permalink
With great power comes great responsibility
Browse files Browse the repository at this point in the history
The africana-framework is a software designed for network & web hacking by automating as much stuff as possible to detect vulnerabilities on most common services and web technologies. It also has some wide range of penetration testing from internal network, Wi-Fi, system anonymity to web bug hunting. It's purely written for Good and not Evil
  • Loading branch information
r0jahsm0ntar1 authored Apr 10, 2024
1 parent a8484db commit 3b9b085
Show file tree
Hide file tree
Showing 49 changed files with 10,482 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/externals/nettacker/lib/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
pass
3 changes: 3 additions & 0 deletions src/externals/nettacker/lib/graph/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
pass
3 changes: 3 additions & 0 deletions src/externals/nettacker/lib/graph/d3_tree_v1/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
pass
94 changes: 94 additions & 0 deletions src/externals/nettacker/lib/graph/d3_tree_v1/engine.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import json
import os
from core.alert import messages


def start(events):
"""
generate the d3_tree_v1_graph with events
Args:
events: all events
Returns:
a graph in HTML
"""

# define a normalised_json
normalisedjson = {
"name": "Started attack",
"children": {}
}
# get data for normalised_json
for event in events:
if event['target'] not in normalisedjson['children']:
normalisedjson['children'].update(
{
event['target']: {}
}
)
normalisedjson['children'][event['target']].update(
{
event['module_name']: []
}
)

if event['module_name'] not in normalisedjson['children'][event['target']]:
normalisedjson['children'][event['target']].update(
{
event['module_name']: []
}
)
normalisedjson['children'][event['target']][event['module_name']].append(
f"target: {event['target']}, module_name: {event['module_name']}, port: "
f"{event['port']}, event: {event['event']}"
)
# define a d3_structure_json
d3_structure = {
"name": "Starting attack",
"children": []
}
# get data for normalised_json
for target in list(normalisedjson['children'].keys()):
for module_name in list(normalisedjson['children'][target].keys()):
for description in normalisedjson["children"][target][module_name]:
children_array = [
{
"name": module_name,
"children": [
{
"name": description
}
]
}
]
d3_structure["children"].append(
{
"name": target,
"children": children_array
}
)

from config import nettacker_paths
data = open(
os.path.join(
nettacker_paths()['web_static_files_path'],
'report/d3_tree_v1.html'
)
).read().replace(
'__data_will_locate_here__',
json.dumps(d3_structure)
).replace(
'__title_to_replace__',
messages("pentest_graphs")
).replace(
'__description_to_replace__',
messages("graph_message")
).replace(
'__html_title_to_replace__',
messages("nettacker_report")
)
return data
50 changes: 50 additions & 0 deletions src/externals/nettacker/lib/graph/d3_tree_v1/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
LICENSE
=======
https://code.jquery.com/jquery/

license: https://jquery.org/license/




https://github.com/d3/d3

Copyright 2010-2017 Mike Bostock
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of the author nor the names of contributors may be used to
endorse or promote products derived from this software without specific prior
written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.




http://bl.ocks.org/robschmuecker/7880033

Credits
bl.ocks.org is run by Mike Bostock.
bl.ocks.org is not affiliated with GitHub.

Code highlighting by Highlight.js (BSD license).
Markdown formatting by Showdown (BSD license).
3 changes: 3 additions & 0 deletions src/externals/nettacker/lib/graph/d3_tree_v2/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
pass
24 changes: 24 additions & 0 deletions src/externals/nettacker/lib/graph/d3_tree_v2/engine.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import string
import random
import json


def start(events):
"""
generate the d3_tree_v2_graph with events (using d3_tree_v1_graph)
Args:
events: events
Returns:
a graph in HTML
"""
from lib.graph.d3_tree_v1.engine import start
return start(events).replace(
'''\t root.children.forEach(function(child){
collapse(child);
\t });''',
''
)
50 changes: 50 additions & 0 deletions src/externals/nettacker/lib/graph/d3_tree_v2/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
LICENSE
=======
https://code.jquery.com/jquery/

license: https://jquery.org/license/




https://github.com/d3/d3

Copyright 2010-2017 Mike Bostock
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of the author nor the names of contributors may be used to
endorse or promote products derived from this software without specific prior
written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.




http://bl.ocks.org/robschmuecker/7880033

Credits
bl.ocks.org is run by Mike Bostock.
bl.ocks.org is not affiliated with GitHub.

Code highlighting by Highlight.js (BSD license).
Markdown formatting by Showdown (BSD license).
4 changes: 4 additions & 0 deletions src/externals/nettacker/lib/graph/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
OWASP Nettacker Graphs
======================

OWASP Nettacker graphs stored in here.
3 changes: 3 additions & 0 deletions src/externals/nettacker/lib/html_log/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
pass
40 changes: 40 additions & 0 deletions src/externals/nettacker/lib/html_log/log_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import os
from config import nettacker_paths

css_1 = open(
os.path.join(
nettacker_paths()['web_static_files_path'],
'report/html_table.css'
)
).read()

json_parse_js = open(
os.path.join(
nettacker_paths()['web_static_files_path'],
'report/json_parse.js'
)
).read()

table_title = open(
os.path.join(
nettacker_paths()['web_static_files_path'],
'report/table_title.html'
)
).read()

table_items = open(
os.path.join(
nettacker_paths()['web_static_files_path'],
'report/table_items.html'
)
).read()

table_end = open(
os.path.join(
nettacker_paths()['web_static_files_path'],
'report/table_end.html'
)
).read()
4 changes: 4 additions & 0 deletions src/externals/nettacker/lib/html_log/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
OWASP Nettacker HTML Report
===========================

OWASP Nettacker HTML report lib stored in here.
3 changes: 3 additions & 0 deletions src/externals/nettacker/lib/icmp/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
pass
Loading

0 comments on commit 3b9b085

Please sign in to comment.