http-theft-bank-LiujJian created by GitHub Classroom

http-theft-bank-start-template

木犀银行抢劫游戏模版 hope this can help you

To begin with

请完成游戏。

序章

此时你正在敲代码解题,突然,电脑黑屏了,并逐行出现了文字:

>欢迎参与Backend黑客组织的考核_

>我们已经在暗中观察你很久了_

>也知道你期待加入我们组织_

>现在机会来了_

>请骇入MUXI银行最深处的电子密码门_

>我们会在那里恭候你的光临_

文字的最后,出现了一个字符串:

http://http-theft-bank.gtainccnu.muxixyz.com/api/v1/organization/code

似乎是一个网址,用浏览器打开或许能找到一些线索......

Tips

  • 通关游戏,目前一共有 5 个 checkpoint。通关游戏之后会有明确的提示

  • 目前模版里有 5 个文件夹,每个 checkpoint 的程序放在对应文件夹里面

    单独一个 main.go 文件,不要改文件名,否则测试无法通过

  • 如果是用 github classroom,每推一次仓库(可能)会告诉你有无通过

  • 注意把每个 checkpoint 返回的文本信息要输出,自动检测需要

  • 为了更容易通关,需要导入 hacker-support 包

    包地址: https://github.com/Grand-Theft-Auto-In-CCNU-MUXI/hacker-support

  • 有能力的可以看服务端源码,等于作弊通关

    服务端地址: https://github.com/Grand-Theft-Auto-In-CCNU-MUXI/http-theft-bank

附录 http

URL

URL 需要提供的信息有协议名,服务器地址,端口号,路径

http://localhost:8080/helloworld

在这里,http 就是协议名,其他的还有 https、FTP、SSH 等

localhost 就是主机地址localhost 表示的是本机的地址,又可以写成 127.0.0.1。有时,在主机名前也可以包含连接到服务器所需的用户名和密码(格式:username:password@hostname)。

8080表示的是端口号

后面则是跟着路径,一般用来表示主机上的一个目录或文件地址,通常由零或多个/隔开的字符串

又如百度的 url 为:https://www.baidu.com

其中 www.baidu.com 为其域名。把它解析成一般形式的 url,也是上述的 主机地址+端口号 形式。

详细介绍

http 工作流程

使用 http 常用于 B/S 模型,即 client & server ,一端担任客户端角色,另一端担任服务端角色。

客户端给服务端发送请求,服务端收到请求后,做一些处理再返回给客户端一个响应

流程如下:

                 request
       ----------------------------->
client                                server
       <-----------------------------
                 response

值得注意的是请求报文里面有请求的方法。例如,getpost 等等。在服务端返回的时候会包含一个状态码,就是我们平时所熟知的200404等等。

http 协议方法

  • GET 用于获取资源

    用来请求访问的资源。

  • POST 用来传输实体主体

  • PUT 用来传输文件

  • DELETE 用来删除文件

  • OPTIONS 用来询问支持的方法

  • HEAD 获得报文的首部

  • PATCH 在请求中定义了一个描述修改的实体的集合,如果被请求修改的资源不存在,服务器可能会创建一个新的资源

HTTP Header 的介绍

HTTP头字段(英语:HTTP header fields)是指在超文本传输协议(HTTP)的请求和响应消息中的消息头部分。它们定义了一个超文本传输协议事务中的操作参数。HTTP头部字段可以自己根据需要定义,因此可能在 Web 服务器和浏览器上发现非标准的头字段。

HTTP 头字段根据实际用途被分为以下 4 种类型:

  • 通用头字段(英语:General Header Fields)
  • 请求头字段(英语:Request Header Fields)
  • 响应头字段(英语:Response Header Fields)
  • 实体头字段(英语:Entity Header Fields)\

Requests 部分 (request 的 header 简称请求头)

