原定于2022年7月12日出成绩的广州中考,却因为改卷老师的改卷速度,提前在2022年7月9日发布了成绩,别看这短短的三天,7月9日一出成绩,朋友圈哀嚎一片,大家都觉得今年的分数线太高了。就那我自己举例子,我的社交媒体中只有一两个考的不错的人公布了自己的成绩。然后,我就看到了一条来自我妈的转发信息。
请注意,本程序仅供学习使用,请不要用于任何非法用途
 是这样的  还有两个不可思议的  虽然后边证实这些是假的,在感叹的同时,我也在心中有了一个小小的计划,咱们为何不能通过咱们的编程“造假”,在朋友圈当中转发一个实际上不是自己而是伪造的分数呢,于是,咱们说干就干!
捣鼓中考官方网页
首先咱们登录后点击“综合查询”,然后看一看咱们的分数页面  然后一番操作之后,我们可以发现成绩页已经出现了  然后,咱们CTRL+S 保存下整个页面 记得选择MHTML格式的 
然后,我们就可以获得整一个网页。我也将我自己保存下来的网站文件传到了网盘上边,所以大家点击这里,就可以下载了

根据常识,我们可以得知,MHTML文件中的中文是采用Quoted-printable编码的。然后这个编码的方式就令我眼前一黑。最终在一番摸索下,我们终于知道了如何进行编解码。详细可以看看这位大佬的文章Python (巨蟒) 简易实现 quoted-printable 编码
 所以在上传的文件当中,其实考生名被我处理成了“我的名字”,那么接下来的一番操作,我们可以人工先尝试操作一遍,然后再让程序帮我们运行。
手动操作
http://www.hiencode.com/quoted.html
这个网站可以帮我们完成Quoted-printable的编码,我们打开并选择gb2312的选项

打开SublimeText,导入MHTML文件,按下CTRL+F 进行查找=C4=E3=B5=C4=C3=FB=D7=D6  在工具中输入自己的名字,例如王大牛  在Sublime Text中按下Ctrl+Shift+F 并将获得的编码复制到REPLACE的地方  重新刷新页面可以看到,中考查询界面已经被我们更改  接下来再用CTRL+SHIFT+F 查找搜索咱们的语文成绩,以上图的112为例  然后咱们直接更改分数,动一动邪恶的小手指  让老师们开心的事情发生了!  但是我们还是可以看到下面有一些破绽,所以咱们继续更改  更改一下这两行的一点点代码 我们发现这简直是完美 
程序制作
刚刚既然已经过足了手瘾,那么现在就是真正的时刻,我们应该用我们的代码知识来进行编程啦,在编程之前,我对下载下来的文本进行了一些处理,这对我们的后续编程工作有益。(实际上就是将几个难找的地方改成了中文)
创建一个python文件,取名“HSEES Changers” HSEES是High school entrance examination scores的缩写。
接收文件HSEES.mhtml
 创建函数,直接更改我们文件中的内容  然后咱们完善一下这个时间这个小瑕疵,并在这里进行转换  最后咱们使用最丑陋的控制台输入来进行整理  于是,我们整一个程序就大功告成了!  
import requests
from bs4 import BeautifulSoup
import datetime
def requests_quopri(msg):
data = {
"text" : msg,
"flag" : "quoted",
"encode_flag" : "gbk"
}
quopri = requests.post("http://www.hiencode.com/ctf/ctf_encode",data = data)
quopri = quopri.text
soup = BeautifulSoup(quopri,"html.parser")
quopri_show = soup.div.div.pre.text
return quopri_show
def changers(chi="120",mat="120",eng="120",pol="90",his="90",phy="100",che="100",pe="70",ms="810",same="1",name="王大牛",num="0112280000"):
qp_name = requests_quopri(name)
date = datetime.date.today()
year = date.year
month = date.month
day = date.day
now_date = str(year)+"年"+str(month)+"月"+str(day)+"日"
qp_date = requests_quopri(now_date)
with open("./HSEES.mhtml") as hsees:
hsees_line = hsees.read()
hsees_line = hsees_line.replace("语文",chi)
hsees_line = hsees_line.replace("数学",mat)
hsees_line = hsees_line.replace("英语",eng)
hsees_line = hsees_line.replace("道法",pol)
hsees_line = hsees_line.replace("历史",his)
hsees_line = hsees_line.replace("物理",phy)
hsees_line = hsees_line.replace("化学",che)
hsees_line = hsees_line.replace("体育",pe)
hsees_line = hsees_line.replace("总分",ms)
hsees_line = hsees_line.replace("同位号",same)
hsees_line = hsees_line.replace("名字",qp_name)
hsees_line = hsees_line.replace("学号",num)
hsees_line = hsees_line.replace("时间",qp_date)
with open("./FakeScore.mhtml","w+")as fs:
fs.write(hsees_line)
fs.close()
def show_score():
chi = input("请输入你的语文成绩:")
mat = input("请输入你的数学成绩:")
eng = input("请输入你的英语成绩:")
pol = input("请输入你的政治成绩:")
his = input("请输入你的历史成绩:")
phy = input("请输入你的物理成绩:")
che = input("请输入你的化学成绩:")
pe = input("请输入你的体育成绩:")
ms = int(chi)+int(mat)+int(eng)+int(pol)+int(his)+int(phy)+int(che)+int(pe)
import random
same = random.randint(1,100)
name = input("请输入你的名字:")
num = input("请输入你的学号:")
print("程序正在自动生成成绩中... 请稍后 ...")
changers(str(chi),str(mat),str(eng),str(pol),str(his),str(phy),str(che),str(pe),str(ms),str(same),str(name),str(num))
import os,webbrowser
webbrowser.open("file:///"+os.path.realpath("FakeScore.mhtml"))
show_score()
祝福各位中考考生考上理想的高中呀!
|