![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programming Guru
![]() |
Networking - Safety Concern
If I have a program that will download (textual) content based on what a client tells me to download, what kind of safety should I be concerned about?
My biggest concern was first that I shouldn't let them tell me to access anything in the local network. So I should filter out 127.0.0.1 and 192.168.X.X(X). However I've also seen 10.174.X.X(X) used for business networks, and am not exactly sure what else is possible. What's the best way to securely filter out downloading local content? If I manually check the address with something like: if url[:7].lower() == 'http://':
url = url[7:]
if url[:9] == '127.0.0.1' or url[:5].lower() == 'local':
return self.response['values']Can downloading textual content lead to any client-side side-effects? Finally, can malicious code be pushed into urllib2.Request, such as the problem with eval with input? |
|
|
|
|
|
#2 |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
Valid local networks IPs are defined in RFC 1918:
10.0.0.0 - 10.255.255.255 (10/8 prefix)
172.16.0.0 - 172.31.255.255 (172.16/12 prefix)
192.168.0.0 - 192.168.255.255 (192.168/16 prefix) python Syntax (Toggle Plain Text)
python Syntax (Toggle Plain Text)
python Syntax (Toggle Plain Text)
|
|
|
|
|
|
#3 | |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
Quote:
Probably not. |
|
|
|
|
|
|
#4 | |
|
Programming Guru
![]() |
Wow thanks! That's some great useful information there! It's funny because I was playing with the socket.gethostbyname, but for all the wrong reasons.
Quote:
Is it possible that they could use that to make me download a virus or potentially harmful data? |
|
|
|
|
|
|
#5 | |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
Quote:
|
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| To Networking GODs and GURUs, Is this possible? | thrasherx | Project Ideas | 4 | Oct 31st, 2006 10:00 PM |
| C++ Networking Question | MorphysGhost | C++ | 5 | Apr 22nd, 2006 11:21 AM |
| java networking tutorials | Brent | Java | 2 | Aug 31st, 2005 9:29 AM |
| Networking in vb.net | BrianN | Visual Basic | 2 | Aug 15th, 2005 5:57 PM |
| networking in VB | Brent | Visual Basic | 1 | Aug 4th, 2005 10:17 AM |