Header 解释 示例
Accept 指定客户端能够接收的内容类型 Accept: text/plain, text/html
Accept-Charset 浏览器可以接受的字符编码集。 Accept-Charset: iso-8859-5
Accept-Encoding 指定浏览器可以支持的web服务器返回内容压缩编码类型。 Accept-Encoding: compress, gzip
Authorization HTTP授权的授权证书 Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Cache-Control 指定请求和响应遵循的缓存机制 Cache-Control: no-cache
Connection 表示是否需要持久连接。(HTTP 1.1默认进行持久连接) Connection: close
Cookie HTTP请求发送时,会把保存在该请求域名下的所有cookie值一起发送给web服务器。 Cookie: $Version=1; Skin=new;
Content-Length 请求的内容长度 Content-Length: 348
Content-Type 请求的与实体对应的MIME信息 Content-Type: application/x-www-form-urlencoded
User-Agent User-Agent的内容包含发出请求的用户信息 User-Agent: Mozilla/5.0 (Linux; X11)
Host 指定请求的服务器的域名和端口号 Host: www.zcmhi.com

Responses 部分 (response header 简称 响应头)

Header 解释 示例
Cache-Control 告诉所有的缓存机制是否可以缓存及哪种类型 Cache-Control: no-cache
Content-Encoding web服务器支持的返回内容压缩编码类型。 Content-Encoding: gzip
Content-Length 响应体的长度 Content-Length: 348
Content-Type 返回内容的MIME类型 Content-Type: text/html; charset=utf-8
Expires 响应过期的日期和时间 Expires: Thu, 01 Dec 2010 16:00:00 GMT
Location 用来重定向接收方到非请求URL的位置来完成请求或标识新的资源 Location: http://www.zcmhi.com/archives/94.html
Set-Cookie 设置Http Cookie Set-Cookie: UserID=JohnDoe; Max-Age=3600; Version=1
cookies

由于http是一种无状态的协议,所以服务器是无法对之前的客户端进行记录的,因此使用了Cookie技术,可以得到之前的状态信息。写在了请求和响应的报文内。比如你在登陆了淘宝后,系统再次访问其他页面,倘若需要验证用户权限,不可能让你再次登入,因此使用了这个技术。同理,token的作用也是类似。

返回结果的HTTP状态码

  • 2XX 表示成功
    • 200 正常处理
    • 204 处理成功,但是没有资源返回
    • 206 表示客户端进行了范围的请求,服务端也成功执行了这个部分的请求
  • 3XX 表示需要重定向,表明浏览器需要执行某些特殊的处理以正确处理请求
    • 301 表示资源的位置永久更换了
    • 302 表示的是临时更换了位置
  • 4XX 表示客户端错误
    • 400 表示请求报文内存在语法错误
    • 401 表示认证失败,页面需要认证信息
    • 403 表示访问被服务端拒绝了
    • 404 表示服务器上没有请求的资源
  • 5XX 表示服务器的错误
    • 500 表示服务端本身的问题
    • 503 表示服务端暂时处于超载或者停机维护
Similar Resources

Stargather is fast GitHub repository stargazers information gathering tool

Stargather is fast GitHub repository stargazers information gathering tool that can scrapes: Organization, Location, Email, Twitter, Follow

Dec 12, 2022

Give your dependencies stars on GitHub! 🌟

Give stars to your dependencies of Go repositories and say thank you to developers!!

May 29, 2022

GitHub Review Stats

gh-review-stats - GitHub Review Stats A command line tool for examining review statistics for GitHub repositories. Installing Download a pre-built bin

Jul 21, 2022

set and get github user statuses

gh user-status being an extension for interacting with the status on a GitHub profile. gh user-status set gh user-status set interactively set status

Nov 19, 2022

Auto-updating F-Droid repo using GitHub Actions

Auto-updating F-Droid repo using GitHub Actions

fdroid This repository hosts an F-Droid repo for my apps. This allows you to install and update apps very easily. How to use At first, you should inst

Dec 29, 2022

Golang Github Template Helper

ggth Golang Github Template Helper Usage ggth PreBuilt Binaries Grab Binaries from The Releases Page Install Homebrew brew install Jmainguy/tap/ggth

Jan 4, 2022

A Github action to check if IDT could synthesize a given DNA sequence.

dna-is-synthesizable A github action to check if a part is synthesizable from a given Genbank file. dna-is-synthesizable is a Github Action that recei

Oct 28, 2021

Monitor star changes of GitHub repo, and send the notification to slack or lark.

