Create new branch to refactor cli
This commit is contained in:
parent
904ec77932
commit
b0c14895b4
6 changed files with 37 additions and 19 deletions
19
main.py
19
main.py
|
@ -1,19 +0,0 @@
|
||||||
#!/usr/bin/python
|
|
||||||
|
|
||||||
import argparse
|
|
||||||
|
|
||||||
from src import ddos
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
|
||||||
parser = argparse.ArgumentParser(description="DDoS Proof of concept")
|
|
||||||
parser.add_argument('-t', '--target', help="Attack target IP address")
|
|
||||||
parser.add_argument('-p', '--port', help="Port to attack")
|
|
||||||
parser.add_argument('-i', '--ipaddress', help="Fake ip address")
|
|
||||||
|
|
||||||
args = parser.parse_args(ddos)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
main()
|
|
4
requirements.txt
Normal file
4
requirements.txt
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
typer==0.3.2
|
||||||
|
colorama==0.4.4
|
||||||
|
shellingham==1.4.0
|
||||||
|
pytest==6.2.4
|
5
simpleDDoS/__init__.py
Normal file
5
simpleDDoS/__init__.py
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
"""Top-level package for Simple DDoS."""
|
||||||
|
# simpleDDoS/__init__.py
|
||||||
|
|
||||||
|
__app_name__ = 'simple_ddos'
|
||||||
|
__version__ = "0.1.0"
|
0
simpleDDoS/__main__.py
Normal file
0
simpleDDoS/__main__.py
Normal file
28
simpleDDoS/cli.py
Normal file
28
simpleDDoS/cli.py
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
"""Top-level package for Simple DDoS."""
|
||||||
|
# simpleDDoS/cli.py
|
||||||
|
|
||||||
|
from typing import Optional
|
||||||
|
|
||||||
|
import typer
|
||||||
|
|
||||||
|
from simpleDDoS import __app_name__, __version__
|
||||||
|
|
||||||
|
app = typer.Typer()
|
||||||
|
|
||||||
|
def _version_callback(value: bool) -> None:
|
||||||
|
if value:
|
||||||
|
typer.echo(f"{__app_name__} v{__version__}")
|
||||||
|
raise typer.Exit()
|
||||||
|
|
||||||
|
@app.callback()
|
||||||
|
def main(
|
||||||
|
version: Optional[bool] = typer.Option(
|
||||||
|
None,
|
||||||
|
"--version",
|
||||||
|
"-v",
|
||||||
|
help="Show the application's version and exit.",
|
||||||
|
callback=_version_callback,
|
||||||
|
is_eager=True,
|
||||||
|
)
|
||||||
|
) -> None:
|
||||||
|
return
|
Loading…
Reference in a new issue