#networks

1 messages · Page 1 of 1 (latest)

ocean bay
#

Yeahh, so you're saying that in a TCP connection all packets need to follow the TCP protocol (TCP Packets) and that's what makes it a TCP connection

cloud spruce
#

if it wasn't using TCP headers it wouldn't be a TCP connection and it's the OS that is managing the TCP connection, the application doesn't need to concern it self with all those details

cloud spruce
ocean bay
#

Yepp thanks for this haha

ocean bay
prisma cobalt
#

after this chat

ocean bay
#

Haha I feel like im having a hard time wrapping my head around these basic topics that I feel should be straightforward and its frustrating

cloud spruce
ocean bay
#

Perfect

ocean bay
cloud spruce
ocean bay
#

yeah but how does the actual TCP connection do that

prisma cobalt
#

TCP ensures the packet is received by resending it if necessary which can only be done because of the TCP connection

#

since the receiver can send an ACK [or not] back through the "connection"

#

UDP doesnt allow this

ocean bay
#

To my understanding, this resending is only done if the sender doesnt detect the ACK

#

yes

prisma cobalt
#

yes

ocean bay
#

how does the tcp connection come into play

#

if the sender is the one that detects the ack

#

i get its done ‘through’ the tcp connection, but why does it have to be ‘through’ the tcp connection

cloud spruce
prisma cobalt
#

a "connection" is a concept, not an actual thing which is where i think your getting caught up on

#

everything is packets, its just TCP has some infomation in the header that allows a persistant "connection"

ocean bay
#

so the three way handshake establishes the sequence number of the packets, ill take that as an answer

ocean bay
prisma cobalt
#

correct me if im wrong here @cloud spruce

prisma cobalt
ocean bay
prisma cobalt
#

what

#

isnt that the same thing

ocean bay
ocean bay
#

thanks haha sorry if my reasoning is a bit unclear

prisma cobalt
#

before i answer that, before when i said that:

the sequence number of the packets is decided when the packets are sent, not during the 3 way handshake
i was talking about the "relative" sequence number

let me explain the handshake

client initiates connection by sending a SYN packet to the server, this contains a 32 bit random sequence number
server responds with a SYN-ACK packet, this contains the servers 32 bit random sequence number and tells the client that the server acknowledges the first SYN packet
the client then sends an ACK to the server and this is the "connection" (both machines now have each other listed locally so they can recognise each other)

the sequence number is initally random for both sides and then is incremented with every packet sent, this is so when one side ACKs the other, they can say exactly which packet they ACKed

ocean bay
#

Yepp that seems consistent with what Ive read

prisma cobalt
#

the sequence number represents the amount of data sent between each "device" and gets updated with every piece of data recved

cloud spruce
cloud spruce
cloud spruce
ocean bay
ocean bay
prisma cobalt
ocean bay
#

Ahh ok thanks

cloud spruce
ocean bay
#

Yepp makes sense thanks

twin flame
#

i updated my Raspberry pi 3 with the latest os
i set up my antenna wireless wifi adapter
except i cant tell if my raspberry is using it or the inbuilt antenna because the the raspberry still shows the wifi signal in the taskbar

cloud spruce
ocean bay
#

Referring back to this question, with HTTP1/2, how does the os know it needs to create a TCP connection? Does HTTP tell the os that it needs to open a TCP connection? e.g. if im using http3 instead, who is the one that tells the os to use quic instead of a tcp connection.

cloud spruce
# ocean bay Referring back to this question, with HTTP1/2, how does the os know it needs to ...

http and quic isn't implemented on an OS level, the OS will only handle the TCP and UDP parts
http and for http/3 also quic is implemented in the application (typically using a library) and it's up to the application to tie it all together by requesting a TCP socket from the os to then run http 1, 1.1 or 2 over or a UDP socket to run quic and http/3 over
the OS doesn't concern itself with the higher level protocols

ocean bay
#

Ahh, so the application is the one that ties it together

#

HTTP is completely independent from tcp/quic

cloud spruce
# ocean bay Ahh, so the application is the one that ties it together

tcp and udp are independent from http and quic
but http 1, 1.1 and 2 all depend on tcp, it's a one-way dependence
quic is only applicable to http/3 and runs over udp
the lower level protocols are always independent of the higher level protocols
higher level protocols can be dependent on one or one of several or even several lower level protocols to function over a network an the set of lower level protocols that higher level protocols can run over can be extended in time by additional standards

but yes, it's all down to the application code in the end as the OS will not involve itself with such details

ocean bay
# cloud spruce tcp and udp are independent from http and quic but http 1, 1.1 and 2 all depend ...

Yeah I think I get what youre saying actually, let me rephrase.
The HTTP is independent from the creation of the tcp connection, but http does rely on tcp still for the tcp connection (sending a request getting an ack, sending a response getting an ack).

The application is the one responsible for creating the tcp connection by requesting it from the os. Afterwards, the application then employs the http1.1/2 protocol to send the http packets with that tcp connection

frail tulip
#

hello people i hab question

#

i tried hosting a server locally and use it as DNS server for all my devices on LAN
while all devices can ping the local DNS servers correctly and get packets back, as well as browsing the internet fine
some apps just says no internet

#

if i change DNS on other devices to automatic which uses my router again it works
please ping me when you reply thank you

cloud spruce
# ocean bay Yeah I think I get what youre saying actually, let me rephrase. The HTTP is ind...

almost, but the application doesn't know anything about the packets it only writes and reads a data stream to and from the socket that the os provides to the application, the os is in charge of chopping that data stream into chunks as it sees fit to be able to fit the pieces to the constraints of the path mtu, so just like the os doesn't concern it self with the higher level protocols the application doesn't need to concern it self with the details of the lower level protocols other then selecting witch protocols it requests a socket for from the os

#

separation of concerns is very important for a good architecture and api

cloud spruce
frail tulip
#

is that not indicative of whether the device is using the DNS server? i am very noob to networking lol

#

also i can see there are packets coming to the DNS server if i use fiddler

#

is there a way to know what url the app is trying to access and why its not working perhaps?
or maybe what would be the standard pipeline to debug this behavior? i dont really konw the term for network debugging lol

cunning garden
#

route can tell you where packets are routed on your box

#

(assuming a GNU/Linux environment)

cloud spruce
frail tulip
#

so im trying to launch an app on iOS 15 and iPadOS 15, and after i manually choose my home server(a linux laptop) as their DNS(so like 192.168.x.x), they can browser internet fine

#

but some apps dont work

#

they just say no internet

cunning garden
cloud spruce
#

also beware of how windows does dns lookups to all its dns servers in parallel and uses the first response

frail tulip
#

but i can still use route on the linux laptop to check packets i think

frail tulip
#

and in the terminal app on the iOS I use ping in, the terminal app tells me which DNS server its using

#

and the terminal app gives me back the DNS server address to be the custom home server one instead of the automatic router DNS

#

is this enough of an indicator that the DNS server is working and the problem is on the app itself?

#

i also tried copying a linux virtual machine(as the DNS server) which works on other peoples LAN and their machines with those apps but not on my LAN and my machines after modifying the ip and making sure the VM can connect to internet

cloud spruce
frail tulip
cloud spruce
frail tulip
#

hum

#

i see

#

but what about the VM situation tho

#

in theory if the VM can function as the DNS server that those apps need on other LANs it should also function on my LAN with correct VM ip address and VM DNS server right?

#

and also i think i tried ping some of the specific URL needed for one of the apps

cloud spruce
frail tulip
#

and the local DNS server i have gave back packets after the ping

frail tulip
cloud spruce
frail tulip
#

i dont entirely understand the situation but some of the assets are stored locally on the DNS server itself so i think maybe its trying to redirect those apps onto its locally stored assets?

#

and that could be the problem somehow?

#

maybe i need to learn apache2 idk lol

cloud spruce
#

but if the application says "no internet" when using your dns server you are probably filtering and redirecting traffic that the application needs to function correctly and the application probably isn't getting the response back from the endpoint that it expects

frail tulip
#

i see

cloud spruce
#

that would require a lot more work and installation of a custom root ca on the client device as well as the application not using any form of certificate pinning or certificate transparency checks to validate the certificate in use

frail tulip
#

ohhhhhh

#

i dont even know how certs work lmao

cloud spruce
#

if it's plain http you will have a much easier time

frail tulip
#

im gonna look into that

#

thank you man

#

🙂

#

wait

#

so in the scenario where i put the local dns server in a VM

#

will there be any complications than just running in a native linux machine?

cloud spruce
frail tulip
#

what im thinking is that we now have router firewall, linux machine host firewall and the VM firewall?

#

idk if thats the case or if theres anything else

cloud spruce
#

you just have to see to it that the vm is not behind a nat or being firewalled

frail tulip
#

so what does behind a nat mean?

#

i googled NAT a few hours ago and my understanding is that the router translates 192.168 ip into public ip?

cloud spruce
frail tulip
#

so is sharing the ip with host meaning behind a NAT or not behind a NAT?

cloud spruce
frail tulip
#

yes im just using a home asus router lol

cloud spruce
frail tulip
#

so i should not physically replicate the host network?

#

and let the VM have its own 192.168 ip?

cloud spruce
#

if the host machine is doing nat for an internal vm network the host would have to be setup to forward traffic for certain ports to the correct vm

frail tulip
#

ohhh i think i get it now

#

so i should not let the host NAT the VM but instead let the VM physically replicate the Host network, so that both of them gets NAT from the router?

cloud spruce
#

but if the vm gets it's own ip on the same network as the host and the other machine ls on the network it's much easier to run server software on it that will be reachable from other machines on the network

frail tulip
#

ok so different ip for VM and Host

#

wait so by ip do you mean LAN ip or WAN ip?

cloud spruce
frail tulip
#

i see

cloud spruce
#

that is enough to make it reachable from the lan

#

which should be all you need if you don't need people out on the internet to be able to reach it as well, then you would have to setup port forwarding on your home router the same way as if it was a physical machine

#

just done share the ip between the vm host and the vm guest

frail tulip
#

ok ill try look into that too

#

one more question

#

so recently i changed my microsoft account to be passwordless which sends notification to my phone's microsoft authenticator when i try to log in, but i dont know how i can setup windows folder sharing now since there is no password to login through SMB

cloud spruce
#

see to it that the vm guests gets its own ip on the same lan as the vm host and the other physical machines/devices on the lan

frail tulip
#

i log into my pc using a locally stored pin

frail tulip
cloud spruce
worldly lotus
#

I have some servers at home. Is there any way I can use different external ips for them?

cloud spruce
rapid fog
#

I'm a bit confused by the concept of a carraige-return line-feed here. Does this mean that a http response must consist of at least one line for the version and response code, and another blank line? Is it txt HTTP/1.1 200 OK   or simply ```txt
HTTP/1.1 200 OK

#

Like if I was implementing a http server I would need to return this right?

cloud spruce
# rapid fog I'm a bit confused by the concept of a carraige-return line-feed here. Does this...

in the pre 1.0 version of the protocol it was only GET /path with just one CRLF after it (without any protocol name or version after the path) and the response was just the content (no status line or blank line)
all later versions has the request line optional HTTP header lines and then a blank line to mark the end of the headers and the optional content for the request
for the response there is a status line and then the optional HTTP header lines and then a blank line to again mark the end of the headers and the response content body

cloud spruce
rapid fog
#

Ah ok for the response, if no header or body is required, we can just use the one line with protocol version and status code?

cloud spruce
rapid fog
#

Can you do ```txt
HTTP/1.1 200 OK

<body here>
is this also valid to indicate no headers and just a body?txt
HTTP/1.1 200 OK\r\n\n<body here>

cloud spruce
cloud spruce
#

use of \r\n\r\n is preferred but \n\n works to is not preferred if you can avoid it, what ever you do, don't mix the two in the same response, that can trigger bugs in the clients

cloud spruce
cloud spruce
# rapid fog Gotcha

if you want to reuse the connection you would have to first check that the request contains a Connection: keep-alive HTTP header and then send the same back in your response as well as a Content-Length: x HTTP header with x being the number of bytes the client should expect the content to contain or use chunked encoding instead of the Content-Length HTTP header if you don't know the amount of data when you start responding (for example in dynamic responses that is built during the response) and each chunk will have it's own length indication, this is if you still want the option to reuse the connection even when the content length is unknown when you start sending the response from your server

rapid fog
#

I'll have to look more into chunked encoding! I am familiar with sending content length as I've worked with socket connection before (HTTP uses sockets right?)

cloud spruce
rapid fog
#

Server sends HTTP -> socket -> TCP -> socket -> client receives HTTP (?)

#

I know there are some more steps after TCP, but is this basically it?

cloud spruce
rapid fog
#

Most of that is handled by the ISP though correct?

cloud spruce
#

but it's details you can dig into later if you are interested in how computer communications and networks work

cloud spruce
#

or well, layer 2 devices (switches, hubs, bridges and such) doesn't have to deal with the IP layer, just everything under that layer
while layer 3 devices (for example routers) needs to understand IP and all the layers under that
just like layer 4 devices (firewalls and load balancers to name the most common ones) needs to handle protocols such as TCP and UDP and the lower layers

#

the operating system of a server or client can be seen as a layer 4 device and then the application takes care of the above layers

rapid fog
#

Watching this now, explaining the different layers involved https://www.youtube.com/watch?v=OTwp3xtd4dg

NEW DISCORD SERVER: https://certbros.com/discord

--------------------------------------------------------------------------------------------------------------- --~--
MY FULL CCNA COURSE
📹 Register your interest - https://www.certbros.com/Course-Interest

HOW TO PASS THE CCNA
📚 Get a great book - https://amzn.to/3f16QA5
📹 Take a video course - ...

▶ Play video
rapid fog
#

And the change in application layer logic reduces latency?

#

Wait... The server cannot send a request to the client in HTTP? Then it is only client -> server -> response -> client. But never server -> client -> response -> server

cloud spruce
rapid fog
cloud spruce
rapid fog
#

That makes sense, sort of like normal HTTP is a one way street but websockets have 2 lanes for flow of data.

cloud spruce
rapid fog
# cloud spruce correct, unless you run http/2 with push and such, but it shouldn't be abused fo...

Ohh yeah the http server is coming together now ```txt
PS C:\Users\Jarrod\Desktop\http_server> & C:/Users/Jarrod/AppData/Local/Programs/Python/Python310/python.exe c:/Users/Jarrod/Desktop/http_server/server.py
b'GET / HTTP/1.1\r\nHost: localhost:5000\r\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,/;q=0.8\r\nAccept-Language: en-US,en;q=0.5\r\nAccept-Encoding: gzip, deflate, br\r\nConnection: keep-alive\r\nUpgrade-Insecure-Requests: 1\r\nSec-Fetch-Dest: document\r\nSec-Fetch-Mode: navigate\r\nSec-Fetch-Site: none\r\nSec-Fetch-User: ?1\r\n\r\n'

cloud spruce
rapid fog
#

I simply printed the request to make sure the connection was working haha. The browser hung because no response it sent back

cloud spruce
rapid fog
#

Should I have a default read length for when the header doesn't include a size? Right now I can get the header by reading until crlf,crlf but I can't tell when the request body has ended

cloud spruce
rapid fog
#

I'm using asyncio Stream

#

Just reused some code from a chat app I was working on, trying to recycle it to handle http

cloud spruce
rapid fog
#

From what I understand, the normal sockets library can handle multiple clients, bit it needs to cycle through each clients and see which has data to read, using asyncio Streams avoids this

#

And ofc you can only handle one connection at a time

cloud spruce
cloud spruce
# rapid fog And ofc you can only handle one connection at a time

well, that is kind of the same, even asyncio just takes care of one thing at a time, but it multiplexes between tasks as soon as it hits a await
with normal sockets you can use select and just read as much data as there is and then go on to the next socket with data available and you can use non-blocking io as well if you want to, but async still beats it hands down

earnest blaze
#

In non blocking mode, you've essentially recreated an async event loop minus all the syntactic sugar and native support by the language.

rapid fog
rapid fog
earnest blaze
earnest blaze
# rapid fog Oh haha well that's unfortunate

Yeah, and what's more unfortunate's that the only good alternative for windows is IOCP.
But for some reason asyncio is the only one with a wrapper for it for some reason. (Under the proactor loop)
They just didn't bother updating selectors.

cloud spruce
#

yes, it's very unfortunate that they didn't update the selectors library to use IOCP on windows

cloud spruce
# rapid fog Should I have a default read length for when the header doesn't include a size? ...

back to your original question, read the request until the empty line
and then check the headers for a Content-Length: or Transfer-Encoding: HTTP request header (which are all case insensitive)
if none of them are exists the request was done with the empty line
if one of them exists you must continue reading
for Content-Length it's simple, it's just the number of octets/bytes expressed in the header after the empty line that must be read
but for Transfer-Encoding it will be a bit more tricky (chunked encoding again)

carmine robin
#

can anyone plz help i want to make a twitter bot that runs 24/7 but i don't want to keep computer on all the time any (free) solutions

rapid fog
# cloud spruce back to your original question, read the request until the empty line and then c...

Alright, all of the other classes are just stubs, but the class that handles the connection is coming along, how does this look? ```py
class HTTPConnection:
def init(self, reader, writer):
self.reader: asyncio.StreamReader = reader
self.writer: asyncio.StreamWriter = writer
asyncio.create_task(self._handle_connection())

async def _handle_connection(self):
    try:
        while True:
            request = await self._read_request()

            # get response here

            await self._write_response(response)

            if request['connection'] != 'keep-alive':
                break
    finally:
        await self._close_connection()

async def _read_request(self) -> Request:
    header_data: bytes = await self.reader.readuntil(b'\r\n\r\n')
    header: RequestHeader = RequestHeader.from_bytes(header_data)
    body_data: bytes = await self.reader.readexactly(header['content-length'])
    return Request(header, body_data)

async def _write_response(self, response: Response):
    self.writer.write(bytes(response))
    await self.writer.drain()

async def _close_connection(self):
    self.writer.close()
    await self.writer.wait_closed()

async def main():
server = await asyncio.start_server(
client_connected_cb=HTTPConnection, host=IP, port=PORT)

async with server:
    await server.serve_forever()

if name == 'main':
asyncio.run(main())

frail tulip
#

so why cant i select SAE as my encryption method for WPA3 in my asus router?

#

i read a little online and sites been telling me how amazing SAE is compared to PSK but i only get AES?

cloud spruce
frail tulip
#

so should i choose wpa3 personal or wpa2 enterprise for home router?

#

im thinking wpa3 right? since all my devices support it

cloud spruce
# frail tulip so should i choose wpa3 personal or wpa2 enterprise for home router?

enterprise is if you want to setup authentication using RADIUS, LDAP or other more advanced authentication service
sometimes the wifi system has a built-in such server to not require the infrastructure and complexities that enterprises usually have for central credentials and authentication
if you just want a passphrase you should pick personal, if you want separate usernames and passwords for different users or certificate based authentication you and should use enterprise (in the standard there is such a thing even for WPA3, but your router/ap might not support it)
just know that there is a lot of devices that can only do "personal" and are not compatible with "enterprise" authentication (google chromecast, game consoles and such devices are just a few examples of things that are generally not compatible with enterprise authentication)

frail tulip
#

one more question

#

so the asus router offers something called "instant guard" which enables remote connection from WAN to my home router and use my home router as a VPN server

#

so that i could connect my phone to my home router VPN server when im on public wifi

#

but what kind of new attack surface would this enable by enabling this so called "remote connection" thingy?

#

because i do share folders in my LAN which is just stuff connected to my home router

#

so im a little worried lol

cloud spruce
# frail tulip but what kind of new attack surface would this enable by enabling this so called...

that depends on what technology instant guard is built on, i would have to research it a bit to know more about it
if it's based on openvpn, wireguard or the like, the router would start a local VPN daemon and open the firewall on the router for one or more ports used by the VPN daemon so that clients can connect to it to establish the tunnel, just keep your router firmware updated and use secure passphrases (if it's even based on such things or if they tie it to an asus account you need to have a strong passphrase there) for the vpn access

frail tulip
#

found it lol

#

looks like opensource stuff on github

#

i remember using IKEv2 in like 2015

#

and that its not very secure

cloud spruce
frail tulip
#

i see

#

cuz i was using V2Ray couple years back

#

and it seems that was the new hot thing lol

#

the setup process was painful tho lol

cloud spruce
#

i read something written 1,5 years ago that said that instant guard uses IPsec with AES256 (which is good) and HMAC-SHA1 (which is old and isn't very good for security by today standards)

#

i can only hope that Asus has upgraded to SHA2 or SHA3 for instant guard by now, but without more research i wouldn't know

#

using IPsec can sometimes be problematic in some network environments, so it's good if it has fallback to UDP and then as a absolutely worst case TLS over TCP if everything else is blocked

frail tulip
#

i see that is interesting

#

im not expert in encrption either lol

#

let me google a bit

cloud spruce
# frail tulip let me google a bit

if they had used wireguard they would run over udp instead, which often works better then IPsec in restrictive (or quite common with badly configured) network environments
and if it had been based on openvpn (which i think is also supported on asus routers/firewalls with a bit more manual setup and know-how required to get it right and properly secure) it would try to use UDP first and if it failed it would try to switch to TCP to get through even more restrictive network environments

#

if i understand it right the instant guard thing is kind of auto-setup if you just start the app and click the big icon to let it do the initial setup when connected to the home wifi

frail tulip
#

yeah i wonder if i could just host vpn servers on the router using other protocols or if that would be too much load on the router hardware

#

yes its auto setup

cloud spruce
#

i think asus comes with an openvpn server out of the box
unsure if they require any additional licenses and payment to use it (at least beyond the first 1 or 2 or so devices that they might have included with the purchase of the device as a teaser)

frail tulip
#

ahh thats nice

#

ill do more research then thx man!

#

🙂

ember ledge
#

Hey

#

Can someone help me

#

I got a script from GitHub

#

I’m trying to run it but I can’t figure out how to

ocean bay
# cloud spruce almost, but the application doesn't know anything about the packets it only writ...

Your talk on separation of concerns inspired me to think about this in terms of the TCP/IP model.

Below, I will try explain my mental model of how a client encapsulates an http1.1/2 request for it to be sent a server. Please feel free to correct me at any stage

  1. (I'm still a bit confused here. How does the application know to request a TCP connection instead of say, a made-up connection called the ABC connection? but anyways)

  2. The application (e.g. web browser) requests that the OS creates a TCP connection.

  3. We're now in the application layer. The application, with the HTTP protocol, creates an HTTP request e.g. GET /mypage.html. This is the raw data.

  4. The application sends the HTTP request to the os

  5. We're now in the transport layer. The OS then segments up that HTTP request into multiple HTTP request data pieces (and because of the layering, or 'separation of concerns', the OS doesn't know that it's specifically an HTTP request it is segmenting, just that it's a data stream),

#
  1. Now, with the TCP protocol, the OS creates a TCP header for each 'HTTP request data piece', and puts them in the 'data' portion of each TCP header. These are TCP segments.

  2. The network and network interface layers (I think the OS is also responsible for the network layer, unsure about the network interface) encapsulates further and the network interface layer also sends out the frame to the next device (router).

In this sense, the application does not need to know about lower-level protocols (TCP), since it just sends the HTTP request to the os and lets the os do its thing. And the os doesn't need to know about higher-level protocols (HTTP), since it just performs segmentation arbitrarily.

Could you help answer step 1, and also let me know if I've got it or am completely off track haha. Thanks

dull oak
#

so i m having a small problem with my code. i am trying to retrieve the price of a named stock at a site. running the program normally results in the price being printed. but i want to run the program without having the browser open. so i add options.add_argument("headless") but this time the price is not printed. i am thinking this happens due to the price element not leading without the browser opening. Here is the code

def getPrice(stockName, driver):
    price = ''

    try:

        driver.get('https://www.lankabd.com')

        searchText = driver.find_element(By.ID, "searchText")

        searchText.send_keys(stockName)

        price = WebDriverWait(driver, 10).until(
            EC.presence_of_element_located((By.XPATH, "/html/body/div[2]/div[1]/stocklatesttradestatistics/div/div/div[1]/div/div[1]/span"))
        ).text

    except:
        return -1

    finally:
        return price

ChromeOptions = Options()
ChromeOptions.add_argument("--ingnore-certificate-errors")
ChromeOptions.add_argument("--ignore-ssl-errors")
#ChromeOptions.add_argument("headless")
Chrome = webdriver.Chrome(executable_path = 'chromedriver.exe', options=ChromeOptions)



while 1==1:
    stockName = "ACMELAB"

    os.system('cls')

    print(getPrice(stockName, Chrome))

    time.sleep(10)
rapid fog
#

@cloud spruce Thanks for the help yesterday, just got route decorators working on my http server py @route('/hello') def index(request): items = '' for k, v in request.headers.items(): items += f"<li>{k}: {v}</li>" return f"<html><ul>{items}</ul></html>" ```txt
#localhost:5000/hello
Host: localhost:5000
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,/;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Upgrade-Insecure-Requests: 1
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: none

rapid fog
#

Got the most important status codes working already ```py
STATUS_NAMES = {
200: 'OK',
404: 'NOT FOUND',
418: 'I'm a Teapot!',
}

#

flawless 🍵 ```py
@app.route('/teapot')
def teapot(request):
resp = Response(
status_code=418,
body="I'm a little teapot, short and stout, tip me over and pour me out!"
)
return resp

buoyant dove
#

anyone have any experience with gunicorn, aws sqs and flask? I'm trying to poll for messages while a flask server is running.

cloud spruce
cloud spruce
# ocean bay Your talk on separation of concerns inspired me to think about this in terms of ...

yeah, it's mostly right
and as to how the application knows to request specifically a TCP socket from the OS, that's all down to the application code that the application programmer/developer has written
to get a TCP socket over IPv4 from the OS towards a destination in python you would so something similar to:

import socket
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
    s.connect(("www.google.com", 80))
```where `socket.AF_INET` means IPv4 and `socket.SOCK_STREAM` means TCP, for UDP one would use `socket.SOCK_DGRAM` instead
then you have a socket you can write to and read from
cloud spruce
ocean bay
#

Im designing a queuing app that end users use, and an associated queuing management system for the businesses to handle the queues

1.When a user performs a queue operation (e.g. joins a queue), the server gets updated and notifies both the management system and the app. e.g. management system gets its queue updated with a new user, and the app shows the user in the queue

2.Similarly, when the management system performs a queue operation (e.g. kicks someone out a queue), both the app and management system should be notified, e.g. management system gets its queue updated with the user removed and on the app the user is out of the queue

I'm thinking of either using a hybrid of request-response and websockets or exclusively using websockets to do the 'notifying'

#
  1. Hybrid: When a user joins a queue, it sends a request to the server, and the server responds with the queue details. Then, the server opens a websocket connection with the management system to send it the updated queue. A similar workflow would then occur if the management system performs a queue operation (e.g. kicks someone out), request-response to update the management system, Then opens a websocket connection with the app telling the app the user's been removed from the queue

  2. Exclusively websockets: When a user joins a queue, it opens a websocket connection with the server, and tells the server it's joined the queue. The server then sends the app the queue details through the websocket, and also opens a websocket connection w the management system, and sends the management system the updated queue. A similar workflow would happen when the management system performs a queue operation.

Im definitely leaning towards exclusively using websockets since I imagine it'll kinda allow me to set up an event manager in the server that notifies both the app and management system easily since they'll both be using some similar socket.send() interface.

Any thoughts?

cunning garden
ocean bay
cunning garden
#

If they need real time updates on their move in the queue, then a websocket would make sense to receive updates. But doing so would decouple their presence in the queue from receiving updates and helping resolve issues like disconnections

ocean bay
# cunning garden I would use a http request/response

The only reason im considering websockets instead of http for when a user joins a queue is because the server will then have to send modified info to the management system through sockets, and by making everything use sockets i imagine my event manager will have an easier time doing some socket.send() to send data both to the user and to the management system instead of handling a request-response for the app/user, and a socket connection for the management system

cunning garden
#

What's the difference between your management system and your queueing system?

#

Do you control both?

ocean bay
#

there are two applications.

  1. queuing management system/queuing system/management system all the same thing,

  2. the actual app for users to join a queue

#

yea ill control both

cunning garden
#

so why do you need such strict separation between the queue system and management system?

ocean bay
#

by queue system you mean the mobile app?

cunning garden
#

The thing that receives the requests from the mobile app

ocean bay
#

do you mean the backend?

#

one sec

ocean bay
#

Separation between app and management system is because the app is for actual users to join a queue. Management system is for businesses to monitor the queue

cunning garden
#

so are you saying the management system is a html frontend?

ocean bay
#

Ye

cunning garden
#

got it.
Then yeah, using websockets to receive updates on the management frontend would make sense, with the caveat they only need one connection, not one per user

ocean bay
#

Yepp

#

Now my question still is, would it make sense to also make the app -> server, server <- app process use websockets instead of http requests, so that everything just uses websockets.

I'm afraid that by using request-response, it makes the project difficult to scale if I have more frontends that need to be 'notified' by the backend.

cunning garden
#

that's the opposite. request/response is easy to scale

#

The general pattern is:

  • request/response to get the (latest) state
  • websockets to get the updates
ocean bay
#

For example, when the management system kicks a user out, if I'm using http request-response, then I'll instead have to create a socket connection between the backend and app, and use http between the management system and backend.
So then I'd have two systems.

  1. if the app sends the update, use http for the app and sockets for the management system.
  2. if the management system sends the update use http for the management system and sockets for the app.
    With more frontends the increasing permutations seems a bit much

Conversely, if everything uses websockets...everything uses websockets

ocean bay
cunning garden
cloud spruce
prisma ibex
#

I'm not sure if it's been done before but does anyone know of any implementation of RDP protocol in pure python?

cloud spruce
ember ledge
#

Hey beautiful people I have a question
Today I've been seeing a couple of videos on burp suite...perhaps I don't really understand it much or I haven't just seen a video for exactly what I need..so here's what I'm trying to do.. The data coming through a website's websocket is what I need and I want to know if I'd be able to use burpsuite in any way to reverse engineer it

ocean bay
cloud spruce
# ocean bay Im not quite sure I understand what youre trying to say. Both the app and mana...

either works, and there is even the option of using request/response without websockets and still get really close to real-time updates if you use a notification system

but what i was answering was that in your description of the flow you were saying that the backend server should in specific situations connect to the app or the management system (which are both different kind of clients, right?) to give it an update of an event, and i'm just saying that you shouldn't count on being able to connect to any of the two from the backend server, it is the app and the management system that needs to initiate the connection to the backend server every time, not the other way around, then the backend server can talk to either client through that connection

cloud spruce
ocean bay
ember ledge
scarlet raft
#

Hi everyone.
I have this home assignment that I need to submit.
I'm need to run an Nginx load balancer for a simple flask app.
The flask app should print the IP address of its container OR local IP.
The requirement is to scale to 3 instances and use docker compose to run everything.

What I'm trying to achieve is to browse to localhost:9090 and on each page refresh, have the loadbalancer cycle the IP address of each flask app instance.

The problem is that I'm only getting the IP address of nginx server instead of the flask apps.

#

that's my docker-compose:

version: '3.7'

services:
  # Build the app services
  app1:
    container_name: app1
    # The my_var is for validation purposes
    #environment:
      #my_var: app1
    build: app
    ports:
      - 5001:5000
  app2:
    container_name: app2
    #environment:
      #my_var: app2
    build: app
    ports:
      - 5002:5000
  app3:
    container_name: app3
    #environment:
      #my_var: app3
    build: app
    ports:
      - 5003:5000
  nginx:
    container_name: nginx
    build: nginx
    # Bind the port 80 of container to machine port 9090
    ports:
      - 9090:80
    # Make app as nginx dependency service
    depends_on:
      - app 1
      - app 2
      - app 3
#

that's my nginx.conf:

# nginx will handle the connection requests
events {}



http {
    # Define the group of servers available
    upstream backend {
        server app1:5000;
        server app2:5000;
        server app3:5000;
        keepalive 20;
    }

    server {
        # Server group will respond to port 80
        listen 80;
        location / {
            proxy_pass http://backend;
            proxy_http_version 1.1;
            proxy_set_header Connection "";
        }
    }
}```
#

that's my app.py:

from flask import Flask, request, jsonify
#import os

app = Flask(__name__)

@app.route("/", methods=["GET"])
def get_my_ip():
   ip_addr = {{ request.environ['SERVER_ADDR'] }}
   return ip_addr
   #return ip_addr
   #return jsonify({'IP ': request.remote_addr}), 200
   # return os.environ["my_var"]

app.run(host="0.0.0.0", port=5000, debug=True)
last ore
#

i could add here that by default his docker-compose configures Bridge network, and somehow connects his host/app1/app2/app3/nginx in this equation.
And within app1/app2/app3/nginx is present autoconfigured internal DNS resolver allowing to communicate from nginx to app1 by hostname app1? 🤔
No idea about details. I am newbie to networking.

from host, it is possible to request app1/app2/app3/nginx only through localhost hostname
from nginx/app1/app2/app3/nginx it is possible to address nginx/app1/app2/app3/nginx only through named hostnames like app1, but not possible through localhost

scarlet raft
scarlet raft
shut abyss
#

can someone please help explain to me, what on earth the password for this ssh connection is supposed to be? im beyond lost, and have yet to find an aswer for this...please

#

for clarification, im setting up an SSH tunnel from Host VM #1 (on the left), to Host VM#2 (on the right).

#

The only password that it should be, is my VM2's root password, which its denying.

cloud spruce
shut abyss
#

yeah its giving me a permission denied, so i really want to know how to bypass that or grant permissions to this host

#

because its not saying the password is incorrect

cloud spruce
cloud spruce
# shut abyss because its not saying the password is incorrect

sorry, i don't really do DMs or calls on discord, but if you want to try to go into more details here in the open channel i can try to continue helping you here

so, if we start from the beginning, what are you trying to do?
which host is trying to connect to which host and what are their ip addresses that they can reach each other on?

shut abyss
#

@cloud spruce So theres 2 Virtual Machines running Ubuntu Linux - ip of VM#1 = 192.168.100.5 . ip of VM #2 is 192.168.100.6. Im able to succesfully chat the two via a netcat session, by running nc -lp 1234 on VM1, and connect the VM2 to it by doing nc 192.168.100.5 1234 . This far im good and understand, but netcat is unencrypted so I wanted to create an ssh tunnel over which I can run these same commands and chat.

#

I have no idea whats causing this, and have tried editing my sshd_configs file with all the google suggestions, but god knows what this password is, or permissions issue is coming from....please assist if you can

cedar forum
#

the password should just be the password you use when logging into the test account

cloud spruce
cedar forum
#

it's just the account password

shut abyss
shut abyss
cedar forum
#

from .6 can you SSH regularly into .5? ssh test@192.168.100.5

#

just remove the -L and everything after

shut abyss
#

ok let me check

cedar forum
#

also add -v afterwards if you want some debug logging to see what's going on

cloud spruce
shut abyss
#

yeah nope

shut abyss
cedar forum
#

is the account username on 192.168.100.5 also test

shut abyss
#

nope

cedar forum
#

well that's why you can't login

shut abyss
#

wait what

cedar forum
#

SSH takes the remote host and the remote user

#

you need to ssh saad-linux@192.168.100.5

#

if there is no test account on 196.168.100.5 then what are you logging into?

shut abyss
#

i see, that actually makes alot of sense

#

let me try this

#

wow, yeah so that ssh works

cedar forum
#

neato

shut abyss
#

@cedar forum thanks for clearing that up, now to actually see why my netcat wont connect to the listening port on the host

cedar forum
#

can you show all commands you've run, including the SSH one

#

you need to leave the SSH command running somewhere

shut abyss
#

this is on VM2 (the 0.6 one)

cedar forum
#

uhhh

shut abyss
#

and this is all i should need to do on the VM1 (0.5 one), is just listen for a connection

cedar forum
#

you're logging the VM into itself

#

you're on 192.168.100.5 and are opening a new SSH connection to 192.168.100.5

shut abyss
#

yeah i realized that after reading the name...but you guys said it was correct

shut abyss
#

oh wait

#

im confusing what an ssh tunnel does, my bad

cedar forum
#

okay, what you need is 3 terminal windows, one on 192.168.100.5 and two on 192.168.100.6, something like this:

192.168.100.5:

  • nc -l 127.0.0.1 1234

192.168.100.6:

  • ssh saad-linux@192.168.100.5 -L 1234:localhost:1234 (leave this running, open a new one for the next command)
  • nc localhost 1234
shut abyss
#

oh wow

#

let me verify this real quick

cedar forum
#

explaining what each of those does:

  • on .5: nc -l 127.0.0.1 1234 opens a new netcat session listening on 127.0.0.1:1234
  • on .6: ssh saad-linux@... -L ... creates a new SSH tunnel, it'll proxy any traffic going to localhost:124 on .6 to the port 1234 on .5, over the secure shell session
  • on .6: nc localhost 1234 open a session with netcat to the local end of the SSH tunnel, that'll proxy it to the remote end and eventually to the other nc session
shut abyss
#

should i clear the session? how do i exit the ssh'd instance of my 0.6 host?

#

or should i just continue on another terminal

cedar forum
#

just type exit until the window closes

shut abyss
#

ok

cedar forum
#

you've probably got shell sessions inside shell sessions so you might need to type it a couple of times

cloud spruce
shut abyss
#

ok so i did that last command, on the second terminal nc localhost 1234

#

and it did seem to connect to the listening port on VM1 (0.5), which is just running

#

I sent a message, but it immediately ended the session

#

and it shows this on the ssh terminal tab

#

sorry one second

cedar forum
#

can you try nc -v locahost 1234

#

and copy the full output here

shut abyss
#

@cedar forum @cloud spruce so it seems im having a connection refused

#

for clarity, 0.5 is on the left, 0.6 two terminals machine is on the right ofcourse

cedar forum
#

hmmmmm

#

looks like the SSH tunnel can't get to the local nc url

#

okay try change that SSH command out to uhhh

#

ssh saad-linux@192.168.100.5 -L 127.0.0.1:1234:localhost:1234

#

oh hold on wait

#

might be the wrong way around

shut abyss
#

yeah same issue lol

#

let me try that

cedar forum
#

hmmmm

#

try ssh saad-linux@192.168.100.5 -L 1234:127.0.0.1:1234

shut abyss
#

hm no, its doing the same

#

i didnt see how it would make a difference anyhow, since localhost should be the same on both machines, they're both running on my host network ofcourse

cedar forum
#

hmmm

#

let me try set up a test bench real quick

shut abyss
#

thanks alot for your in depth help man, first person to do this much

cedar forum
#

ahhhhh

cloud spruce
cedar forum
#

i've got it

#

the nc on the other host needs nc -l 127.0.0.1 -p 1234

#

it's missing the port flag

shut abyss
#

dude, i swear to god that was my first hunch

#

since on the regular netcat connection, i needed to do -p otherwise no connection was made..

#

SUCCESS! @cedar forum @cloud spruce thanks a ton guys

cedar forum
#

👍

shut abyss
#

one last question though for my understanding of this tunnel

#

when i exit the connection from the 'host (VM1)' side

#

it closes only its connection

#

and not the connection of the client (VM2), which remains open

#

however, the other way around is not the same, closing the client connection ends both connections

cloud spruce
cloud spruce
shut abyss
#

not at all lol, your help was appreciated all throughout

#

im just rushing as id been stuck here for days now

cloud spruce
shut abyss
#

if you know the reason to the question i made above actually, feel free to share

#

i somewhat understand it

cloud spruce
shut abyss
cloud spruce
#

but nc will still just be able to handle one connection at a time

cloud spruce
ember ledge
#

I feel like sharing something kinda cool I made with sockets that's in its early stages

ember ledge
#

Hey Everyone

Today I've been seeing a couple of videos on burp suite...perhaps I don't really understand it much or I haven't just seen a video for exactly what I need..so here's what I'm trying to do.. The data coming through a website's websocket is what I need and I want to know if I'd be able to use burpsuite in any way to reverse engineer it

ocean bay
#

@ember ledge Pretty sure burpsuite acts as a proxy, so it sits between your device and the server,
device —- burp suite —- server.

when the server sends a websocket msg itll go through burp suite then to your device. you should be able to configure burp suite to receive the messages and see it in the burp suite app. not sure on specific configurations tho

raven palm
#

it's pretty straightforward

#

u enable it in firefox

#

you can enable intercept in burpsuite

#

then the http requests n stuff will pop up when you do anything thru firefox

#

you can then modify and forward them

#

not sure what you mean by reverse engineer it in this case tho

cloud spruce
ember ledge
cloud spruce
# ember ledge From the web browser

then you shouldn't even need the burp suite to see the data, that should be available directly in the network tab of the developer console in chrome

ember ledge
cloud spruce
ember ledge
#

I sent the code here a few weeks back

cloud spruce
ember ledge
slow zinc
#

Good night people
I'm studying about backdoor and I sent my backdoor to my friend
But we saw that I need to be on the same network and I wanted to know how I can circumvent this
If anyone knows, please let me know!

zealous flint
slow zinc
ember ledge
#

Why do we need MAC addresses when you have local IP addresses

cunning garden
peak prairie
#

Hi Guys, I am using python to build up a virtual network. For instance, I got a graph(topology), and I need to stick configurations to each node(device) and edge(connections), which is troublesome. Because, you need to handcraft everything, making sure that each connection is valid (for example, two-end nodes should have ip addresses in the same subnet. Another one, one node has DHCP running should not connect to WAN directly.)

I want to know if there is any library serving the similar purpose as I described. For example, generating random but legit network configurations.

indigo vector
#

how can ı upload file to ftp server with python script

warm knoll
#

does anyone have examples of using flask as a HTTP POST endpoint?

raven palm
#

how could I intercept, modify, and then forward HTTP requests to a server

#

because when I use the requests library and get the headers it doesnt include things like user-agent or the values I put into the search bar

warm knoll
#

I used urllib for parsing headers for one of my projects, not sure if that would be of any use to you

raven palm
#

yea it's just Im not getting the HTTP request I want to when I use the requests library

warm knoll
#

have you tried http.server?

#

sorry idk how to help :s

hasty hawk
#

who help me

#

i have idea

raven palm
#

GET /search?q=heyowhatsup HTTP/2 Host: stackoverflow.com Cookie: prov=ba71d634-73d0-baaa-51b6-98f176c9c1e4; OptanonConsent=isGpcEnabled=0&datestamp=Tue+Jul+26+2022+22%3A15%3A03+GMT%2B0100+(British+Summer+Time)&version=6.37.0&isIABGlobal=false&hosts=&landingPath=NotLandingPage&groups=C0003%3A1%2CC0004%3A1%2CC0002%3A1%2CC0001%3A1; OptanonAlertBoxClosed=2022-07-26T21:15:03.563Z; _ga=GA1.2.1711668389.1658870195; _gid=GA1.2.1682325424.1659038292 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:103.0) Gecko/20100101 Firefox/103.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Referer: https://stackoverflow.com/search?q=heyo Upgrade-Insecure-Requests: 1 Sec-Fetch-Dest: document Sec-Fetch-Mode: navigate Sec-Fetch-Site: same-origin Sec-Fetch-User: ?1 Te: trailers

#

actually containing the search input

#

but im jusdt getting this

#

{'Connection': 'keep-alive', 'cache-control': 'no-cache', 'pragma': 'no-cache', 'content-type': 'text/html; charset=utf-8', 'content-encoding': 'gzip', 'strict-transport-security': 'max-age=15552000', 'x-frame-options': 'SAMEORIGIN', 'x-request-guid': '4f78de5b-cd4d-4b37-b0fc-8ec34a3113c8', 'feature-policy': "microphone 'none'; speaker 'none'", 'content-security-policy': "upgrade-insecure-requests; frame-ancestors 'self' https://stackexchange.com", 'Accept-Ranges': 'bytes', 'Date': 'Thu, 28 Jul 2022 20:41:05 GMT', 'Via': '1.1 varnish', 'X-Served-By': 'cache-ams21066-AMS', 'X-Cache': 'MISS', 'X-Cache-Hits': '0', 'X-Timer': 'S1659040865.319320,VS0,VE187', 'Vary': 'Accept-Encoding,Fastly-SSL', 'X-DNS-Prefetch-Control': 'off', 'Set-Cookie': 'prov=07af97fd-3330-8209-91d2-142e80334ec2; domain=.stackoverflow.com; expires=Fri, 01-Jan-2055 00:00:00 GMT; path=/; HttpOnly', 'transfer-encoding': 'chunked'}

raven palm
raven palm
warm knoll
raven palm
#

aah yea I saw that but I just realised

#

.get gets the received data not the one being sent

#

which is what I want

warm knoll
#

Takes a key Val pair

raven palm
#

I need to do .post with some empty data maybe

warm knoll
#

ohh I see

raven palm
#

thanks anyway!

warm knoll
#

no problem, I think that might help me with my next project too

ember ledge
#

any good general networking discord servers?

cloud spruce
#

this feels really dodgy and i would advise anyone and everyone to not download and execute binaries from random people or sites online, it could be very dangerous

vocal abyss
#

\ In Linux, many environment variables are ignored by the dynamic linker if the program to be executed is a Set-UID program. Two such examples are LD PRELOAD and LD LIBRARY PATH. Please explain for what reasons would the following environment variables be considered a security risk if they are not ignored:
• LD AUDIT
• LD DEBUG OUTPUT

peak prairie
#

Hi Guys, I am using python to build up a virtual network. For instance, I got a graph(topology), and I need to stick configurations to each node(device) and edge(connections), which is troublesome. Because, you need to handcraft everything, making sure that each connection is valid (for example, two-end nodes should have ip addresses in the same subnet. Another one, one node has DHCP running should not connect to WAN directly.)

I want to know if there is any library serving the similar purpose as I described. For example, generating random but legit network configurations.

ocean bay
#

So w the tcp/ip model, an http request gets segmented into multiple segments and has a tcp header added to each segment. all the segments then get turned into packets and then frames

You send the frames to a server. Does the server send an ack back for every frame or does it rebuild a request from the frames and then send a single ack for the request?

ember ledge
ember ledge
cloud spruce
# ocean bay So w the tcp/ip model, an http request gets segmented into multiple segments and...

the receiving side does not need to acknowledge every packet, it is very common that the tcp stack will acknowledge every other packet or even less often if the data rate is high enough (packets are received in quick succession)
the acknowledgement number tells the our peer which sequence number that we are expecting next and that we have received all octets/bytes prior to that sequence number
we're really acknowledging the number of octets/bytes we have received so far in the data stream rather then packets or segments as such, even though it will always align with a segment boundary
the sender needs to receive an acknowledgement before it has sent as many octets/bytes as the size of its window since the last acknowledgement it received, or else that peer must pause its transmission of data when it has exhausted its transmission window until it has received an acknowledgement, or in the event of not receiving an acknowledgement before its retransmission timeout it will need to send that unacknowledged data again

cloud spruce
ember ledge
cloud spruce
ember ledge
cloud spruce
prisma cobalt
#

that would allow you to get that exact text

raven palm
#

idk I realised that my proram needs to be able to detect input fields like the searchbar and try to actually perform a search from it

#

to get that data

#

because otherwise if I just input the link with the search in the url there's no search info that needs to be sent so it wont be in the request

cloud spruce
raven palm
#

I dont want to add it

#

I want to receive the data

#

but like I said nvm I figured it out alrdy

cloud spruce
ember ledge
#

Is there anyway to drop repetitive packets/payloads from a host? I've been looking around articles and such but I haven't found anything useful.

cloud spruce
cloud spruce
# ember ledge Mainly DoS/DDoS.

if you know the source ip addresses you can always block the host(s) it with a firewall rule
if it's http/https requests a WAF might be able to help you to a certain extent
or if all you want to serve is https traffic and you're okay with hiding your host behind cloudflare and letting them get access to all the traffic, then that might be an option
otherwise we are probably talking about either very complex open source solutions (using things like snort, sagan, zeek, suricata and prelude to stitch something together by yourself) or some expensive commercial DoS/DDoS solutions

ember ledge
#

I'm mainly trying to block L4 traffic, most DoS/DDoS attacks consist of sending a single payload repetitively being sent to overwhelm servers or whatever they're targeting. I'm just trying to find a simple solution to that. Thank you for naming a few programs that I can possibly create this firewall with!

ember ledge
ocean bay
cloud spruce
# ember ledge you can always change your devices ip but it really wouldnt change the fact that...

if you have a [dynamic] dns entry for a site/service that you're hosting and they know the dns name of that entry it won't change much at all
your probably much better off trying to automatically identify the source ip addresses of those that are abusing the service through patterns in your web logs and automatically temporary block them for x number of hours or even a few days at a time

ember ledge
#

thanks btw

burnt quartz
#

How do i make sockets communicate globally instead of locally?

flint pelican
#

Does python requests have any .content similar for post?

#

ah .text 👍

ember ledge
#

websocket packets use HTTP to format messages right?

#

What is best practice? To create the public and private key on the client and send the public key to the ssh server, or, create the public and private key on the ssh server and send the private key to the client?

cloud spruce
prisma cobalt
#

that doesnt answer his question and why would you do that anyway 😂

prisma cobalt
#

this can usually be found in your routers settings

#

basically it allows incoming connections (from the internet) past your router and allows your server to handle them itself

cloud spruce
cloud spruce
cloud spruce
sour forge
#

i was wondering if anyone knows how to make a sneaker bot

#

im new to python completly and was wondering if someone can point me in a direction or make it for me for a pay

arctic rivet
lapis forum
#

how do i get what networks my flask app is running on?

#

like in a variable

#

and not printed

faint beacon
#

Can anyone describe what netmiko is and connection handler in it im new to python

cloud spruce
errant bayBOT
#

5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.

cloud spruce
errant bayBOT
#

9. Do not offer or ask for paid work of any kind.

cloud spruce
prisma cobalt
cloud spruce
hexed stratus
#

can scapy be used on windows?

burnt quartz
mild lake
#

I'm not sure if there's a better place to ask this, but can someone make a simple script in Python or C# (unity) that uses networking to log into either backpack: (https://unsmbp.uns.nova.edu/SeniorApps/facelets/registration/loginCenter.xhtml), or Canvas: (https://uschool.instructure.com/login/ldap),

I know this is kind of a big ask, but I've tried it myself and I simply don't know enough to do what I want to do. For now, after logging in, I just want to print the HTML of the page you're sent to after logging in. Thanks.

cloud spruce
cloud spruce
cloud spruce
mild lake
#

Like I said, Python is fine too, I'm just more new to Python than C#

frosty idol
#

would mocking a request like this be a simple post request with json={...} or data={...}? Getting 520 status, usually when sending json data it didn't say form data as title at top

ocean bay
#

At 14:10 https://youtu.be/r5oT_2ndjms, the speaker says hpack works over the tcp connection not over streams.

To my understanding, a ‘stream’ is just a logical connection, where any h2 packet sent with a stream id is in a ‘stream’. similarly, a tcp connection is just an environment when a tcp packet is sent where it receives an ack back.

Im a bit confused on where hpack is located and how it can be ‘stored’ as a single instance within a tcp connection,

like is it stored within the application and decompresses the header frame(but then this would be part of the application layer and not over tcp like the speaker says),

or does the os store the hpack instance (but then it shouldnt know about the http header frame).

Please help clarify this, thanks

HTTP/2 is coming. Actually, it’s here. Right now. It impacts not only your user’s experience but also the way you need to think about your website and webapps. Let’s see how HTTP/2 came to be and how it makes development easier.

Surma is an engineer working with the Chrome team. He likes to cut himself on the bleeding edge, goes full-stack ever...

▶ Play video
real drum
#

But my nameservers work fine?

#

I also created smt like that

#

Mailinabox service

magic jasper
#
dot11b = Dot11(type=0, subtype=12, addr1=client, addr2=AP, addr3=AP)

why is it often that addr2=addr3 in these type of packets?

worn salmon
#

How can I pass some data from django to js script preferably without using this in template (I prefer storing scripts as separate files)

