#networks
1 messages · Page 3 of 1
Np
could someone show me the best way to begin studying networking, some roadmap or something
It's best you do your own research, but I would begin with getting a study guide for a cert if you don't want to pursue some traditional training
ok ty
Hey
So I have a server code, when I put two sendall back to back, the two messages merge, how to fix?
Can anyone here help me with python web scraping with getting when a new episode comes out for a show. I've done quite a bit already but I need a bit more help with getting to notify the user when the episode actually comes out.
yo
help
my wifi subscription had ended and i think my wifi admin just changed the dns
cuz it says dns not found
is there a way i can bypass that
If your ISP cut you off there's not much you can do
except pay your bills of course
But "DNS not found" is not always because your internet had been cut off
Could just be a configuration issue but we'd need to know more details to be able to troubleshoot that
where theres a will, there is a way
dont give up young padalin
Hey guys I'm setting up a python http.server at my home network but can't get it to work past localhost. I set my local machines ip address but no device can find it. Any tips people might know here?
I think it needs to be run on 0.0.0.0
I’ve had the same issue
Need some assistance with a assignment in python can any one pm me?
can anyone help determine the internet provider for a given IP i have
i also have something like this...consmr.mail.ir2.yahoo.com
im trying to report someone
#❓|how-to-get-help or just ask here, channels are made for this and there is no point on DMing you
8. Do not help with ongoing exams. When helping with homework, help people learn how to do the assignment without doing it for them.
Keep that in mind though 👆
why?
That indicates other machines on the LAN can connect to your server
localhost or 127.0.0.1 only lets you connect
anyone have any examples on how I can point netmiko to a CSV with a list of commands to run?
output4 = net_connect.send_command('show run')
when a client connects, add them to a list
when they disconnect, remove them
Isn't there a property in the socket object to check all connections?
!d socket.socket
class socket.socket(family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None)```
Create a new socket using the given address family, socket type and protocol number. The address family should be [`AF_INET`](https://docs.python.org/3/library/socket.html#socket.AF_INET "socket.AF_INET") (the default), [`AF_INET6`](https://docs.python.org/3/library/socket.html#socket.AF_INET6 "socket.AF_INET6"), [`AF_UNIX`](https://docs.python.org/3/library/socket.html#socket.AF_UNIX "socket.AF_UNIX"), [`AF_CAN`](https://docs.python.org/3/library/socket.html#socket.AF_CAN "socket.AF_CAN"), [`AF_PACKET`](https://docs.python.org/3/library/socket.html#socket.AF_PACKET "socket.AF_PACKET"), or [`AF_RDS`](https://docs.python.org/3/library/socket.html#socket.AF_RDS "socket.AF_RDS"). The socket type should be [`SOCK_STREAM`](https://docs.python.org/3/library/socket.html#socket.SOCK_STREAM "socket.SOCK_STREAM") (the default), [`SOCK_DGRAM`](https://docs.python.org/3/library/socket.html#socket.SOCK_DGRAM "socket.SOCK_DGRAM"), [`SOCK_RAW`](https://docs.python.org/3/library/socket.html#socket.SOCK_RAW "socket.SOCK_RAW") or perhaps one of the other `SOCK_` constants. The protocol number is usually zero and may be omitted or in the case where the address family is [`AF_CAN`](https://docs.python.org/3/library/socket.html#socket.AF_CAN "socket.AF_CAN") the protocol should be one of `CAN_RAW`, [`CAN_BCM`](https://docs.python.org/3/library/socket.html#socket.CAN_BCM "socket.CAN_BCM"), [`CAN_ISOTP`](https://docs.python.org/3/library/socket.html#socket.CAN_ISOTP "socket.CAN_ISOTP") or [`CAN_J1939`](https://docs.python.org/3/library/socket.html#socket.CAN_J1939 "socket.CAN_J1939").
i dont think so
Yeah you're right there isn't
But how do I know it's offline?
wdym?
There is an event you can listen to when a socket connection gets disconnected. Handle it accordingly
Basically, im trying to get data from an api on a website, using js fetch in the console i am able to get it to work but i am unable to run the same request in python using requests or using curl. I am getting an error regarding cloudflare. Im just wondering why a request through the console works using js while the exact same request does not work in python
any help would be appreciated
cookies = {
'__ddg1_': '-----',
'__ddgid_': '-----',
'cf_clearance': '----0',
'__cf_bm': '-------1663881600-0-ASi4VvOTU90+7XgTNz0NALar1yNpdeZli9zUbesjpmdknzcH8uPE4nr7nKajRvuPGWEGP1mnupxIQjZgQ9x8MzTmb0E9ALA1vqyySj7OQ31tgbfrDAEMDEE81N5/RgBomw==',
'XSRF-TOKEN': '------%3D',
'adurite_session': '------%3D',
'A2------29-------uWSLJm': '------%3D%3D',
}
headers = {
'authority': 'adurite.com',
'accept': 'application/json, text/javascript, */*; q=0.01',
'accept-language': 'en-US,en;q=0.6',
'cache-control': 'no-cache',
'origin': 'https://adurite.com',
'pragma': 'no-cache',
'referer': 'https://adurite.com/',
'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'same-origin',
'sec-gpc': '1',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36',
'x-csrf-token': 'VO08----------zjtAYO93a9YQsJJ',
'x-requested-with': 'XMLHttpRequest',
}
response = requests.post('https://adurite.com/api/get-items-onsite', cookies=cookies, headers=headers)```
i removed a lot of the cookie stuff
using -
the same request works in js fetch("https://adurite.com/api/get-items-onsite", { "headers": { "accept": "application/json, text/javascript, */*; q=0.01", "accept-language": "en-US,en;q=0.6", "authority": "adurite.com", "cache-control": "no-cache", "pragma": "no-cache", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-origin", "sec-gpc": "1", "x-csrf-token": "VO08jQ-----tAYO93a9YQsJJ", "x-requested-with": "XMLHttpRequest" }, "referrer": "https://adurite.com/", "referrerPolicy": "strict-origin-when-cross-origin", "body": null, "method": "POST", "mode": "cors", "credentials": "include" });
does not work
Very vague. How about you give some output you've got during your own debug and research e.g. the status code you get etc.
how to link gunicorn gunicorn -w 3 django_habr.wsgi:application --bind 0.0.0.0:8000 with nginx? nginx/default.conf
events {
working connections 1024;
accept_mutex on;
}```
i've been messing about with sockets and learned about asyncio sockets recently. What approach would you take to set up a server with a flask website to receive dict data from a couple of clients every minute?
just need to be pointed in the direction of what i actually need to be learning. (it has to be non-blocking)
could use regular blocking sockets and run it in another thread, or i could learn this select stuff with non-blocking sockets, or i could rewrite for asyncio sockets or whatever is suggested 
how to make a http/3 protocol post request using python?
couldnt find one on google
yeah, i managed to play about and make a chat/messenger application with it that could handle multiple clients, curious whether that's the best approach
gonna require me rewriting everything to switch to asyncio steams on my apps
might just pull the trigger on it, it'll work fine
why do my aws subnets have both allow and deny all incoming traffic by default?
does the rule number do something I dont get it
You’ll have to explicitly enable it. As to the rationale, I’m not sure
Something something security probably
okay so I can't delete the base * rule and I think rule 100 takes precedent over * so I think currently the subnet does accept incoming traffic from all addresses?
holy crap i think i figured it out it's a security group inbound rule god this is so many rule blocking everything but one ip
Hey buddy, you good or you still need help?
no im good thanks it was unrelated about security groups problem 👍
helo! i've been toying with web sockets for sometime, trying to get it working with multiple clients. However, when i connect the second client to the server, the first client gets disconnected. So what solution i got from this site totally came up with on my own was like this:
- Second client sends a connection request to the server (First client is connected rn), so the First client lets it connect and breaks its own connection.
- Then, the server generates a pool(array) of connected clients(their request.origin).
- When server receives the message, it sends it to all the members in the pool (disconnects from the Seconds client)
- The First client connects, sends message and so on...
But this approach seems really inefficient because I were to disconnect and connect again and again, I'd have just used some HTTP connections.
So i wanted to ask if there was a better solution with low wait times without having to connect to the server again and again.
import threading
import time
import requests
import sys
from queue import Queue
threads = 500
Que = Queue()
domain = None
def Scan_sub_domain():
while not Que.empty():
ssn = Que.get()
Targ_url = f'http://{ssn}.{domain}'
try:
requests.get(Targ_url)
print(f'> {Targ_url}')
except requests.ConnectionError:
pass
def Main():
dom_list = open('Word_Lists/subDm.txt', 'r').read().split('\n')
for sub_domain in dom_list:
Que.put(sub_domain)
ts = []
for i in range(0,threads):
try:
t = threading.Thread(target=Scan_sub_domain)
ts.append(t)
t.start()
except Exception as e:
print(e)
for t in ts:
t.join()
if __name__=='__main__':
domain = 'bing.com'
Main()
I've added multi threading in my subdomain scanner.
Still it's slow.
Any solution to make it fast af?
..
how can we reduce the rate of false positives alert issued by NIDS? Like any solution that one can work on
https://youtu.be/MCs5OvhV9S4
I haven't been able to implement it for myself but this talk at pycon seems to be covering what you're looking for
"Speaker: David Beazley
There are currently three popular approaches to Python concurrency: threads, event loops, and coroutines. Each is shrouded by various degrees of mystery and peril. In this talk, all three approaches will be deconstructed and explained in a epic ground-up live coding battle.
Slides can be found at: https://speakerdeck.c...
Thanks for the reply! it seems like the webserver IS actl connecting to both the clients and mantains it. It's just that it doesn't send data to both of them, so i'll have to do that manually by looping through an array of request.origins. Will still look into the video though. Thanks!
Yeah fair enough, that is usually how multiple connections are handled, just maintaining a connection pool as far I know
i forgot about this video, its fricken amazing. thanks for bringing back into my life 😄
lol looks like he's an old school legend or smthn
they do
but they don't send the data received through one connection to all the other
it doesnt
i thought it did
yea
seems like i declared the connection variable int he global scope so there was only one connection even when 2 clients tried to connect
The server, even though accepted the request when the disconnected client tried to send a message, still didn't send him any data while he was disconnected
yea, thanks for the reply
what reasons are there for not being able to ping your own public ip address?
or, well, noone at all being able to ping your public ip?
I could think of two reasons:
- Firewall has a form of wan ping disabled, preventing devices from getting a response when pinging your public IP.
- Device itself is not accessible or able to access the internet.
Hello there, so I was trying to deploy this very simple python socket server to AWS ec2. But it seems I can't connect to my server, any ideas why this could be happening or what should I do to fix it, any help? On the right, my server is running on an AWS EC2 instance; on the left, I am running a simple client script to connect to the server.
Thanks!
If I want to make a host-based network IDS, and detect the any anomaly or intrusion or any attack on the host pc, I can detect them through the packets right? So like how can we differentiate malicious packets and normal harmless packets?
hi, i am currently making a web cloner from python, requests and bs4
currently trying to clone Instagram page for testing,
it fetches the html of page, searches for all css and js files linked, download them and save to the path as written in href.
But my script clones the preplash screen of the page, not the page after preplash/loading.
how can i fetch the html after the preplash screen?
ok so now i used selenium for that purpose, and somehow successfull in getting the actual html + css + js code of the webpage
but when i host the webpage on localhost, there is a weird infinte reload automatically
idk whats the issue
Did you change the default security group settings?
By default it blocks all incoming traffic I believe
Ooh how do I do that any idea?
Have you figured out yet?
You need to edit the security groups of your ec2 instance
And allow incoming traffic
Hey I got a question about smtp
Currently I can get an email client as '192.168.0.11' and can send emails via .py scripts just fine, but how do I create a 'username@192.168.0.11' for sending emails normally?
If someone could help with this, that would be great
Hi all,
I'm trying to write a python script to extract connected clients from a dell n2000 series switch, no luck at this stage... I use to use switch miner in the past for Cisco extraction to detect the phones connected to what port of the switch but im unable to achieve this with dell. Has anyone tried to get an export of all connected devices from a dell switch?
anyone use pyzabbix? Cant seem to wrap my head around its usage, need to get device by IP and then a 7day history in values
look into snmp
@finite dock yep just got to script it to extract it
i like easysnmp.. clean and easy
So I’ve extracted arp and Mac table now MAC address don’t marry up…. @finite dock do you have any easysnmp samples?
ill get you my most used couple of lines here in a bit.
also.. I have read before that cisco devices return macs that need to be formatted bc they return in binary.. let me know if you have that problem, ill find the post I read.. i got it saved somewhere
#Useful for calls that are hidden behind multiple results, or in a table.
genEquipMngSwOperationOperation = [item.value for item in bh_session.bulkwalk('.1.3.6.1.4.1.2281.10.4.1.21.1.2') if item.value != 'None']
genEquipMngSwOperationOperation = genEquipMngSwOperationOperation[0] #<-[0-XX] for result wanted, is just a list.
## bh_session is my connector to easysnmp via,
def create_session_bh(NETWORK, host):
#host = IP
if NETWORK == 'NetworkName':
bh_session = Session(hostname=host, community='PWString', version=2, timeout=5, retries=1)
return bh_session
#So in general I just import easysnmp as,
from easysnmp import Session
hope that helps.
Hello, I need help with request status code 429 in aws(amazon web services) / cloudfront
I tried to print the headers, and if randomize sleep it's will end up with block, I want to know the specific amount of how long time I have to sleep..
Output:
{'Server': 'CloudFront', 'Date': 'Tue, 27 Sep 2022 13:48:12 GMT', 'Content-Length': '188', 'Connection': 'keep-alive', 'Content-Type': 'text/plain', 'X-Cache': 'Error from cloudfront', 'Via': '1.1 397f210a9eb9ec34ba3f1f814bc1a7a2.cloudfront.net (CloudFront)', 'X-Amz-Cf-Pop': 'AMS1-P2', 'X-Amz-Cf-Id': '06LZjQ7t9v6RbIkiAjlaEoY1c2klERyzQWnxAuPFe1OWF38ria5pYA=='}
--ping me when you replay.
a good language to learn for networking other then python
i wanna learn new language
Learn the CLI language of switches and routers. The vendor depends on you, but Cisco is a major contender in that field. I think it may be worthwhile learning IOS if you want to do networking
ok ill look into it, thanks, coding ideas are low so maybe learning new langs might work
Anyone got experience with wireshark?
when u do a request.get or post
u can put your cookies in the headers so it can access something only you can right
Don't ask to ask, just ask
hey okay so i need help w setting up cisco’ packet tracer and get familiar with it but i’m stuck at understanding most of it
wondering if anyone has experience and can help
I haven't used packet tracer myself but maybe that doesn't matter... What are you trying to accomplish?
hi guys, i am not sure if this is the right chat, but I’ve build an app that helps people to practice their Python skills through short, bit-sized coding challenges. It’s currently in beta so any feedback would be appreciated. You can download it via this link - https://testflight.apple.com/join/QnV6FJN6
i was just trying to set it up and configure something it’s my first time using it so i was nervous but i got it working
I think #pedagogy might be the best channel
thanks!
It's not, just so you know. If they wanted to talk about what teaching techniques their app employs, then it would be on-topic.
sup buds
what if router is offline during routing
will it just keep routing endlessly?
it'll just "drop" the packets, it's offline
that's why it's important to set up redundant links
How does it know that it is offline?
Once it has gathered all active router ips?
Yeah the sender's
The senders don't
Unless we're talking about like STP or something
But for the sake of simplicity let's assume a simple network without redundant links
The switches and hosts will just send packets to the router as if it's still online
But the router is offline so the packets just sort of... go into a "void", if that makes sense
They don't get a response back for their packets
Ah got it
That doesn't always mean it's offline, so they dont know it's offline
You'll just get a generic timed out error or some other error clientside
It's up to you as the user to figure out if it's offline or not
So the packet just hops to the next network endlessly
The packet just dies, it doesn't go anywhere
The router is offline, so it can't route it to another network
Ahhh this makes sense!
Yeah it won't find a route to its destination
Makes sense
Thank you for clarifying : )
No prob
Is this channel for networks in sofware or for networking through people?
networks in software. If it's a question about networking for career purpose, then #career-advice would work
Can someone help me with networking mailing client
Traceback (most recent call last):
File "c:\Users\Admin\Documents\Python\Networking.py", line 16, in <module>
server.login('(my username im not gonna list it here)@gmail.com', password)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\smtplib.py", line 750, in login
raise last_exception
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\smtplib.py", line 739, in login
(code, resp) = self.auth(
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\smtplib.py", line 662, in auth
raise SMTPAuthenticationError(code, resp)
smtplib.SMTPAuthenticationError: (535, b'5.7.8 Username and Password not accepted. Learn more at\n5.7.8 d79-20020a621d52000000b0056012d934fasm1842802pfd.156 - gsmtp')
the username is right but idk if there is something wrong with the password's
did you get the app password?
you mean like the gmail password ?
no
if you google for the error code, it points you to https://support.google.com/accounts/answer/185833
so basically i have to put the app password into the password.txt file ?
I haven't used smtp with gmail, so I have never tried
the problem is
I watch a tutorial and they have something called "app password" in the signing into google section but i don't
It's fine, thanks for helping tho I will see if there is any way to get it.
Finally
it works
i forgot the "()" at msg = multipart & didn't use app password
@cunning garden ty for the app password one
i'm new to the stuff anyone can tell me why there are sooo many failed hops here??
i mean id get it was a 3 or 4 why 20 hops fail
hello could i get some help with my python chat that im making
dose anyone know how I could host a dns server that all requests get told to go back to my self (local host), I want to forward them like a proxy, without needing to config the device, (host a dns server redirecting all data back to me, host a website that redirects all data over a tunnel and out to the open web) but main thing I need is how I can do it with a dns server to have every website go to me while I am the dns
(ping to reply)
Why do you need a proxy? Why not just host a DNS server as it is?
I think adding a proxy will only make it harder because you've got 2 devices/applications to configure rather than just 1
no, like the dns server goes to me, and I then do the proxy
Right, but why not have your machine as the DNS without any proxies?
Just makes things much easier
I cant do that it is a phone
Well you'll still need something to host a DNS server
and I dont have access to the proxy configs, and I want to encrypt things on the dns server
I do the outher device
that is what I am saying
So just set that other device as the DNS
There's no need to overcomplicate and slow things down with a middleman proxy
but there is for me, I have been thinking bout this for a while, it is so I can heist data over a network, by hosting a rasberry pi that has (i forgot what it is called rn, but a hosted wifi, that goes over then the real network) then I use that to set the network dns, and using the dns I proxy over the network back to a computer at a diffrent location who decodes the data, and sends it out, a convoluted tunnel to stop the network from reading any data in the middel
..DNS poisoning?
no, I am sending the dns at my home pc back to the proper location but for the middle techecly yes
god my spelling is bad today
Sounds kind of malicious, what's the point?
dms rq?
I guess you could set up a DNS upstream forwarding thing
But this is a strange usecase
yes, but long story short, I want to find a way to bypass the school blocking software, becuase they blocked fu**ing github and stackoverflow, ITS A STEM SCHOOL AND THEY BLOCK LEARNING TECHNOLOGY
so just use a VPN?
hmm
see, this is why I am doing it
i have a feeling this has a very low chance of working
there are multiple points of failure
yes and no, Its the best way I could come up with
because I dont want to do any send images shi*
because that has file:// explitation
i don't think just using a different DNS server is going to allow you to bypass the content filter, is it? Because the end result is still the same
your outgoing request is still the same IP/domain
dns points every request to me, whitch is hosting a webserver who forwards all data to my home computer (encrypted with public/private keypare), on a kinda like a hotspot but as a midddle betwine the thing, and then at my home computer make the thing decrypt and send as a normal request and return back 3 times to the machine, bypassing all data lookup they could do
is this all in your home network?
So.. the DNS server that points to your webserver, is that on the school's network?
convoluted proxy
no, it is https://wiki.debian.org/NetworkConfiguration this shish, set as having the dns be me, whitch points all data to me, whitch sends encrypted over the outher connection, and then my pc decodes and sends as if it was from my pc
I see where you're coming from
insanity
But I think the issue is that content filters usually don't look at DNS requests
That's the reason why VPNs work
no, but they use a certificate to decode data and sniff for things
Right but the certificate is not the DNS's job, is it?
anything not on http or https is blocked
no, but if I encrypt, and send as a ""http request"" to the website, with the data encrypted inside, after applying the cert, they will just see random bits not a real website request
So.. you're trying to encapsulate your DNS request inside of a HTTP request?
also I would use either a host like (forgot rn the one all tech people advertise) or just use ngrok
no,
request -> my network -> my dns -> my http server -> encryption -> add http (not https) headers -> school network -> proxy -> server -> decryption -> make request
backwards
request data -> encrytion -> send back as http response -> school -> my decrytor -> the device
the school never sees the device only my servers local ip (randomised macs) and goes to a proxy, like ngrok who dont leak ips
network layout
devices -> my middle server -> the school [-> a proxy ] -> a server
ITS A STEM SCHOOL AND THEY BLOCK LEARNING TECHNOLOGY
Have you spoken to the school about it?
the school is bad lol no tech middle or high school
That doesn't align with it being a stem school at all.
This is something to bring up to the technology staff of the school.
*the one girl who cant do anything, because of the district
I asked her what I could use as a text editor on the chromebooks, and they said that the district said you cant use it, so only google docs, goodluck programing a website using only javascript: bookmarklets, and not dev console, with not being able to save anywhere becuase google docs changes ' and " to special characters
And this is the same school that has you in a class to learn these things?
nope like I said nothing about tech nothing at all, one of my teachers wanted to teach begining python, and couldnt use replit or anything else, becuase It was "not child appropriate", a coding website, on a school computer at a school named stem
yep I am mad
also, this is the best school in my area for this kinda stuff, It is so dumb
As justified at being angry as you may be, you cannot expect us to assist with a project is this breaking all of the protections on the school's equipment put there, seemingly, to prevent you from doing this. That, in a short summary, is a malicious act.
okay, I just dont want to have to use all my mobile data, because everyone just uses that in class, and its not free lol
I just cant come to understand my school
also I am fine if you remove the conversation, as it is about somthing you say is malicious, I am sorry for wasting your time
bye lol, I was just mad at them becuase its a stem school, and its not like they even looked at what they block, they just block anything they see people on more than three times a day, I swear google classroom got blocked for a hour one time
Sounds like they could use some insight and help in setting up their protections.
I know, but there is only one lady there for tech support, and she cant help, its all district things, my teacher is blocked from programs too, we were trying to do programing in python last year and they blocked the good websites like replit, so we could only use the shi**y ones that had adds everywhere, and didnt work half the time, no one learned anything and he requested 2 months ahead a time for it to be unblocked but they said it was not safe for kids, and was not going to be unblocked. these people are verry smart, also its still blocked over a year and a half later, with multiple requests, that each take like 2 weeks to send for the teachers to get a responce, I hope you can see why I am mad bro.
If I've not made it clear, I have no judgement for your ire. I am quite sure you are justified in it and I would not dispute that.
I'm only here because the specific course of the conversation was leaning far enough into an area that can only be used in a "malicious" way. (not the word I want exactly but I'm lacking a better one). This server has rules and I get to enforce them.
fam could i get help in #help-cupcake pls
I understand, and I am sorry, once again if you wish to deleate the messages that is ok with me, I was not trying to be malicious and I have stoped discussing how I could do it, and just explained my reasons for fealing so, so thankyou for your help, I am sorry I seam malicious in any way
thankyou again and I am sorry for the inconvenience for you
should you remove this conversation as it is malicious or what, I feal like if this is somthing bad than it is best for me or you to remove it so no one else uses it, but idk, your the mod
I have no issues with the conversation, actually. You handled yourself quite well and there's knowledge in your exchange with Robin on how things work. That's what this is about, in the end. "How do things work?"
oh ok, thankyou for the input and I hope you have a good day/night
Heey everyone, so far this has been the livliest discord server Ive ever been in. Recently I got interested in generic algorithms. Is there anyone in here who can help/guide me, or give tips please?
"generic" algorithms? not sure what exactly that's supposed to be. You can try asking in #algos-and-data-structs or if you have specific (python) questions, open a help channel #❓|how-to-get-help
Thank you for the quick response.
Hi everyone
I want ask to how to know a fingerprint machine connected to the network by python
You can use the nmap python library if you want to script it
Thank you
Hey, Im doing a project about web scraping on a large scale. Anyone here has experience with using scrapy and python? Would appreciate some help or guidance
Im working as a jr python dev ✌️
There are two possible options to abuse actually
- installing programs not requiring admin permissions. U could try get hands on Python(or whatever Lang u need) interpreter and some Notepad++ with syntax highlight for this as example
- getting USB with Live Linux like Ubuntu and just using it in Live more without installing. (Admin rights to install anything, IDE or other programming tools)
(Second option can be treated as malicious though. It would be cool if u recieved permission)
(Second option requires ability to use Linux)
If they blacklisted stuff, then Wireguard with enabled global DNSes will pass all blocks. If they whitelisted stuff, than nothing will help except another internet connection
Optionally forward proxy(like Squid) can be tried with DNS change as lightweight alternative, but Wireguard VPN is a more ultimate solution
Does anyone know a good book to start learning about computer networks, routing, protocols etc?
chromebook
its not a dns blocking system, they just have a cert and decrypt all data
I am currently working on a project that I establish a connection with a websocket, which I already successfully did, send data to the client (achieved) and lastly receive the binary messages which are send from the server to me. However the response I receive isnt the binary message I see in the browser(network)
This is the message I get.
Have you tried prefixing the string literal with r
I think the percent symbols are messing up with the send method
the send method is working perfectly, its only the recv method which doesnt work as planned
Hello
How can I open a socket using S.Connect and provide cookies/auth details.
for example if I were to do a normal XHR requests it'd be
(..., cookies={})
if anyone could help, would rlly appreciate it.
I just wanna open a socket whilst sending auth to the server basically.
networking is hell
It’s fun
I love understanding how things work on a low level
when it works yes
Networking is fun as hell! It's interesting and it gets more and more interesting as you keep getting the in-depth knowledge about it
Agreed unless I'm troubleshooting SSL/TLS
how do u send forms with requests.posts
maybe this will help @twin flame
https://stackoverflow.com/questions/20759981/python-trying-to-post-form-using-requests
oh thanks, why did I forget i could google that XD
Hello!, I'm trying to setup my own dns server using python: (code not mine)
import socket
from dns_generator import ClientHandler
# Global variables
IP = "192.168.1.XXX" #was 127.0.0.1
PORT = 53
def main():
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.bind((IP, PORT))
print("DNS Listening on {0}:{1} ...".format(IP, PORT))
while True:
data, address = sock.recvfrom(650)
client = ClientHandler(address, data, sock)
client.run()
if __name__ == "__main__":
main()
So I edited the firewall rules to allow inbound udp on port 53 and run the thing but it seems the script is not receiving any dns requests when I try to set the dns on my phone as 192.168.1.XXX? am I missing something?
pretty sure DNS is both TCP and UDP
ohhh thanks! finally got it working lol
can i ask about networkign not about python here ?
sure
how to change ssid and secure my network ,??? all people on building using my wifi
It depends on the setup, it looks like totolink ex_200 is an extender of sorts so maybe ypu could still access 192.168.1.1 even if you're connected to totolink?
if i connect to toto
and i cant find my main router to setup pass and ssid
how did you get it working, I was trying to work with dns before and ran into the same problem, how did you do both tcp and udp at the same time?
I added another firewall rule that accepts tcp connections on the same port, I had only 1 firewall rule (only udp) before I got it to work
hummmmm
for some reason I just dont get anything, hosted on linux with root
only dig works with it
Haven't tried running this on linux yet so I'm not sure. Though from what i remember, opening up service ports on linux is much more straightforward
Does ARP use the OSI model for transmitting the MAC request? If so how does the data link layer work without knowing any MAC addresses?
Or does ARP use some other method that bypasses the OSI model?
I think it sends the question "who is x" to every entity in the local network and then the entity in the same network which identifies as x replies with its MAC address
Im pretty sure it uses the osi model but just skips L4-L7 since the arp packet doesnt have an allocated section to encapsulate L4 packets. you dont need to go through every layer if theres nothing to encapsulate at that layer, e.g the syn ack packets for tcp dont encapsulate a L7 packet. is that right @prisma cobalt ?
yes! it's a broadcast message that every client on the local network receives. if its not for them they discard but if it is then they respond with their MAC address
example:
A: "who is 192.168.1.100"
B: "its not me so i wont respond"
C: "its not me so i wont respond"
D: "wait, thats me! Hello A, i am 192.168.1.100, my MAC address is AA:...:AA"
@rapid fog
thats right
what do you mean by L7 packet though?
odd format
i mean when I learnt about osi model, I heard that you gotta encapsulate data from L7 to L1, so there needs to be a data (or wtv the term is at different levels) that gets encapsulated at every stage, but thats not actually the case as we see with the arp protocl, you dont have any data you need to encapsulate from L4-L7 so you just encapsulate from L2/3 to L1
e.g http packet
It's not that kind of a protocol
I think it's on the same layer as protocols such as IP
Its L2/3
For the encapsulation terms, we were taught a mnemonic:
Do students pay for books
D - data
S - Segments
P - Packets
F - Frames
B - Bits
Going from Application layer to the physical layer
Yes you encapsulate. Think of it this way ARP is how you get the next layers information so you can add that information to the layers pdu (frame in the case of L2. The computer has already done a DNS lookup and has the destination IP address and now needs to validate if it is on the same local network by checking against the subnet mask and destination IP or if on the same local network check the local ARP table for the destination MAC. If not broadcast with the destination MAC address of FF:FF:FF:FF:FF the question who has the address or if determined not on the local subnet who has the default gateway address and return its MAC so the L2 frame can be completed.
The osi model breaks down pretty quickly after a certain point. It was originally created in 1980 to be fair. In reality the terms have basically become industry jargon that is equivalent to:
Layer 1: physical connections
Layer 2: Hardware address space (Vlans and mac addresses on ethernet - there are equivalents else where)
Layer 3: Logical address space and movement between spaces (IP addresses, and routing protocols for example)
Layer 4: Communication methods between Logical address endpoints (TCP, UDP, ICMP, etc.)
Layer 5: uhhhhhh
Layer 6: uhhhhhh
Layer 7: Anything inside of the communication that's interesting enough that we want to peel it apart and poke at it.
Layer 5: sockets
Layer 6: TLS/SSL
Hi guys,
Does anyone know how I could create an app blocker with python?-Not the one with editing hosts file.
Preferably with scanning which websites are currently open
hello, does anyone know how to compare desktop screen and image in opencv2? My solution do not work 😕
Wrong btw.
TLS/SSL are security protocols that sit at the transport layer.
TLS is what’s currently used and is the standard for website security over https.
Layer 1: Physical - NIC, Hub
Layer 2: Data Link - Switches, Mac Address
Layer 3: Internet - Routers, IP protocol
Layer 4: Transport - ICMP, UDP, TCP, TLS, SSL
Layer 5: Session - Sets up the session between client and server
Layer 6: Presentation - organizes the data in a human presentable/readable format.
Layer 7: Application - You can think of this as the application window on your computer.
Although at the end of the day the OSI model is bullshit.
Either a computer accepts a communication or it doesn’t.
It doesn’t care about what layer something is at since the model is just for human understanding.
This is true.
it's hard to constrict it to a specific layer, the OSI model isnt really that flexible
Yeah I'm very familiar with the theoretical layers, but the reality is that there's a whole aspect of industry jargon and what I was trying to articulate is how people actually use it
i partially disagree, it has its uses (mainly for visualization) but it also can be improved. the human understanding was the purpose it was created (and to segregate specialists etc) and i think its pretty good at allowing that
It's become more useful as a description set than engineering principles
A computer accepts a communication or it doesn’t it’s not going to care what theoretical layer that communication is at since the model is completely based on human thought on the system the system itself has no programming to check for layers or anything of that sort.
whilst theres some overlap, in reality (in a larger company) you would have people employed to manage the networking hardware (roughly L1 to 3/4) and you would have people employed to manage the higher level communication.
It’s another reason why the most secure computer in the world is one not connected to the internet.
@prisma cobalt I'm a network engineer first, and came to programming through it. So I'm quite familiar with industry realities around data networks.
What company do you work for?
correct, there are no such things as "layers" in a network but the model stands for trying to understanding and visualize communication with different protocols. for instance, routing packets is a good way of seeing the model in action
Just curious.
ohh my bad, i realise i misread your message and i thought it was a question, sorry
Yes and in that instance it is useful at a beginners level but once you actually dig into things it holds next to no value.
@fast tusk Right now I work for a company called MYR group, which is a large holding company for electrical construction subsidiaries, but in a past life I worked at various Vars and MSPs, and have built some very large data networks.
agree to disagree
what does this have to do with the OSI model???
We are talking about the communication of devices over the OSI model and that simply can happen if it’s not connected to the internet. If it stays internal with no outside connection then it doesn’t matter what’s at layer 3 the computer simply wouldn’t recognize it without a connection.
It would only have a media access control and that’s it.
Maybe an apipa depending on the device.
Are you ever truly disconnected with RFC 1149? Who knows when they might extend it and teach the pigeons how to plug USB drives in.
lmao
Don’t worry they don’t use pigeons.
Cats are more effective.
Sounds proprietary.
My whole point of the original post was that people really shouldn't be too hung up on what the intent of the OSI model was for. We have so many exceptions to the so-called rules at this point that all that's actually important is how the industry uses the jargon
Apipa is a windows protocol that give a computer a private IP address in the 169.254.0.0 range I think.
Exactly.
Again why I say it’s bullshit.
agree to disagree 😄
I mean it has a measure of utility. When somebody says this happens a layer 3 and not a layer 2
You've got a ballpark idea of what kind of technology you're using.
But it's just not a design philosophy. It's a descriptor set.
But all in all it's given far too much attention in entry-level classes
They believe it’s the end all be all when it’s just the first step.
In order to learn anything you have to baseline it first.
Yeah I'm aware. My field in particular is a little bit frustrating, in that there are definitely people who go to college with the hopes of jumping directly into network focused stuff... And the typical academic flow just does not prepare them for that
But I need to be careful not to stand on that soap box too long
I’ve never gone to college.
I think it’s a bad first step.
Unless you have a scholarship.
Me either. But I don't know if that I agree with that either.
Simple. With work experience.
I’ve never gone to college but I have enough hours for an associates in cyber security.
I believe college can be useful and it’s different for everyone.
@prisma cobalt I think you deleted your comment, but it was a valid question and yes it does limit your options.
wouldnt you limit your future prospects, employers recognise previous work but if you cant apply it to their situation then they wont hire you.
i pressed the enter key too early by accident xD jumped the gun
Ahh
Depends on where you have worked previously.
Currently I’m employed in a place that will make college free.
Should I choose to take it.
i wouldnt want to limit my future to one path based on the luck i get finding my initial work experience
I didn’t get where I am through luck.
I just don’t see the point in going to college and ending up with tons of debt to possibly not get hired.
That sounds more risky.
And it works for some people it really does.
i think this is another case of "agree to disagree" :/
Very well then.
Eventually I will go to college but the only difference is it will be free and I already will have 3 years job experience.
Having the degree and extra years of work experience will make it far more likely you get hired.
true, but you could argue that the people who went to college initially and then moved on to a job after (people the same age as you) have come out better as you have to leave your job to get into education and then find another job whereas the graduates would have found a job and can stay in it, not to mention that graduates are more likely to get higher pay initially
- more job prospects after leaving college
and knowledge that expands where they can go
Rn I’ve got 2 years job experience and hours equivalent to an associates degree.
okay
I already know where I am working next is the thing.
And I believe you would be right in most cases.
Also those graduates would start off in an entry level position in the field whereas I’ve already built a reputation and have the experience to back it up.
So I wouldn’t be hired entry level.
Of course there is internships.
So that could help a little bit for sure.
It also depends on the job you were working before.
Also that’s pretty impressive I personally have never built a network but I am required to know how they work and their weaknesses.
you know, something I took for granted for a long time was that programmers understood network level communication and conventions because they were programmers. How sweet and innocent I was.
That makes sense cause they have to program their programs to connect to the network in a way that allows their program to function I’m not a programmer though so I could be wrong.
I know I still have a lot to learn when it comes to networks and how specific protocols work on a granular level.
here's the thing, a lot of the time you can leverage libraries to take care of the pesky bits
but then there are times where... you're building a feature that isn't addressed by a library. Multicast is a good example of this coming up often
it's important enough to deal with from time to time, but not so frequent that there is a robust set of tools around it in some situations
ehhhhhh
So wouldn’t that change in the future?
not precisely no
but even then, if it were true
you'd have to find more than a handful of developers who were comfortable writing to ipv6 in the first place.
That makes sense since IPv4 has been the standard for so long.
I had to walk a vendor through the RFC and show him where his TTL was mucking things up with v6
the details are escaping me, but there was a corner case where you had to be very particular about the TTL
that was years ago though
anyone who takes an interest in network level stuff should be at least aware of the RFCs
there is a wealth of information in them
I know what they are and yes there is a lot of information in them.
Like a metric ton.
Even though I don’t build networks I still read a few from time to time to understand a protocol as in detail as possible.
I’m still in training rn but it’s on the job training.
I’m in the Air Force and I am currently working in the NSA.
It quite honestly is a lot of fun since I learn new things everyday.
I plan to transfer over to the civilian sector after my military contract is over and working only for the NSA instead of as a military position.
@lusty field
hey
i have 3 devices on network
192.168.1.2
192.168.1.3
192.168.1.4
3 and 4 can connect to each other
2 and 4 can connect to each other
2 and 3 can not connect to each other
via RDP or file sharing ... where it is the problem ?
Can you ping 2 to 3?
Hm. How does the network topology look like?
Hmmm. Is there anything going on with the router? Like do you have VLANs set up or anything?
I’m not an expert on this but is .1 the only IP address that router has configured?
what ?
Interfaces. Which interface is 192.168.1.1?
I'm pretty sure each port on a router is a different network and has to have a different IP
Yeah but which interface on the router?
what do u mean by interface
Each "line" coming out of the router is an interface
And each "line" is a different network
to access netwrork admin panel is 192.168.1.1
and getway of ipv4 of all devices is 192.168.1.1
that might make sense
The line connecting router and 4 probably has the .1 interface
the line connecting router to 3 might not
which is this?
I think I get the issue
I'm not sure how you can ping from 2 and 4 because each device needs to have a different default gateway
unless some sort of bridging is going on
2 ping 3 timeout
2 ping 4 ok
3 ping 2 timeout
3 ping 4 ok
4 ping 2 ok
4 ping 3 ok
hmmm
why should have different gateway ???
the were working for 2 years
you're sure the device in the middle is a router?
on the same sittings
that's how routers are supposed to work without any special configs (eg bridging)
this my netwrok
maybe it's a switch?
or a layer 3 switch?
2 is directly wired to the router right?
What is the "extander"?
Ah, can we assume it's a switch for logistics reasons?
no
2 work with 4
4 work with 2
4 work with 3
3 work with 4
2 dont work with 3
3 dont work with 2
3 work with 2 yesterday
2 work with 3 yesterday
clear ?
I understand that part
I'm just speculating reasons for why
It's odd because it doesn't make sense how 2 can't connect to 3 but 4 can
What's the make and model of the router?
that is what confuise me
Huawie ...
but trust me no realtion to router module , i said they was working for two years
Maybe check the configs on the extender? A software/firmware update may have broken something
Usually when something works but doesn't work a while later, it's usually an update of some kind
okay i give up
any idea how to solve the issue ?
if there was an update for frimware that should broke the connection between 2 and 4 too, not 3 only
arp -a can see, ping not ping (timeout) lol
that's what i'm thinking too
maybe it's somehow altering only connection from 3 and 2?
like what ,?
what is the IP of the extender? Can you ping it from 3?
extander dotn have ip
i dont know honstly
First step would be to figure that out then
See if the extender has an admin portal or similar and how you access it
yup
to access to it i should change the defult getway to 192.168.0.254
then get access to 192.168.0.254 control panel
in an online multiplayer game, i need to send a tuple(ints), a string, and an int to the server each execution, what's the best way to do it in terms of server network load? make a list, serialize it and send it? send 3 separate messages? 4 messages?
Hello I have a list of multiple email addresses with custom domains (exemple: name@organisation.com).
Some emails are valid others aren't.
How can I programmatically test the smtp response of these emails with python?
the struct module may be able to help you
its better to send it all at once if the data is related
Asked this in a help channel about 4 times and never got an answer so I will ask here...
Here's a link to my message because I'm lazy and don't want to find it again (had the link pre-copied to my keyboard)
#help-popcorn message
What is an ip address? I seem many different things and they are confusing me. What is ipv4 and ipv6? What are the 6 classes of adresses? What is a local and public adress and what is a router, do i need it to send data to, say, my friends address?
For all intents and purposes your public IP address is similar to the address of your house. It allows other servers and hosts on the internet to find you
Private IP is similar to where you are in your house, e.g: your bedroom, the master bedroom, the kitchen, etc
Your private IP doesn't mean anything without a public IP
If someone asked where you lived, and you told them "in my bedroom", it wouldn't help
Same deal with saying my IP is 192.168.1.2
You can't test emails, but you can test domains
.sendall ensures that the message you want is sent along the connection ; this is different from .send which may only partially send the data. It does not send the data along multiple connections
a concern with use of raw TCP sockets is that it is an interface for sending/receiving a stream of bytes. When you run .recv on socket you may receive the raw bytes from one object, multiple objects or part of an object.
You have a couple options if you want to pull out proper objects on the receiving side
- only send objects of a fixed number of bytes, e.g. ints
- prefix every send with a header (e.g. a 4 byte header) saying how many bytes the following object/string is. Decode that many bytes, then find the next 4 byte header, etc...
- use pickle.dump, pickle.load to dump load bytes on to and from the socket byte stream
- instead of sockets, use something like multiprocessing.connection Connection which will allow you to send and receive objects and manage the encoding/decoding behind the scenes
recommend the last as the most practical approach, although the first 3 might be more educational
Hi
I am trying to use HTTPS with a Flask server
There are quite a few conflicting threads on the topic https://blog.miguelgrinberg.com/post/running-your-flask-application-over-https
https://stackoverflow.com/questions/29458548/can-you-add-https-functionality-to-a-python-flask-web-server
While you work on your Flask application, you normally run the development web server, which provides a basic, yet functional WSGI complaint HTTP server. But eventually you will want to deploy your…
if __name__ == "__main__":
context = ('secrets/cert.pem', 'secrets/key.pem')
app.run(port=8080, debug=True, ssl_context=context)
This is the approach recommended in the stackoverflow thread
How do you give the password for the key.pem to Flask?
Hey @lyric dust!
You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.
Hello,
When I am trying to make a WSDL connection , sometimes I am getting below error
2022-10-11T12:50:43.663Z socket.timeout: The read operation timed out
Kindly suggest
Hi, I am new to kuberetes cluster and gRPC. What I am trying to run a gRPC server (docker file image) image on kubernetes cluster and then run the client. But I am not sure how should I proceed. My server and client works fine on local system.
using app.run() for production is not recommended. app.run() is a development server. Instead it's typical to use a public facing webserver like nginx or apache, and have it pass (using some reverse proxy config) requests to the flask app, that is running using some app server (uwsgi, gunicorn, uvicorn, hypercorn... etc. there are quite a few)
can flask work with https? like can I create an https server using flask? working with requests actually
if so, do you have any documentation or video that could help me setup an https server to work with requests? Thanks in advance 🙂
see my message right above yours 🙂 you'd configure the public facing webserver with https. they support it without issue usually.
I doubt anyone will be able to help, but I've setup a basic socket server which starts a new thread for each connection, which works fine, I'm using connection.recv(1024) in an infinite loop to receive data and send a reply, the issue is that if I send two lots of data to the server at once, it will miss one and it won't get processed... how can I make sure I'm not missing any data?
you need to buffer your data. you cannot rely on .recv(N) giving you N number of bytes. There is no guarantee that you get what you sent on the other end. it might be split up, or merged with other data.
add the data you recv to buffer, and check that buffer for a delimiter or similar. something both ends agree on should mark "the end of a message". remove the message from the buffer, and keep the remaining part in the buffer. and repeat.
buf = b''
while True:
data = conn.recv(1024)
if not data:
break # connection closed
buf += data
*lines, buf = buf.split(b'\n') # anything after the last \n is what stays in buf, usually empty.
for line in lines:
process_line(line)
``` very simple example of what it could look like, if your "end of message" delimiter is a single `\n` newline.
Hi, is it possible to open a VPN connection with Python, I need my script to access a remote pc that it is in a private network that I can access trough a VPN
is HTTP always over UDP or TCP?
Is there a way to what is causing a script not to connect?
anyone know a way to curl/httpRequest natively in python without importing a lib? Im over at #help-pancakes :c
does setting up a home server help learn networking stuff or not really
Sure. Probably not to the extent that a course might, but it's still hands on experience and can make the whole thing less daunting
@cloud plover
if you have to ask this question tbh, idk if youll get much out of wireshark but the second option would work I believe. If you can do multiple, 2nd+3rd but this depends on your method of connection. are you wired or wireless?
2nd is most ideal if you ask me
@ember ledge
yes hosting your own server will teach you alot. setting up linux taught me alot about how OS work. this is a hands on field with lots of trial and error
wireshark is some 2010 tech lol unless youre doing local networking or MITM stuff. wouldnt recommend. Try an api or a lib instead of pure hex unless youre trying to learn TCP/IP. injecting and sending hex packets is legitimately 2010 tech and unless youre trying to test an api, I wouldnt recommend using it
hmm
not saying wireshark isnt useful for debugging, just that if you need to ask, you prolly wont get what you want from it
hex values and the obfuscation will heavily throw you off. network serialization too
it all depends what youre wanting to achieve. someones IP over P2P? Use an api with vulnerabilities but wireshark would work. just dont expect to get help from this community. Debugging your home network? Good idea
Hello, I'm Gonçalo from the Data-Centric AI Community!
The Data-Centric AI Summit is now available on demand, I think you could be interested in watching 🙂
https://www.youtube.com/channel/UC4AFOG1a8b9r46G9w0CacUA/playlists
Also, check the github with 10k+ stars so you can ramp up your python game: https://github.com/ydataai
Enjoy!
im using sockets for a multiplayer locally hosted game and my client easily connects to the server when both are run on the same machine, but client throws this error when i run the client on a bridged adapter VM
what might cause this?
i don't think it's a firewall thing because i had been able to connect this way a week or 2 ago
Hello. Sorry for the noob question. If this is the IPv6 address "5d66:5ec9:0046:0000:2576:004f:7159:0639", would the proper compressed address be "5d66:5ec9:46::2576:4f:7159:639"??
Guidance in any way, shape, or form would be greatly appreciated. Have a great day! 😁🙏
that would be it, yeah
Thanks. I'm currently taking a class at Coursera, but the quiz doesn't seem to be recognizing the answer. Which kinda confuses me big time. It's already gotten on my nerves 😅
Attempt the webSocket on a second machine vs a vm
Or change the code to connect to localhost
Cant firewall your own IP hahaha... Oh wait
what do you mean?
You can have 2 games open on the same machine
Attempt to connect to the localhost 127.0.0.1 i think
If that works, then debug from there
Or try 2 seperate local machines
1 machine can host a server AND can connect to it. Thats what im saying to try
Or try disabling your firewall on server and vm. If that fails, download wireshark and see why the connection is dropping
If its an api, use fiddler
thats why im so confused
it connects if i run the client on the same machine the server is running
But drops the connection when you try locally?
it waits for a couple minutes then throws the error
like its trying to connect but doesnt find it or something
Hmmmm thats odd
Try setting up a vpn on your client machine and the trying so its not really local
Maybe theres a latency issue but if you know wireshark, you can debug and see why its not connecting
It might be a server setting youre missing also
Is it in unity?
pygame
its python
Yeah honestly I dont use python lol
C# is kingggg
its a work laptop
Its a work laptop?? And youre sure it isnt a firewall issue?
i would assume that
but like 2 weeks ago
i was following a socket multiplayer game tutorial and it worked
so idk anymore
its not like the networking code is any different
Then I would recommend rechecking your server and client settings
Oh
First, check server and client settings, if nothing appears out of the ordinary(same port you tried 2 weeks ago) try wireshark to ser whats happening with the connection
There might be better software but idk any other than wireshark. Any failed connections should show up in color
So should be easy to find whats happening with the connection
Sorry idk python enough to help with screenshots sadly
wireshark on the server machine?
Correct
was just showing you the ips and ports were the same
Well actually
Wireshark on both if you cant find a problem
The client might yield more info due to it trying to connect and throwing an exception
I say wireshark on the client. It will show you where the packet is going and why the connection is being dropped
Or actually
You could write an exception block in the client script and log a stacktrace
Thats prolly the best way
stacktrace?
Yes, look into it. Its essential for debugging
Always learn logging and unit tests, itll save you headaches :p
But theres a few suggestions to help you out. i need sleep, godspeed
alright thanks!
Cheers~
sadly didn't give much more info
Says it timed out but connected? Theres a logic error with that code then
Something in the code that threw that error also sent connected. Somethings wrong with the code that spit that out. Keep trying :p
no yeah that Connected shouldn't be there
it was right after the connect method and i should've put it inside the try except
after the exception was thrown it just continued and printed Connected
but it didnt connect
what am i looking for in wireshark?
Get your 2 local ips of the devices and folloe the packet and where its dropping at
Start a capture, try to connect to server. When it fails, look and see where the packet went. Did it not find the correct IP to connect to? Port issue?
I would bet on there being a vm issue. I would use 2 seperate machines instead
Being the network channel, the connection is trying and either not finding the servers IP or just timing out due to latency issues would be my guess. I suspect the vm being the issue and recommend 2 machines
idk who to ask at the office lol
Hmmm not having a second device sucks
Maybe try an ssh server? Or like I said, vpn on your VM
So its a different IP
im using this as a filter for wireshark
Might need to filter by port instead
The client machine will definitely send out a packet searching for the server
You can follow it and see where it stops. Your router, a firewall, etc
Look into wireshark filter docs for further assistance
I dont use it often and am not a guru on wireshark but it will help I believe
Client: hey wheres this ip?
Server: im over here!
Client: heres your data
Lol
Something like that
Check for acknowledgement packets and push packets
im working on it, it doesnt like my filters lol
Wireshark can be a pain lol, peep the docs
okay i found something, looks like these appear when i run the client code
okay🙏 go sleep
Godspeed
wireshark on server machine doesn't detect anything at all
Sounds like a setting issue then. Try 2 seperate machines when you can, local and over the internet
I may be able to help out tomorrow with a secondary machine
Feel free to add me
ill need to see how hosting outside of local network works
Ah. Shouldnt be too bad
traditional http/1 and also the newer http/2 is TCP.. however http/3 (developed by google as well) is using something called QUIC, which are essentially UDP based connections.
okay
@cold geyser I have a question: Does chrome support HTTP/3
yes
you don't
you use a public facing webserver with a reverse proxy config, like nginx or similar, and those would support http/3 if at all. django communicates with the "outside" (the webserver) using WSGI or ASGI protocol
then you have to see if nginx already supports http/3
you usually don't connect to django directly. You'd run it using a wsgi/asgi server, and connect to that one instead, usually through a webserver like nginx. https://docs.djangoproject.com/en/4.1/howto/deployment/
what should the packet look like when a client connects to a server using python socket?
Im not sure if this is te right channel to ask this question but I'm wondering how
to mount a volume in Docker
with all the files inside the directory
Hi
What are you trying to do?
Or why?
Have you solved it?
I've not worked with docker in a long time, but if you tell me, I could try to help you, it shouldn't be hard
I ask, because most of the time, people mix up binds, volumes and I think there's an extra way to manage storage
Well basically what i was trying to do it's to access some python scripts outside the container
I had my volumes mounted with the paths but somehow they didn't show the files inside the volumes
Turns out i was missing './' in the name of the mount
this is wrong
- data:/opt/airflow/data
this is right
- ./data:/opt/airflow/data
Glad you fixed it!
Thanks !
Hi guys, I'm very new to networking, and I was trying to configure nat so I could test it
I've a small server (that does nothing, basically, just be there for testing), I can access from my phone
But when I try to access from my public ip, it doesn't work
I tested it on yougetsignal.com as well and I've had no luck
I was following this tutorial
https://youtu.be/H_z76hV3wRw
How to port forward those pesky arris routers
I've very minor exp with networking, basically know nothing
Yesterday I even tried enabling DMZ and it didn't work either
I don't know what's this x(
I don't know, hopefully, not
I also just thought that my isp could be using cg nat, but I doubt it
Yes
I think, if my isp uses cg nat, I won't be able to do this, right?
Holy cow
I'm looking up how to know if my isp uses cg nat
I think it does it 😢
Very much likely they're using it
Thank you
Yes cg nat or dual stack like won't work
Lite
But you have connection with your phone
Can I request them when they is tall the stuff to not use cg nat nat and give me ipv6 or something?
Yes, I can connect from within my lan
Ah, OK. Depends on your ISP. If they're lacking ips then they will use cgnat sadly. And for duals take you can probably contact your provider
Thank you, I'll see what can I do
I was lucky. My provider "only" uses dynamic ipv4 and proper iv6
Cg nat is absolute perversion. But since no one wants ipv6 it's what we get
Can someone help me out with some Docker problems again haha
i'm trying to access from the airflow-airflow-worker-1 through a python script with psycopg2 to the airflow-capstone-db-1 container
But im getting this error
could not translate host name "postgres://capstone-db:5432" to address: Name or service not known
Nvm i've fixed it
Turns out I only needed to pass the service name to the host instead of this .
Help solve the problem. I have 1000 users and 1000 articles. Forum. How can I make the user know which articles he has read and which he has not? Help me google please. You can create an array column where read articles will be stored. What's the best way to travel?
Hey, there is a certain mobile game for which I want to create a bot, but it has no public API. If it was a web game then just opening developer tools I would be able to find the API calls its making, but since its a mobile game, I want to know how can I go about intercepting the traffic. In general for any mobile app or desktop app(which is not opened through a browser) how does one see the requests made by the app.
You could make a dictionary where the key is the user and the value is a list of 1-1000 True or False boolean expressions
Or you can also make a list of the articles and make a list in the value of the key in the dict and append the article id everytime they read an article
You can connext to a proxy (I use burp suite) and then check all the requests happening there
Honestly, I don't know much about this, but to catch the packets you can use Wireshark, if they send them without encryption, you could pretty much read them in plain text, but I doubt this is the best approach
Probably decompiling the app would the the best approach
Also, what you're doing is probably prohibited and if you get caught you'll get banned, very likely
Hey anyone know subnetting
sure
what's the issue
though fair warning of advice i'm not very good at it and it's been a while :p
Thats my question
I just want to check my answer with someone
Please check if it is correct
could you rotate that if you can? thanks
is it possible to read the packets and detect bad packets(malicious) from the network traffic using ML algorithms for the detection in realtime?
Lots of companies are trying to do that. That was also the topic of the kdd 99 cup
so like, at present there is no NIDS that works in real time reading the network traffic and detecting bad packets from it, right?
tons of them
snort does not work in real time does it?
Tons of established and startups went into ML applied to networking for the past 10 years
I haven't look at snort for decades. So can't comment specifically on it
alright...well i am working on my UG project and I want to create an IDS that works in realtime
sounds great!
yeah well I am kinda stuck after the network traffic capturing and logging part
what's the hold up specifically? Once you got it captured, you need to find anomalous traffic
can't figure out the interface...CLI is usually the case with most cysec tools, but I wanna implement it on a GUI, for the analysis through graphs and stuff..will it be slow if i am using tkinter for the GUI and matplotlib for the graphs
Two ways to go about it: push vs pull
You could have an interface and program that analyzes it as you go. Or you could have some background processing that will derive the anomalies that are then surfaced by your interface
I am not very familiar with networking tools, could you elaborate a little more or refer some tutorial that I can refer
Im not sure on a specific tutorial, but there are plenty of burp suite tutorials on yt you can choose from
does anyone know how to use websockets in python?
yep I am going just this way..
btw is there any python library that can record the network traffic(packet) data captured by a python program in .pcap file
so that we can analyse and visualize that data afterwards
Hey guys, so I'm trying to make a Torrent Downloader; so it downloads the file when you put in the magnet link, but it's saying that the dll load didn't work because the module could not be found. I've checked and it is installed, I even tried to uninstall it and reinstall it but it still has the same dll error on the first line where the import is. Any help would be appreciated.
import libtorrent as lt
import datetime
import time
import os
print("Torrent Downloader")
print("\nBy: ViridianTelamon.")
time.sleep(2)
link = input("\nEnter In The Magnet Link For Your Torrent File To Download Properly: ")
session = lt.session()
session.listen_on(6881, 6981)
try:
if not os.path.exists("Torrent Downloads"):
os.mkdir("Torrent Downloads")
except OSError:
print("\nTorrent Downloads Folder Is Already Made.")
parameters = {
"save_path": f"{os.getcwd()}/Torrent Downalods/",
"storage_mode": lt.storage_mode_t(2),
"paused": False,
"auto_managed": True,
"duplicate_is_error": True
}
print(f"\n{link}")
handle = lt.add_magnet_url(session, link, parameters)
session.start_dht()
start = time.time()
print(f"\nCurrent Date And Time: {datetime.datetime.now()}")
print("\nGetting The File Data.")
while(not handle.has_metadata()):
time.sleep(2)
print("\nGot The File Data.")
print("\nDownloading Process Is Starting.")
print(f"\nProcess Starting: {handle.name()}")
while(handle.status().state != lt.torrent_status.seeding):
downloader = handle.status()
state = ["Queued", "Checking", "Downloading File Data"\
"Downloading File", "Finished", "Seeding", "Allocating"]
print("% .2f %% Complete || Download: %.1f kb / 1s | Upload: %.1f kb / 1s | Peers: %d || %s" % \
(downloader.progress * 100 , downloader.download_rate / 1000, downloader.upload_rate / 1000, \
downloader.num_peers, state[downloader.state]))
time.sleep(8)
end = time.time()
print("\nProcess Finished: " + handle.name())
print("\n" + int((end - start) // 60), "Minutes" + " And " + int((end - start) % 60), "Seconds" + "Time Taken To Download The File Overall.")
print("\nDownload Process Finished.")
time.sleep(2)```
Hello I wanted to know if someone's good with WebRTC related softwares?
I'm thinking if it's possible to route WebRTC connections through socks5 proxy?
With the help of pyshark + pydivert
Sort of like a side project for me since webRTC is known to leak public ips with proxies
Okay nevermind my idea is a bit flawed lol
Was thinking if you could hijack the webrtc session and replace the source IP to that of your local socks5 proxy address
Can anyone tell me about smtp library , an how to get connect to mail, in list
does anyone knows to use iperf?
google it
there are lot of resources
I don't know about the last part but have you tried scapy
Yeah thanks! I actually found the library that does the exact work, it's Pypcap
I need some help with Python and Docker.
I'm running a script in python every 5 min with Apache Airflow mounted in a Docker Container
I'm accessing a PostgreSQL DB mounted in another docker container through the python script in the docker container
I can successfully perfom sql queries in the PostgreSQL container like counting rows
But when i try to export the table to a .csv it doesn't allow me to do it. It alway's throw this error
could not open file "/opt/transaction/2022-10-17/transaction_2022-10-17.csv" for writing: No such file or directory
HINT: COPY TO instructs the PostgreSQL server process to write a file. You may want a client-side facility such as psql's \copy.
The path to the .csv file it's being generated automatically by the python script that exports the file, i'm using os.mkdir & os.system with bash commands to access the docker container throught the containerID and mkdir commands
But so far both ways of trying to create the dir don't create the directory
Any ideas how to fix it ?
why is the PICKLE message takins 200ms to arrive when the header takes barely 1ms? this is from a NatNetwork VM which has 0.5-2ms ping against the server (hosted on the VM host)
that really depends on your code
what is client
how do i troubleshoot lag?
if i host my server on my host machine and run the client on a NatNetwork VM, the header takes 1ms to arrive and the pickled dict takes 250ms
if i host on a VM and client on another VM, both in an internalNetwork, both the header and the pickled dict take 40ms to arrive
Sorry for the long delay but work™️
it's most likely because your bandwidth rates and latency are difference
the header is much much smaller than the pickle object I imagine, so your bandwidth limits will be exacerbated or more noticeable with larger payload sizes
Guys i have a simple doubt regardsing using socket..
I connected my laptop (server) and android phone(client) to hotspot of another android device that has nothing to do with the code do i have to put the IP address of the client(android device containing client file) as host in my android (client file) and also inside the laptop (server file).
you put the ip of the server on both
#Server.py
import socket
port = 5000
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(('', port))
s.listen(1)
c, addr = s.accept()
print("CONNECTION FROM:", str(addr))
c.send(b"Hello from server")
msg = "Bye.............."
c.send(msg.encode())
c.close()
Client.py
import socket
port = 6270
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
s.connect(('', port))
msg = s.recv(1024)
while msg:
print('Received:' + msg.decode())
msg = s.recv(1024)
s.close()
Ip address i get after ipconfig
command in cmd of my laptop
you only get one ipv4 address?
Yes,i also check in android hotspot setting(with whom my laptop and android device is connected) and when i click on the device name of my laptop i can see the ip of it..
Is fastAPI good?
of course
When i tryed using two android devices as client and server and connecting them to another device hotspot,then i find it working seems like there is some problem in laptop accepting client 🤔🤔 may i have to go throught some settings but anyway thankyou for your inputs 🙂
very good
Hi im learning about protocols, and sockets, and networks in python but not quite grasping the idea,
what exactly is a protocol
it's an agreement between two computers, how and in what format data is to be exchanged... If a client connects to a server and just sends random data, the server won't understand what it means and fails processing it. so both client and server need to agree on a protocol on how exactly the data, that is exchanged, needs to be structured so the receiving end understands it
I highly suggest getting basic understanding of the osi/iso model.
Sani has sent you a good definition - think of it like a language. You and I are speaking the same language right now, it can be analogous to a protocol. We understand each other and can communicate. Different machines on a network do the same thing as well
Hello guys, I'm peter and I'm new to Descord, can anyone please help me to solve the "error_proto" while trying to connect to FTP ?
I have searched the internet with no luck
depends on what you use to connect to ftp and what your exact error is. "error_proto" sadly doesn't say much.
anybody could help me to transform numbers to human-redeable IP Address?
Guys can someone tell me how to configure switches, routers and do all the networking stuff using python? Pls share the resources if possible 🙃.
3128580215
the ip i need to get with that number is "186.122.88.119"
ohhhh
first
number to bin
and later bin to ip
im pretty sure thats not what you mean to do
lmao
@bold gyro :x: Your 3.11 eval job has completed with return code 1.
001 | File "<string>", line 1
002 | !e
003 | ^
004 | SyntaxError: invalid syntax
!e
num = 3128580215
while num > 0:
print(num % 256)
num //= 256
@umbral cargo :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 119
002 | 88
003 | 122
004 | 186
It depends heavily on the vendor, what type of switches/routers are you planning on configuring?
If you want to use can also just use bin I think
!e
ip = "186.122.88.119"
b = list(map(bin, map(int, ip.split("."))))
print(b)
@zealous flint :white_check_mark: Your 3.11 eval job has completed with return code 0.
['0b10111010', '0b1111010', '0b1011000', '0b1110111']
slightly esoteric but it works
yeah, but im not ussing python
i need to use lua for this
it will be a lot easier
conceptually it should still be the same
yeah, but now im trying to pass this to lua
i end using PY in lua, lmao
anyone here in the network security field?
Just ask your question. Don't ask to ask, ask for topic experts or DMs. Skip the formalities and ask away 
I want to ask, sir. May I? Well okay. So I do learn go rn, I love this language but I'm doubting if I will be able to find a junior position with this lang, so I decided to learn python as well. So to be able to do networking stuff on both language I need a theory I guess, where can I get that? I mean, can you link some resources or give some advices on learning theory? (P.s. I checked pinned messages, so please don't refer that)
I find that often times knowing a programming language or two doesn't always help with networking
That's why I am asking for theory to understand stuff
I know plenty of people in the field who only know one or two languages and not well either
Ah right. I read that as you asking for resources on using python/go with networking
Because lang doesn't matter,code is code, the main part is to understand concepts
!resources I haven't checked here specifically for networking but it might be worth a shot
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
As this is fundamentally separate from python
oh ye, lang issues, I meant networking theory
there isnt much, guess i'll have to make some 😕
It's my first time working with a tcp server, I have checked the networking FAQ as well so I made sure these troubles were crossed off. I am currently trying to make a server that connect to an OBD device. The OBD sends a log in message such as C00000009DAA020000000000010001001047325F48312E315F56322E31000300133836313434353033343533383130330004000A313135323030000200153147314A4335343434523732353233363900050005010006000B6265656C696E650007000B6265656C696E650008000500000900183839373031393931363031313930343036363466000A0017696E7465726E65742E6265656C696E652E7275C0 and I have to return a response like this C00100000DFF0300000000000100C0
Here is my current code:
import socket
PORT = 1234
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((socket.gethostname(), PORT))
s.listen(5)
print('Server is running...')
while True:
clientsocket, address = s.accept()
print(f"Connection from {address} has been established!")
clientsocket.send(bytes.fromhex('C00100000DFF0300000000000100C0'))
that doesnt matter @lucid scroll
trying to make a server that connect to an OBD device
the OBD device needs to connect to the server
not the other way around
whats not working @jovial fable
Yes that's what I thought so too, but I added it and it ended up working!
I ended up going back to the real python tutorial and using their code instead of another i found online:
import socket
HOST = "127.0.0.1" # Standard loopback interface address (localhost)
PORT = 1234 # Port to listen on (non-privileged ports are > 1023)
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.bind((HOST, PORT))
s.listen()
print('Server is running...')
conn, addr = s.accept()
with conn:
print(f"Connected by {addr}")
while True:
data = conn.recv(1024)
print('Raw Bytes data: ', data)
print('Hex Data: ', data.hex())
if not data:
break
conn.sendall(bytes.fromhex('C00100000DFF0300000000000100C0'))
Hello you know why "https://i.instagram.com/api/v1/users/web_profile_info/?username=maicleitomoficial" does not return json to me but html
url = f"https://i.instagram.com/api/v1/users/web_profile_info/?username={USERNAME}"
req = urllib.request.Request(
url,
data=None,
headers={
'User-Agent': 'Instagram 219.0.0.12.117 Android',
'Accept': "*/*",
'accept-language': "fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7",
'origin': "https://www.instagram.com"
}
)
response = urllib.request.urlopen(req)
response = response.read().decode("utf-8")
return response
because the problem is that I don't get the information I need
I just looked with a friend, we did the same command for him, it works, but for me, it doesn't work on my 2 computers
i tested it on postman and it is return json, if you are using vscode, then i recommend to use thunderbolt to test your http requests
where can i find thunderbolt?
it's a vscode extension
thank you
does anyone know how to drop an ip permanently or for a set period of time if an ip exceeds a rate limit in either ufw or iptables?
I use Fabric in order to connect to an SFTP client in order to upload and download files from it. Connecting, uploading and downloading files works.
I don't know how to properly handle my credentials though. I don't want to type in my password every time I connect and I also don't want to write it in plain text. I have read through Fabric's documentation telling me about keyfiles, passphrases and SSH configs, but I couldn't really follow. Can you give me an ELI5 version of it?
how do i know when a websocket connection is closed by the client so that i can do some cleanup activity on the server
what library are you using?
Hello everyone, i am facing a little problem with python requests lib on my raspberry.
I am trying to build a bot with python and to do so i am using requests library.
When i try to do a GET on some URL to get info from i have a 403 error. The problem is that on my mac when running the same code i get a 200.
Version 3.9.0 for python
Raspberry pi on Raspberry os
Thanx for helping
what i am getting from a curl command on my raspberry
Hello guys,
Does anyone know how to connect to FTP that has a text file that contains public keys necessary for this connection ?
What are you trying to achieve?
@wicked vigil
I want to connect to FTP through filezilla and upload some files with python
Take a look at https://docs.python.org/3/library/ftplib.html
I have seen this link before but I'm kinda new and don't know which one can help me to connect to the FTP
Especially as i have a txt file that contains public keys necessary to connect
Literally says it
It's not working
I have to use the txt file somewhere but i dont know how
The public keys
Take a look at the docs oof
hey so if i wanna do like a certain job of coding like machine learning ant networking do i learn the whole language or just the parts i need to learn
there isn't really any "networking" or "ML" part in the python language. And learning the language itself is really just a small part of the whole learning process.
there are libraries that cover those topics, but to use them, you need to first understand how to use python
@zealous flint
is this good so far?
!e
from socket import gethostname, gethostbyname
print(gethostbyname(gethostname()))
@misty coral :x: Your 3.10 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 3, in <module>
003 | socket.gaierror: [Errno -3] Temporary failure in name resolution
ah rip no networking
LGTM
are you sure that the subnet mask remains the same?
yes
am i doing anything wrong? please let me know what i should change.
Everything looks good! Great job!
thanks bro
Hey, There!
I'm getting a ConnectionResetError with BaseHTTPRequestHandler from builtin http module. The error happens when a client cancelled a sending a packet to server.
Is there a way to catch this error in the BaseHTTPRequestHandler class?
Here's what I have:
def run(server_class=HTTPServer, handler_class=Server):
server_address = (SERVER_IP, SERVER_PORT)
httpd = server_class(server_address, handler_class)
def wrapped():
try:
print(f"Starting httpd on port {SERVER_PORT}")
httpd.serve_forever()
except ConnectionResetError:
wrapped()
wrapped()
Resetting all the connections when it occurs is definitely a no no.
Server class is a subclass of BaseHTTPRequestHandler
websockets
.
If I use ipv6 in socket , will I be able to connect it by the device which is not on the same network?
is there a way I can get the packet info like this using any python library...I am making a packet sniffer with GUI and I want to get the packet info like this like i did in wireshark
i am using scapy for the packet capturing
how to get client server lag of 2 machines running on the local network
ping tells you latency in milliseconds
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
Does anyone know whether i done this correctly?
Anyone have a good tip for a root/dedicated server with a good price to run scripts on it?
is there any way to identify if there is a traffic analyzer in the network by an external agent?
take a look at https://www.fabfile.org/
What is the best way to ping a website without any 3rd party libraries and sub-processes?
https://stackoverflow.com/a/32684938
Is this what you're looking for?
Is there a way without sub processes ?