Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
ddos-attack-tool
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package Registry
Operate
Terraform modules
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OST
DAT505-Ethical_hacking
ddos-attack-tool
Commits
a7726738
Commit
a7726738
authored
1 year ago
by
Andri Joos
Browse files
Options
Downloads
Patches
Plain Diff
add Attack base class
parent
24f2663a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
attacks/Attack.py
+30
-0
30 additions, 0 deletions
attacks/Attack.py
attacks/__init__.py
+1
-0
1 addition, 0 deletions
attacks/__init__.py
with
31 additions
and
0 deletions
attacks/Attack.py
0 → 100644
+
30
−
0
View file @
a7726738
import
abc
import
signal
from
typing
import
List
from
multiprocessing
import
Process
class
Attack
(
object
):
_processes
:
List
[
Process
]
def
__init__
(
self
)
->
None
:
self
.
_processes
=
[]
@abc.abstractmethod
def
run
(
self
):
""""""
def
_wait_for_sigint
(
self
):
signal
.
signal
(
signal
.
SIGINT
,
self
.
_sig_handler
)
print
(
"
Press Ctrl+C to exit
"
)
signal
.
pause
()
def
_sig_handler
(
self
,
sig
,
frame
):
print
(
"
Exiting
"
)
for
process
in
self
.
_processes
:
if
process
is
not
None
and
process
.
is_alive
():
process
.
kill
()
process
.
join
()
def
_wait_for_processes
(
self
):
for
proc
in
self
.
_processes
:
proc
.
join
()
This diff is collapsed.
Click to expand it.
attacks/__init__.py
+
1
−
0
View file @
a7726738
from
attacks.Attack
import
Attack
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment