Skip to content

Commit de441a9

Browse files
author
Ali Razmjoo
authored
Merge pull request #268 from OWASP/development
Development
2 parents 78d4258 + 72b2b96 commit de441a9

20 files changed

Lines changed: 44 additions & 48 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
runs-on: ubuntu-latest
4242
strategy:
4343
matrix:
44-
python-version: [3.5.9, 3.6.11, 3.7.8, 3.8.5]
44+
python-version: [3.9.4, 3.8.9]
4545

4646
steps:
4747
- uses: actions/checkout@v2
@@ -77,11 +77,8 @@ jobs:
7777
- name: Check API server logs
7878
run: docker-compose logs ohp
7979

80-
- name: Kill API Server
81-
run: docker-compose down
82-
83-
- name: Start mongodb
84-
run: docker run -p 27017-27019:27017-27019 -d mongo
85-
8680
- name: Run modules test
8781
run: sudo python3 ohp.py -m all --test --store-pcap
82+
83+
- name: Kill API Server
84+
run: docker-compose down

core/load.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -464,9 +464,9 @@ def honeypot_configuration_builder(selected_modules):
464464
return honeypot_configuration
465465

466466

467-
def port_is_reserved(real_machine_port):
467+
def port_is_free(real_machine_port):
468468
"""
469-
check if port is reserved
469+
check if port is free
470470
471471
Args:
472472
real_machine_port: port number
@@ -478,14 +478,14 @@ def port_is_reserved(real_machine_port):
478478
tcp = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
479479
tcp.bind(
480480
(
481-
network_configuration()["real_machine_ip_address"],
481+
"0.0.0.0",
482482
real_machine_port
483483
)
484484
)
485485
tcp.close()
486-
return False
487-
except Exception:
488486
return True
487+
except Exception:
488+
return False
489489

490490

491491
def reserve_tcp_port(real_machine_port, module_name, configuration):
@@ -502,16 +502,15 @@ def reserve_tcp_port(real_machine_port, module_name, configuration):
502502
"""
503503
while True:
504504
try:
505-
if not port_is_reserved(real_machine_port):
505+
if port_is_free(real_machine_port):
506506
# unique_port = True
507507
configuration[module_name]["real_machine_port_number"] = real_machine_port
508508
duplicated_ports = []
509509
for selected_module in configuration:
510510
duplicated_ports.append(
511511
configuration[selected_module]["real_machine_port_number"])
512512
if duplicated_ports.count(real_machine_port) == 1:
513-
info("port {0} selected for {1}".format(
514-
real_machine_port, module_name))
513+
info("port {0} selected for {1}".format(real_machine_port, module_name))
515514
return real_machine_port
516515
except Exception:
517516
pass

modules/ftp/strong_password/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# using phusion/baseimage as base image
2-
FROM ubuntu:20.04
2+
FROM ubuntu:latest
33

44
# use baseimage-docker's init system.
55
CMD ["/sbin/my_init"]
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
python3=3.8.2-0ubuntu2
2-
python3-pip=20.0.2-5ubuntu1.1
1+
python3
2+
python3-pip

modules/ftp/weak_password/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# using phusion/baseimage as base image
2-
FROM phusion/baseimage:0.9.19
2+
FROM phusion/baseimage:master
33

44
# use baseimage-docker's init system.
55
CMD ["/sbin/my_init"]
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
vsftpd=3.0.3-3ubuntu2
2-
libpam-pwdfile=1.0-1
3-
apache2-utils=2.4.18-2ubuntu3.17
1+
vsftpd
2+
libpam-pwdfile
3+
apache2-utils

modules/http/basic_auth_strong_password/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# using phusion/baseimage as base image
2-
FROM phusion/baseimage:0.9.19
2+
FROM phusion/baseimage:master
33

44
# update and install apache + python
55

@@ -16,4 +16,4 @@ COPY files/.htaccess /var/www/html/.htaccess
1616
COPY files/apache2.conf /etc/apache2/apache2.conf
1717

1818
# start the service + wait for container
19-
ENTRYPOINT service apache2 restart && tail
19+
ENTRYPOINT service apache2 restart && tail
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
apache2=2.4.18-2ubuntu3.17
2-
apache2-utils=2.4.18-2ubuntu3.17
1+
apache2
2+
apache2-utils

modules/http/basic_auth_weak_password/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# using phusion/baseimage as base image
2-
FROM phusion/baseimage:0.9.19
2+
FROM phusion/baseimage:master
33

44
# update and install apache + python
55
COPY files/requirements-apt-get.txt requirements-apt-get.txt
@@ -17,4 +17,4 @@ COPY files/.htaccess /var/www/html/.htaccess
1717
RUN sed -i 's/AllowOverride None/AllowOverride All/g' /etc/apache2/apache2.conf
1818

1919
# start the service + wait for container
20-
ENTRYPOINT service apache2 restart && tail
20+
ENTRYPOINT service apache2 restart && tail
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
apache2=2.4.18-2ubuntu3.17
2-
apache2-utils=2.4.18-2ubuntu3.17
1+
apache2
2+
apache2-utils

0 commit comments

Comments
 (0)