Information Security Projects - Port Scanner

Tell us what’s happening:
Describe your issue in detail here.
hello,
so i have been trying to run the programm to see if it s working so far but the replit is keep saying:

unable to read .replit:
unable to decode .replit: toml: cannot load TOML value of type map[string]interface {} into a Go string

can anyone tell me how i can fix it?

Your code so far

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36 OPR/91.0.4516.72

Challenge: Information Security Projects - Port Scanner

Link to the challenge:

Never seen this error before. You’ll have to post a link to your repl.

hmm i did attach it but its gone lol.

this one is my link.
if the link doesnt work. my code is >
import socket
import re

def get_open_ports(target, port_range,verbose=False):
ip=“”
open_ports=
try:
ip=socket.gethostbyname(target)
for port in range(port_range[0],port_range[1]):
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
socket.setdefaulttimeout(1)
result=s.connect_ex((ip,port))
if result==0:
open_ports.append(port)
s.close()
except socket.gaierror:
if(re.search(‘[a-zA-Z]’),target):
return “Error: Invalid hostname”
return “Error: Invalid IP address”
except socket.error:
return “Error: Invalid IP address”
return(open_ports)

You’ll need to use code blocks for code, especially since Python is unusable without indentation. We’ll need the repl to debug as I doubt that error is caused by your code.

damn how do i share my code. i wrote my code with indentations but the forum just took it away. https://replit.com/@tegshbayar85/boilerplate-port-scanner#port_scanner.py

You have to use code blocks or the </> button in the post editor. Any markdown howto will be helpful.

As for the repl, there’s something wrong with it that doesn’t seem easily fixable. I got your code to start by creating a new, empty python repl and copying the files into there, so I suggest doing that.

thanks for answering :).
i think it was replit bug or sth. i couldnt import a new boilerplate for hours. Now it s working normally. i think it was because i had imported many times in a row in the previous challenge or sth.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.