Skip to content

Commit

Permalink
Add app and dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
todaywasawesome committed Apr 27, 2021
1 parent 2abc62b commit 81f9fa9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
Empty file added .codefresh.yaml
Empty file.
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

FROM alpine:3.13.5

RUN apk update
RUN apk add scapy python3 && ln -sf python3 /usr/bin/python

RUN mkdir /code
WORKDIR /code
ADD advertise.py /code/

CMD ["python", "-u", "/code/advertise.py"]
13 changes: 13 additions & 0 deletions advertise.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from scapy.all import *
import time
import os

hostip = os.environ['HOST_IP']

print("Container started")
while True:
send(IP(src=hostip, dst="8.8.8.8")/ICMP())
print("Sent from", hostip, "sleep 5 mins")
time.sleep(300)

0 comments on commit 81f9fa9

Please sign in to comment.