安装nmap
通过TCP
测试ncat
同时打开两个命令窗口
左边的充当服务器,打开
9999
端口
右边访问本地服务器
9999
端口- 在左边窗口输入句子,右边可显示
架设第一台服务器
- 将自己所写的网页文件放入一个文件夹中
在控制台进入次文件夹
- 创建一个本地服务器
如果是在自己的本地
Linux
电脑,可在浏览器直接输入:- 访问你所上传的网页
因我是使用的树莓派进行练习,通过
ssh
连接,所以需要在浏览器输入,树莓派的ip
地址访问:
- 网页有访问时,服务器有相应操作记录
localhost
与端口
利用
host
查看本地服务:
端口
http
默认端口:80https
默认端口:443
通过ncat
手动get
网页
在当前控制台保持服务器状态,打开新控制台
在右侧输入:
再输入:
- 敲两次回车确认
状态码
1xx: 消息
- 100:
Continue
- 101:
Switching Protocols
- 102:
Processing
2xx: 成功
- 200:
OK
- 201:
Created
- 202:
Accepted
- 203:
Non-Authoritative Information
- 204:
No Content
- 205:
Reset Content
- 206:
Partial Content
- 207:
Multi-Status
- 208:
Already Reported
- 226:
IM Used
3xx重定向
- 300:
Multiple Choices
- 301:
Moved Permanently
- 302:
Found
- 303:
See Other
- 304:
Not Modified
- 305:
Use Proxy
- 306:
Switch Proxy
- 307:
Temporary Redirect
- 308:
Permanent Redirect
4xx客户端错误
- 400:
Bad Request
- 401:
Unauthorized
- 402:
Payment Required
- 403:
Forbidden
- 404:
Not Found
- 405:
Method Not Allowed
- 406:
Not Acceptable
- 407:
Proxy Authentication Required
- 408:
Request Timeout
- 409:
Conflict
- 410:
Gone
- 411:
Length Required
- 412:
Precondition Failed
- 413:
Request Entity Too Large
- 414:
Request-URI Too Long
- 415:
Unsupported Media Type
- 416:
Requested Range Not Satisfiable
- 417:
Expectation Failed
- 418:
I'm a teapot
- 420:
Enhance Your Caim
- 421:
Misdirected Request
- 422:
Unprocessable Entity
- 423:
Locked
- 424:
Failed Dependency
- 425:
Unordered Collection
- 426:
Upgrade Required
- 428:
Precondition Required
- 429:
Too Many Requests
- 431:
Request Header Fields Too Large
- 444:
No Response
- 450:
Blocked by Windows Parental Controls
- 451:
Unavailable For Legal Reasons
- 494:
Request Header Too Large
5xx服务器错误
- 500:
Internal Server Error
- 501:
Not Implemented
- 502:
Bad Gateway
- 503:
Service Unavailable
- 504:
Gateway Timeout
- 505:
HTTP Version Not Supported
- 506:
Variant Also Negotiates
- 507:
Insufficient Storage
- 508:
Loop Detected
- 510:
Not Extended
- 511:
Network Authentication Required
非官方状态码
- 420:
Enhance Your Calm
- 498:
Invalid Token
- 499:
Token Required
- 520:
Unknown Error
- 521:
Web Server Is Down
将用户重定向
创建服务器
在浏览器访问此端口
在命令窗口输入:
- 敲两次回车,进行重定向
通过class代替手动输入
跑一下手写的服务
- 转到
.py
文件所在的目录
- 浏览器访问
搜索查询网址
利用
python
将搜索的网址进行拆分