#networks
1 messages · Page 15 of 1
when i check the quality of my ip it says that its being abused by bots and what not
which is why im worried
Did you disable WPS
does anyone have any good resources for two way real-time communications between a controller and robot?
Did you disable WPS
@dusty oyster idk i dont think so
does anyone have any good resources for two way real-time communications between a controller and robot?
@cerulean tusk 0MQ might be good for that
assuming that the "robot" and the "controller" are python processes that are on the same network
if you mean a real robot, then I have no idea
@lavish rock yeah real robot. (A drone)
well actually, if the robot and the controller are talking over the same sort of TCP/IP network that I use every day to use the web, then I stand by 0MQ
probably the "pubsub" style
I've got a question regarding best practices for implementing a program with a network dependency. This "api"/program connects to a webhook, local db, someone else's api, and a collection of scripts for interfacing with a lan connected controller.
The controller has no implemented security and relies exclusively on obscurity and network isolation for security. With that in mind how do I expose my api without risking/exposing the controller? Is there a secure way to host the api online and still have it securely execute the scripts on the lan? I would actually like to host the api on the same network as the controller, but I don't know how to keep the controller safe and expose the api?
Any advice is appreciated.
@crisp thistle Know very little about security, but if you keep it on LAN and ensure it isn't exposed then that's the safest option. To ensure it isn't exposed host it on 0.0.0.0 (i.e. the LAN address) rather than your external IP and also remove any unnecessary port forwarding on the router and enable all of the security measures.
The webhook requires access to my hosted api. I also don't fully understand what you mean by.
To ensure it isn't exposed host it on 0.0.0.0
So presumably I would need to portforward and provide the webhook with my public IP.
@crisp thistle I think I misunderstood the situation you described. How about changing the settings on the router such that the only IP allowed to connect to the port is your IP?
@compact mist is there risk associated with exposing the machine running the server?
Of course.
Mitigation is the only thing you can do.
So minimal number of open ports
Restrictive rules, etc.
Besides firewall settings and a token system for the api is there anything else I can do to mitigate risk?
As I said, disallowing all IPs except yours.
Externally I don't have control over the webhooks ip
I believe that can be done at the router level.
Or do you not have access to the router?
The web hook is wild apricot. They're the webhook host and external api I'm interfacing with.
My application takes their webhook and checks if a flag exists and updates their api/ runs an associated script
Right so a VPS?
Uhh, I don't know?
It's a (Linux?) server in the cloud right?
Presumably. It's more like a cms. I don't have access to anything past a WordPress like editor and the api isn't hosted under our domain
It's accessed via api.wildapricot.com our data is accessed via an account id
Right.
In that case, I'm sure they've already implemented a lot of security features.
This seems more like domain securing.
My concern is not with their platform's security. Rather my api's hosts security
I know nothing about that aspect of security.
Neither do i
Surely the API's host is wild apricot?
Yeah, but the scripts are running on my server.
Scripts are located here
They talk to this box
The box will open the door if you tell it too. It doesn't ask questions. It just spits out yes sir. So if the network is compromised the door is open to anyone with wireshark.
If I expose an api do I need to be concerned about the door popping open randomly?
Pfsense for router/firewall, server w/ scripts is running Linux in a vm
That's ok, I appreciate the help. Is securing the server enough to secure the network? Assuming pfsense is configured correctly?
Both are best, if possible.
@lavish rock it has to be 2 way, can a subscriber talk back?
guys Im building a small network with cisco packet tracer, and I dont know if im Right or not
post your network
should vlans communicate ONLY with the router they are connected to, or can they send packets to other routers to
@ember ledge its about vlan
because the VLANs are communicating through sub interfaces, so I cant route them to other routers
nvm I fixed
it
😄
@ember ledge btw I can send my network to you if you'd like
Does the router send packets to another router in another network to be able to send the require data to the desired address ?
Or does it just send to the pc directly ?
Short words: Do routers only work as senders or receivers too ?
How do I kick my uncle off the neighbors wifi which I'm not connected to?
lmao
you tell your uncle to disconnect from your neighbor's wifi
He can't. Always watching shit on YouTube late night when I want to sleep
If I get his phone, what settings should I change?
Ever heard of ear plugs ?
I think you should talk to him dog
Nothing, Just forget the settings of your neightbors wifi
:3 You might get a single night of calm
But you wouldn't like the same to happen to you
Im trying to send a GET request for a website and everything is working fine for me locally but when I deploy to AWS I get 403'd every single time. Im using an HTTTP proxy to try get pass this but somehow the site can still work out when im sending the request from AWS. Any ideas how they might be doing this?
Originally I thought the site might be using the X-Forwarded-For header to determine where the request is coming from but my proxy also spoofs that header so i think its something else.
I don't know if this might help, @patent wharf : https://aws.amazon.com/premiumsupport/knowledge-center/s3-403-forbidden-error/
The problem isnt on the AWS side. Im trying to get a site thats hosted by Akamai which is known to be blocking the IP ranges published by AWS
Im just trying to work out how theyre able to identify that the request is coming from am AWS instance despite being behind a proxy
If you get the answer mention me
sure, will do
Some more info, if i send a curl request to http://ifconfig.me/all this is the response from my local machine:
ip_addr: 86.27.56.179
remote_host: unavailable
user_agent: curl/7.68.0
port: 36774
language:
referer:
connection:
keep_alive:
method: GET
encoding: gzip
mime: */*
charset:
via: 1.1 google
forwarded: 86.27.56.179, 216.239.32.21
and this is the response from my AWS instance:
ip_addr: 2.222.145.252
remote_host: unavailable
user_agent: curl/7.58.0
port: 3278
language:
referer:
connection:
keep_alive:
method: GET
encoding:
mime: */*
charset:
via: 1.1 google
forwarded: 2.222.145.252, 216.239.34.21
I also dont understand why the first forwarded ip address is different despite using the same HTTP proxy for both requests
im sending the curl request with curl -x <proxy>:<port> http://ifconfig.me/all
Hello, does anyone of u know any tutorial or something from which i can learn using python in this category?
The pinned message has some great resources for learning some networking concepts.
Haven`t checked there, thanks a lot mate
@snow tulip Yeah i mentioned that, ive looked into it but im pretty sure the proxy is spoofing that header since it never points to the AWS instance IP
hey i got problem with connecting to server usding socketio
pip freeze
eventlet
import socketio
sio = socketio.Client()
pip3 install python-socketio
how can i use ur conda ..
@cunning pagoda i need to use python-socektio
for python3
maybe u have any idea for me first to clean whole lib' and than install the conda like u said?
conda install -c conda-forge python-socketio
Hello guys, does anyone know how to extract .pcap files to .csv files with python? i really appreciate it if someone can help me
guys, is there an module for handling mail boxes (getting mails from timeframe, getting their data etc). pop3/imap, gmail etc?
I've read these builtin dont handles gmail new api
but I'm fine is it handles these correctl 🙂
thx
:incoming_envelope: :ok_hand: applied mute to @white kraken until 2020-06-09 17:08 (9 minutes and 59 seconds) (reason: mentions rule: sent 23 mentions in 10s).
ghost pong nagy
lol
Huh
bruh
e
ty python bot
what happened xD
⚠️
????
Who pong?
oo
Uuf
!silence
✅ silenced current channel for 10 minute(s).
!ban 574727901900177448 mention spammer
:x: User is already permanently banned (#8338).
oh
let's leave this silenced
Yep, for those coming from the ping we got hit with a mention spammer, they have been banned. Apologies.
✅ unsilenced current channel.
Np!! Good job guys
very quick response
i got pinged
same :')
+1 (:
+1
@latent drum Did you try imapclient? or imaplib?
honestly when I read gmail treat it as obsolete I din't use it
I had a code but it isn't clear
I was hoping for some easy to use lib 😉

reason: mentions rule: sent 23 mentions in 10s).
O_e but i mean i dont think all those people NEEDED mentioned to begin with (regardless of 23 mentions or not) good riddance thats been happening a lot latly on a bunch of servers
spammer
guys can anyone help me resolve this error:
SMTP 421 Cannot connect to SMTP server MYIP (MYIP:MYPORT), connect error 10060\x0d\x0a
can't connect to SMTP server
...
it's pretty clear what's wrong
could also be SMTP server is issuing 421 which is "I don't want to talk to you"
the instance is in AWS, do u think that it is the problem?, do i have to change some setting on AWS or something?
421 is SMTP server side, you need to speak to whoever runs that SMTP server
well i launched the program that is opening the port
on AWS
do u think am going terribly wrong here
are you running SMTP server?
yep, i believe so, am using Mailoney as a honeypot
sooo
it gives an option for server name u knoe
then configure it so it accepts email I guess
I have done it from mailoney, it still shows same error, i cant even connect it through telnet
I think thats some AWS thing but i cannot see any option to do that in dashboard
I'm trying to access flask dev server running on my virtual machine on the same network
tried changing the virtual machine network setting to Bridged Adaptor but its still not working.
i should be able to access it on 127.0.0.1 right?
( https://stackoverflow.com/questions/7023052/configure-flask-dev-server-to-be-visible-across-the-network )
can someone help me with this?
@rancid cradle VM loopback interface is separate from the host's loopback interface
bind the dev server to your bridge interface instead
Hello !
I am trying to send emails with python smtplib but I can't manage to do it.
I dont understand what I am doing wrong and I found nothing helpful on the internet.
I am using python 3.8.
Here is my code :
import smtplib, ssl
from email.message import EmailMessage
mail = u"my_adress@something.com"
password = u"password"
destination = "her_adress@something.com"
subject = "test"
content = "test message"
message = EmailMessage()
message.set_content(contenu)
message["Subject"] = subject
message["From"] = mail
message["To"] = destination
context = ssl.create_default_context()
with smtplib.SMTP('soething.com', 587) as server:
server.starttls(context=context)
server.login(mail, password)
server.send_message(message)
When I run the following code, I get this error message :
Traceback (most recent call last):
File "quizmail.py", line 27, in <module>
server.login(mail, password)
File "/usr/lib/python3.8/smtplib.py", line 734, in login
raise last_exception
File "/usr/lib/python3.8/smtplib.py", line 723, in login
(code, resp) = self.auth(
File "/usr/lib/python3.8/smtplib.py", line 646, in auth
raise SMTPAuthenticationError(code, resp)
smtplib.SMTPAuthenticationError: (334, b'UGFzc3dvcmQ6')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "quizmail.py", line 30, in <module>
print("envoi ok")
File "/usr/lib/python3.8/smtplib.py", line 282, in __exit__
raise SMTPResponseException(code, message)
smtplib.SMTPResponseException: (535, b'Authentication refused')
Thank you for your time.
@elfin shell u can check this things at SET tool kit on github
u can check their code
and fix ur code
Sorry, I can't find what you are speaking about. Could you share the link, please ?
Hey @ember ledge!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
Thank you for your answer. I still can't figure out what is wrong.
.__.
Why am I getting constantly pinged
hey guys, i have a question i tried googling for. it's worded weirdly. "Why do you need the IP address of a DNS server?"
so you can send DNS requests to it.
thankyou! ill google what a dns request is now, youve helped heaps :). cheers bro
you send a DNS request to a DNS server (lets say 8.8.8.8) and ask it "hey, i want to get to www.google.com, how do i get there?" and it'll send you a reply with what IP address is associated with www.google.com so your computer knows what web server to communicate with.
all the diagrams on google are shit, rofl
so i did something way worse
@snow tulip why not just ask another dns server how to get to the dns server
it's dns servers all the way down
we've been lied to all along, there are no webservers
it's just a neural net of dns servers
@snow tulip haha, i love the art work, very abstract. thank you for your reply 🙂
np
Yo i busted the box to a set of CCTV cameras is it possible to catch the signal of the cameras without the native box or something using the information of the cameras like DNS IP etc??
Anyone here good with wireshark?
are they digital IP cameras @upper robin ?
if so you could probably log directly into the camera and view the feed from there
uhh im not sure , theyre like basic cameras that just plug into the wall and my box captures the feed but my box no longer has Network capability
Is scp known to corrupt binary data?
So I'm pretty bad at networking in general and I'm trying to figure out if I can do this/how I can do this.
I'm trying to monitor a UDP port on a wifi network that I'm connected to. It's usually not a problem because I'm only connected to one network. But I'm currently connected to a wifi network and an ethernet network and I don't know how to bind the socket to the one network + port. (If that's even the correct way of thinking about it)
are you the admin of the wifi network itself?
@solid bluff are you the admin of said wifi network?
Yes, I have admin control of both networks
is this like a home wifi router?
For now it's a dinky little LinkSys, eventually it'll be a full-up proper Nighthawk-like router
But it's a simple network with just a router, not even connected to the internet
i'm not sure if a dinky linksys could do it, but a couple things to try.... enable syslog/logging, then you could do an access control list / restriction on the UDP port number in question. You might have the option to send it to a log
and use the router's UI to output the log
otherwise, if you are just trying to see if that UDP port is hitting your PC or device, you could use wireshark, or another linux based app to do a packet capture. you could filter the pcap on the UPD port while capturing to limit the packets written to the pcap
Alright, I'll do that~ Thanks
can you guys help me with a ZMQ problem?
can I ask here
I'm using a PUB/SUB design pattern, problem is my client does not ALWAYS recieve all the msgs only the first ones
The server loops through a list of objects, the data on those objects changes in real time. Every millisecond the server publishes all of the new data of those objects.
i.e. ['Carrot', 'Banana', 'Mango', 'Eggplant']
The Client can subscribe to specific objects via their name. self.sub_socket.setsockopt_string(zmq.SUBSCRIBE, 'Carrot')
On a thread the client polls these data in realtime as well
while True:
sockets = dict(self.poller.poll(poll_timeout))
if self.sub_socket in sockets and sockets[self.sub_socket] == zmq.POLLIN:
msg = self.sub_socket.recv_string(zmq.DONTWAIT)
// do something with the msg...
The problem is when I subscribe to multiple objects let's say, Carrot, Eggplant & Banana. I only
recieve the changes from Carrot, sometimes Banana, and so rare on Eggplant. I think this is because from the order of looping of the server, like maybe when the client polls, receives Carrot, process the data, then polls again but the server is already done with the publishing through the list and just publishing Carrot again then client polls recieves just Carrot because of that.
So I thought of creating individual sockets for each subscription? Is that a solution? I'm pretty new with ZMQ, would love some help here thanks!
why python not work correctly with me or my friends. Any atuallization? So what?
Hi Guys! Someone know, how to create p2p network, if the bigger part of nodes (members) are under the NAT. I heard about UPnP, but someone know another ways?
You will need a server to handle peer discovery, then use UPnP to forward ports through the NAT to the clients for initial connections
On websockets, does the example server design on ReadTheDocs allow for multiple websocket connections, or do I need a modified base to work on?
.
async def client_handle_connection(self) -> None:
self.s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
self.epoll.register(self.s.fileno())
self.s.bind(("", self.config['Preferences']['cnc-port']))
self.s.listen(1)
while(True):
events = self.epoll.poll(1)
for fd, event in events:
try:
sock = await self.client_return_socket(fd)
if(fd == self.s.fileno()):
self.afd, self.addr = self.s.accept()
threading.Thread(target=self.client_connected_cnc,
args=(self.afd, )).start()
elif(event & select.EPOLLIN):
self.rdbuf = sock.recv(1024).decode().rstrip()
sock.send(self.config['Preferences']['prompt'].encode())
except(BlockingIOError):
await self.client_remove_socket(fd)
self.epoll.unregister(fd)
so my assumption would be that the terminal is rendering a newline because you pressed enter
yea
which means it's hard to keep the prompt in sync
i don't know if there's even a solution to that
aw
Well I saw something that did have a fix for it
it's in golang
tho
And I refuse to believe golang can keep up like that while C cannot
if golang can C can and if C can then python can too because they both have this bug
hmm
Do you have any idea maybe?
i'm afraid i cna't really understand the structure of your code
never done much sockets
i've only ever done timeout reads > write back
do you just assume that each time you receive data that's a line then
i guess that makes sense
yeah
was the Go solution to just reply as quickly as possible
it did some weird stuff with hexadecimal reading
i guess you could move the user's terminal cursor position
to where it should be
before you send
maybe that's what they were doing
Hi
no, they were itterating over every individual char
and then checking some hexadecimal stuff and then returninmg
god knows why
wack
i have no idea what this means lol
i imagine there's a lot of tcp shell magic you can do
no not 0x10 but it was just an example
lemme show
if buf[bufPos] == '\xFF' {
n, err := this.conn.Read(buf[bufPos:bufPos+2])
if err != nil || n != 2 {
return "", err
}
bufPos--
} else if buf[bufPos] == '\x7F' || buf[bufPos] == '\x08' {
if bufPos > 0 {
this.conn.Write([]byte(string(buf[bufPos])))
bufPos--
}
bufPos--
} else if buf[bufPos] == '\r' || buf[bufPos] == '\t' || buf[bufPos] == '\x09' {
bufPos--
} else if buf[bufPos] == '\n' || buf[bufPos] == '\x00' {
this.conn.Write([]byte("\r\n"))
return string(buf[:bufPos]), nil
} else if buf[bufPos] == 0x03 {
this.conn.Write([]byte("^C\r\n"))
return "", nil
} else {
if buf[bufPos] == '\x1B' {
buf[bufPos] = '^';
this.conn.Write([]byte(string(buf[bufPos])))
bufPos++;
buf[bufPos] = '[';
this.conn.Write([]byte(string(buf[bufPos])))
} else if masked {
this.conn.Write([]byte("*"))
} else {
this.conn.Write([]byte(string(buf[bufPos])))
}
who needs comments anyway
lmao
oh I see
} else if buf[bufPos] == 0x03 {
this.conn.Write([]byte("^C\r\n"))
0x03 is ctrl C
oh so that's just responding with what you expect to see
ye
Hello!
I need to automate some string searches on a particular web site. At every search, it generates a .php page containing the data I want to download. I haven't done much scraping before so am unsure of where to start. The search string is not part of the page's address.
Ideas? 🙂
you could use the requests library to send a GET request and then parse the data you get back
requests + beautiful soup should do the trick
@snow tulip Is a GET request equivalent to entering a string into the site's search field and hit enter?
well when you enter a search string, does the new URL you're directed to take you to like uhhh
http://somesite.com/?q=searchquery
?
you could probably look at the network traffic and figure out how it's sending the request
or you could be lazy and just automate the action with a browser driver like Selenium
@snow tulip Would Selenium be much slower, or is the bottleneck probably the page's loading time? (it's a bit slow, takes a few seconds).
selenium would be slower as it'd have to drive the browser
Hmm
Well OK, I'll try with requests and beautifulsoup first, then.
@snow tulip I realized it's actually three php pages generated in total, of which only the last one contains the data I want. It goes like this:
- Enter search string, hit enter
- Click a button in generated php page # 1
- php page #2 loads
- php page #3 loads
- Get data
Is this possible with requests and beautifulsoup?
Couldn't possibly say without trying or looking at it myself
But if it were me I'd be lazy and just go the selenium route
Then again if I've got a hammer everything looks like a nail
Selenium sounds a bit simpler for a rookie to get going, I must say. I don't have all the time in the world for this so perhaps I'll try that first. Thanks for your help and thoughts m8!
NoProblem
i'm trying to make a short server runner for a small chatroom for me and my friend and i keep having trouble with the except keyword
can someone help?
def recieve_message(client_socket):
try:
message_header = client_socket.recv(HEADER_LENGTH)
if not len(message_header):
return false
message_length = int(message_header.decode("utf-8").strip())
return {"header": message_header, "data": client_socket.recv(message_length)
except:
return False
this is the section it's part of
I dunno if this is your exact problem, but that's bad because it'll hide -all- exceptions, including software bugs
it's not that
you should catch Exception, or better yet, a more-narrow class; and you should at least print out the exception you're catching
i keep getting a syntax error
that's
my problem i just continue getting syntax errors
oh you hae a missing }
i was thinking about it
i used notepad++ mostly for design purposes and basic jscript stuff
it's not great with pointing out mistakes in python
all it really does is provide descriptions of keywords
i'll check out pycharm
again thanks
oh yeah -- visual studio code is good too
i think i have that
but i'll still compare the two
ok, see you
for try/except cases can you make more than one except
Would there be a way for me to write an IRC in Python?
Like a server, client, bot yeah anything I just want the library aha.
there are a couple of python IRC libraries or frameworks out there.
I have the sense that some of them are even good.
Do you have any in mind? Any you would recommend?
i'm having a syntax error in this pg and i don't know why
for notified_socket in read_sockets:
if notified_socket == server_socket:
client_socket, client_address = server_socket.accept()
user = recieve_message(client_socket)
if user is False:
continue
sockets_list.append(client_socket)
clients[client_socket] = user
print(f"Accepted new connection from {client_address[0]}:{client_address[1]} username:{user['data'].decode('utf-8')}")
it's on the print sentence
I want to start to write an ssh server and client i found a lobrary named paramiko and i wonder if i should use that or it is possible to write it with sockets and i should use that way?
Anyone able to help me creating an ssh connection on my vps?
So our project is kinda same?
@vague basalt using paramiko is probably your best bet. I haven’t personally used it but have heard good things about it
I want to start to write an ssh server and client i found a lobrary named paramiko and i wonder if i should use that or it is possible to write it with sockets and i should use that way?
@vague basalt use paramiko
if you try using straight up sockets, you'll just end up reimplementing a lot of paramiko's functionality
which, i mean, if your objective is to learn, then go for it
but if your objective is to create a functional application, use paramiko
hi guys i am really new to python. i would like to send bulk emails . i have tried to search YouTube but not able to get any results . i hope this is the right group to ask how. if anyone knows and is willing to help a complete new guy please let me know
@commands.command(aliases=["con"])
async def connect(self, ctx):
app = web.Application()
runner = web.AppRunner(app)
await runner.setup()
site = web.TCPSite(runner, "megaroo.com.br", 80)
await site.start()
await runner.cleanup()
[Errno 11001] getaddrinfo failed
Someone help?
?
@ember ledge
can you help me?
why are you pinging random people?
he seems to know .-.
@ember ledge
i got it
ok?
@commands.command(aliases=["con"])
async def connect(self, ctx):
session = aiohttp.ClientSession()
await session.get('http://142.44.253.16/')
await ctx.send("sucess")
thx
i forgot to import aiohttp
lol
Anyone know what does “scapy contextmanagersubprocess” do? And can anyone explain it to me?
@fresh gull Haven't used scapy but the documentation for ContextManagerSubprocess is here: https://scapy.readthedocs.io/en/latest/api/scapy.utils.html#scapy.utils.ContextManagerSubprocess
Looks like its a context manager that stops you from crashing if you use subprocess to run a command or program that's not available or couldn't be found
@worldly lodge thanks. I have a question that can I execute something in a packet on the dst ip?(I’m a beginner😁)
what do you mean by that?
@worldly lodge I mean that send a packet that can execute file on the dst ip
Can I do something like that?
Server.py (Running on my aws ec2 instance)
import socket
s = socket.socket()
host = socket.gethostbyaddr('aws.ec2.public.ip')[0]
port = 12345
s.bind((host, port))
s.listen(5)
while True:
c, addr = s.accept()
print('Got connection from', addr)
c.send('Thank you for connecting'.encode())
c.close()
Client.py (Running on my local pc)
import socket
s = socket.socket()
host = socket.gethostbyaddr('aws.ec2.public.ip')[0]
port = 12345
s.connect((host, port))
print(s.recv(1024).decode())
s.close()
All inbound & outbound TCP traffic granted
The Server code shows no error.
But the Client code says
Traceback (most recent call last):
File "/Users/sohamjain/Desktop/client.py", line 7, in <module>
s.connect((host, port))
TimeoutError: [Errno 60] Operation timed out
>>>
Connecting to the EC2 instance via rdp client works perfectly
When I run both these scripts on local host they seem to work fine.
But in case of AWS EC2 Instance, it does not.
Where did I go wrong?
dunno
on the server, i'd try binding to 0.0.0.0 instead of host
you're sure you're using a "security group" that allows all inbound ports?
Yes
ah I was just about to paste my equivalent of that 🙂
looks a bit different actually
but I guess yours is fine
anyway, other than my 0.0.0.0 idea -- I got nuttin' 😦
I tried 0.0.0.0 but it does not work either
above my pay grade, then; good luck 😐
holy shit
don't open all those ports
that makes me nervous
i haven't really read everything thoroughly @rain otter
buuut
host = socket.gethostbyaddr('aws.ec2.public.ip')[0]```
on the client?
oh nvm it's not a resolution.
my bad.
Hey there I have a question I’m just not sure about it because I’m a beginner. Can i communicate with a client on a network using python socket?
@snow tulip The ports are open just for testing
@snow tulip Any workaround you'd like to put forth?
how about some diagnostics with tcpdump or something?
see what data is actually being sent
both client and server.
so what i do with this go damm problem Cannot connect to host discordapp.com:443 ssl:default [The specified network name is no longer available]
Is this the place to ask basic-ish questions regarding networking? (Pinging in particular)
what do you want to know? @regal forge
I got it figured out, thanks tho!
Does anyone know a function that can replace inet_addr()?
I've been looking everywhere and even tried inline c but inline c with arguments shits itself
what's wrong with inet_addr()
@ember ledge theres no inet_addr() in python
bruh
@ember ledge see these four functions https://docs.python.org/3/library/socket.html#socket.inet_aton
@ember ledge that gives me hex
It need it in uint32 format
sorry for late response
hex?
it gives back raw bytes
sec
I don't think you understand what inet_addr() does...
give me an example of you using it
oh nvm it does
b'2224'
input, code, and output
that's not what I need
printf("%lu\n", inet_addr("50.50.50.52"));
I am very sure I do know what inet_addr does
@ember ledge I tried inet_pton and it sort of gives what I am looking for but in the wrong endianness
yes... you are casting it as a long...
that's exactly what I am looking for
give me a sec
ignore the ctypes import