<script>
let data = JSON.parse("{{ data }}");
</script>```

Idk if this is a valid channel to ask but I already asked in [#web-development](/guild/267624335836053506/channel/366673702533988363/) and got sent to here
worn salmon
#

If possible ping me on reply pls

analog compass
#

what would be a very bare bones multi connection server?

ember ledge
#

what is ip data plane ?

stable bough
#

Hi. when doing socket.getaddrinfo(host, port ...), port could be string like "http", "https", ... , or int like 80; 443. Where could be seen a reference for this mapping : "svc": N ? thx

static trench
#
# bot.py
import os

import discord
from discord.ext import commands

#client = discord.Client()
client = discord.Client(intents=discord.Intents.default(),proxy="http://myproxy.com:8080")

bot = commands.Bot(intents=discord.Intents.default(),proxy="https://myproxy.com:8080",command_prefix='!')
os.environ['HTTP_PROXY'] = 'http://myproxy.com:8080'
os.environ['HTTPS_PROXY'] = 'https://myproxy.com:8080'

@client.event
async def on_ready():
    print(f'{client.user} has connected!')

@bot.command()
async def dosomething(ctx):
    await ctx.send('I did something')

@client.event
async def on_message(message):
    if message.author == client.user:
        return
    if message.content.startswith('$hello'):
        await message.channel.send('Hello!')

client.run('TOKEN')

#

can anyone help how to run discord bot using proxy ?

#

this script is working only make bot online but when type no working.

#

I already try using export HTTPS_PROXY= and export HTTP_PROXY=

#

I ask in discord topic also they don't know

analog compass
#

so, i got a docker file up and running, it starts up server.py (my server) on http://127.0.0.1:80 (i'm using fastapi and uvicorn), this has only one websocket endpoint, the root (/). however, when i connect to it i get a ConnectionRefusedError: [WinError 1225] The remote computer refused the network connection.
Yes i have done EXPOSE 80. Any ideas?

worn salmon
analog compass
#

👍

worn salmon
#

Ok

opal orbit
#
def main():
    srvr = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    srvr.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
    srvr.bind((ip, port))
    srvr.listen(5)
    print(f'[*] Listeining on {ip}:{port}')

    while True:
        cli, addr = srvr.accept()
        print(f'[*] Accepted connection from {addr[0]}:{addr[1]}')
        cli_hndlr = threading.Thread(target=handle_cli, 
            args=(cli,))
        cli_hndlr.start()

def handle_cli(cli_sock:socket):
    with cli_sock as sock:
        req = sock.recv(1024)
        print(f'[*] RECV: {req.decode("utf-8")}')
        sock.send(b'ACK')


if __name__ == '__main__':
    main()

First recv and send is ok, but after that there is always a broken pipe error, what am I missing guys?

wind nacelle
#

can someone tell me why when i send a request using python to a site it returns {"status":"error"} but when i do it in the browser with the same headers and payload it works

#

also the response code is 200

acoustic patrol
#

So i want to make a get request with a proxy that looks like this

ip.blabal.com:12323:user:pass

how do I do that?

#

oh

#

nvm

#

got it

static trench
pallid fractal
#

Hi I wanted to learn backend development (create endpoints and such). I was wondering wheres the best place to start?

loud dove
#

hey guys, i am building an app for small python code challenges, basically you can download it and solve small coding challenges. the beta version will be available soon on testflight. leave your email addresses and i will add you in beta if interested.

analog compass
#

You are making a client and bot instance

#

Which is a bad idea

#

Use only the bot instance

#

And add await bot.process_commands(message) at the end of the on_message event

#

And you might gotten the port/endpoint wrong

#

Check your proxy docs

frail tulip
#

hello peeps i managed to setup a ubuntu vm in vmware with static ip(bridged) that has the same 192.168.50.xxx as its host, i also setup static ip in the router for the host machine

#

the vm and host have different ip and can both access the internet but i cannot ping my vm no matter what

#

i tried a number of devices with dns server set to the VM's ip(192.168.50.xxx) but i just cant get the ping through

#

firewall on the VM and host are both disabled

#

the host is win11, vm is ubuntu18.04

#

i ve been trying to get this working for weeks lol

wise jungle
#

rndpkt still going at it!

#

legend

analog compass
static trench
sour forge
#

Get off my d### WORD like why u on my d### you not even a mod or admin

ember ledge
#

using pycurl.Curl(), how can i get the json response, the text and response_code? this syntax is weird, and im not entirely sure if im doing it correctly

small delta
jade aspen
#

Anyone have any experience using the EasySNMP library? From reading the documentation (https://easysnmp.readthedocs.io/en/latest/session_api.html) it looks like there's no way to create a session where you can specify a separate read and write community strings. It looks like it attempts to use whatever is passed to "community" for both read and write. Does anyone know if there's a way to create a session instance with a separate read and write community string?

This seems kind of silly because most SNMP devices don't use the same community string for both read and write. I know I can just create a new session using the write string for write operations, but ideally I'd like to use the same session instance for both.

ocean bay
#

What is the difference between tcp flow control and http2 flow control.

More specifically, with window_update frames that work on the whole connection vs tcp window size.

To my understanding, window_update frames that work on the whole connection, works by a sender being allowed to send as many octets as agreed upon by the initial window size in the settings frame, the receiver then sends a window update frame to tell the sender their buffer is free and the sender can again send octets equal to the initial window size determined by the settings frame.

with tcp flow control, each ACK by a receiver contains a window size field that tells the sender how many remaining octets the sender can send.

This seems redundant to me. With TCP you’re telling the sender the updated window size after every packet gets received and with http2 you wait until all of the octets are received before sending a window_update frame saying your buffer is free and to send octets equal to that initial window size again.

Why the need for these two flow controls? Why couldnt http2 just rely on tcp’s flow control?

lethal fulcrum
#

isn't it because you can have multiple http2 streams in single tcp connection? just guessing, don't know real answer

ocean bay
#

I get the use of window update for flow controlling individual streams

lethal fulcrum
#

oh yea just found that: both endpoints maintain stream level and connection level windows. hmm that indeed looks redundant

normal oyster
#

how do i connect to other computers from who are on same wifi as me

#

using python

#

without reverse shell

#

like this

#

both computers connected to same network

#

me

#

connecting to other computer just using ip, port and same network

#

i know there is a way

cunning garden
normal oyster
#

my friend told me that is possible :/

cunning garden
normal oyster
#

oh

cunning garden
# normal oyster oh

If you want to connect to a host, there must be something listening on a port. Which means there must be an application opening up a socket to listen, which means there must be an application running there.

normal oyster
#

so you mean reverse shell

#

client and server

cunning garden
prisma cobalt
# normal oyster like this

the target computer needs to run a server script and your computer needs to run a client script (if your the one wanting to connect to them)

normal oyster
#

i know

prisma cobalt
#

once the server is listening on an address like recursive_error said, its easy as pi

tawny valley
#

So, I wrote some code today and ended up using socket conns as dictionary keys. While writing I was thinking "this feels like a stupid way to do this and it probably won't work". And then it worked. Anyway I felt like telling someone who might care

#

A short explanation is the tcpip.server can have multiple simultaneous clients (likely up to 60+ eventually) and they send data that gets passed via queues to a gRPC client/server and I needed a way to associate responses back to the proper client

tawny valley
#

I just dreamed up a better way... Key it by socket.r_port. that will be equivalent and not a dumb key

boreal arch
#

Im trying to get IPv6 of the matchine running the program.
I tried gethostbyname which is states in document but it gives local ip.
I now trying a aproach of doing with os.system("cmd /c ' ipconfig' ")
it gives the whole ipconfig I want to get just IPv6 part

#

how can I do it

cedar forum
#

you're not going to get that from ipconfig

#

you need to use a service on the web

tawny valley
#

No, my thing is a local socket connection. I definitely should use the remote port

cedar forum
#

right, but then you just said it gives the local ip

tawny valley
#

You're mixing up two conversations I think

cedar forum
#

oh

#

wait

#

yeah i replied to the wrong message hahaaha

#

my bad

tawny valley
cedar forum
#

oh they left anyway lol

tawny valley
#

Dang. I thought you were going to have an interesting insight on my thing :/

#

Rip

cedar forum
#

other than it makes sense that things work as dictionary key given how computers represent network conns

#

it'll give back a file descriptor which is a monotonically increasing integer which makes it very suitable for hashing

tawny valley
#

Yeah. It was an interesting problem though

#

Because I had to encode my command reference into the reference that went out via gRPC and then translate the reference back to figure out which connection I needed to queue the response to

#

Pushing multiplexed messages through a singleplexed pipe

cedar forum
#

ahhh

left aurora
#

Hey guys! I have a question. I am going into college-level network security classes, and I've never worked with network security or networks in general. Any videos I could watch to help me get a leading edge?

ocean bay
#

So does a router send a packet or a frame? I always thought a router decapsulates a frame, read the L3 data, then re-encapsulates the frame to send it to the next router, and the process repeats.

https://networkengineering.stackexchange.com/a/56644/84919 This first paragraph of this answer explicitly says it sends a packet. The router decapsulates the frame, reads the L3 data, then sends off a packet to the next router. Then the next hop router rebuilds a frame for the packet so that it can strip it off again? I'm not sure about that last part about the next hop router.

In any case, in the last paragraph, the answer suggests that routers do send frames, but the layer 2 protocol is just different e.g. PPP.

Could someone clarify this for me? Thanks

wise jungle
#

where is @cloud spruce

#

i aint see him in a while

quasi wraith
#

so we were assigned minor project for semester 5 ....and since my specialization in course is cyber security I have decided to work on network analyzer and visualizer(graphs and plots)...and I have recently got to know about networkx library in python..and I want to make everything with python so if anyone has ever worked with analyzing and visualizing computer networks then I would like them to guide me a bit

tawny valley
#

Do you have a typo in the above?

lofty bough
#

Is there some variant of Happy Eyeballs but with a different timeout for each option? Is it even a good idea?

#

I it is a good idea, in what order should I try the connections? Smallest timeout to biggest, or vice versa? Or maybe it's irrelevant without failure rate information?

ember ledge
#

Whats netowrking?

ebon silo
#

in networking, how would you call some information exchange between the server and client. I'm basically looking for the term I should use to name one of my base classes. I already have a packet, which can be contain some data and be sent or received, but I'm not sure how to name a class that performs some longer communication that should still be groupped, such as for example the initial handshake, where some data/packets are sent, but also received, I'm thinking of names like 'transaction' or 'interaction', but I'd like to use some conventional term if there is one

prisma cobalt
#

How’s “connection “

ebon silo
#

I'm not sure that's really what I'd want, since there can be multiple transactions like these done during a connection

prisma cobalt
#

<@&831776746206265384> this link is a scam

#

so many redirects to finally see "youve been infected with a virus" which is a shame because i was actually looking forward to learning about networking in docker

prisma cobalt
ebon silo
#

client: connects to server
server: accepts the connection
-- Handshake transaction
client: sends their username to the server
client: sends their public key to the server
server: receives the username and public key
server: sends it's public key to the client
client: receives the public key
-- Some other transaction
...

orchid basin
#

Hi, I'm trying to develop a websocket client that connects to WilliamHill server and reads realtime data. But it sends me only binary data. Is there a way/practice to handle this data?

URL:
wss://scoreboards-push.williamhill.com/diffusion?ty=WB&v=16&ca=8&r=300000&sp=%7B%22src%22%3A%22traf_sb_football%22%7D

Data returned on connect:
b'#\x10d\x1f\xbe\xd4\x1dMe\x92C\x00\x00\x00\x02\x00#0-fSe40w+NZgS9cc78a0xdYZ2S\x00\x00\x00\x00\x00\x01_\x90'

#

This image represents what the browser sent after connected.

dense geode
#

how do you do this curl command in python?

curl 
--cert $CERT_FOLDER/client-cert.pem 
--key $CERT_FOLDER/client-key.pem 
--cacert $CERT_FOLDER/truststore/ca-cert
https://localhost:8080/echo -X POST 
-d '{"a":"test"}'
mental epoch
#

Depends on the library you're using, but it should look mostly the same in all of the same

#

I'm assuming the part you're having issue with is the certs

keen glen
#

what is the difference between udp and tcp and which is better

drowsy smelt
#

Good evening team!
I have an important question. I was wondering what everyone thinks of Mimo Dev. Should I apply for the course they offer?

jaunty wasp
#

how to make a proxy server using python

cedar forum
#

they solve different tasks

#

TCP is intended for communication which is fast, but can handle network congestion and will resend any packets that get lost along the way

#

It ensures that all packets at the receiving end will be collected in the exact order of sending

#

UDP is intended for fast realtime communications, if UDP packets get dropped, they are not resent, if they are received out of order nothing is done, it's better for things like video calling or multiplayer games where it doesn't matter if a single frame or something was dropped, you just want to get a good enough amount of data transfer in a non-specified order

quasi wraith
#

anyone here worked with networkx package?

fallow valve
cedar forum
#

^, vast majority of UDP/TCP is unicast, going from one host to another host

#

it's just that if you do want to do broadcast/multicast/anycast, UDP is much more optimised for that because it doesn't have a handshake, meaning that multiple devices can receive the same packet and be satisfied with it

prisma cobalt
#

what is a UDP socket then, sockets as a concept define 2 communicating endpoints but UDP doesnt require a connection or anything, you can just release a packet into the wild

cedar forum
#

you can just release a packet into the wild, but it's still directed from somewhere and to somewhere

#

which in my books, are two endpoints 😄

ocean bay
cedar forum
#

The router receives a frame destined for it, but that frame alone can't tell it where it is to go next, so it decapsulates the frame, gets the L3 data including next IP, then it looks up that IP in it's ARP/NDP table, creates a new L2 frame and forwards that on to the next router in the chain

#

the confusion arises because the packet remains the same across the whole transmission, but at every router the old L2 frame is discarded and a new one created

ocean bay
cedar forum
#

👍

dusty olive
#

Sorry I’m a bit lost with the channels where can I go to get advice as what to do as a a beginner?

ocean bay
#

So what’s the point of framing the packets then if routers don’t even read it?

#

I’ve seen so many posts talking about how routers don’t care about L2 data and only read the L3 data and forward packets based on IP. So what’s the point in repeatedly framing them?

cedar forum
ocean bay
#

In a non ethernet network

cedar forum
#

and local networks are routed based on L2

ocean bay
# cedar forum and local networks are routed based on L2

Me sending packets to a google server in another country. why should my router repeatedly frame the packet? My router shouldnt be physically connected to the next hop router that gets it closer to google (and thus they shouldnt have a switxh between them)

cedar forum
#

they absolutely will have a switch between them

ocean bay
#

Oh

cedar forum
#

you might have say

#

10 or 11 hops between your laptop and google

#

the only bit of that which isn't ethernet/switched is in your home

#

it gets to your router, your router connects to your ISPs routers/switches, and then it's just a path of routers and switches until you reach the destination server

#

it's true that L2 is only used for communication on adjacent networks, but that's not a minor job, bear in mind there will be layer2 networks with hundreds of nodes

ocean bay
cedar forum
#

on the network i'm currently on, my laptop is connected directly to the switch

#

if i was to connect to my wifi AP right now, it'd just be adding a hop to get to the wifi router, which then goes physical to the switch

#

and L2 is still used on wifi networks

ocean bay
cedar forum
#

any IEEE 802 layer will use MAC addresses https://en.wikipedia.org/wiki/IEEE_802

IEEE 802 is a family of Institute of Electrical and Electronics Engineers (IEEE) standards for local area networks (LAN), personal area network (PAN), and metropolitan area networks (MAN). The IEEE 802 LAN/MAN Standards Committee (LMSC) maintains these standards. The IEEE 802 family of standards has twelve members, numbered 802.1 through 802.12,...

#

yes

#

or well, i've yet to see a switch which isn't physical lol

ocean bay
#

as in the two routers arent connected via ethernet but rather via wifi

cedar forum
#

the wifi AP has an Ethernet running into the switch

ocean bay
#

youre saying every router in the world is connected via ethernet?

cedar forum
#

every router has an Ethernet port in the back, probably going to a modem, which goes to your ISP

ocean bay
#

oh wtf haha thats so neat

cedar forum
#

the wifi AP there goes into the switch you see in the cabinet which in turn goes uhhh

gloomy root
#

The world is connected by wires

cedar forum
gloomy root
#

And then the sharks eat the cables

ocean bay
#

wrong reply but my point still stabds

ocean bay
cedar forum
#

the smaller of our switches but the smaller Cisco catalyst is a real nifty little switch

cedar forum
ocean bay
#

But theres no switch connecting it to the router

cedar forum
#

your phone connects to the router over wifi, that is the physical link, the router then connects to your ISP

#

and that connection to the ISP will probably be to your ISPs switch, it will probably not be a LAN protocol but it will be L2 (like PPP)

#

I found this non-smart switch earlier, amusing stuff, maxes out at 100M, making it completely useless to us hahaha

#

nearly found it's way into my coffee table but it's already full

ocean bay
#

Switches are all physical. I don't see a switch on my phone. So my phone doesn't actually need a switch to forward its frames to the ISP switch, since it can use wifi. Thus, MAC addresses are not actually necessary for packet transfer. Thus, using wifi, L2 can essentially be omitted. Does that mean that if the world connected all the routers via wifi instead, you could remove L2 altogether?

cedar forum
#

Wireless routers are an addition to the network stack in order to allow phones and whatnot to connect

#

Switches are absolutely necessary for transfer, remember how switches work, instead of copying packets onto every interface they direct packets based on L2, and they often have considerably more ports than a router, even a professional one, switches are just as powerful as routers and neither are things that are "unnecessary"

ocean bay
#

My main confusion is I don't see a switch on my phone

cedar forum
#

You do need L2 routing, even on wifi you need L2 because remember that if you try contact an adjacent device the lookup uses L2 and is routed on L2

#

Yes, because you're not connected to the switch

#

Your router is connected to your ISPs switch

#

That's not in your house, that's probably at your local internet exchange

#

Critically, you keep saying things along the lines of "if we route on IPs we don't need L2", remember that there are other L3 protocols which don't even have the concepts of IP addresses

ocean bay
#

Ahh I see

ocean bay
# cedar forum You do need L2 routing, even on wifi you need L2 because remember that if you tr...

Ahhh so do you mean to say that over wifi there's an alternate data link protocol that isn't mac addresses and doesn't use ethernet, that doesn't need a physical switch that can let my phone send packets to the ISP switch?

My router is connected to the ISP switch and that is how my router can send packets to all the other routers in the world through L2, mac addresses, arp and all that, that part makes sense to me.

I am still confused tho on what L2 protocol allows my phone which is on wifi and not connected to any ethernet, to send packets to my router/ISP switch, if L2 works on an ethernet basis

cedar forum
#

L2 doesn't work just on an Ethernet basis

#

Ethernet frames are one form of L2 transmission

#

IEEE 802.11 is part of the IEEE 802 set of local area network (LAN) technical standards, and specifies the set of media access control (MAC) and physical layer (PHY) protocols for implementing wireless local area network (WLAN) computer communication. The standard and amendments provide the basis for wireless network products using the Wi-Fi bra...

#

There's a whole set of protocols in the 802 family https://en.wikipedia.org/wiki/IEEE_802 if you expand Working Groups

IEEE 802 is a family of Institute of Electrical and Electronics Engineers (IEEE) standards for local area networks (LAN), personal area network (PAN), and metropolitan area networks (MAN). The IEEE 802 LAN/MAN Standards Committee (LMSC) maintains these standards. The IEEE 802 family of standards has twelve members, numbered 802.1 through 802.12,...

#

Ethernet is 802.3, WiFi is 802.11

#

They're the most common two

ocean bay
#

That wiki article looks promising as an answer, I'll read up on that article and this topic some more since I'm clearly missing something. Thanks for being willing to discuss always a great help!

keen glen
#

also can run a python server on WLAN

#

???

cedar forum
#

You're going to have to explain that one a bit

#

Your laptop is connected to your WLAN network, you can run Python on your laptop which binds to that WLAN connection if that's what you mean, but if you want it publicly accessible you'll need to set up port forwarding

#

Christmas came early

unique hamlet
prisma cobalt
#

@ocean bay MAC addresses are used for communication between computers physically connected by wires
IP addresses are more "routeable" which means that they can be used for computers that arent connected to each other
for example, A wants to send data to C, since its not physically connected, it cant just send data over a wire, instead it has to rely on intermediaries (B)

#

A surrounds its data with more data that says its destination is C (ip address)
A cant send the packet directly to C but it knows that B could try
A surrounds the data with more data that says its immediate destination is B (MAC address)
B receives this data but when it unwraps it, it sees that the data wasn't intended for it (MAC address)
B see's that the intended destination is C so it wraps the data with some more data that specifies the hop between B and C (MAC address)
C receives the data and sees that its the intended recipient, it also see's that it was A's ip address that originally sent it

#

an Ethernet frame contains the MAC address
the ethernet frame encapsulates the IP header which specifies the destination IP address

#

thats a nice image to describe the different layers

#

Just to clarify as well, the internet is made up of wires. The wireless stuff happens only at the very very beginning when your device is talking to a WAP. The data is then converted to work on wires as shown above

#

God I love networking

blazing night
#

if a computer has a damaged LAN card, will that prevent an ethernet cable from working?

#

or are they completely separate?

prisma cobalt
#

so to answer your question, they are seperate

blazing night
#

thanks, thats a relief to hear nikosigh

#

google wasn't giving me any straight answers on if the cable would keep going even if the card stopped working, and i've been having some really annoying issues with it uninstalling its own drivers at random?

#

so that gives me some peace of mind, thanks nikoThumbsUp

prisma cobalt
ocean bay
prisma cobalt
#

wireless access point lol, certainly nothing else 👀

ocean bay
#

ayo haha

ocean bay
ember ledge
prisma cobalt
#

lmao

ember ledge
molten jay
#

For applications that require diverse clients intercommunicating like for example a video feed or a udp based game client, how from the application side is the destination IP determined or configured? I am a traditional network guy and I understand that on the network/server side you can use multicast groups to deliver that content, but I cant figure out how the application itself knows who to reach out to.

Anyone know/have any experience with this?

green fiber
#

Anyone hazard a guess to why (on a newly registered domain & new web app) would traffic be successfully routed to the app on mobile devices (ipad, iphone) but when attempting to hit in a browser on Mac / PC, gets the landing page for FastHost as though it's not hitting anything? 😄

tranquil trellis
#

am I understanding this routing table crrectly?

molten jay
#

@tranquil trellis
seem correct, but it looks like either there is a layer 2 switch or subinterfaces between 172.16.1.2 and 1.3

#

Or just a bad way of diagraming a lan segment given the number of devices

tranquil trellis
#

I have no idea how to configure this in packet tracer

indigo spade
#

I"m currenly having DNS_PROBE_POSSIBLE error while trying to access my website. I saw that my domain got expired which i've paid the renewal fee. But i'm still getting the DNS_PROBE_POSSIBLE error on my browser. My nameservers configurations are all good as i didn't update that from it's previous working state.

What should I do to resolve this ?

ember ledge
#

I'm fairly new to IPTABLES, I understand that NAT is before INPUT in the process of handling packets.
I am currently trying to use my VPS to proxy my main server for learning and security purposes.
I have blocked all https://check-host.net/ servers WHICH works, I can't connect to my SSH port but my proxy port is allowing https://check-host.net/ servers to connect to my proxy port which means my DDoS protection IPTABLES are not taking effect on my proxy port. How should I go about fixing this issue?

#

I should add that my proxy tables are in NAT and my DDoS tables are in INPUT and OUTPUT.

high jolt
#

Hello guys, anyone can help me ? I soft brick a ap wireless, surfing in the network I find one exploit to unbrick but is in python and I don't know nothin about it, can help me please ?

ember ledge
#

if anyone here at any point has played with liveoverflows mc proxy please help me i need a sanity check

hushed birch
#

I'm trying to find a ballpark figure of what bandwidth costs at the transit level, e.g. from the people running the undersea fibers etc.
CloudFlare has some blog posts comparing costs between regions but was careful not to include any real dollar amount. Does anyone has a ballpark figure?

cedar forum
#

if you get a blended connection provided by someone else you can sometimes get it around that/cheaper

#

however, the nature of transit is that costs are going to differ based on your location, your datacenter and at times even the location within the datacenter, so it's hard to say without getting a quote what a definitive baseline figure is

#

if you go for a tier 2 that price sooooars down, then you're only paying colo fees which you're looking at anything from $45 to $300 per U per month

#

depending on what the colo provider is offering, the quality of the DC, etc.

queen axle
#

Can somebody explain why there are four ipv4 addresses

cedar forum
keen glen
#

does anyone have good articles on P2P(peer to peer Network)?

wise jungle
tranquil trellis
#

anyone free to help me out with my packet tracer assignment?

keen glen
wise jungle
#

or Plug n play

#

its a way to use Peer to Peer without the middle man(servers)

keen glen
wise jungle
keen glen
#

but if you do p2p when ever one is connected to router do you still need port fowarding

wise jungle
#

no

#

local host doesn't need port forwarding

keen glen
#

@wise jungle do you thinks it better to use a lib for this or write my own code

wise jungle
#

lib

#

i think there is Pnp in sockets

#

if not im sure there is a lirbary

clever jackal
#

Hey there i am transmitting 2 numbers from the client to the server in the same message (using sockets).

How can i find those 2 numbers and make them into separate variables?

Message from client:

99 85

Current code:

        data = str(data)
        data_x = data[0:1]
        data_y = data[1:2]
        print(f"X: {data_x}, Y: {data_y}")

Current output:

X: 9, Y: 8

Problem: It is printing only the first digit of the 2 digit number that can change to 1 digit number.

What i want:

data_x = 99
data_y = 85
clever jackal
visual eagle
#

Hi looking to speak, want to hear about more experience in the industry

wise jungle
#

we will not just give you the solution as its pretty clear what the issue is

clever jackal
clever jackal
#

So don’t expect everyone to have the same amount of knowledge that you have.

#

Because I wouldn’t ask if I would know what is wrong.

wise jungle
#

jumping into sockets then as a beginner is a huge leep

#

you should learn more python before jumping into sockets

clever jackal
wise jungle
#

ok so there is this function called split

clever jackal
wise jungle
#

and you can split strings by however you want

clever jackal
wise jungle
#

yea you can find some good explanations in stackoverflow

restive blaze
#

Most python apps don’t need sockets. HTTP or websocket works fine.

ocean bay
#

How does a receiving device know what protocol is being used in each layer. e.g when a dns server sends my computer back a packet, how can my computer know that the packet’s L3 is the ip protocol, its L4 is udp and the application layer is dns?

restive blaze
#

Receiving device can look it up but it rarely cares

ocean bay
restive blaze
ocean bay
little plank
#

A little unrelated, does anyone know how to disguise my computer when I connect to my wifi, I want to show up as an android phone or etc.. when I am using windows

ember ledge
#

Interesting question, as a kid i used to play with a nintendo 2ds and there was a feature where you could connect to a other one wirelessly without wifi, near by like Bluetooth, does any one know what protocols they used to transfer data very quickly for games like nintendo super smash bros, i tried to search on google but the answers werent really exactly what i wanted and were quite foggy in terms to answering the question i have.

cedar forum
pale moat
#

Is there any way to write a program that handles accepting socket connections instead of windows doing it?

gloomy pulsar
#

Anyone in Georgia? I have no friends that code😭

crystal cave
#

I dont even have friends

quick galleon
#

I have a backend for an iOS app I did with Flask. It’s been running fine for a year now. It’s pretty simple with only maybe 70-80 API calls for CRUD for various more or less complex data types. I now started to slowly port stuff to FastAPI. I was somewhat surprised to see that for the absolutely trivial stuff that I’ve ported so far that Flask is faster. I had hoped to see the opposite as my backend is already glacially slow.

#

FastAPI is so much nicer to work with though, so users will just have to wait some hundreds of ms longer per API call.

#

FastAPI is running via uvicorn (all defaults) and Flask via uwsgi (minor settings tweaked). Both on the same server against the same Postgres db.

#

I hope there’s some magical options that can be tweaked to at least halve the response time.

#

The endpoint I’m now looking at is one that doesn’t even do any authentication or data validation, which seems extremely slow in FastAPI, but it’s simply a “ping” type call that I call from Pingdom. As the call is executed every minute or so I have some statistical data to look at, so it’s not just a few curl calls and quick conclusions.

#

Interesting that there is no dedicated channel to backend cruft, I guess this channel is more about bytes, sockets and Nagle than REST.

#

Ok, it seems to be a common problem that FastAPI is slower API than Flask. You have to be an expert at tuning the whatever thingiemagick is running it in order to get comparable performance to a default Flask.

https://github.com/tiangolo/fastapi/issues/2690

GitHub

I'm new to fastapi and I'm trying to test speed between fastapi and flask, but I didn't get a better result by fastapi. pls tell me if I'm making anything wrong? Exa...

#

I had hoped a tool meant for API:s would be massively faster than a tool meant for serving web pages.

last ore
#

It should make optional usage of resources in fastapi, equal to resources used by flask

#

Then u could see if fastapi has better performance

#

Although may be uvicorn can run in multiprocess too 🤔

ember ledge
quick galleon
ember ledge
#

Hadn't considered that angle. How fast would you say it is compared to say, Flask-Restful or RestX?

#

I've found Flask API frameworks to be quite easy to setup, a few minutes of work give or take, can't imagine how you could streamline the process even more

prisma cobalt
# wise jungle ok so there is this function called split

its not splitting, its slicing. they are not interchangeable!
also:

as its pretty clear what the issue is
if someone asks a question and they are trying to understand... this isnt particularly useful
maybe to you the problem is obvious but it can be frustrating to hear someone tell you that
to help, you could answer their question or at least point them in the right direction, even if that is just saying "it might be better to open a help channel"

prisma cobalt
#

i guess you could say the effect is similar to port forwarding but they arent the same

wise jungle
gloomy root
# quick galleon Ok, it seems to be a common problem that FastAPI is slower API than Flask. You h...

Realistically most applications are all the same speed, the framework will make essentially do difference. Because you application is only as fast as the slowest thing, which is normally the DB.

The advantage of FastAPI over flask is the fact it uses asyncio, which means you gain the ability to handle multiple concurrent connections on the same thread, so while one request is waiting on the DB for example (via an async driver) other requests can be processed. However, this does have a limit because again, normally the database will have a limit and if your app has a bunch of queries with JOINs if you're in the SQL world, you'll likely top out at about the same as Flask + Threading.

If you're just 1:1 pasting flask code to fastapi and expecting it to magically be faster, you'll have a hard time, because the only way you'll get any performance improvements is if the server can do multiple things per thread, so database connections need to be async, things need to not block the event loop, etc...

prisma cobalt
wise jungle
#

it does technically auto port forward

restive blaze
near totem
#

Hi is there anyway i can get this to not return 127.0.0.1?

import socket

HostName = socket.gethostname()
IP = socket.gethostbyname(HostName)
print(IP)
cedar forum
near totem
#

192.168.x.x?

cedar forum
#

riiiiight

#

so

#

you can kind of hack that a little bit with socket

#
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(("8.8.8.8", 80))
print(s.getsockname()[0])
s.close()
#

it assumes you've got internet and works by opening a connection and seeing which IP was used to open that connection

prisma cobalt
near totem
#

Oh ok thx

dull sedge
#

How do I parse incoming GET request? Looking for specific header key:value to respond to to verify a webhook address

#

I feel like ive been reading information wrong. For example I print request.url and its my webhook address, which I would think would be the host_url

quasi smelt
#

Hey how do I implement dependency injection in a python socketio event listener .

#

The socketio instance is hooked to fastapi

#

Any help would be appreciated!

#

🤝

mossy terrace
#

any with relevant experience/knowledge, please @me

ISM (Rockwell)
Trainee Responsibilities:

  • Participate in training in: VMware vSphere, Cisco CCNA, Microsoft Servers

  • Self-study related to networks and virtual machines

SOME START-UP
Analysis and identification of errors reported by platform users,

Direct and remote support for users of software (first line of support),

Resolving system requests (including granting privileges, password resets, answering functional questions).
What they offer
Development in the environment of new technologies (internal and external training, conferences, training budget),

Creating and supporting SaaS projects,

Startup atmosphere with a partnership approach,

About them
Just remember, in NAME you are not only a programmer. You are the next brick (there are already 50 of us) who is invited to work with us on a long-term basis. With us, you will contribute to the startup ecosystem by becoming either a mentor, an IT project leader or even an investor (as it is described above). You can also switch your career path and turn into an entrepreneur with NAME venture building – our acceleration program for the early-stage startups.

analog compass
#

!paste

errant bayBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

analog compass
#

anyone have a webscraper? i want to find every url in the site that has a specific string

cloud plover
#

I have some basic doubts related to networking

#

the layers

#

is there anyone available?

snow walrus
#

how do i check whether the port on which im trying to run my react project is free or not? If its not free, how do i change it?

ember ledge
#

hello

#

anyone here?

quasi smelt
#

Hey, can someone show me how to properly do dependency injection on a python-socketio event-listener's callback function?
I need dependency injection to check the priviledges of a user and then return the user.
I need it not to happen in the func's body.

#

Thanks in advance

sour forge
#

fym

#

get off my d###

#

word

zealous flint
#

The default should be 3000

#

Though usually tools like vite will tell you which URL it's running on

thorn vault
#

Hi everyone, can someone help me with a few questions I have about GCP

#

I'm currently doing a quiz but somehow i cannot manage to achive more than 67%

steep musk
#

@ember ledge @wise jungle please discontinue this conversation here and DM @small mango if any further issues.

and just fyi for all, all users are welcome to inform one another of our rules, not just mods and admins

#

i think i pinged the wrong person

inland basalt
#

Hello, could someone explain p2p to me? I seem quite confused and I'm not that good at networking either...

zealous flint
# inland basalt Hello, could someone explain p2p to me? I seem quite confused and I'm not that g...

Not an expert but have some knowledge. P2P is fundamentally different from your client vs server model which is the most common. It eliminates the server entirely (in some cases of P2P there will be an index server), but the server’s job is distributed to the users, so there’s no need for dedicated computing power, it’s instead distributed over the client machines. P2P applications will usually have a “daemon” or a background process running that’s handling part of the server’s job, for other users.

#

That’s sort of a basic level explanation. There’s a lot more into it but that’s out of my expertise

inland basalt
#

I see I see

#

thank you so much

#

but how does the client do the server's job?

cedar forum
cedar forum
#

so it's client-server-client

#

that means there is one transmission of the file from sender to server and then server to recipient

#

p2p cuts that out, there is a direct connection from the sender to the recipient without the transfer going through the server, or being sent twice

#

often there is a server involved to help coordinate the transfer, because it's very difficult when two clients are behind firewalls to effectively ensure that they can communicate directly without a server

#

that's called NAT traversal or holepunching

inland basalt
#

Oh wow that makes a lot of sense

cedar forum
#

p2p used to be a whoooole lot easier, so a lot of older multiplayer games and software for sharing files (sometimes not so legally hahahaha) worked around p2p

#

now that we're running short of IPv4 addresses, people are using stricter firewalls, etc. it's a lot harder to implement p2p, but still very much possible and a lot of applications use it (for example, a lot of smart VPN software uses it)

#

they use a p2p network for any device you connect, very smart stuff, they have another blog post on how they manage to get around firewalls and traverse NATs which is frankly genius

inland basalt
#

Yeah this all sounds WAY too complicated for me to comprehend, probably because I'm lacking networking skills but I still somewhat understand

cedar forum
#

yeah it's one of those things where the idea is simple, but implementation is difficult

#

but if you're just looking to understand p2p, it's just a way of two computers, like yours and mine, communicating directly without going through a server (e.g. discord)

inland basalt
#

yeahhhhh that's the thing that I actually understood lmfao

#

but why p2p? 🤔

cedar forum
# inland basalt but why p2p? 🤔

so, there used to be a few good reasons to use p2p over client-server, main one was that since you don't have the "server" bit you don't need to pay for a server

inland basalt
#

Okayyy that actually makes a ton of sense

#

is it also faster or is performance still the same?

cedar forum
#

there is the other less "legal" benefit that it's harder to legislate and cease&decist a p2p network, because there is no central server you can shut down

#

uhhh performance can vary

#

depends on how good your internet is, how good the other peers internet is, how many peers you're connected to

#

if you imagine a large p2p network you could have hundreds of clients sending and receiving data from your computer, which as it grows is going to be less performant than having a server

inland basalt
#

ahhaaaa

cedar forum
#

but p2p is still everywhere and used everywhere, on the network I operate we've just enabled a thing so that windows machines can download Windows updates from each other instead of going to the central Microsoft download server

inland basalt
#

oh wow lmao

#

seems like fun for a side project tbh

cedar forum
#

it is -- if you're on a local network (i.e. your home router) and not going across the network, it's very much feasible to set up a p2p network and play around with it

inland basalt
#

Does p2p have any vulnerabilities though? Would the other peer be exposed to some sort of vulnerability

cedar forum
#

discord is client-server and as a result when you join a discord voice call your IP does not go to the other person

#

conversely, from what I recall, Skype is p2p, and so when you're in a Skype call, your IP is leaked to all those in the call with you

inland basalt
#

Ahhaa I see

#

Well I really appreciate your time and thank you so much for explaining p2p further

#

I was honestly confused at the very beginning but now I understand the idea of it

zealous flint
#

Trace the connection, change the packets, whatever really

prisma cobalt
zealous flint
prisma cobalt
zealous flint
#

🤔 actually not sure about that. don't quote me on it

prisma cobalt
#

Like, if the service doesn’t have a main server backing it, is the index server just one that people using the network volunteer to host?

#

But that raises the problem of who knows where to initially connect to the index server

#

You need a recognised entity to host it for decentralisation to work right?

cedar forum
prisma cobalt
#

I looked at the tail scale resource you sent, very interesting and in depth

cyan bear
#

Does anyone here think they can create a forex copier software? One that can charge both monthly and performance fees? Message me if you do

ember ledge
#

Hello does anyone know what browser is faster brave or vivaldi by performance??

ember ledge
#

Hey, quick question regarding Cloudflare

#

I just set up my site to use Cloudflare and now its blocking requests from my Python script

#

What settings should I change through Cloudflare to avoid blocking the requests?

#

I accidentally tinkered with a few settings and now it doesn't work. It was working with Cloudflare earlier

ember ledge
#

they say POST requests are about submitting data to create something in a server. but I was just doing something with curl -X POST ... (mostly tokens as the data) and there definitely is a json response back. so I dont think I understand the distinction between GET and POST anymore if POST gives back a response too

bronze anchor
#

@ember ledge often you want to create something and then get back some info like its ID or an error message about why it failed

stiff mirage
#

it is going to say what is being blocked

tender hemlock
cinder isle
#

Hello, I’m creating a python script with socket so I have clients and my server when a client logs in for the first time it gets a generated ID that will be transmitted to the client and will be stored in the server as a.json file and I would like to know how do so that when I type "show_connections" it displays in a rich.table table the list of connected clients by writing in the table their public ID and IP. Thank you

zealous flint
tender hemlock
zealous flint
tender hemlock
#

That is indeed odd as is my situation.

timber cliff
#

Is it difficult to setup my own machine so that i can access it for example with putty from another machine?

zealous flint
cunning garden
#

And set up port forwarding on your router at home, if it is meant to be accessed from the Internet to your machine.

Note that if you make it available on the Internet, I would strongly recommend you to at least:

  • Disable password authentication and use pub/private key authentication
  • Setup fail2ban and enable the ssh module
inner spade
#

How can I understand if a proxy is residential or datacenter with py?

shell tulip
#

hi lets do zoom meeting

cloud plover
shell tulip
#

hi

shell tulip
shell tulip
cloud plover
#

what about you?