Guys I'm using Kali Linux, I created a python script and everything is fine, but when I try to use a reserved port for this error:
PermissionError: [Errno 13] Permission denied
But when I use a higher port, 8080
for example, then it works, but I’m already logged in as root, and I’ve also given permission to my Python file with chmod + x script.py
. The port I want to use is 443, can someone help me?
Edit:
My code:
import os
import sys
import platform
import time
import socket
import argparse
HOST = "localhost"
PORT = 443
def main():
try:
print(f"Starting honeypot ...")
time.sleep(5)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((HOST,PORT))
while True:
s.listen(5)
conn,addr = s.accept()
print(f"Honeypot has been visited by: {addr[0]}")
print(f"Honeypot has been visited by: {addr[1]}")
conn.sendall(b"I got you!\n")
except KeyboardInterrupt:
print("\nShutdown honeypot ...")
main()
Similar but unsolved questions that solve the problem https://askubuntu.com/questions/868590/ping-socket-permission-denied A similar question https://superuser.com/questions/922732/why-do-i-get-permission-denied-even-as-root Among others ...
The idea is to build a honeypot