give me a second
oh my god
thank you
👍 glad you got it working
addr.sin_addr.s_addr = (in_addr_t)atol(conf[queue].target);
works flawless now
also ignore the cast

seems relatively uncursed
What is the difference between a hierarchical and menu structure?
Isnt a menu structure basically a hierarchy?
How does proxies exactly work in the way that one can obtain them?
Like I have heard of creating a proxy server with python but I mean it would be limited would it not in terms of being tied to one IP?
what keywords should I search to delcare variables at script execution, for example 'create-inventory.py -d Inventory.csv -s Store -t Production'
The pinned message have some resources for sockets. If you have questions during your learning process you can probably just ask here
from scapy.all import IP, ICMP, send
src = "1.1.1.1"
ip_hdr = IP(src, Host
_packet = ip_hdr / ICMP()
send(_packet)
ping("IP")```
Im getting an error ```
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\scapy\fields.py", line 1492, in getfield
_bytes = struct.unpack('!%dB' % nb_bytes, w)
struct.error: unpack requires a buffer of 2 bytes```
what's the server running on that port
the server is running on port 5000
if __name__ == '__main__': print("listening on port 5000") eventlet.wsgi.server(eventlet.listen(('', 5000)), app, log_output=False)
import aioconsole
import websockets
class ChatClient:
def __init__(self):
self.uri = "ws://localhost:8765"
self.loop = asyncio.get_event_loop()
self.q: asyncio.Queue = asyncio.Queue()
self.ws: Optional[websockets.WebSocketClientProtocol] = None
self.running = asyncio.Event()
def _input_available(self, q: asyncio.Queue):
print("inp")
asyncio.ensure_future(q.put(sys.stdin.readline()))
async def run(self):
self.ws = websockets.connect(self.uri)
self.loop.add_reader(sys.stdin, self._input_available, self.q)
print("reader added")
self.running.clear()
self.loop.create_task(self._comms())
self.loop.create_task(self._io())
await self.running.wait()
async def _comms(self):
while True:
await aioconsole.aprint(await self.ws.recv())
async def _io(self):
while True:
a = await aioconsole.ainput()
if a == ".quit":
self.running.set()
await self.ws.send(a)
c = ChatClient()
asyncio.ensure_future(c.run())
exits immedately
if i do asyncio.get_event_loop().run_until_complete(c.run()) i get:
Traceback (most recent call last):
File "D:/repos/chatbot/libs/client/client.py", line 43, in <module>
asyncio.get_event_loop().run_until_complete(c.run())
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\asyncio\base_events.py", line 571, in run_until_complete
self.run_forever()
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\asyncio\base_events.py", line 539, in run_forever
self._run_once()
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\asyncio\base_events.py", line 1739, in _run_once
event_list = self._selector.select(timeout)
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\selectors.py", line 323, in select
r, w, _ = self._select(self._readers, self._writers, [], timeout)
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\selectors.py", line 314, in _select
r, w, x = select.select(r, w, w, timeout)
OSError: [WinError 10038] An operation was attempted on something that is not a socket
TL; DR, i cant seem to find a way to have non-blocking input with the websockets lib
So I just stumbled upon the concept of socket programming (I am new to python). Although I think i got the basics of the concept, I am having trouble figuring out when to use it compared to a web server like a flask application. For instance I just started on a little home automation project. Initially I was going to use flask to build a simple API, which talks back and forth with devices, but now I am starting to wonder if socket programming is the way forward. When do you use what?
check the pins
@ebon crescent
Use flask if you care about having your API being user-friendly and perhaps used by several people. You would also need to code more if you decide to go with a web based solution as you would need to somehow transfer the data from the website to the back-end flask (dependent on how you build your project), which might require some JavaScript. Sockets on the other side are low-level and quite efficient. If you want some simple communication between two or more devices then sockets is probably the easiest solution, though it might not be so user-friendly if you decide to go with a non-web-based solution. For longer strings and data / images then sockets is probably the technology you would chose.
Hi Guys, I am trying to install Juniper vSRX3.0 on EVE-NG, however no matter what I try I can't come right... I come to a point where I start the vSRX on EVE-NG and then it loads, after a couple of minutes it says "Rebooting in 15 seconds". I am using a qcow2 vSRX file which has been downloaded from the Juniper Website. Can anyone help out please?
Hey @timid skiff!
Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:
• If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)
• If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:
i have app when i use discord oauth2 and flask but how i can stop flask on redirect to redirect_uri ?https://pastebin.com/RbfK4p7A
Heya! I just want to set up a simple networking setup. I would like to send files from a sub to a main computer for backup. And then the sub can ask "hey are thease files corect?"
Heya! I just want to set up a simple networking setup. I would like to send files from a sub to a main computer for backup. And then the sub can ask "hey are thease files corect?"
@tacit matrixChecksum?
guys, i want to connect a new router to the old (main) router and use it as a new wifi to extend the old one
it shows up on devices and it connects but it gives no internet access
DNS light isnt on nor internet light
how are you connecting it? LAN cable to WAN (red) port? In bridge mode? @sick mantle
LAN to LAN
alright
is there a way to make it from LAN to LAN?
@ember ledge
cus there is a dsl port and 4 LAN ports on the sub router
there is no WAN
depends entirely on the routers
if you were trying to create a "sub" network with the 2nd router you'd need one with a WAN RJ45 port
as xx says, the router may support a WiFi Bridge mode.
you'd have to read the manual
mhm
Hi i am running a python program(app.py) which uses socket library to port scan, also after the port scanning is done, I am calling another python file, screenshot.py which uses selenium but when I run app.py the error occurs (Can not connect to the Service chromedriver) but running the screenshot.py individually doesn't
as in running both socket and selenium one after the other causes the error, but running the selenium program individually the program works fine.
also, I am using a reverse_proxy via local host.
anyone?
are you using the same python version/interpreter for each one
also
!rule5
!rule 5
5. Do not provide or request help on projects that may break laws, breach terms of services, be considered malicious/inappropriate or be for graded coursework/exams.
don't be doing anything illegal or malicious
that means you better be port scanning equipment or systems that you own or are authorised to scan
or
when using verbose with sys.argv , i want to have verbose turn on or off . what would be the best way to go about this
@unreal path using the argparse module might be of interest, rather than manually parsing sys.argv
will look into it thanks
@unreal path also not related to networking
sry
@snow tulip you can't scan anyone's stuff?
I am trying to get Live Chat from https://www.nonolive.com/room/34219606. How do I extract data from NETWORK-WS as shown in the picture?
@rotund swift legality of port scanning a computer you don't own can vary from country to country
Hello! I'm learning to use python and sshtunnel.
When using:
With sshtunnel... as tunnel:
Does it close the tunnel automatically at the end?
Hi guys, Ive created my own load balancer and I want to be able to differentiate between requests that are using the load balancer as a proxy and requests that are just attempting to GET the server.
from the server side how would I be able to differentiate between:
curl -x http://loadbalancer.com/ http://wttr.in/
curl http://loadbalancer.com/
In the case that someone just GETs the page instead of using it as a load balancer i want to serve some HTML
use the x-forwarded-for header
?
My loadbalancer is applying the x-forwarded-for header before it proxies the request
An inbound request won't have an x-forwarded-for header
Hello, I have something this in tcp server:
while 1: read_sockets,write_sockets,error_sockets = select.select(CONNECTION_LIST,[],[],1.00)
I used profiler and this is the line where server spends all time
Can it be written any better and less cpu consuming?
Hey @willow glade!
It looks like you tried to attach file type(s) that we do not allow (.exe). We currently allow the following file types: .3gp, .3g2, .avi, .bmp, .gif, .h264, .jpg, .jpeg, .m4v, .mkv, .mov, .mp4, .mpeg, .mpg, .png, .tiff, .wmv, .svg, .psd, .ai, .aep, .xcf, .mp3, .wav, .ogg.
Feel free to ask in #community-meta if you think this is a mistake.
guys, LAN is under peer to peer or client server network, or both
lan is land area network it can act like client server network if their is a server idk about peer to peer
OKOK, THX
Peer to peer and client/server is application level structures. LAN is a network layer concept so it is a bit like comparing apples and oranges.
Client/server essentially only means one of the applications is client, the other is server. Client sends the server requests and the server responds.
Peer to peer means that both applications can be "server" or "client" depending on requirements. They can also switch the roles around. They are equal.
In short applications within a LAN can be configured to act both as client/server or peer to peer.
I think you can just plug 'em all into the hub, and tell Windows to do its "home network" thing, and it should all Just Work®
Hi, can we get the received & sent network Bytes per second For a process using python ? Like resmon do
probably, I'd google "python network statistics"
any async web server modules? I've tried fastapi and I can;t get it to behave, and aiohttp is less than ideal
why is 0.0.0.0:port_num invalid?
I can't GET it
(None, None, None, ClientConnectorError(ConnectionKey(host='0.0.0.0', port=8090, is_ssl=False, ssl=None, proxy=None, proxy_auth=None, proxy_headers_hash=None), OSError(22, 'The format of the specified network name is invalid', None, 1214, None)))
you can't get 0.0.0.0 or whatever can you?
found it
suggest me a book to learn networking in python
so im building a project that takes exported csv from wigle and looks for iot devices
any idea on how to determine whether an entry may be a device
not sure if this is the right channel, but its network related
Could anyone quickly clear up what a post request does? I've seen curl -X POST <url>, and that is supposed to create a new "resource" on the server. But, what's in the new resource?
An example might also be useful :D
it doesnt "do" anything unless the server says to
but conventionally, post is creating a resource
mayhaps this will help explain it?
POST just tells the server to expect some data in the request body.
An example GET request (which is sent to the server):
GET /index.php HTTP/1.1
Host: mysite.com
An example POST request:
POST /form.php HTTP/1.1
Host: mysite.com
value1=somedata&value2=otherdata
you could also include stuff in a GET request body, but by convention browsers don't do this so servers usually discard any data in a GET request
for get requests, the data is moved to the URL instead
example:
GET /form.php?value1=somedata&value2=otherdata HTTP/1.1
Host: mysite.com
guys, what you more prefer between BUS topology and STAR topology
in a small business office
hi can people who are free help do this survey?
u can take up identities and pretend you are from a enterprise and say your opinions abt cloud storage
star leaves a single point of failure but is slightly more efficient than bus
I hope this channel is free. I got a question.
I have a data cap on my internet connection. I feel like my ISP's portal is overestimating my data usage. So I decided to measure my data usage on my own. We (family) use 4 devices. (2 phones, 2 laptops ) It's kinda hard to install seperate meters like Glasswire or vnstat and add up all to find total usage. I have a openvpn server (self hosted). So I'm thinking of setting up it to measure data usage. (Then use VPN on all devices.) Will this work as I want. I mean will it measure my data usage correctly.
will it be disturbed by extra data usage of VPN service for encryption etc etc. ?
my router's firmware doesn't have a bandwith meter and im not confortable with installing a custom firmware. Also I don't have resources to setup pfsense or something like that :/
Encryption increases data usage
@rigid patrol how much will it increase. do you have any idea ?
It varies of course, but 15% wouldn't surprise me
Not without additional hardware being involved. Cable/DSL modems often have bandwidth usage metrics though
my router is a ISP issued one (their own firmware). there is a statistic tab. (im not sure how to read it.) :/
Interface ID, Received packets, received packets with error, dropped received packets, transmitted packets, transmitted packets with error, dropped transmitted packets
i assume
yeah, over your different interfaces
ppp0-vc0 being your internet line
obviously without knowing packet sizes you can't infer much from that
where did rx/tx come from
oh like transmit
with x being like
things going across each other
receive transmit
idk where the x came from
appears that "xmit" may have been slang used in the military for transmit
yeah that makes sense
RECEIVEMIT
RX is the telegraph and radio abbreviation for "receive", "receiver" or "reception".
all those telegraph nerds
Hello all, I want to run linux command for capturing traffic using tcpdump. For example the command i want tran is "sudo tcpdump -nnli any -tttt 'tcp' -G 1 | awk '{print $1,$2,$4,$22}' any good python module , i have tried with subprocess and could not pass the linux pipe command.
you would probably have to run bash sudo tcpdump -nnli any -tttt 'tcp' -G 1 | awk '{print $1,$2,$4,$22} I think, but it would probably be easier to find some python library that can do similar behavior
i can run in linux termainl, but i am looking python library that can do it
process2 = subprocess.Popen("|", "awk", '{print $1,$2,$4,$22}' ", stdout=subprocess.PIPE)
it sounds like you want to line buffer the output
the "-l" in the command is used for line buffer out put, do you mean for the subprocess call?
so i can get real time read by doing something like uhhh
import subprocess
proc = subprocess.Popen(('sudo', 'tcpdump, '-l'), stdout=subprocess.PIPE
for line in iter(proc.stdout.readline, b''):
print(line.rstrip())```
and that gives me a live output of tcpdump
oops, missed a bracket
np 👌
@snow tulip it is throwing an error File "app.py", line 3 proc = subprocess.Popen(('sudo', 'tcpdump, '-l'), stdout=subprocess.PIPE) ^ SyntaxError: EOL while scanning string literal
'tcpdump missing a closing quote
ohh
hey i double typo'd and didn't notice
:D
gotta keep em on their toes ¬_¬
and actually now thinking about it i wouldn't bother to use awk to trim the tcpdump output anyway
how would i filter out on the fly , because the tcpdump is dumping huge data
i assume you're processing each line in python somehow?
https://pypi.org/project/pcap-ct/ would it not be easier to use a python library for this, rather than using a shell command
^
might be an idea
for splitting out useful information i'd have just written a regex or smth
has anyone used the AWS SDK boto3 to do presigned urls since the v4 update?
I cant get it to work anymore, get authentication errors
Specifically following this example exactly to do a presigned post uploading a file works to generate the URL but making the request with the pre-signed URL gives error: https://boto3.amazonaws.com/v1/documentation/api/latest/guide/s3-presigned-urls.html
however I can use the exact same client configuration to upload a file directly, so Im not sure if the issue is a configuration setting in AWS or what
can someone explain what is 201 code?
10.2.2 201 Created
The request has been fulfilled and resulted in a new resource being created. The newly created resource can be referenced by the URI(s) returned in the entity of the response, with the most specific URI for the resource given by a Location header field. The response SHOULD include an entity containing a list of resource characteristics and location(s) from which the user or user agent can choose the one most appropriate. The entity format is specified by the media type given in the Content-Type header field. The origin server MUST create the resource before returning the 201 status code. If the action cannot be carried out immediately, the server SHOULD respond with 202 (Accepted) response instead.A 201 response MAY contain an ETag response header field indicating the current value of the entity tag for the requested variant just created, see section 14.19.
assuming we're talking http
assuming we're talking http
@snow tulip What is the 'new resource' ? Sorry, I'm a little poor in networking
it confirms that after a POST request has been sent that a new resource has been created.
it confirms that after a POST request has been sent that a new resource has been created.
@snow tulip thank you
Hi guys, I have a reverse proxy that ive written sitting behind a load balancer in a kubernetes cluster and im trying to send a curl -x https://url.com/ http://wttr.in/ request to it. This fails for some reason and I get a default backend - 404 response. It works find when i just curl https://url.com/ directly to the website so im wondering why the proxy request dosen't work. It dosen't even show up in any logs. From my understanding both requests are being sent over ports 80/443 so should atleast show up in logs
does anyone know why im getting this?:
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))
i copied all the headers that are under the network tab for the get requests on my browser
r = s.get(url, headers=HEADERS)
Does anyone know of some good resources for learning the basics of HTTP? (Headers, body, http methods, etc.)
^
@exotic solar this is pretty good: https://developer.mozilla.org/en-US/docs/Web/HTTP/Overview
Thanks :D
no problem
helllo
how to keep a ws connection alive
You can send some keep alive package
Here is a JS blog post about it, I believe it is still applicable to python https://www.jstips.co/en/javascript/working-with-websocket-timeout/
Anyone able to guide me in the right direction in regards to how I can go about connecting my android phone to windows laptop via bluetooth with Python?
I need someone that can help me out and be partial partners with a new app that I am currently working on building that will hopefully change the stock trading game. I am currently learning python but would love to have someone who could help with the backend stuff! pm me, thanks
👀
Hi I have recently been trying to make a http2 client using python but there seems to be not much development in this regard. Only module available seems hyper and it's development seems stopped. Can anyone help me in this regard?
@steady sedge what makes you say that hyper development has stopped?
seems relatively active
last commit was 15 days ago
aha, but their documentation link seems broken
odd
@ember ledge there issue resolution and commits seems few and far between. Almost like 1 a month.
May be due to lack of participants on this. Would try and contribute even though m quite new to python. Hopefully more developers grow interest in this and the module improves.
How does the server get any string sent to it, reverse it and send it back to the client. Can someone help pls?
Have you tried something yet? Send the code and where specifically you need help.
We are given the client code we have to write the corresponding server code
!codeblock
I am tried writing the code but I am not sure if it is right because I have not done python in networking and just needed some help to check when I reverse the string. @narrow oak how do I send the code?
Have*
Pasting large amounts of code
If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pydis.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
That is the client code
I have to write a corresponding server code
I have tried writing it down but I do not know if it right
Yes @narrow oak I am new to this and I just joined the discord channel sorry that is why asking alot of questions
But how do I run and see if the program is right?
Do you have Python installed and added to your path
Open a command prompt and navigated to your folder where the file is. Then python file.py should do the work.
Also make sure that there are no active processes in your pc running something on that port
If you don't have more networking specific questions consider creating a help channel
Ok thank you @narrow oak
@rose blaze how did you solve the two generals problem?
Hey do any of you guys know if you can find out if something in a set can be found in a graph
Hello does anybody know a good tcp/ip osi course
I'm sending a GET request to an image path on discord using aiohttp, and reading the response (into bytes) and writing it into an io.BytesIO() object.
The response is this: https://mystb.in/EugeneDeclarationFallen.php-template
And the file is completely empty (0 bytes)
What am I doing wrong?
This is the result: https://i.imgur.com/w12uPIi.png
Fixed it by not IO.write() int
I always get ERROR_PROXY_CONNECT_REFUSED
Even when I'm using verified proxies which I scraped and tested
But what commands do you use to run the program
That’s what I don’t know
Sorry I know this question is stupid but I am new to coding and networking my first time doing it
In Linux
Yes I do
and open one with python3 ./path/to/file/server.py
if everything went well you now should be able to test your program
rarp is difficult in connection-oriented networks, why would that be?
is it because of handshaking requiring ip address from the machine?
hey I want to ask about something
$ nmcli
tun0: connected to tun0
"tun0"
tun, sw, mtu 1500
inet4 10.10.15.99/23
route4 10.10.14.0/23
route4 10.10.10.0/24
I am connected to a network through vpn I know about subnetting but I don't understand how I am able ping 10.10.10.174 because ips in my network, I believe, start from 10.10.14.0
I don't understand route4 entries can somebody help me with this?
default via 192.168.1.1 dev eth0 proto static metric 100
10.10.10.0/24 via 10.10.14.1 dev tun0
10.10.14.0/23 dev tun0 proto kernel scope link src 10.10.15.99
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.11 metric 100
I hope this helps as well
"10.10.10.0/24 via 10.10.14.1 dev tun0 "
It goes to that IP through 10.10.14.1
how 10.10.14.1 knows where 10.10.10.0/24 is, I don't know
your route says 10.10.10.0/24 goes via 10.10.14.1, and 10.10.14.0/23 goes via tun0
so when you try to ping 10.10.10.147 which is on 10.10.10.0/24, it has to go via 10.10.14.1, but to get to 10.10.14.1 it has to go via dev tun0
so a packet is sent out of dev tun0 addressed to 10.10.14.1, containing instructions to go onto 10.10.10.174 as per routing table
does that mean there are two LANs sitting on a router? I am just trying to visualize it.
"Intel Wireless 3160 (Dual Band Wireless AC 3160)"
wifi (iwlwifi), 34:E6:AD:C4:C1:33, hw, mtu 1500
ip4 default
inet4 192.168.1.22/24
route4 0.0.0.0/0
route4 169.254.0.0/16
route4 192.168.1.0/24```
I have this for my WLAN can I have a device at 169.254.1.11 and try to ping it from 192.168.1.22? or do I need another router for this? How does it work?
We don't have enough information to know that. The router at 10.10.14.1 could be directly connected to 10.10.10.0/24, or it could have to go through another router to get there
is that your computers route table?
also I don't really understand it in that format 
is that your computers route table?
@thorn stratus yes
you could try to traceroute to 10.10.10.174 to see how you reach it
Can someone pls help me
I have the server code written but when I run the client and server
When I run it in two different terminals it gives me an error because my port number is 65000
But when I try with a different port number it doesn’t work
Can someone help me out
!paste @hazy zinc
Pasting large amounts of code
If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pydis.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
@ember ledge
Here it is
Pls could you help me
With 65000 it works
But when I try it with a different port number it doesn’t work
How do I write this code without the WITH statement
PLEASE HELP
!!!!
I have the project due in two hours
what port number exactly
and what do you mean "doesn't work"
what error are you getting
@hazy zinc
we can't help you without seeing what code you're trying to run
I'm not sure what you mean with is wrong, it's the most correct way to handle a bound socket like that
the alternative is manually closing the socket afterwards but that is prone to not running properly (have to catch all exceptions etc)
the code you sent before works fine for me
please don't send pictures
nobody wants to read that
!codeblocks
Discord has support for Markdown, which allows you to post code with full syntax highlighting. Please use these whenever you paste code, as this helps improve the legibility and makes it easier for us to help you.
To do this, use the following method:
```python
print('Hello world!')
```
Note:
• These are backticks, not quotes. Backticks can usually be found on the tilde key.
• You can also use py as the language instead of python
• The language must be on the first line next to the backticks with no space between them
This will result in the following:
print('Hello world!')
Ok when I run the code and choose my port number as 5000
There is an error
How do I fix that
what error
@ember ledge
we literally cannot help you if we don't know what error you're getting
it works fine for me with port 5000
How did you do that
do what
it's just a listening socket
you can connect to it using anything you want
I used nc
what exactly doesn't work
I'm asking you the fourth time: please send the exact error you're getting
If I choose my port number as 5000 it doesn’t connect to the server
Connection refused error
and you changed the listening port in the server?
?
I was given the client code
you need to connect to the port your server is listening on
We were suppose to make a server code
the client can connect to anything
I did
if your server listens on port 65000, you need to connect to 65000
if 5000, then 5000
If my professor tests it my code will only work if it listens to 65000
it has to be specific
use python3
no you didn't
also you're not parsing the argument 5000 in any way
look at the client code example to see how to parse command line options like you're giving
I am sorry it is the first time I am doing networking in python
And I am coding the first time
So I am still learning
Sorry to be annoying
But how do I parse the command
the client code has a direct example, using the argparse library
So do I just write args = parser.parse_args(argv[1:])
Are you telling me to write this statement
Where do you want me to change it
@ember ledge pls could you elaborate more and help me
Client code
Someone
Client and server both working
But the reverse string result file is not printing
Could someone help
Discord has support for Markdown, which allows you to post code with full syntax highlighting. Please use these whenever you paste code, as this helps improve the legibility and makes it easier for us to help you.
To do this, use the following method:
```python
print('Hello world!')
```
Note:
• These are backticks, not quotes. Backticks can usually be found on the tilde key.
• You can also use py as the language instead of python
• The language must be on the first line next to the backticks with no space between them
This will result in the following:
print('Hello world!')
I have a bug with socket in Python:
client.py
# Imports
import socket
# Variables
ip_address = '10.0.0.195'
ip_port = 10000
txt = 'utf-8'
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
msg = s.recv(1024)
# Code
"""Connect to the server"""
s.connect((ip_address, ip_port))
while True:
var = msg.decode(txt)
print(var)
if var == "quit":
break
# Imports
import socket
# Variables
ip_address = '10.0.0.195'
ip_port = 10000
max_connections = 5
txt = 'utf-8'
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# Code
s.bind((socket.gethostname(), ip_port))
s.listen(max_connections)
while True:
clientsocket, address = s.accept()
print(f"{address} connected!")
clientsocket.send(bytes("quit", txt))
Bug: OSError: [Errno 57] Socket is not connected
Even if the server is running, this weird message comes up.
When replying to me, please @ mention me, thanks.
Firstly I would check if the target IP is actually 10.0.0.195 @gilded delta
And that if it is, both computers are on the same local network
Good Morning. how do I wrap a code snippet for display in Discord? I am having problems with a traderoute program just returning starts (windows 10/python v3.x)
Good Morning. how do I wrap a code snippet for display in Discord? I am having problems with a traderoute program just returning starts (windows 10/python v3.x)
@cinder trellis
!codeblock
Discord has support for Markdown, which allows you to post code with full syntax highlighting. Please use these whenever you paste code, as this helps improve the legibility and makes it easier for us to help you.
To do this, use the following method:
```python
print('Hello world!')
```
Note:
• These are backticks, not quotes. Backticks can usually be found on the tilde key.
• You can also use py as the language instead of python
• The language must be on the first line next to the backticks with no space between them
This will result in the following:
print('Hello world!')
Pasting large amounts of code
If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pydis.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
Top-notch network security
https://i.redd.it/nb0cd5rewgu21.jpg
so I am trying to run and capture traceroute for domains in a text file. I am using the os.popen method and it seems a bit slow. any thoughts on improvements?
'''python
'''python
import os
input_file = "domains.txt"
results_file = "results.txt"
msg = "TraceRoute V6.0"
print(msg)
f_out = open(results_file, "w")
print("Trace Route...")
get handle to file open for reading
f_In = open(input_file, "r")
get the number of items in the file
dom_count = sum(1 for line in f_In)
print(f"Number of Domains to process: {dom_count}")
reset to start of file
f_In.seek(0)
loop through the list of domains
for domain in f_In:
print(f"Tracing: {domain}")
trace_results = os.popen(f"tracert {domain}").read()
print(f"Response is {trace_results}")
f_In.close
f_out.close
print("Done.")
'''
@gilded delta you recv before you connect lol
@cinder trellis traceroutes in general are quite slow, but you can run them all at once
make each process all at once, then get their results all at once
if you have a lot might be best to make them like 5 at a time
Are you on windows?
Pretty sure you need to specify a gateway
your just trying to connect to one computer?
destination^ ^mask ^gateway metric^ ^
Interface^
your destination and gateway will be the same, and your mask will be 255.255.255.255 to specify that its just a single ip
I think you can omit the metric and be fine
yep
the error tells you whats wrong
the command requires elevation
you need to do it in a command prompt running as administrator
np
mm no
a different answer on that server fault link you posted said the original command you posted would work but gives me an invalid mask error on my computer
worth a try I guess
are you sure your using the correct interface
which you found out with route print?
yup
Are you sure the computer on the other end responds to pings?
can you show me the full output of route print
I think you might need to put the gateway as 0.0.0.0 not the destination
hi everyone
has anyone worked with SMTP in python before
I need to code a tool which verifies existence of a given email address
has anyone done something similar before with python. I looked on github but was not able to find a working program (maybe I did not install them well? 😦 )
here is an example project I found. I wasn't able to get it running.
Official Library Python Library for verifier.meetchopra.com - email-verifier/verifier-py
Well many mail servers will prevent you from doing this so you can't enumerate users
The VRFY command is for exactly this thougj
NatyCat, few SMTP servers allow VRFY
there is no way to test except send email with link to verify
That's what I said
But some mail servers will also not tell you an email address doesn't exist
Hey so I asked this in python help channel and nobody said anything, so figured this would be the more appropriate place for it.
So I'm doing this project that pulls a bunch of data from this site with BeautifulSoup, but the data is sort of nested into other pages on the site, and then those pages nested even further than that, and basically I did the math and estimate that I would have to pull from over 3,000 different pages on the site to get all the data I need. If I webscrape the html from that many pages in one code, would that be like DDOSing the site? I certainly don't want to spam the site with thousands of html download requests all in rapid succession and do anything malicious, but I'm not sure if that would actually do that.
I'm going to bed but @ me if you have any advice or info
Thats not realllllllyyyyyy topical for this channel, but yes that would probably look like a ddos if you tried doing them all at once @marsh trellis
we also cant help you with that if it's against the site's ToS so you might also want to check that 🙂
!rule 5
5. Do not provide or request help on projects that may break laws, breach terms of services, be considered malicious/inappropriate or be for graded coursework/exams.
make sure you're not violating the usage policy of the website
Alright, thanks. Maybe putting a pause in between each html pull would help. Also the website itself is older and doesn't have a ToS. And I was only asking because of what I DONT want to do, all I want to do is pull report data from site, but I dont want to bother them either.
Also where would a question like this be appropriate then?
If not in the networking channel
anyone familiar with iperf for generating traffic?
no screenshare?
?
hi, I want to run a simple socket server from my PC but i can understand why it wont work...
import socket
def server():
host = "192.168.1.158"
port = 5000 # Make sure it's within the > 1024 $$ <65535 range
s = socket.socket()
s.bind((host, port))
s.listen(1)
client_socket, adress = s.accept()
print("Connection from: " + str(adress))
while True:
data = client_socket.recv(1024).decode('utf-8')
if not data:
break
print('From online user: ' + data)
data = data.upper()
client_socket.send(data.encode('utf-8'))
client_socket.close()
if __name__ == '__main__':
server()
heres my server code
import socket
def client():
host = "<public ip>"
port = 5000 # Make sure it's within the > 1024 $$ <65535 range
s = socket.socket()
s.connect((host, port))
message = input('-> ')
while message != 'q':
s.send(message.encode('utf-8'))
data = s.recv(1024).decode('utf-8')
print('Received from server: ' + data)
message = input('==> ')
s.close()
if __name__ == '__main__':
client()
heres my client code
and ive enabled port forwarding
but for some reason i cant make it work
your host might have to not be the public IP
have you tried "0.0.0.0" or "192.168.1.158" for the host instead
oh sorry my bad
I read the host and client the wrong way round
does this work locally?
it works locally when the client also uses the internal ip
i havent yet no,
worth doing it, make sure incoming TCP from internet on port 5000 is allowed
i suspended the firewall and it still doesnt work unfortunately with ethier a local machine using the public ip or a remote amchine using it
wait, no my bad
it just took a while longer though,
thanks!
cool!
not really sure if this is a networking thing, but if anyone knows of a bot like framework (e.g. discord.py) for mobile providers like twilio/nexmo etc, pls tell me
wdym bot-like
Guys i have one question
How mobile dats functionate and is there a way to make my own service for mobile data
For personal usage
What does mySQL and networking have to do together? I am trying to get the basic of networking down.
not a lot other than MySQL servers being connected to over a network
I guess the most interesting things happen because you usually want this network to not be publicly accessible, so there's various interesting network-related things you can do with VPCs and VPNs
and other network-based access rules
@rotund swift what kinds of events?
@thorn stratus i'll write my own and show you
How do I open up an SSH server on Android java?
I’m tryna write a packet sniffer with scapy and every time I run the program I just get the error message “scapy.error.Scapy_Exception: Failed to attach filter: tcpdump returned: tcpdump: can’t parse filter expression: syntax error”
Does anyone know what is wrong
Scapy is up to date
Can you post some of your code
#!/usr/bin/env/python
import scapy.all as scapy
# from scapy.layers import http
def sniff(interface):
scapy.sniff(iface=interface, store=False, prn=process_sniffed_packet, filter= 'http')
def process_sniffed_packet(packet):
if packet.haslayer(http.HTTPRequest):
print(packet)
sniff('wlan0')
this is basically my entire code
and if i run it with python3 i get this
scapy.error.Scapy_Exception: Failed to attach filter: tcpdump returned: b"tcpdump: can't parse filter expression: syntax error\n"
File "packet_sniffer.py", line 12, in <module>
sniff('wlan0')
File "packet_sniffer.py", line 6, in sniff
scapy.sniff(iface=interface, store=False, prn=process_sniffed_packet, filter= 'http')
File "/usr/local/lib/python3.8/dist-packages/scapy/sendrecv.py", line 972, in sniff
sniffer._run(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/scapy/sendrecv.py", line 841, in _run
sniff_sockets[L2socket(type=ETH_P_ALL, iface=iface,
File "/usr/local/lib/python3.8/dist-packages/scapy/arch/linux.py", line 475, in __init__
attach_filter(self.ins, filter, iface)
File "/usr/local/lib/python3.8/dist-packages/scapy/arch/linux.py", line 160, in attach_filter
bp = compile_filter(bpf_filter, iface)
File "/usr/local/lib/python3.8/dist-packages/scapy/arch/common.py", line 182, in compile_filter
raise Scapy_Exception(
scapy.error.Scapy_Exception: Failed to attach filter: tcpdump returned: b"tcpdump: can't parse filter expression: syntax error\n"```
lol yeah
and the source in the git repos doesn't line up with your tracebacks
does tcpdump -i wlan0 http work properly
tcpdump: can't parse filter expression: syntax error
i get this
looks similar to the error message on scapy
i tried making sure tcpdump was installed and i made surte it was and it still says the same thing
I think tcpdump might only know about protocols layer 4 and below
use "tcp port 80"
port 443 if you want https traffic
Hi, does anyone here have any experience with kubernetes networking? Im trying to better understand name-based routing since some of my traffic seems to be getting lost.
Hiho, is there a lib that can support having a consistent URL pattern? Like, always "http://www/" when I put urls into it's function?
hey can anybody help for making a listner for a backdoor over LAN in python
I though made a client but I was having trouble making a listner(server)
IT'll be greatfull of you if you post the code for one
!rule 5
5. Do not provide or request help on projects that may break laws, breach terms of services, be considered malicious/inappropriate or be for graded coursework/exams.
we can't know your intended use for it so we can't help, sorry.
!rule 5
@snow tulip bro OK let me know the one for LAN??
same shit.
same shit.
@snow tulip there is whole lot of difference bro
there very much isn't.
same shit.
@snow tulip when you don't know then don't say
nothing to offend upon
no, i'm informing you about the rules of the server
there very much isn't.
@snow tulip for a WAN we have to forward a port and that is not waht I'm asking
this isn't my first rodeo fella, we don't help with this stuff
no, i'm informing you about the rules of the server
@snow tulip so I'm not harming or doing malicious work with a LAN listner
we cannot know your intentions
there are plenty of resources out there with information on this
we cannot know your intentions
@snow tulip agai??
nothing with LAN server🤦♂️🤷♂️
LAN or WAN doesn't matter. a backdoor is still a potentially malicious / illegal tool
there are plenty of resources out there with information on this
@snow tulip I'm not getting any everyone is saying to use net cat or metasploit
LAN or WAN doesn't matter. a backdoor is still a potentially malicious / illegal tool
@snow tulip I'm asking for a listner
ok leave it thanks
whats wrong with those options
@thorn stratus asking me??
yes
nothing the difference is that LAN is on a local network
and WAN is over internet
What
umm like LAN is like someone who is connected to your wifi and so he/she is considered as connected in LAN network
and in WAN anyone who is connected to internet is considered as over WAN connected
What does that have to do with netcat or metasploit
net cat was different I was asking for a python listner
and I searched web so they suggested to use netcat listner or a metasploit listner for that
but I wanted a python listner
so I was asking here