stargazers Features monitor the star events of the GitHub repo send the notifications to Slack or Lark How to use For Lark, create a bot called like s

Dec 4, 2022

Print lines matching a pattern in repositories using GitHub API

Print lines matching a pattern in repositories using GitHub API

gh-grep Print lines matching a pattern in repositories using GitHub API Usage $ gh grep func.*schema.Schema --include=**/*.go --owner k1LoW --repo tbl

Dec 1, 2022
Comments
  • Feedback

    Feedback

    :wave:! GitHub Classroom created this pull request as a place for your teacher to leave feedback on your work. It will update automatically. Don’t close or merge this pull request, unless you’re instructed to do so by your teacher. In this pull request, your teacher can leave comments and feedback on your code. Click the Subscribe button to be notified if that happens. Click the Files changed or Commits tab to see all of the changes pushed to main since the assignment started. Your teacher can see this too.

    Notes for teachers Use this PR to leave feedback. Here are some tips: - Click the **Files changed** tab to see all of the changes pushed to `main` since the assignment started. To leave comments on specific lines of code, put your cursor over a line of code and click the blue **+** (plus sign). To learn more about comments, read “[Commenting on a pull request](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/commenting-on-a-pull-request)”. - Click the **Commits** tab to see the commits pushed to `main`. Click a commit to see specific changes. - If you turned on autograding, then click the **Checks** tab to see the results. - This page is an overview. It shows commits, line comments, and general comments. You can leave a general comment below. For more information about this pull request, read “[Leaving assignment feedback in GitHub](https://docs.github.com/education/manage-coursework-with-github-classroom/leave-feedback-with-pull-requests)”.

    Subscribed: @LiujJian

simple bank which is implemented using Golang

Banker The service that we’re going to build is a simple bank. It will provide APIs for the frontend to do following things: Create and manage bank ac

Nov 15, 2021
Bank-End Master Class [ Golang, Postges, Docker ]

Simple Bank This repository contains the codes of the Backend master class course by TECH SCHOOL. In this backend master class, we’re going to learn e

Dec 14, 2021
Simplebank - A simple bank with golang

Simple-Bank The service that we’re going to build is a simple bank. It will prov

Feb 1, 2022
Tools created for my OSCP preparation

goscp Set of tools created during my OSCP preparation. They include: gosheller - terminal based interface for cmdasp.aspx webshell. It provides intera

Dec 3, 2021
A poetry website created by Go and Vue.
A poetry website created by Go and Vue.

中华诗词 基于Go语言和Vue构建的前后端分离项目。( A poetry website created by Go and Vue. ) 中华诗词收录了上至先秦,下至当代共计五万余首诗词,完全免费并开放所有诗词内容和程序源代码,您可自由复制、修改、传播诗词内容和程序源码。 特色 后端采用GoFra

Sep 14, 2022
Quickly clone an entire org/users repositories into one directory - Supports GitHub, GitLab, Bitbucket, and more
Quickly clone an entire org/users repositories into one directory - Supports GitHub, GitLab, Bitbucket, and more

ghorg ghorg allows you to quickly clone all of an orgs, or users repos into a single directory. This can be useful in many situations including Search

Jan 1, 2023
GoThanks automatically stars Go's official repository and your go.mod github dependencies, providing a simple way to say thanks to the maintainers of the modules you use and the contributors of Go itself.
GoThanks automatically stars Go's official repository and your go.mod github dependencies, providing a simple way  to say thanks to the maintainers of the modules you use and the contributors of Go itself.

Give thanks (in the form of a GitHub ★) to your fellow Go modules maintainers. About GoThanks performs the following operations Sends a star to Go's r

Dec 24, 2022
generate my_github status using GitHub Actions
generate my_github status using GitHub Actions

generate my_github status using GitHub Actions

Sep 21, 2022
Bot to manage team members in GitHub organizations

Team manager Team manager is a utility that allows an organization owner to add or remove people from existing teams and / or assign people for GitHub

Oct 29, 2022
Generate spreadsheets based on GitHub contributions

pullsheet generates a CSV (comma separated values) & HTML output about GitHub activity across a series of repositories.

Oct 17, 2022