#networks
1 messages ยท Page 10 of 1
IP and TCP exist for different purposes.
IP provides the ability to send data across networks in general
and TCP provides some structure to data. The TCP data has to go inside the IP data to work.
Packets are dealt with at layer 3 and segments are dealt with at layer 4. That is the difference.
It might help to understand packets fully, then move on to segments once you understand IP a bit better. IP is much simpler than TCP.
http://www.tcpipguide.com/free/t_NetworkLayerLayer3.htm
So it's like two different packets for a type of data or just on different levels??
Thanks for help @hasty quest
different levels
Packets are a layer 3 structure
Segments are a layer 4 structure.
๐ฏ๐๐ป
does anyone know how to use vs code's port forward feature with python socket
im having issues with that
I am sorry no one answered you
I don't know the answer to that question
Please try ChatGpt ๐
we kind of solved it in a help post instead, it turns out that the port forwarding feature in vscode appears to only allow http/https much like the free Cloudflare Tunnel service and that they are quite similar, but this one is more for development and built in to vscode
import requests
session = requests.Session()
headers = {
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Basic eHl6YTc4OTF6clRYTllNbhbbbbbbbbbbbbh"
}
data = {
"scope":"basic_profile:friends_list:presence",
"grant_type": "client_credentials",
"password": "vgutgvu@123",
"username": "fyccccc"
}
response = session.post("https://account-public-service-prod.ol.epicgames.com/account/api/oauth/token", headers=headers, data=data)
print(response.text)
headers = {
"Authorization": "bearer "+response.json()["access_token"]
}
uer = session.get(" https://account-public-service-prod.ol.epicgames.com/account/api/public/account/displayName/vghhgv",headers=headers)
print(uer.text)
error:
{"errorCode":"errors.com.epicgames.common.missing_permission","errorMessage":"Sorry your login does not posses the permissions 'account:public:account READ' needed to perform the requested operation","messageVars":["account:public:account","READ"],"numericErrorCode":1023,"originatingService":"com.epicgames.account.public","intent":"prod"}
I have this thing, where one client can send any number of packets and I forward them to a known set of clients after modifying them. The client can also send a quit packet and in that case the client has decided to leave.
Now, If I selectors.select on a socket that has EVENT_READ and I try to read it after doing a .setblocking(False) I read nothing since it always raises a BlockingIOError. And say I block on the first read_packet (because obviously something has to be there) I still am unable to read anything (blocks indefinitely). I am wondering if I've got the wrong idea about setblocking
I've spent the better part of today debugging this, and now the exact moment when I decided to ask for help I put a sleep(0.5) before doing a read operation and it has decided to work again?
I'm not sure if there's some troll in my computer,
How does a sleep(0.5) make any sense?
i don't know what you are doing as i have only skimmed your code quickly
i've done non-blocking network io with select/selectors (at different times), but then i just make the sockets non-blocking at creation and then leave them like that for the rest of their lifetime
or with threading i just create a new thread per connection that needs reading and i do the reading blocking, sure you could probably do a thread pool and combine it with non-blocking io but i never needed too
why back i've even done multi-processing for client connections instead of threads, but i can't recommend that in general
nowadays i most often use asyncio instead and call a coroutine per connection that needs reading
I'll give asyncio a try. For this problem my guess is that a blocking socket.sendall is a lie and it doesn't actually block until it sends all the bytes out and internally does some shenanigans, need to check.
Spinning a thread to do blocking reads and having some shared list of read and written packets seemed a bit heavy weight and perhaps more complicated than it needs to be.
to get a bit more technical, the OS has an independent trasmit buffer and receive buffer per connection and as long as the transmit buffer is not full send() will return almost instantly
the transmit buffer can fill up if the other side isn't acknowledging the packets that our system sent or if the other systems kernel starts sending us zero window packets telling us to hold sending any more data for the time being
this can happen if there is a communication problem between the two systems respectively it the receive buffer on the other system gets full due to the application on the other side isn't reading the data fast or often enough from that systems receive buffer (or at all if it has become stuck on some other task)
but it is far more likely that a blocking recv() call would get your application hanging when there is no further data to read
Interesting, thank you for your insights!
how can i make 2 PC connect each other on different networks with server and client
i tried with UDP and TCP
it doesnt works
but the problem is that if u r trying to connect from a different network u have to configure the router to allow connections for a perticular port
if the computer is not directly exposed to the internet
@undone timber issue is im trying to open server from my VDS
my VDS says UDP is Activated
thats why i tried with UDP
hey anyone knows zeroconf well ? dm me pls
Im not really sure how to do or where to send this so Im just gonna send this in multiple channels, but redirect me to the correct one if im wrong, I wanna make a micro controller / ardiuno where you plug it into a router and it automatically spits out all the people on the network into a file, how would I do this? and what materials / tech should I use
wdym by spitting out all people on a network
you mean an ARP?
like device names
I don't know about Arduino but you could run a normal packet capture on a pi and then extract a list of hostnames from that. https://pimylifeup.com/raspberry-pi-wireshark/
someone go into #game-development plz we need you rn
question
why does this happen?
when I do 0.0/24 not every device pops up
but when I do 0.1/24 every one does
oye
Having a lot of trouble here: #1214679370447327322
would appreciate a lot some help :7
are you planning on hosting it or just LAN?
if it's just for lan you don't need nginx as long as it is in the same network
Hey, I know it is not directly related to Python, but I have a problem with connection on my Hetzner VPS server. It is a Fedora 39 with just a few packages downloaded. I wanted to deploy the simplest to-do list but when I wanted to clone repo I encountered this error - git clone https://github.com/Zimzozaur/TDD_Django.git
I received the following error message:
Cloning into 'TDD_Django'...
fatal: unable to access 'https://github.com/Zimzozaur/TDD_Django.git/': Failed to connect to github.com port 443 after 133525 ms: Couldn't connect to server
Also Ping does not work
What can cause this problem?
Is the problem specific to GitHub or are you lacking network connectivity in general? Is DNS correct?
Your firewall rules are ipv6 only, you probably need ipv4
Hellow i have network like this
DHCP server(mikrotik)->DHCP server(ubuntu)->mikrotik ->client
I want my clients get ip from dhcp client from ubuntu but while i test i sometime clients get ip from dhcp server in mikrotik
Now how to block dhcp request to DHCP server in mikrotik using Ubuntu
If the Ubuntu server is the gateway for the relevant clients, you can set a static route to block all communication, or a firewall rule to just block DHCP
can anyone please explain to me how to count the number of networks in a topology?
ping please
You mean the number of nodes in a network? Either way it's not clear what you're asking for exactly.
no, i mean the number of, i think theyโre also called subnets. it has something to do with removing the routers and then somehow counting, but i donโt know exactly how to do it
yeah
how to set static router for that? Like i make interface that connected to mikrotik which have DHCP server to static?
Not sure I follow the question and I'm not actually familiar with mikrotik, but when I said static routes I meant something like this: https://www.cyberciti.biz/faq/ubuntu-linux-add-static-routing/
n = 0
while True:
b = []
n_s += 1
n= n_s
print(n)
while n != 1:
if n % 2 == 0:
n = n / 2
else:
n = n * 3 + 1
if n in b:
print(str(n)+'!!!!!!!!!!!')
else:
b.upeend(n)
.
hello
Hello there,
I am looking for some tips and tricks regarding the management of states in the socketserver.StreamRequestHandler class in python.
I trying to couple the handle method from the RequestHandler together with the design-pattern for statemachines.
I am looking at https://refactoring.guru/design-patterns/state for inspiration on how to organize it.
What are the best practices ?
class RequestHandler(socketserver.StreamRequestHandler):
def __init__(self, Elf, *args, **kwargs):
self.Elf = Elf
super().__init__(*args, **kwargs)
def handle(self):
# Receive the message type
data_bytes = self.request.recv(1024)
# Decode bytes to a string and convert it to a dictionary
payload = json.loads(data_bytes.decode('utf-8'))
# Access msg_type from the dictionary
msg_type = payload['type']
if msg_type == MSG_TYPE.SANTA._value_:
self.handle_santa_msg(payload)
elif msg_type == MSG_TYPE.FEELER._value_:
self.handle_feeler_msg(payload)
elif msg_type == MSG_TYPE.ACKNOWLEDGEMENT._value_:
self.handle_acknowledgement_msg(payload)
elif msg_type == MSG_TYPE.READY_REQUEST._value_:
self.handle_ready_request_msg(payload)
elif msg_type == MSG_TYPE.READY_RESPONSE._value_:
self.handle_ready_response_msg(payload)
elif msg_type == MSG_TYPE.REJECT._value_:
self.handle_reject_msg(payload)
elif msg_type == MSG_TYPE.START_OVER._value_:
self.handle_start_over_msg()
what kind of protocol do traffic signals use
the common answer i usually get is NTCIP
just wanted to know if thats what they use in industry solutions
What are "industry solutions"? If you mean commercially available equipment, then yes, NTCIP seems to be the standard. But I'm not a traffic engineer
Instead of a massive if-else chain, you could employ a dictionary with keys of MSG_TYPE and values of the respective functions.
That way you'd only need to perform a single lookup and call the result
yes try to use sockets in pyhton that you can connect 2 pc using bind() and listen() function........
yeah
can u elobarate
1 method can be is to use sockets and its built in functons to bind a socket(of server) to a port and connect the socket of the other computer to that socket(of server).
But for this u would need to configure ur router to let in tcp connections at your desired ports in the server side
UDP would not work here as routers block udp
TCP is the best option
Could someone help me understand the inner workings of a 3 layered neural network during back propogation if we used cost function MAE and a sigmoid activation ( 1/(1+e^-x))? ๐
like how to calculate the gradient
๐
But this is a channel for computer networks, not neural network.
You should go to #data-science-and-ml
about http API, and upload of files: I've come accros multipart POST of files, but I was wondering: if I chose to put the file content into a simple post request, what would be the size limit of that file ?
I googled it for you, the answer is what I would have guessed, no enforced limit just the practical ones: https://serverfault.com/questions/151090/is-there-a-maximum-size-for-content-of-an-http-post
oh mb, ty ๐
Hello I'm trying to get a lets encrypt ssl cert for a domain I got from linode to use with a python websocket server but keep getting this error:
root@localhost:~# sudo certbot certonly --standalone
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Please enter the domain name(s) you would like on your certificate (comma and/or
space separated) (Enter 'c' to cancel): websockettictactoe.co.uk
Requesting a certificate for websockettictactoe.co.uk
Certbot failed to authenticate some domains (authenticator: standalone). The Certificate Authority reported these problems:
Domain: websockettictactoe.co.uk
Type: dns
Detail: DNS problem: NXDOMAIN looking up A for websockettictactoe.co.uk - check that a DNS record exists for this domain; DNS problem: NXDOMAIN looking up AAAA for websockettictactoe.co.uk - check that a DNS record exists for this domain
Hint: The Certificate Authority failed to download the challenge files from the temporary standalone webserver started by Certbot on port 80. Ensure that the listed domains point to this machine and that it can accept inbound connections from the internet.
Some challenges have failed.
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.
Anyone know what I might be doing wrong? I did previously have a cert for this same domain working but lost that domain and created a new one recently with a different provider
can anyone help me print the latest email from a specific sender in imap ?
I googled it for you... I assume this is what you're asking? https://stackoverflow.com/questions/5632713/getting-n-most-recent-emails-using-imap-and-python
Does somebody have a good packet model with dynamic key and values?
My packet model is.
[
MAGIC,
Size Of Data,
Size Of Dictionary,
Dictionary (Contains null terminated keys and offsets to data after MAGIC_2),
MAGIC_2,
Data
]
there's a library for this
scapy
any good tutorials for creating a network scanner in python?
Hey guys, im making a client/server application, and rn im doing a ping function. The problem is that the client sends 'p0;', 'p' to indicate that it is for the ping, '0' so that there is at least some data, and ';' so that i can separate stacked data. The server receives it, but when its supposed to send it back so that the client can compare time, the client recieves 'c007;'. Any idea on what to do, to check ?
Just wait, i might have one somewhere
Nevermind, it can only scan an ip to get the opened ports
not really sure what you are asking.
Idk, the issue seems weird, some compression/encoding problem, because nowhere in my code i have written 'c007', so im not sure what to do
does anyone know how to install pcapy module? pip install pcapy is not working
Is there an error message?
Yes, I put a post and someone told that pcapy is discontinued since 2018
best code i've ever used : import turtle
And suggested pypcapkit
Depending on your use case, pyshark may do what you need, and it's still maintained.
Sure, I'll try it
Anyone got any experience with the Raft algo implementation PySyncObj library?
I am trying to remove the leader node from the cluster But it keeps giving me โFAIL_REASON: request deniedโ
It does require you to be very familiar with a native library like openssl and know exactly which methods to hook to so that you can interfere the handshake process. That's not a very common piece of knowledge (no doubt it was closed so many times). My advice is to hire someone experienced consultant.
Hey Guys, does anyone know how to fix this code? I am trying to do a broadcasting sort of thing for a school year 11 science experiment.
Fix what? Is there an error?
i'm guessing they're referring to all the linter squigglies
Yep
Hover on them to see what they're about. Or look for the error list at the bottom of the page
@cloud spruce sorry for a long hiatus, unfortunately my HDD died ๐ any idea if you still have any bits or pieces of the code saved?
I'm currently going through all my old messages here
i've not been very active for quite some time and not at all for a long time there in between
i have some code since june and july of 2022, but nothing since then
Ah, by chance did any of the code contain packet editing for a game using structs? Like printing a location and stuff like that
hello
so i went to this place this moring and i wanted to know its IP adress how can i do it?
if i have its mail adress is there anyways i can find its IP adress?
not sure exactly what this question means
which IP address are you trying to find, their mailserver? and why?
just like a house ip adress
and all i have it there location
good question
needs a good answer
so does it exist?
well you haven't given a use case that isn't malicious
expermentel use
If that were possible it would be a major problem for security
It isn't. It doesn't work like u could find anybody's IP address and hack into their PCs
i was bulding clint and server basic
i am getting this error on client side
File "/home/anonymous/Documents/Items/codes/Python/client.py", line 9, in <module>
socket.bind((host , port ))#send req to server
^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 98] Address already in use
it says address alredy in use even when i change my server "host" ip still it say address allredy in use dose it mean that port is busy or smth
educational purposes i guess lol
The client shouldn't call the bind method
Just the server
oh
There's a connect method clients should use
For future records, make sure you close the sockets appropriately so you won't get an error saying the same just because little time passed and the system just waits idly by while some internal timer resets
.connect should be used by client?
oh
can i close it through terminal .. is there any cmd
Wdym
to close the socket
socket.close()```
Mark the socket closed. The underlying system resource (e.g. a file descriptor) is also closed when all file objects from [`makefile()`](https://docs.python.org/3/library/socket.html#socket.socket.makefile) are closed. Once that happens, all future operations on the socket object will fail. The remote end will receive no more data (after queued data is flushed).
Sockets are automatically closed when they are garbage-collected, but it is recommended to [`close()`](https://docs.python.org/3/library/socket.html#socket.close) them explicitly, or to use a [`with`](https://docs.python.org/3/reference/compound_stmts.html#with) statement around them.
Changed in version 3.6: [`OSError`](https://docs.python.org/3/library/exceptions.html#OSError) is now raised if an error occurs when the underlying `close()` call is made.
yeha
ok im gonnga read and try it
Or better yet, use the socket in a with statement so it does it for you and takes care of abrupt shutdowns
Like with files
!d socket.socket.connect
socket.connect(address)```
Connect to a remote socket at *address*. (The format of *address* depends on the address family โ see above.)
If the connection is interrupted by a signal, the method waits until the connection completes, or raise a [`TimeoutError`](https://docs.python.org/3/library/exceptions.html#TimeoutError) on timeout, if the signal handler doesnโt raise an exception and the socket is blocking or has a timeout. For non-blocking sockets, the method raises an [`InterruptedError`](https://docs.python.org/3/library/exceptions.html#InterruptedError) exception if the connection is interrupted by a signal (or the exception raised by the signal handler).
Raises an [auditing event](https://docs.python.org/3/library/sys.html#auditing) `socket.connect` with arguments `self`, `address`.
There's a nice simple walkthrough in the docs
yeha i see
I think it's called sockets HOWTO
oh
import nmap
scanner = nmap.PortScanner()```
gives the error
import nmap
File "/home/anonymous/Documents/Items/codes/Python/Netmaps/nmap.py", line 5, in <module>
scanner = nmap.PortScanner()
^^^^^^^^^^^^^^^^
AttributeError: partially initialized module 'nmap' has no attribute 'PortScanner' (most likely due to a circular import)
โโ[โ]โ[root@parro```
even i did installed python-nmap through pip3 install python-nmap
yeha it is
i cahnged it to something else still not working
bind is used to set which IP address(es) the socket should use
The socket on the client only needs to receive reply traffic from the other end of the connection, so this isn't required.
The server on the other hand needs to deal with requests to establish new connections, so the ways in which the socket should be reachable can't just be inferred.
e.g. if you bind to 127.0.0.1 then it will not accept incoming connections over the LAN, only local connections.
If you bind to 192.168.1.1 then it will accept LAN connections but not local ones (assuming that is a valid IP for the server on the LAN)
Oh understood
Oh
Thaks you so much I understood ๐
hi
Try:
from nmap import PortScanner
scanner = nmap.PortScanner()
if you instead bind to 0.0.0.0 it will work for any ip and interface on your computer (i.e. both localhost and lan), just be aware that if any other process binds to specific ip address on the same port, they will get all those connections instead
Reminder: IPv4 only.
true
::1 is for IPv6 iirc
yo can i leak the persons ip adress who tried to hack my acc???
not in compliance with the policies of discord or this server, no
i think it will also let local connections too
i was testing a few things with flask on my vps and i suddenly see this
what is this?
btw the flask app is running on 0.0.0.0 and i havent shared the flask link with anyone except on my own private discord guild with no members except me
or should i ask this on the cybersec channel? idk if this is related to that tho
btw the ip is from russia but i dont remember any umm web crawlers being there
what ip?
it's likely just a scraper
you don't have to share links for things to be public/reachable, as soon as your web app is open to the internet it really is that
your VPS will likely be getting hundreds of attempts at SSH/HTTP per day from random IPs from all around the globe and from all sorts of providers
ssh too? by whom?
by scanners, trying to break into your server
generally they are other compromised servers or specifically set up servers
as long as you configure SSH and your firewalls correctly, you are fine, but never assume anything that you have an open port to is "private"
The only 2 ports i have open are 22 and 8080
One for ssh and one for apps like flask whenever im testing
Also thanks for the reply good sir
yep that's fine -- just make sure they are secure, set a good password (not "password"), and you're fine, but don't be too surprised if random IPs stumble across your IP
anyone have a sec to help me understand a bug I'm running into with getting certificates with sockets?
Why not just ask your actual question? #โ๏ฝhow-to-get-help
Oh is this not a help section?
it is, I think dowcet just meant that if you describe your problem it's more likely that someone who knows things will be able to see it and answer ๐, if people don't know the specifics they are unable to think they can help
Ah yeah, good point. I guess saying "getting certificates with sockets" is pretty vague.
Right... But f you show a link to your code and explain what the problem is, then someone will respond if they have an idea
bro I'm agreeing with what you initially said ๐
I have a client and server application (socket) that periodically send each other the status of the application they're running in. Now I want to synchronously execute some procedure between them with a series of synchronous send/recv calls. My problem is, when I send the send(PROCEDURE_INIT) the following recv() might not be the response I expect, and instead be one of the periodic status updates the client hapened to send at that time.
What is a good way to sync the two back up so I can run some procedure in lockstep again? Any tips or resources? (no 3rd party libraries)
im no expert, but you might want to design your protocol in a way that lets you process the stream into a sequence of events, regardless of the order they come in
https://sans-io.readthedocs.io/how-to-sans-io.html
writing a sans-IO implementation can make it easier to manage this, for example you might have a Client with a receive_bytes() method, where you pass the data you receive from the server and it returns a list of events that were able to be parsed (buffering any incomplete data)
afterwards you can have a receiver thread/task feed it data and handle the resulting events, such as waking up another task when a particular procedure has been acknowledged by the server
XD i can share but headphones does not work
i like your pfp :)
Anyone know how to use SQLite with JavaScript in a browser?
I googled it for you: https://stackoverflow.com/questions/13192643/is-it-possible-to-access-an-sqlite-database-from-javascript
but how do I add it to my project?
Why not direct that question to the good people in #databases
I'm sure they'll know more over there :)
Hi i am here to looking for advice on a project where I want to build a http server from scratch on python is there any good guide or book or any kind of advice will help
Thank you
There are a few quick tutorials on the web like https://www.codementor.io/@joaojonesventura/building-a-basic-http-server-from-scratch-in-python-1cedkg0842
In this we are using socket but I want to learn the http protocol how can i build it from scratch with out any library like socket or http.server . Is it possible or do I have to other library ?
I would guess it's possible if you really want to, but no idea if anyone has spelled it out in detail
What's recommended for game-making? Currently trying python sockets but i'm struggling to send objects from one client to another and to the server...
There isn't really a canonical solution for this in python, I would recommend JSON over websockets, that is kind of good enough for simple games.
i'm trying to make a online card game which can have either 1v1 or 2v2 options, but i need to be constantly sending objects from one client to another
do you reckon JSON is just better for this than sockets?
I think socketio will do the work
I have no experience in networking so this is my starting project
If your new in coding start with a simple project after understanding basic foundation then go for networking it's very hard when it's come to games
i'm not new in coding, just network
in that case, I would probably suggest learning sockets on more generic projects then using that knowledge for a game.
i've made games before but none multiplayer or online
Then i would recommend socketIO
They aren't too complicated, but there is sort of a baseline level of knowledge you need to actually be successful
Socketio is like a wrapping for socket it's much easier to use
yes, socketIO is a higher level networking thing, it should do fine for games.
socket is pain
(with tcp btw)
sometimes
it mixes up the order of the packest
sometimes
it smushes them together
sometimes it just doesnt wanna work
I know right and you have to write it multi thread manually when io is built in
i think this is the correct channel to ask
sorry its wrong
can a old laptop run python
i have a ryzen 2500u laptop
about 9 years old
or should i upgrade
it can be sufficient depending on what you want to do, but #python-discussion would probably be a better place to ask
my bad brother ill take note
thank you
https://palworldtrainer.com/robots.txt does this mean i'm allowed to scrape data off this site?
oh okay, nevermind i found another site that's an API with the data i need
although, i'd still like to know 
you would be fine for this probably yes, if the robots.txt does not forbid it and the terms of service do not, then you should be fine, but if you are going to be heavily reliant on a service then it would not be a bad shout to reach out to them also
ah, they don't seem to list a terms of service
That's an interesting question from you, but from scratch isn't something feasible. You won't be able to implement your own TCP stack or HTTP stack easily as previous work took weeks to finish and years to stablize. IETF has RFC documents for HTTP 1.0/1.1/2/3 but they are for experienced audiences and also lack of certain details to guide you to implement your own. That's overall why people tend to use existing libraries.
Oh I see that's why I couldn't find any guide to it. I just wanted to learn how it works in the back for more understanding. But it is what it is so i start using socket to build some what similar to flask for api
How do I create a server script that responds to concurrent connections?
my script sends out different requests every minute
in the last about 2 weeks ive had this twice where i can't start a flask server giving me an error something like the port is taken
but it's not
then i can't send http requests, instead i get httpcore.ConnectError: [WinError 10055] An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full
i can google search and use discord and all that but i can't click a link and go to like reddit instead it gives me a network error
once i restart my pc it all goes away
im not 100% sure this is something with my python script but it seems like it
huh, and killing your program doesn't fix it?
no
first result when looking it up is this
port exhaustion
could explain why a few requests still work but probably less than 5%
the issue is that.. well, a well-behaved requests library shouldn't leave open ports at all unless killed in the middle of a request, but more importantly the OS should reclaim them after the process is dead, and it's very weird if that isn't the case. perhaps check for orphaned proceses: https://serverfault.com/a/273727
ill open an issue on httpx and see whats up
i wonder if i could recreate it
and since this is running for over a week it could be having a few fail here and there and it just builds up
sorry my problem might not so related to the network.
I try to get the picture from ebook-mirae-n.com,but even I use seleium, I still cant get web info.
Is anyone know how to get the picture from this web-site?
from selenium import webdriver
from selenium.webdriver.chrome.service import Service as ChromeService
from webdriver_manager.chrome import ChromeDriverManager
opt = webdriver.ChromeOptions()
driver = webdriver.Chrome(service=ChromeService(ChromeDriverManager().install()),options=opt)
url = "https://ebook.mirae-n.com/@kb2072/319"
driver.get(url)
driver.implicitly_wait(1)
page_source = driver.page_source
print(page_source)
driver.quit()
How do I write tests for scripts and error handling, please?
Thanks, I wanted to mention for server specific tests, and to get examplers on that
It's very possible, at least for HTTP! Start of reading some of the core RFC's, start basic (HTTP 1.0) and go from there, don't worry about adding all the features straight away. It'll take a while but it'll also improve your knowledge of the protocol
I have a server script and I want to protect it from attackers. How do I go about it while handling buffer overflows and other potential security issues, and implementing SSL authentication between theh server and the client, using either a self-signed certificate or PSK as the authentication method? Any directions to resources will be much appreciated
#cybersecurity might be more suited for this question, but i can point you towards the built-in ssl module which allows wrapping sockets with TLS encryption
https://docs.python.org/3/library/ssl.html
see ssl.create_default_context(cafile=) and SSLContext.load_cert_chain() for authorizing self-signed certs
How do I go about it while handling buffer overflows and other potential security issues
Use Rust /s
this is python i dont think buffer overflows exist
depending on how you are structing things you can get i guess "meta" buffer overflows
but it's more just index errors because user input caused you to go past the bounds of a list
CVE-2021-3177
python is interpreted, so all actual vulnerabilities lie in the runtime
too lazy :P
to... search the exact string with minimal research effort?
Python 3.x through 3.9.1 has a buffer overflow in PyCArg_repr in _ctypes/callproc.c, which may lead to remote code execution in certain Python applications that accept floating-point numbers as untrusted input, as demonstrated by a 1e300 argument to c_double.from_param. This occurs because sprintf is used unsafely.
Thanks
https://www.rfc-editor.org/rfc/rfc2616 (HTTP 1.1)
https://www.ietf.org/rfc/rfc9293.html (TCP)
https://www.rfc-editor.org/rfc/rfc8446 (TLS 1.3)
https://www.rfc-editor.org/rfc/rfc5246 (TLS 1.2)
good luck!
(you'll need it)
This document specifies the Transmission Control Protocol (TCP). TCP is an important transport-layer protocol in the Internet protocol stack, and it has continuously evolved over decades of use and growth of the Internet. Over this time, a number of changes have been made to TCP as it was specified in RFC 793, though these have only be...
Thank you so much โค
Sure ill try my best
poor soul
Can I dm you If i get stuck?
you can learn the http protocol and implement it using socket just fine and you'll still be low level enough for implementing that whole protocol layer yourself
if you don't want to use sockets you would need to use raw sockets and implement the tcp and ip stacks yourself, that will be a much bigger endeavor, (more on that below)
just start with https://datatracker.ietf.org/doc/html/rfc1945 for HTTP/1.0 as Evorage suggested earlier even if it's kind of an outdated protocol by now (or even first start with the unofficial predecessor later dubbed HTTP/0.9 at https://www.w3.org/Protocols/HTTP/AsImplemented with an example at https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Evolution_of_HTTP#http0.9_โ_the_one-line_protocol) so that you don't get sidetracked and end up in a much deeper rabbit hole, if you want to get anywhere anytime soon and not just be reading hundreds of pages of RFC documentation on the full Ethernet, IP and TCP stacks with helper protocols such as ICMP and ARP (and more, it will branch out fast)
I have already built a simple api service with socket like flask. And it can also handle template rendering. It was simple because i had already learn socket in basics leave
okay, so which http version did you go ahead and implemented?
and did you implement the full spec or just parts of it?
I used socket and i responses with 1.1 in the header. the only thing im familiar with is use socket listen in host:port and response with it
I don't think it's full slec
I listen if the path is in route response with that route functions or send a 404 page just that it can response with json data or a html page
No dynamic template system just a simple page
what i'm talking about is much more low level and closer to the protocol layer than content types and content or even path matching
i'm talking about the HTTP RFC specification, the protocol itself that you said that you wanted to learn more about
that would be: parsing the request line, correctly handling different request methods (and give the correct type of error if it's not one of the supported ones), parsing headers and handling the request correctly depending on the different headers and their meaning according to the specification and such
the HTTP/1.1 specs are really extensive, with things connection reuse for multiple requests (handling the Content-length header or the little bit more advanced chunked encoding), it's a pretty big jump up from HTTP/1.0 (even after adding the unofficial but widely supported Connection: keep-alive extension to handle multiple requests over the same connection)
I have dm you my git repo place can you review it
Available subnet: 192.168.4.0/24
Create 3 subnets with 2 hosts
I'm confused. How do you solve this?
Good day. One question Please. I am using python CAN (https://python-can.readthedocs.io/en/stable/index.html) for sending and receiving messages. I have been trying to send messages. What I am doing is using the library to send a message and write the characteristics of that message on a CSV doc. The code I have used is the following:
#!/usr/bin/env python
import time
import can
import os
import csv
import pdb
os.system('sudo ifconfig can0 down')
os.system('sudo ip link set can0 type can bitrate 125000')
os.system('sudo ifconfig can0 up')
def main():
with can.Bus(interface='socketcan', channel = 'can0',receive_own_messages=True) as bus:
#print_listener = can.Printer()
#pdb.set_trace()
print_listener = can.CSVWriter("in.csv")
can.Notifier(bus, [print_listener])
bus.send(can.Message(arbitration_id=1,data=[1], is_extended_id=False))
bus.send(can.Message(arbitration_id=2,data=[1], is_extended_id=False))
bus.send(can.Message(arbitration_id=3,data=[1], is_extended_id=False))
#message = bus.recv()
#print(message.arbitration_id)
time.sleep(1.0)
print_listener.stop()
bus.shutdown()
if __name__ == "__main__":
main()
The thing is that it writes what it should ib the CSV, but when seeing the signal in an oscilloscope, it send infinite messages. Any hint on how to just send the messages I want /(not infinite messages), would be appreciated.
Thanks a lot in advance
that is a strange description of an "assignment", maybe they mean to say "create 3 subnets with 2 hosts each"?
historically the smallest usable network would be a /30 link network with a network address, two device addresses and a broadcast address
but for many years there is a special case where you can use a /31 link network with only two device addresses and which discards the notion of a network address and broadcast address specific for that network
have you tried asking in #microcontrollers ?
i think a CAN bus can be more their domain as they are closer to that type of hardware and someone in there might have worked with them before
Thank you @cloud spruce , will do!
!paste is this servers own pastebin-like service that is preferred here
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
is there an issue with bpaste?
that is just the default for wgetpaste
i got it wokring anyways, i think it wanted shell mode
Starting address: 192.168.4.112
Ending address: 192.168.4.115
Subnet: 192.168.4.112/30
Is this correct?
Available subnet: 192.168.4.0/24
-
Subnet for 50 hosts
Subnet mask: 32 (original) + 6 = /28
Subnet size: 256 - 64 = 192
Starting address: 192.168.4.0
Ending address: 192.168.4.63
Subnet: 192.168.4.0/28 -
Subnet for 24 hosts
Subnet mask: 32 + 5 = /29
Subnet size: 256 - 32 = 224
Starting address: 192.168.4.64
Ending address: 192.168.4.95
Subnet: 192.168.4.64/29 <-- This is wrong right? The subnet mask should be /27? @cloud spruce
truly a rabbithole
i havent even gone anywhere near tcp/udp/http and im already stuck in the endless rabbithole
yes, subnet 192.168.4.112/30 will start at 192.168.4.112 (the network address) and end with 192.168.4.115 (the broadcast address) and have two usable addresses for hosts or devices in-between
Source code: Lib/socket.py
This module provides access to the BSD socket interface. It is available on all modern Unix systems, Windows, MacOS, and probably additional platforms.
Note
Some behavior may be platform dependent, since calls are made to the operating system socket APIs.
Availability: not Emscripten, not WASI.
This module does not work or is not available on WebAssembly platforms wasm32-emscripten and wasm32-wasi. See WebAssembly platforms for more information.
im running into more paramiko issues, it seems to be sending partial data
im using sendall, not sur why it's failing or how i can fix this
only 20 characters seem to be sent
weirdly it's also sending a \r\n?
i mean the system shouldn't even take it if it's missing \r\n, but it seems to pretend the whole line was sent and i can see it's setting partial data
like the username is cut in half
hey if i want to do a post request on a site with the requests lib and the request's payload has a captcha is there any way for me to get that captcha code?
5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.
yeah kinda sounds like it but idk how to explain it so it sounds right
nevermind i made a help post but apparently doing such things is against rule 5
:incoming_envelope: :ok_hand: applied timeout to @grave ingot until <t:1713542123:f> (10 minutes) (reason: newlines spam - sent 127 newlines).
The <@&831776746206265384> have been alerted for review.
!unmute 1180761894290718842
:incoming_envelope: :ok_hand: pardoned infraction timeout for @grave ingot.
!paste
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
use pastebin pls
It seems impossible to find a way to send video and audio stream from different network devices, I tried socket for same network for a start but I am not sure what to use to make it work
what are you trying to create
A web application for companies that do live streams, basically it will need to have access on current frame of the livestream and the audio for the last x seconds. Then frame and audio will need to be processed with some python and return a message based on the frame and audio, that message will then be written somewhere else with web automation tool (probably selenium python)
Since the web application have to be online 24/7 I need to have it on cloud and I found out about aws kinesis data stream
There are protocols for streaming (such as RTMP/WebRTC). You might use existing implementations other than rolling out your own.
@ember ledge Can you stop the spam?
anyone know if I can make urllib3.HTTPSConnectionPool reject domains that don't support HTTPS rather than just silently downgrading to HTTP?
If you have a lot of tcp client connected, how would you broadcast some data to all the TCP client for the best efficiency?
It has to be done at the application layer. At the network layer, there's no equivalent to a UDP broadcast for TCP.
If these are clients connecting to a web server for example, you need scripting to do whatever it is you're trying to do.
so just a for loop?
I thought I could use some alternative to save bandwidth
is this the correct channel for paramiko questions?
I am trying to send RTMP from one device to another on a different network (I am using mobile data to recreate that in my house)
I have obs in my mac and I have this as settings:
stream_key: something_random```
Windows PC:
```rtmp {
server {
listen 1935;
chunk_size 4096;
application live {
live on;
record off;
push rtmp://x.rtmp.youtube.com/live2/[youtube_stream_key];
}
}
}```
I have also made a rule to accept all connections to port 1935 on windows
However when I press ```Start Streaming``` on macbook obs I get error: Failed to connect to Server
Guys, does anyone have good documentation on the socket library
Source code: Lib/socket.py
This module provides access to the BSD socket interface. It is available on all modern Unix systems, Windows, MacOS, and probably additional platforms.
Note
Some behavior may be platform dependent, since calls are made to the operating system socket APIs.
Availability: not Emscripten, not WASI.
This module does not work or is not available on WebAssembly platforms wasm32-emscripten and wasm32-wasi. See WebAssembly platforms for more information.
This is a neat webpage: https://docs.python.org/3/howto/sockets.html
anyone familier with paramiko's check_channel_pty_request method
i need to enable it for a couple reasons but when i do, the users input from channel.recv is taken using bytes meaning letter by letter, this wouldnt be an issue since i can just log the bytes to buffer and then wait for new line to interpret the users full input, however i now face the issue of interpretting backspace, arrow keys, control c n whatnot so its going to be quite challanging as im pretty sure some terminals and operating systems have different codes for arrow keys... does anyone know a better way of doing this
Hii
I have published my project on IIS and it's working, but I want to run it on mobile , my pc and mobile is connect on same network, what to do?
Its running on 127.0.0.1 and port number 443
what to do
?
https://paste.pythondiscord.com/CFYQ
Fehler bei der Verbindung zur Datenbank: PostgreSQL server at "45.84.197.202:3306" rejected SSL upgrade
Warte 2 Sekunden, bevor die Verbindung zur Datenbank erneut hergestellt wird...
whatโs the question? also, this is an english speaking server
it looks like asyncpg is trying to create a SSL connection but the server doesnโt want to, or the other way around
i will get mysql conntection for a globalchat bot but error and idk how to fixx
if thatโs a mysql database you need a mysql library, not postgresql
now this error
Error connecting to the database: (1129, "45.65.115.85' is blocked because of many connection errors; unblock with 'mariadb-admin flush-hosts'")
Waiting 2 seconds before attempting to reconnect to the database...
i have fixx it but now they say the passwort is wrong but the passwort is working i used it self
Error connecting to the database: (1045, "Access denied for user 'root'@'45.65.115.85' (using password: YES)")
Waiting 2 seconds before attempting to reconnect to the database...
You need to use your actual private IP address. Run ipconfig /all to find it
If you meant the IIS site currently binds to 127.0.0.1:443, then it wonโt accept requests from any other machine in the network. You will have to change the site bindings, https://docs.lextudio.com/jexusmanager/tutorials/binding-diagnostics.html
having an incomprehensible problem with login, pasted modules at https://discord.com/channels/267624335836053506/1233507517540077731. would greatly appreciate help, im lost, bruteforcing with LLM does not work
Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.
Anyone knows how to send malformed packets?
Try doing it as you would with well-formed packets and hope the other end doesn't automatically discard the packets
Like wdym
Hi all, wondering if I can get some help understanding where these errors that I'm dealing with are coming from and how to fix them?
[Errno - 2] Name or service not known
[Errno 111] Connection refused
[Errno 104] Connection reset by peer (this one writes "Killed" to the terminal and kills my entire program for some reason)
request function https://paste.pythondiscord.com/7TMQ
It appears that these errors are coming from the underlying library itself because they're not actually throwing python exceptions? They just print to the terminal. I'm also only getting these on specific domains and ip addresses.
They are from the wire. "[Errno - 2] Name or service not known" is a typical DNS related error (missing DNS records and name resolution failed). "[Errno 104] Connection reset by peer" indicates TCP RST occurred. Usually you don't "fix them", but surface them to callers of your library or end users of your app. They should work with their network administrators (or themselves) to fix those.
the name or service not known seems odd because I'm doing the DNS lookup myself and connecting with an A record IP along with the domain
Does the connection reset by peer mean that my network administrator is killing my connection?
Impossible to tell from the error itself. Anything on the wire (such as a proxy) can send you TCP RST for some reason. That's why network administrators are needed
I think I understand. Is my application exiting because the sockets library is calling sys exit when it sees TCP RST? Or is it exiting for a different reason?
I'm not sure if I'm asking you the same question in a different way, I'm just trying to understand this a little more
I think what I'm trying to ask is, I don't understand why receiving TCP RST kills my application.
on payload u can see the value of key2, which i observed and found out that everytime i authorise the value of key2 regenerates but i want to know in what pattern or from where it actually generates since it is different for every time i auth (doesnt change on which is it already authorised).
so how can i find from where or how it is generated
I have a server script and it is already functional but now getting a little bit complex with new functions coming in, the newest of them all is to have different file search algorithms linked to a file path and to search for queries sent by the client, I don't wish to add more functions so as not to break it as I will only be adding the best benchmarked algorithm into the server.py, how do you suggest I go about it?
Not sure I follow but it sounds like you need a development environment to do your testing in. Only push code to production when you're sure it's production ready
can anybody help me with sockets please?
i'm trying to connect two clients to the same thread of a game however i do not know how to write up the client side... the server side is fully working.
A socket expert usually has no idea what is "the same thread of a game", so you need to change the way you ask it.
A socket client is very different from a game client, as the latter might involve a complex game protocol.
you can use the python library named scapy for that
What are you having trouble with specifically? If you're done writing the server, surely you've got a starting point and a goal in mind
Envisioned a protocol and stuff
that's what I'm doing but I have no idea what is considered a malformed packet
I am doing a penetration testing, suppose I have a web server and if I send a packet that the server is unable to process it would crash the server. But I can't reproduce this error
i just donโt know how to do the sending of the objects of the client to the server wnd then updating the other clientโs screenโฆ
the server side has all the game protocols but iโm stuck with how the clients should interact with the server and where to update them
It is for an evaluation task, I am still in development
If you're using proper version management it should be easy enough to test and roll back or switch between branches. But if you really need separate Dev and Test instances that's an option too
Okay, thank you, I think I've gotten it now. Please, can I send you a DM? Also I wanted to ask, if I have a config file that reads if SSL is turned off or on on the server script, how do i go about that?
One message removed from a suspended account.
Guys, I have a problem, I want to create connection with webpage and parse it, so I have this code:
time1 = time.time()
driver = Driver(browser="chrome", headless=True, proxy=proxy_host, page_load_strategy=None)
driver.get("https://www.somepage.app")
driver.add_cookie(
{'name': '__Secure-next-auth.session-token',
'value': cookie_value,
'domain':'www.somepage.app'})
driver.get(link)
time2 = time.time()
print('Step1 : ', time2 - time1)
WebDriverWait(driver, 20).until(lambda driver: driver.execute_script('return document.readyState') == 'complete')
time3 = time.time()
print('Step2 : ', time3 - time2)
And here is the time consumption result:
Step1 : 4.481840372085571
Step2 : 3.3659958839416504
So on average it takes 8 seconds only to load the page, the question is how can I speed up this process as much as possible if I need js to be loaded on the page, because without this many elements I want to parse won't display?
Can anyone help me understand signals and slots?
Anyone has experience with fuzz testing?
Self signed, and CA-signed certificates provide the same level of encryption? The only difference is trust (whether the website is legit or not), right?
it depends on whether you trust the certificate authorities more than the server's self signed certificate
Self signed: trust me bro
CA signed: trust me bro, trust him
Certificates are about trust, not encryption iirc
they are about both
a HTTPS exchange starts with some assymetric encryption and then a symmetric key is agreed upon and used for the continuation of the dialogue
what are the differences between tls 1.3 and tls 1.2?
speed & security
there is a reduced handshake length with TLS 1.3, 0-RTT
can be used in some cases as a replay attack vector, but used correctly, makes handshakes considerably faster
huh neat
it's a lot of minor changes to the encryption suites used
so it bundles in more data into a packet?
not really, it uses less packets to establish the same secure connection
huh
but if you look at that website, there's some very interesting tidbits, how like TLS 1.3 pretends to be a TLS 1.2 session so that firewalls that are looking inside packets don't block packets because they don't recognise 1.3
it's all built to get through middleboxes without causing additional havoc, so it tries to change from 1.2 as little as possible
ChangeCipherSpec is just "yep, i know what suite we're using" right?
yeah it's the switch from assymetric to symmetric
neat
Click on Initiator tab in this image, and look at where in the code was the request made. then work your way from there. You can also see initiator chain, functions which are called from user interaction (or loading the website or something) until the very request is made, 'key2' is probably mentioned along the way
note that this is not related to networks at all
a basic spoofing
Hello everyone!
I wanted to know if it's possible to make payments automatically from a python backend (or C++, but it doesn't matter) and not selenium for greater speed or if it's clearly impossible due to potential security issues (which I have no idea about).
At the moment I've managed to create APIs for various things that involve POST/GET requests (particularly for LLMs like Microsoft copilot or other ) but never for requests involving payment, so I wanted to ask you about the feasibility of this.
Thanks ๐
that's cool, can you write me in dm?
You can absolutely process payments with Python. But if you don't know what you're doing with security, get help. That's true regardless of the language.
stripe
Hi all,
Is it possible headless python os level automation ?
But it is possible to do payment request on website like amazon from python backend ? Because it is faster than selenium
Are you work for software develop test?
Of course
I'm not familiar with this but have you looked at https://developer.amazon.com/docs/amazon-pay-checkout/get-set-up-for-integration.html
Get set up for integration
It's not that clear to me what you're actually trying to do though
I just ask to the feasibility to make a program that buy on platform like Amazon and other faster than traditional method like selenium.
But thanks for the link
It also can be useful to buy sneakers faster than other people who use selenium
That's definitely against Amazon's terms of service and so against this server's rules to discuss
Ok I understand, I will search this alone, ty
Hello guys , i am newbie at networking, I'm a student also , could you please give some free resources to learn networking from scratch?โจthat would be great help for me
Look for the study materials for the ConpTIA Network+ such as the official exam objectives and Professors Messer videos on YouTube.
Even if you don't plan to take the exam, it's a good way to cover all the most basic topics
I tried and research everywhere nothing found. I am working on project which device 1 force device 2 to format disk, install os, install drivers but there is one condition device 2 will be totally empty. And the whole process will be done using python language only.
I am still not sure this process is possible or not
Please suggest.
Thanks for the suggestions, yeah i started basic's of networking technician course which is offered to Cisco for free, and can you suggest some yt channel for learn networking?
I did... Professor Messer
Oh I see. No, Python needs an OS installed first to do anything.
Once your machine is up serving SSH then you could install drivers with Python via Paramiko, but tools like Ansible are easier at scale.
If you need that level of infrastructure automation look into "infrastructure as code" frameworks like Terraform that can spin up a virtual server for you with a given image.
If you have more questions about that, #tools-and-devops is a better channel
Thank you , and i really interested in assemble gaming pc builds also , could you suggest any of the yt channel u known about oc builds and computer hardware all this stuffs?โจ๐ซ๐ซ
with selenium, requests or beautifulsoup, paramiko yeah
Thanks
Thanks๐. For your suggestion and reply
MAC Spoofing Detection Tool ๐ฅณ
Of course, you can send me a message for similar vehicle suggestions, I need your inspiration.
I'm currently having a problem where I'm trying to connect to a remote server using SSH
They instructed me to connect using a VPN first using openvpn (they gave me a config file)
So I run sudo openvpn --config <config>.ovpn then i try to ssh into the remote server, after I enter my credentials the connection closes immediately
Also tried checking if my public IP ad has changed after using the VPN but my IP was the same
How do i troubleshoot this?
Sounds unrelated to the VPN connection if it's prompting you for credentials.
i also have credentials, they gave me
isn't my public ip supposed to change tho after I connect to a vpn?
Not if it's a split tunnel that only routes specific traffic over the VPN, which is likely the case
And again, you're reaching the server right? At a private IP? And if you disconnect from the VPN, you don't get prompted for login credentials? All of that would suggest VPN is working fine.
I suppose it's possible that the server is on a public IP, letting you log in but dropping you because your IP is wrong, but that would be an unusual setup
If you didn't still have a public IP address for your network, you wouldn't be able to use the Internet in order to talk to the VPN server
VPN = Virtual Private Network
Contrary to what random people on Youtube will tell you, VPNs exist to transfer data into a private network without physically travelling there and plugging your computer in.
Not to watch Peruvian Netflix
Traffic only needs to be tunnelled through the VPN server if it needs to go to said private network
When you connect to Shit VPN (sponsor of today's video - use code REPENT, HARLEQUIN to get up to 15% or more off a 1-fortnight subscription), "traffic that needs to go to the private network" means any traffic NOT going to the VPN server itself, or like, your LAN.
So if you then google search "My IP," it gets routed using that policy
the VPN client then encapsulates your request and sends it to the virtual private network
where it gets sent through the network's default gateway and to Google
Google sees the originating IP as the network you sent it through and sends it back
There's no reason to send your regular public internet traffic through a VPN if you're using it for the actual Private Network part, instead of as a crappy single-hop traffic proxy.
So, when using a VPN that's not a youtube sponsor monetizing peoples' FUD about how Internets work, your normal traffic gets routed, well, normally.
There are legitimate VPNs that do route all traffic for anonymity or other purposes, but that's not the kind you would use to access private company resources
fortnite subscription?
flosses
This is not a Python question but if anyone has any experience routing traffic through IPSec with PFSense, please help! https://www.reddit.com/r/PFSENSE/comments/1cux59r/n00b_struggling_with_routing_over_ipsec_please/
actually laughed at this, thanks
I have a problem revolving a connection between a mobile and my server in python
I can send and receive messages between the mobile and server tough the mobile recieves only the message sent by the server when i close the server. Does anyone know something realted I might be missing?
It sends only the first message i try to sent from the server
What do you mean by "messages" What do you mean "close the server"? Is there code you can share? #โ๏ฝhow-to-get-help
It's a string I'm trying to get sent by my laptop to my phone, they can be communicated but seems that the mobile receives the first string I sent when I stop the code running from the server.
hey guys, btw, I need a guest writer for my article where I share things like cybersecurity/coding/ML&AI, please dm if interested.
I want to run a server on a seperate network so my own network has a smaller chance to get infested from the outside, could I add a seperate network next to my other networks in my household?
wait so it wasn't made to watch the newest episode of insert anime??????????????/
You can. VLANs are a common way to do this.
Have an issue of a website thatโs aborting get requests for image zip files if my program throws too much work in a given time frame.
This prevents completing the task I was to automate given there are 100 thousand parts with images to pull down.
The only thing I think to do is switch my ip address so that server sees the requests as new calls.
Appreciate anyone thought on this issue.
Thanks
Don't throw too much work at it in a given timeframe. Respect their ToS.
You inside a container??
yes
It is ubuntu 24 so it shouldn't be any differed.
Those are probably because you do not have access to the main hardware to make those changes from inside the container I think
any alternatives?
Idk, I think stuff related to routing and related things have specific container commands
I don't really know much I am just guessing. I had this issue when I used docker
Then how can I deal with it?
any alternatives?
Use proxies
And do you mean "time frame" as ratelimit? If so, just sleep between requests to avoid saturating your session
Are you closing the socket and/or packet properly?
I had that same issue with Golang, since I didn't close the connection
Hi there, I meet an issue when building the docker image from Dockerfile. In Dockerfile, I run command โdpkg -i package.debโ, When installing that package, it runs a command โsudo iptables โฆโ and I got permission denied. Here is the output: [INFO] DOCKER> root [INFO] DOCKER> /sbin/iptables [INFO] DOCKER> [91miptables v1.6.0: canโt initializ...
Python documents socket functions not available when using the code. Using Windows 11 and Python 3.12.3
Figured it out use module to call function
Figured what out
Some things are just platform specific when it comes to operating system APIs
so, as i know if a computer behind a firewall makes a request to a server outside the LAN the firewall trust it and let the incoming package from the server come into the computer right?
how can i configure this in python
to send like also a simple message
so i don't need port forwarding cause the main request was created by the client on the pc
So if I understood correctly, you have ports forwaded already but the firewall is not letting you?
nope i want to not open my ports
You can't, Python will only act as an intermediary for that, the router still won't allow the packet to go through
so how can i send and receive packets?
so why i donโt need port forwarding like to play video games
like idk basic networking stuff
but how does it work iโm also receiving packets
in a minecraft server i need like to receive the position of the other players
to visualize them
Is Minecraft P2P?
itโs tcp i think
If not, that's your answer
That's a protocol
so protocols donโt need port forwarding?
like i specify an address over the internet and it send the packet and the other people receive it?
P2P = Peer to Peer
TCP/UDP are protocols that require open ports to send/receive packets
so if minecraft is tcp he is port forwarding if i play a server
a stupid but effective example
How the game interacts with the user and the server depends on the game itself, I couldn't explain how Minecraft networking works
thx for the advices
also can you provide me like a place where to learn more networking stuff like this
Check https://ngrok.com for tunneling, pretty great service
i see itโs your sector
i studied a bit and how can i hole punch with udp and sockets?
like why it doesn't work
#CLIENT N1
import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.bind(('', 5500))
sock.sendto(b'0', ("ADDRESS MACHINE 2",5500))
data, addr = sock.recvfrom(1024)
print(data.decode())
#CLIENT N2
import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.bind(("",5500))
sock.sendto(b'0',("ADDRESS MACHINE 1",5500))
machine 1 starts before machine 2
Trying to solve why .recv is working intermittently
currently doing a cs degree and one of my units was networks
i was interested to buy myself a mini server and tinker around with it
is there anything i should know like do i need switches or can i just use my router and a server
this isn't quite how holepunching works
generally you have one central public server, both your clients connect there, then the server tells each client the receive address of the other client
you can't just open a port and bind because the routers NAT will not forward traffic as you expect it to
P2P is a connection model, TCP and UDP are transportation protocols
I've never used this but it's popular https://www.netacad.com/courses/packet-tracer
Enroll, download, and get started learning valuable tips and best practices for using the latest version of Packet Tracer with our brief introductory course.
but basically doing what i do is sending a packet (even if it's not recived) and receiving a packet from the same ip
I've been using it in class
so even if i don't have a server in the middle the NAT shoul let the packet pass
But like hardware wise do I need something besides a router and a server?
If I wanted to host a minecraft world for example
i don't have a port open
You might not need to buy anything if you have a computer and a network connection
I was thinking of turning my pc into the server but I'd need it to be running every time to actually connect right?
why does it not work?
So friends wouldn't be able to connect unless my pc is on?
basically
yeah thought so
a main issue would be internet speed
i'd need to be basically using my internet to run the server right? which one would come with huge frame drops
would having a physical server acting aside from my pc fix that?
i'm really confused, are these devices on the same network?
nope on different networks
yeah that's why then
your local UDP socket probably has a port of like, 1.1.1.1:5500, but when it leaves your network, the NAT will rewrite that to the NAT port
but i read that you can send like a ghost packet
the other client needs to send to that NAT port
you need a centralised server that is on the public internet that both tools can hit to do the holepunch
the other client knows already that port
which port, the NAT port? or the 5500 port that you've put in
the public port will not be 5500
yes
that's why you need both devices to connect to a central server, then the server tells each client what the port is
i need to know that port in order to reply to this ghost packet
this is exactly what https://en.wikipedia.org/wiki/STUN is for
STUN (Session Traversal Utilities for NAT; originally Simple Traversal of User Datagram Protocol (UDP) through Network Address Translators) is a standardized set of methods, including a network protocol, for traversal of network address translator (NAT) gateways in applications of real-time voice, video, messaging, and other interactive communic...
perfect then
Your computer would need to be turned on and connected to the Internet. A Minecraft server doesn't need a lot of power or bandwidth if it's not supporting a ton of users. Even a Pi can be enough. https://www.reddit.com/r/raspberry_pi/comments/vzj9ha/a_guide_for_minecraft_servers_on_a_pi/
i just need to have a server in the middle and let the client1 send a packet even if refused by client2 and wait for client2 to send a packet to client1 in order to enstablish a (connection), all that after receiving the infos from the server @cedar forum
alright thank you
i'll look into this and see the player limit
both clients need to send to the server for bidirectional comms, i can't remember the specifics of then convincing the UDP sockets to send to the peer address
should be the ones i mentioned before
as i remember
like after having all the infos i need to send a packet that should not be received cause the ports are not open and the router don't know where to put this datas
and client2 after that should send client1 a packet that is interpreted as a response and redirected to the actual client
Yes exactly
so i'm learning about this UDP hole-punching and i'm stuck on a concept
if i use the server to get the infos of all the clients
so
Client1 1.2.3.4:5678 (address provided by nat)
Client2 2.3.6.9:5743 (address provided by nat)
so we talk to the server with those ports
when i try with C1 to send a packet to C2 does not the port change based on the new packet i'm sending? that is no more directed to the server?
What are you trying to do?
hole punching UDP
For what purpose?
Even with UDP your packets won't go through
Without prior port forwarding
the server has port forwarded
they can go trough cause they are not just entering
but are a response from a request i made
What?
so basically
The thing to know about UDP hole-punching is that many consumer-grade Internet routers/NAT-firewalls have a policy along the lines of "block any incoming UDP packets, except for UDP packets coming from an IP address that the user's local computer has recently sent a UDP packet to"
the idea being that if the local user is sending packets to a particular IP address, then the packets coming back from that same IP address are probably legitimate/desirable.
then if i send a packet to C2 even if refused if C2 send a packet to me my NAT and Firewall let it pass cause it's flagged as legitimate
so i'm basically not listening to any router port
i'm making a request and waiting for a response
if i have to enable PortForwarding for responses you have to open a port even for requesting a website no?
and that's not this good i mean
i found a nice source: https://bford.info/pub/net/p2pnat/
Solved the issue
@hasty quest
how does this happen?
can i udp holepunch with utp rendezvous server?
Hey guys does anyone know how to make my code work so i want to make it so like python files replace html files just strings code: ```python
from fastapi import FastAPI, Request
from fastapi.templating import Jinja2Templates
app = FastAPI()
templates = Jinja2Templates(directory="templates")
@app.get("/")
async def root(request: Request):
return templates.TemplateResponse(
item=html, request=request
)
html = "<h1>Dash sucks this good</h1>"```
i got everything to work
anyone
please
fine i will do it myself
https://github.com/nutaro/bisturi/blob/master/bisturi.py
nmap calls with threads
i want ideias on parsing the data
It looks like you want to dynamically render HTML content
So
render HTML content using FastAPI and Jinja2 templates. Your current approach is close, but it needs some adjustments to correctly pass and render the HTML string. Hereโs how you can modify your code:
Use Jinja2 templates to render HTML.
Pass the HTML content to the template from your FastAPI endpoint.
@left berry how's your neural network going?
uhmm still searching videos and stuff
What are you planning on making the neural network do?
well no it depends on what do i want to do ! more like other then how to make neural network.
i need a AI that can be a code generator !
i thought i can have a llm or other things like neural networks that can each do a each indevejual things !
like one can be a philisophere
one can be like a lover
one can be like a thinker
like how humans brain works ๐
idk
just thinking ways right now
what about your project ?!
um
Intenal
ip
adress
like
Internal IP addresses are used for communication within a private network, such as a home, office, or organizational network.
Internal
ip
addresses add a layer of security by isolating the internal
network from the external internet. Direct access to devices on the internal network is restricted, reducing exposure to external threats.
Starting off to learn the basics again because I don't really understand my apologies
FastAPI vs Flask vs Django use cases, prons and cons.
Anyone who could help me with a simple Flask task? can't seem to get it to work

Sorry
For your neral network(s)
Put shut down keys if things get out of hand
Is TCP/IP included in layer 7 ? Like if a program supports only layer 7 networking that means it can read all protocols, but if it supports only layer 4 that means it can only access TCP/IP and UDP/IP packets. Right?
Layer 7 usually means just some specific application eg only http or only sql
So even if it is above layer 4 it doesn't include layer 4?
Can someone help me speed up this network request?
On Chrome, I can see the full time of the request is 1.03 seconds.
In python using requests.session it takes 2.19 seconds
Saving a full second would be great, what am I doing wrong?
it's just a very simple POST
content=session.post(url=urlUpload, headers = headerUpload, data=dataUpload).content.decode('utf-8')
Doh I realized it's probably the decoding to utf-8
Hey y'all. My ISP uses CGNAT, and I'm trying to make a UDP listener in python. It works, but on LAN. What could I use to bypass the CGNAT, and open a port / a way to get the packets to my PC? Any FOSS options?
Ipv6?
IpV4...
They do cgnat and no v6? That's ludicrous
... isn't that the point of cgnat?
if they were using v6 they could just give everyone their own ip
Usually cgnat is for v4 and they provide v6 in dual stack
huh
only time i've seen this kind of single-stack v4 with cgnat is like... dodgy cell carriers
sadly its the best and biggest isp in here. u could consider it dodgy. I'm going to try and give them a call tomorrow. Gonna see if port forward is even doable
๐ naaa i havent done shit since i said it i was busy sleeping and doing IRL shit
but i will thanks tho
we got to acomplish what we want brother
So, I'm trying to convert from Python requests to pycurl. Is there an easy way to do this, or do I have to reformat all my data
wow while doing this I figured out the problem
I wasn't sending any headers
So I guess the server was sending me slow responses as a result (maybe some kind of compatability mode)
Isn't this what requests-html does?
I dunno but now I don't care ๐ My request time went from 2 seconds to 1.1 seconds because I fixed my headers. Maybe pycurl would help even more, but I did my goal
My original concern was that when I used a particular API from the browser, I was getting 1 second times, but from python was 2 seconds.
I think any additional benefit from a different library isn't going to be significant. Maybe a tenth of a second
not worth making my code brittle and have more dependencies
Probably can't meaningfully increase the speed beyond what the browser would do
whats the point of CNAME and MX type DNS records, why the don't map aliases straight to IPs?
good questio
they all do difefrent things
these map domains to IPS
Alias of one name to another: the DNS lookup will continue by retrying the lookup with the new name.
CNAME is 1 domain -> another
A mail exchanger record (MX record) specifies the mail server responsible for accepting email messages on behalf of a domain name. It is a resource record in the Domain Name System (DNS). It is possible to configure several MX records, typically pointing to an array of mail servers for load balancing and redundancy.
and MX points a domain to another domain which is the mail server
Hi! I have 2 processes and both of them have the same TCP socket. Is there a problem if from one process i read data from the socket while from the other process i send data through it?
Does anyone have experience with modbus
thanks @edgy pelican
Hi @stray harbor I can help you. DM
that sounds like what sockets are designed for
so 2 things, they apparently do ipv6, but it's not shown in the router for some reason... and (i think) they unblocked the cgnat. My IP isn't in the 100.x range anymore. It's a public IP, with xx.xxx.xx.xx. I've heard that it doesn't work with PPPoE IP acquisition? Can someone tell me if its true or not?
Apparently they brick their terminals with CGNAT unless u make an application, which is usually denied. BUT, they do usually disable the CGNAT when getting a DDNS from them.
Hello fellow programmers! I am parsing a site, and everything's alright BUT some kind of dynamically loaded element ruins everything. I tried to use playwright lib to extract this thing, but for some reason it doesnt work. I have no idea what's the deal with this thing is. If anyone can help, i'll be awfully greatfull!
Code:
async def main():
async with async_playwright() as p:
browser = await p.chromium.launch(headless=True)
page = await browser.new_page()
await page.goto("https://bamper.by/zapchast_dvigatel/22348-114861368_1/", timeout=60000)
await page.wait_for_selector(".js-breadcrumbs", state='visible')
print(await page.content())
await browser.close()
asyncio.get_event_loop().run_until_complete(main())
Markup of breadcrumbs is on picture.
Remember to use asyncio.run, get_event_loop is deprecated in use like that
It's a Belarusian site, so ye, you're right
Sure
First by typing correct spelling
Is there an alternative to setting a socket timeout so that I can shutdown a socket? I also know there is the possibility that you just create a dummy client socket that connects/disconnects from the server, but I'm hoping for something a bit more programatic...
hey guys Im learning python( is it a good idea for networking tho? When compared to something like go and cpp? ) but I wanted a project and I was thinking of something like Napster ? Is that a good go? Like any networking app like that
Also could i monetize something like that even if I do end up building it( I might be thinking a bit ahead of myself but still xd)
I mean, napster was a big thing when it came out right? Is there still a potential for something like that today?
Napster? Is that still around?
I don't want to dissuade you from learning Python, but I don't think any Napster-like service could ever gain traction today
yeah I just thought of it too, lol. But perhaps there must be other networking like projects out there as well yeah? that I could do and perhaps gain traction by an amount?
ยฏ_(ใ)_/ยฏ
it would be worthwhile to learn programming so that when you have an idea or a need for a tool, you can implement it
the only practical move ig haha
thanks anyways
well, just practically speaking, if you haven't learned any programming before, going from "nothing" to "napster" is not an easy task
the napster protocol is open (or at least there was OpenNap at one point), so you can see how it works
i kind of code like cli stuff but I just wanted to spice things up and write something a bit bigger with the hope of it getting some attention yk
dont really know what to aim at, but then I thought of hitting the networking side man
might seem like a dumb question but is there an app that fake simulates cisco connections so i can practice cisco commands without physical wiring or hardware
i assume its possible in theory but i don't know if its actually done
this souuuuunds like packet tracer https://www.netacad.com/courses/packet-tracer
Enroll, download, and get started learning valuable tips and best practices for using the latest version of Packet Tracer with our brief introductory course.
Does this allow me to simulate configuring ospf and ipv6 etc?
Thank you I'll check it out
i don't have it installed right now so can only show you google screenshots, but regardless I think this will certainly get you somewhat along what you're looking to set up
Needed to practice for exams without going in person so this is crazy helpful
ahh if it's for exam-style things then yeah packet tracer should 100% cover you
looks like you might have to do some sort of enrollment now to get access to the downloads but you should be able to just put in phony info and get the install instructions
i kinda want to tinker around outside of uni anyways so wouldn't mind having it
Hello, I currently have a code that create a tcp connection with a server. However I need this connection to use a proxy. Is there an easy way to achieve this?
I found the solution.
https://github.com/romis2012/python-socks
for anyone who might need it.
i want to see if somoene has already created a sock5 proxy if yes i have some questions that i would like to ask or he can point me to a github repo that can help or something
im trying to connect my google cloud function to cloud sql... i need it for my school project: a system that will send you emails in the morning even when your pc is off.. the problem is ive been stuck with the same errors for three days:
-pymysql/connections.py613
-socket = socket.create connection
-pymysql Operational error: cant connect to MySQL server on (localhost and mycloudsql public ipaddress)
pag nirurun ko yung code ko locally using the cloudsqlproxy.. gumagana naman sya. pag nilalagay ko sa cloud function.. hindii and its the same errors that keep showing to my log. guys im new to apis and cloud and im honestly lost. i already ran out of yt videos to watch and follow..
also tried using vpc connector but nung iseset kona sa cloud function yung vcp, error occurred: Insufficient CPU quota in region
these are also the code that ive tried using:
1.)
def get_conn():
return pymysql.connect(
host=instance's public ip address,
user=DB_USER,
password=DB_PASS,
database=DB_NAME
)
2.)
connection = pymysql.connect(
unix_socket=f'/cloudsql/{GOOGLE_CLOUD_SQL_INSTANCE_NAME}',
user=get_secret('DB_USER'),
password=get_secret('DB_PASS'),
db=get_secret('DB_NAME')
)
mitmproxy is open source & does socks5 proxy
i got a list of the mac addresses and i'm wondering, what if pc-a wants to pass a frame to s1, the mac address of s1-vlan1 would be used in the frame right?
That's the interface VLAN 1 from the switch S1
From what I know, vlans only work with IP, as they are virtual lans, there shouldn't be a Mac, as they have nothing physical, that is my reasoning
well in a cisco switch, there is a mac for the vlan interface
Isn't it the same as the macs phisical interface?
You can even configure traffic with specific source MACs to be mapped to a certain VLAN. So the idea that VLANS only work at layer 3 (IP) is not accurate.
If by "pass a frame to s1" you mean directly talking to S1, for example accessing S1's management interface, PC-A would use the MAC ending on 4ca1 as destination. Which is assigned to the virtual interface that has 192.168.1.11 configured, the IP address you'd be connecting to.
I say that with 90 but not 100% certainty.
What i understood is that say multiple department which each department assigned with their respective subnet ...then vlan is configured so that if a pc wan to send traffic into their own subnet.they wont send unnecessary broadcast ff:ff:ff:ff:ff:ff to other subnet
Are you configured the switches from the pc via console?
Oh hey you're here lolol
And yeah i configured them via console
Ahh...im here bcuz im learning data science
Nvr thot this server also have networking channel
Just now noticed
Unfortunately you're mixing up things here, so your explanation isn't correct.
I also don't see how it's related to the message you answered to, where I just gave an example of how VLANs are not limited to layer 3. In fact VLANs mainly operate at layer 2, in contrast to the statement above "vlans only work with IP". IEEE 802.1Q VLAN tags are added to ethernet frames, not IP packets.
Okay. That what i understood regarding vlan...i dont respond it necessarily regarding to his point that vlan only operate on L3
Rather im explained my understanding regarding vlan and the reasoning im doing so is there anything that i may need to understand about vlan other than that?
Like to broaden my understanding regarding vlan
But im srry tho that it sound random
You are correct that VLANs form a broadcast domain so an ethernet broadcast from one VLAN doesn't reach other VLANs. That's one benefit of using VLANs.
But that technically doesn't have anything to do with subnets, which are a network layer thing.
In practice they are usually used together so if it's that's what you meant, I misunderstood you. Sorry if that's the case.
But you don't need subnets to have VLANs and vice versa, there's not necessarily a 1:1 relationship between them.
hi @cosmic vigil !
right so, since you mentioned I should try experimenting; I immediately experimented with changing the port. So I changed it and tested "oha http://localhost:{PORT}" to send multiple concurrent connections/requests and it worked
but when I tried to change it to the original port number, now it's giving me an error that Idon't quite understand
I was learning more about the curl command, to test my code locally
hmm, let me change it once again
but now it worked
whatt
lol
changed it to 1142
why's that?
except for 4221, which is the original port, it works
i think it was just restarting the server when you made the request
is it working now?
wait i think you made the curl request to 4221 when the server was running on 1142
check which localhost you're making the get request to
oh wait icccc
i didnt read the error
yeah.. lol
you can run a single socket on a single port
you are running main.py from the vscode terminal and the git bash terminal too
sooo just run it in either one or the other
yeahhhhh butt
first I run the file, right
then the cmd
but that error appears when I run the file
but I think we don't need to dwell too much on it
lol
since it works on the other port
whats happening is that you have 2 terminals trying to run 2 servers on 1 port
oh
when you make changes to the file it doesnt really trigger a re run of the server
ohh
so in one state if you set the port to 1000 and run the file, it runs on 1000 but as it is running and you change the port to 2000, the server will continue to run on 1000 and if you run the file again in another terminal, it'll run the same file on 1000 and 2000
like you gotta manually shutdown and restart the server
uhh I don't quite understand
did you run python app.py in the bash terminal or inside vs code's integrated terminal?
yea like open it
hit ctrl + c a few times
that'll bring the command line up
and then run python app.py again
then ctrl + c a few times
and just run the file again? alr
hmm
but I think we shouldn't dwell on it too much
since it works with a different port
alr great
why do people use DoH over DoT?
How come the first packet doesn't cause a SYN/ACK to be sent back but the second one does?
Are the extra options really necessary for it to work or what else could be wrong?
@snow yoke ive seen u talk a lot about networks in #cybersecurity. U got any clue about this?
Thanks in advance
I'd say that's because of the tiny window size of the first segment. 130 bytes is barely enough to send back the SYN/ACK response. Usually you see a calculated (=window * scaling factor) window size in the five digits with a client connecting to a server. Like in the 2nd segment which does get a response.
Changed the window but still the same result. What else could it be? Everything else is almost identical except for the extra options which I don't think should be necessary
I'd add the options one by one then to see when it works, if you have control over that.
Nvm figured it out. Server was listening at lo interface and curl operated on lo interface by default when using ip 127.0.0.1. My program was using eth0 and even though I could see the data it couldn't be routed
ty though
Oh so these two packets were sent by different programs?
And I was wondering why I saw multiple seconds of delay between them ๐
Yeah my bad
guys, i want to make a chat room app and host it through my computer, but i have a dynamic ip
and from what i remember when i was younger and tried to host a mc server it is a problem right?
If it's just a hobby project there are ways to make it work (I use Duck DNS), but if uptime is critical you want a VPS
thanks, ill check out the duck dns and yeah its just a hobby project to try some network stuff for the first time
Aside from public IP changes, you will probably need to configure port forwarding on your router.
That's assuming you have your own public IP and not a shared one behind NAT. Otherwise, something like ngrok or a Cloudflare tunnel may be needed
how can I check if i have my own public ip ?
I would just try port forwarding and confirm that you're reachable at your public IP on that port. If so, you're good
@gentle blade traceroute can help
maybe
It can be hard to interpret. But if there are two stages of NAT (1 being yours, the other being CGNAT) you might be able to see the CGNAT with it.
anyone got a suggestion of a framework to use in python?
Framework for what? If you mean backend web framework, the normal choices are Django, Flask and FastAPI

is there an off topic channel?
so uhh..transport input ssh?
lmao
!ot yes, there are always at least three open
#ot2-never-nesterโs-nightmare
Please read our off-topic etiquette before participating in conversations.
Im sending the first tcp SYN packet from my own program ive written to port 8000 where a http server is listening. As you can see it doesn't trigger a response to be sent back. The second packet is sent when I do curl localhost:8000 and that does trigger a response even though the packets are practically identical, except for some extra options in the second packet which I don't think is making a difference.
What could be the reason for this behavior and how do I solve it?
this is on linux btw
me when i read this channel: ack /pun
I have discussed it with my friends as well as researched the internet, but I couldn't find a proper way to find if an ip address is using vpn and proxy or not without using APIs and check the fraud score of that particular IP address ๐๐
Can y'all help me or provide me some link to it
unfortunately there's no real be-all-end-all solution to this
you can check who "owns" the IP that the request is coming from and try detect things based off that
based on that you can try narrow down known VPN companies, you can easily narrow down IP ranges like "Microsoft Azure" or other cloud providers
you can also do heuristics like checking for open ports on the IPs on known VPN connection ports and seeing if you get a connection, but that's very time intensive to do on a request
most of these services are basically probing the entire internet and checking for open ports on every host, so they don't need to check it on request, and that's why these ip rep/fraud score services exist and work so well, because they are just constantly scanning the internet for this data instead of compiling it on your request
unfortunately it's not something that will ever be able to be completely automated, you can just try your best to catch 90% of VPN users that come through common providers, and will have to do other forms of periodic aggregation of your requests to catch the others
filtering hosting companies and known VPN companies will cover you for the majority of cases, if a request comes from Azure, GCP, AWS, DO, etc. then you know it's a proxy and that will cover a large portion of proxy users
how did you do this?
true
WHOIS (pronounced as the phrase "who is") is a query and response protocol that is used for querying databases that store an Internet resource's registered users or assignees. These resources include domain names, IP address blocks and autonomous systems, but it is also used for a wider range of other information. The protocol stores and deliver...
i seee
wait so if a request comes from any cloud providers, then its a proxy?
๐ซก thanks sir
no not necessarily, it just means it comes from a cloud provider, so it's contextual
if you are running an API, then requests from cloud providers are obviously just applications most likely
if you have requests going to endpoints for humans from cloud providers, then you are either being a) scraped or b) receiving a visitor through a proxy
you can sometimes delineate between a or b by looking at the user agent (i.e. is the user agent a browser, or something like Python-requests/0.3.1 or whatever), but obviously that can be very very easily forged and should never be trusted
omg shit this is some big brain stuff
need to research hard

there is a lot to it, there's a reason people make full businesses out of this hahahahahaha
wait how?
is this a business thingy?
all those companies that run fraud checkers / ip rep checkers / proxy detectors are profiting off knowing if requests are legitimate
they just compile a big database of all IP addresses and run a set of checks on there to determine their confidence of different things
ahh i see
and people buy these services and use it through apis?
i c
yep exactly
basically, I'm doing an intern in a startup and the owner is developing a code to check all stuffs of IPs for his start-up and he told me to help him in it.
he's working on reverse dns and other things and told me to look on detecting vpns and proxys of a requested ip lol
also, not all ips are registered here right?
ye then it's the stuff mentioned above you'll need, but unfortunately it is mostly based on maintaining some sort of tracking on which ISPs are confirmed hosting companies and which are not, and those proxy detection businesses have been doing it for years to build the knowledgesets they have now, there is no easy classification of "this ASN is a hosting company" vs "this ASN is a residential IP"
yes they all, all IPs, domains and ASNs are required to have information here
it's a sort of safety net in that if your network is being attacked from an IP in a range you can lookup the data with whois and find a contact email for their network operations center
IPs are allocated by regional internet registries (RIR), so I get mine from RIPE because I'm in Europe. with that, i have to submit that information to RIPE for them to expose via their whois servers
but yes you will find info on every range via whois
but again, it's an expensive operation, so doing all these operations on every request is not efficient and not worth it, you need to just track IPs and run this sort of detection on a background basis
if you need immediate access on every request, you're going to need one of those third party APIs
guys does anyone have ressources to build a http proxy server from scratch functionalities are site blocklisting/authenitfication/loging ( i think all of this are easy after i can impolement the logic of the proxy server) i searched everywhere and it seems to be none
update from the ressources i found + some chatgpt help here is the version i have now
current problemes i can t work with https websites even if i tried to create my self signed cert with openssl and made some midications to code (this the main probleme) i would like to add some authentification but i don t know exactly how + some http websites (just one till now don t load fully) any help or recommandations is aprecated
this is an incredibly manual way of writing a proxy
i'd use something like https://pypi.org/project/proxy.py/ and write plugins for the specific things you need
โก Fast โข ๐ชถ Lightweight โข 0๏ธโฃ Dependency โข ๐ Pluggable โข ๐ TLS interception โข ๐ DNS-over-HTTPS โข ๐ฅ Poor Mans VPN โข โช Reverse & โฉ Forward โข ๐ฎ๐ฟ Proxy Server framework โข ๐ Web Server framework โข โต โถ โท โ PubSub framework โข ๐ท Work acceptor & executor framework.
yo guys could you recommend some great networking projects to learn it? something perhaps ambitious lol
check out https://github.com/karan/Projects#networking, few low hanging fruit projects to get familiar with some networking concepts. otherwise, just familiarise yourself with each level of the networking stack (OSI or DoD is fine) and know what the purpose of each layer is, which bits of hardware look at it, etc.
learn the socket module in python, learn how to build TCP/UDP client/servers, learn how to add encryption to those with things like the ssl module
etc. etc.
whats with all the emojis ๐ญ
lol no idea
so i ran a speed test 5 times provided from google and it's weird my download speed dramatically changes in just a short time?
That does seem a bit extreme. Talk to your ISP maybe?
yeah this is probably traffic shaping done wrong
might also be a good idea to try a continuous speed test with iperf between two servers
anyone wants to chime in with why can't I recieve response data from an API with urllib/requests/pycurl but can with standalone curl? https://discord.com/channels/267624335836053506/1255808856177508362
long story short, if I call api from curl, it sends the requests, no packets for 210ish seconds, starts recieving data
if I query with python, it sends the request and leaves the tcp connection in established state forever with no more packets
well that doesnt sound okay
after adding keepalive options to pycurl it magically works, except I see no keepalive packets going on
here be demons, I tell you
*keepalive packets are there, tcpview windows side didn't see them, but I can see them on the router
still doesn't explain why plain binary curl handles the download with no issues
huh
sounds like bad programming
on the server