https://github.com/veerendra2/port-dictionaries
Python dictionaries for HTTP status codes, FTP return codes and TCP ports, etc
https://github.com/veerendra2/port-dictionaries
ftp-return-codes http-status-codes python tcp-ports
Last synced: 3 months ago
JSON representation
Python dictionaries for HTTP status codes, FTP return codes and TCP ports, etc
- Host: GitHub
- URL: https://github.com/veerendra2/port-dictionaries
- Owner: veerendra2
- Created: 2016-01-22T16:15:16.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-07-01T11:05:56.000Z (almost 6 years ago)
- Last Synced: 2025-01-22T05:17:47.688Z (4 months ago)
- Topics: ftp-return-codes, http-status-codes, python, tcp-ports
- Language: Python
- Homepage:
- Size: 53.7 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README


# Python Dictionaries
Simple python dictionaries for HTTP, FTP return codes and TCP ports, etc. Usefull when code throws number(HTTP return code), instead of diplaying return code number like `404`, show message what it means.In same way, when we are doing some networking stuff in python like collecting network connections, with help of `TCPPorts.py` we can identify destination service in it. For example, we have collected network connections(with tools like `conntrack`),the current machine made connection to another machine with destination port `80` which means a web server. Some we can guess like `80`,`8080` and some we dont know, with `TCPPorts.py` we can display the service name instead of port number.
#### Example code snippet
```
import requests
#Local Imports
import HTTPStatusCodesheaders = {'content-type': 'application/json'}
url="http://www.google.com" #Example URL
data={"data":"Your Data"}
response = requests.post(url, data=data,headers=headers)
print response
if response.status_code in HTTPStatusCodes.codes:
print HTTPStatusCodes.codes[response.status_code][0]
print "Description",HTTPStatusCodes.codes[response.status_code][1]
```* Collected TCP port from [http://www.iana.org](http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml)
* Collected HTTP status codes from [wikipedia](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
* Collected FTP returned codes from [wikipedia](https://en.wikipedia.org/wiki/List_of_FTP_server_return_codes)
* Collected TCP connections states from [kernel.org](http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/include/net/tcp_states.h?id=HEAD)