首页
关于
Search
1
pyinstaller打包小记
213 阅读
2
经典的execjs打开js编码错误
197 阅读
3
screen
188 阅读
4
linux pyenv+nvm nodejs
175 阅读
5
gif验证码识别
125 阅读
javascript
python
spider
app逆向
other
登录
/
注册
Search
标签搜索
逆向
opencv
hliang
累计撰写
25
篇文章
累计收到
31
条评论
首页
栏目
javascript
python
spider
app逆向
other
页面
关于
搜索到
6
篇与
的结果
2023-09-14
screen
常用命令:# 启动一个新的screen会话: screen # 启动一个新的screen会话并指定会话名称: screen -S spider # 列出当前所有的screen会话: screen -ls # 连接到一个已经存在的screen会话: screen -r 会话id/name # 删除screen会话 screen -S 会话id/name -X quit在screen会话中关闭当前窗口:按下Ctrl + a,然后按下k在screen会话中分离当前会话(后台运行):按下Ctrl + a,然后按下d在screen会话中退出会话:在所有窗口都关闭后,按下Ctrl + d# 判断是否在screen里面,有输出内容就标识在screen里面 echo $STY# 启动文件 screen -dmS spider python3.9 main.py# 按名称删除全部会话 for session in $(screen -ls | grep <会话名称> | awk '{print $1}'); do screen -S "${session}" -X quit; done{dotted startColor="#07b904" endColor="#d1ca10"/}使用例子编写start.sh脚本(监测代码更新启动此脚本,自动更新程序)查看是否启动程序screen -ls查看日志-切换到会话id里面screen -r id/name注意:在里面千万别按ctrl+c,这样的话会终止程序,这个screen会话就会结束保持后台运行先按ctrl+a 终端不会有啥反应 再按一下d
2023年09月14日
188 阅读
1 评论
1 点赞
2022-11-10
gin框架获取所有的get和post参数
gin获取所有的get参数和post参数
2022年11月10日
102 阅读
3 评论
0 点赞
2022-07-11
vir vps救援模式使用。
救援模式(先点VPS Control Panel按钮,救援模式)DD系统,适用于模板无法开机:会给你一个新密码,ssh连接进入救援模式后apt update -y apt install wget wget -O- 'http://wget.treesky.link/0:/DD/locmjj.com/centos-7-image.gz' | gunzip | dd of=/dev/vda(备用镜像网址:http://www.hl98.cn/centos-7-image.gz)D完关闭救援模式并1分钟后就进入centos7系统了,密码:Pwd@CentOS再运行dd脚本dd脚本网站:https://git.beta.gs/wget --no-check-certificate -O NewReinstall.sh https://git.io/newbetags && chmod a+x NewReinstall.sh && bash NewReinstall.sh如为CN主机(部分主机商已不能使用),可能出现报错或不能下载脚本的问题,可执行以下命令开始安装.wget --no-check-certificate -O NewReinstall.sh https://cdn.jsdelivr.net/gh/fcurrk/reinstall@master/NewReinstall.sh && chmod a+x NewReinstall.sh && bash NewReinstall.sh
2022年07月11日
13 阅读
0 评论
0 点赞
2022-02-09
supervisor使用
安装supervisorcentos:yum install supervisorubuntu:apt-get install supervisor安装完毕,会生成3个系统命令supervisorctl、supervisord和echo_supervisord_confsupervisord: 启动的服务supervisorctl: 操作程序,用来操作管理进程程序的,如 启动|停止|重启 等echo_supervisord_conf: 输出默认配置 并带有注释默认启动的配置文件/etc/supervisor.conf/etc/supervisord.d/配置web可视化界面vi /etc/supervisord.conf找到[inet_http_server]放开注释配置子进程日志存放目录childlogdir=/var/log/supervisor 新建一个管理后台进程cd /etc/supervisord.dvi jsrpc.ini粘贴默认配置[program:jsrpc] ;supervisor管理的名字 command=/root/jsrpc/https-jsrpc ;程序命令 directory=/root/jsrpc ;路径 autostart=true ;自动启动 autorestart=true ;启动重启 user=root ;用户 redirect_stderr=true最后重启一下supervisord 会自动启动配置的任务systemctl restart supervisord
2022年02月09日
101 阅读
0 评论
0 点赞
2022-01-19
逆向之字体反爬-使用woff转图片再识别的方式通过
1.请求api接口 通常会有woff的链接或者以base64的格式返回2.把woff保存下来,通过代码把里面的每个字转为图片from __future__ import print_function, division, absolute_import from fontTools.ttLib import TTFont from fontTools.pens.basePen import BasePen from reportlab.graphics.shapes import Path from reportlab.lib import colors from reportlab.graphics import renderPM from reportlab.graphics.shapes import Group, Drawing, scale class ReportLabPen(BasePen): """A pen for drawing onto a reportlab.graphics.shapes.Path object.""" def __init__(self, glyphSet, path=None): BasePen.__init__(self, glyphSet) if path is None: path = Path() self.path = path def _moveTo(self, p): (x, y) = p self.path.moveTo(x, y) def _lineTo(self, p): (x, y) = p self.path.lineTo(x, y) def _curveToOne(self, p1, p2, p3): (x1, y1) = p1 (x2, y2) = p2 (x3, y3) = p3 self.path.curveTo(x1, y1, x2, y2, x3, y3) def _closePath(self): self.path.closePath() def ttfToImage(fontName, imagePath, fmt="png"): font = TTFont(fontName) gs = font.getGlyphSet() glyphNames = font.getGlyphNames() for i in glyphNames: if i[0] == '.': # 跳过'.notdef', '.null' continue g = gs[i] pen = ReportLabPen(gs, Path(fillColor=colors.black, strokeWidth=1)) g.draw(pen) #这里加200像素为了留白 w, h = g.width+200, g.width+200 g = Group(pen.path) #偏移吧 g.translate(200, 50) d = Drawing(w,h) d.add(g) imageFile = imagePath + "/" + i + ".png" renderPM.drawToFile(d, imageFile, fmt) ttfToImage(fontName="./test.woff", imagePath="Img") 3.使用ddddocr识别文字以下为 猿人学比赛题第七题 字体反爬 代码实例:from __future__ import print_function, division, absolute_import import os import base64 import ddddocr import requests from fontTools.ttLib import TTFont from fontTools.pens.basePen import BasePen from reportlab.graphics.shapes import Path from reportlab.lib import colors from reportlab.graphics import renderPM from reportlab.graphics.shapes import Group, Drawing, scale class ReportLabPen(BasePen): """A pen for drawing onto a reportlab.graphics.shapes.Path object.""" def __init__(self, glyphSet, path=None): BasePen.__init__(self, glyphSet) if path is None: path = Path() self.path = path def _moveTo(self, p): (x, y) = p self.path.moveTo(x, y) def _lineTo(self, p): (x, y) = p self.path.lineTo(x, y) def _curveToOne(self, p1, p2, p3): (x1, y1) = p1 (x2, y2) = p2 (x3, y3) = p3 self.path.curveTo(x1, y1, x2, y2, x3, y3) def _closePath(self): self.path.closePath() def ttfToImage(fontName, imagePath, fmt="png"): font = TTFont(fontName) gs = font.getGlyphSet() glyphNames = font.getGlyphNames() for i in glyphNames: if i[0] == '.': # 跳过'.notdef', '.null' continue g = gs[i] pen = ReportLabPen(gs, Path(fillColor=colors.black, strokeWidth=1)) g.draw(pen) w, h = g.width+200, g.width+200 g = Group(pen.path) g.translate(200, 50) d = Drawing(w,h) d.add(g) imageFile = imagePath + "/" + i + ".png" renderPM.drawToFile(d, imageFile, fmt) dd=ddddocr.DdddOcr() woff_path="./test.woff" imagePath="./woff_img" if not os.path.exists(imagePath): os.makedirs(imagePath) headers = {'user-agent': 'yuanrenxue.project',"cookie":"sessionid=JinJiaoDaWang-alex"} def req(page): params = ( ('page', str(page)), ) response = requests.get('https://match.yuanrenxue.com/api/match/7', headers=headers, params=params) res_json=response.json() woff=res_json["woff"] data=res_json["data"] with open(woff_path,"wb+") as f: f.write(base64.b64decode(woff)) ttfToImage(fontName=woff_path, imagePath=imagePath) data2=data_handler(data) #删除woff转存的图片 ls = os.listdir(imagePath) for i in ls: c_path = os.path.join(imagePath, i) os.remove(c_path) # return data2 mapp_list={} def mapp_func(str): if str not in mapp_list.keys(): # print("开始识别",str) try: with open(f"./{imagePath}/{str}.png","rb") as f: img=f.read() res = dd.classification(img_bytes=img) # print("识别结果",res) mapp_list[str]=res return res except Exception as e: print("无~",e) else: return mapp_list[str] def data_handler(h_data): return_data = [] for d in h_data: #{"value": " 롔   "}, {"value": "숱    "}, res_arr=str(d["value"]).split(" ") # print(res_arr[:-1]) return_str="" for r in res_arr[:-1]: rr=r.replace("&#x","uni") # print(rr) rrr=mapp_func(rr) return_str+=rrr return_data.append({"value":return_str}) return return_data if __name__ == '__main__': for a in range(1,6): data=req(a) print(data)
2022年01月19日
23 阅读
0 评论
0 点赞
1
2