captcha

DRF 图片/语音验证码

倾然丶 夕夏残阳落幕 提交于 2019-11-29 14:00:44
drf 集成图片/语音验证码 在线图片base64 views 集成 生成url_link (后端重定向到link) base64 png (图片数据, 避免二次请求) urls.py path('code_img', views.CodeImageView.as_view(), name='code_img'), serializers.py class CodeImageSerializer(ModelSerializer): id = serializers.IntegerField(label='id', read_only=True) link = serializers.SerializerMethodField(help_text='img url') image_code_data = serializers.SerializerMethodField( help_text='img base64 png') @staticmethod def get_link(obj): return obj.link @staticmethod def get_image_code_data(obj): return obj.image_code_data class Meta: model = CaptchaStore fields = ['id', 'link',

公司网站有漏洞被入侵该怎么解决

杀马特。学长 韩版系。学妹 提交于 2019-11-29 12:44:19
2019年1月14日消息,thinkphp又被爆出致命漏洞,可以直接远程代码执行,getshell提权写入网站木马到网站根目录,甚至直接提权到服务器,该漏洞影响版本ThinkPHP 5.0、ThinkPHP 5.0.10、ThinkPHP5.0.12、ThinkPHP5.0.13、ThinkPHP5.0.23、thinkphp 5.0.22版本。 攻击者可以伪造远程恶意代码,对服务器进行post提交数据来利用漏洞,该漏洞产生的原因是继上次2019元旦前后爆出的网站漏洞后,又一次的致命漏洞。在thinkphp目录下的library文件夹下的think\request.php代码。如下图所示: 从上述代码中可以看出整个代码写的流程,首先打开网站会从app.php代码里将请求的网站地址使用check来进行解析,然后再经过patch类型对其进行深度的赋值.然后可以使用post方式提交数据到_method函数当中去,框架会对进行判断,然后对其调用传入的参数值,经过整个代码的循坏以及传入,就可以导致request的值给覆盖掉,从而产生远程代码执行,我们来构造恶意的代码,看看漏洞是如何使用的。 post地址:anquan/public/index.php?s=captcha POST内容:c=system&f=whoami&_method=filter 直接远程提交过去就会执行我们的命令

How to retrieve captcha and save session with PHP cURL?

限于喜欢 提交于 2019-11-29 12:03:26
UPDATE: SOLVED Hi all, i've got it, just save cookie to temp file, and resubmit form with curl and set cookies with previous temp file :) thanks all for respond :) This my working code $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url_register); curl_setopt($ch, CURLOPT_USERAGENT, $this->useragent); curl_setopt($ch, CURLOPT_COOKIEJAR, $this->cookie); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); $out['result'] = curl_exec($ch); $out['error'] = curl_error($ch); $out['info'] = curl_getinfo($ch); curl_close($ch); And for next curl just use CURLOPT

captcha creation for nodejs

淺唱寂寞╮ 提交于 2019-11-29 10:34:47
问题 I am trying to place a captcha on the registration page of a website. How can I show a captcha in node.js? 回答1: I have found one which is smart written with pure js: captchapng Features Only generate numeric captcha PNG image Build-in fonts Characters up and down, left and right limits, random displacement Full JavaScript It will generate png like : And here is my code : ejs -[express3.x] <img src="data:image/jpeg;base64,<%= valicode %>"/> js var captchaImg = function(){ var p = new

Alternative to Captcha?

房东的猫 提交于 2019-11-29 07:14:51
问题 I have a simple reg form (Name, Email, Password) on my website and im looking to implement some sort of anti-bot/spam protection, Captcha seems like a very long winded way, plus they really annoy me when I see them on sites. Has anybody an alternative method to protecting against spam which is lightweight and simply integrated? 回答1: One alternative is to use a hidden form field as a honeypot for bots. This field can be filled using an appropriate value from Javascript, or it can just be left

Numeric Captcha for PHP

[亡魂溺海] 提交于 2019-11-29 02:33:35
Is there a numeric captcha available for PHP ? ( which doesn't rely on JavaScript being turned on ) EDIT: I know there are JS-independent captchas out there. I know there are PHP captchas out there. I know there are numeric captchas out there. But I'm looking for a PHP numeric Javascript-independent captcha. The only numeric captcha's I've found are either for ASP.NET or jQuery/JS based ones. I don't want any of those as an answer to the question. And I'm not taking about a small website here. In the answer I'd like to know whether your suggestion puts a lot of strain on the server or not. I

jmeter testcases which can handle captcha?

强颜欢笑 提交于 2019-11-29 01:42:32
问题 We are trying to build a jmeter testcase which does the following: login to a system obtain some information and check whether correct. Where we are facing issues is because there is a captcha while logging into the system. What we had planned to do was to download the captcha link and display, and wait for user to type in the value. Once done, everything goes as usual. We couldnt find any plugin that can do the same? Other than writing our own plugin, is there any option here? 回答1: Since

开发必学的验证码,教你从零写一个验证码

喜欢而已 提交于 2019-11-29 01:31:51
这周一写了一篇《2000字谏言,给那些想学Python的人,建议收藏后细看!》给大家讲了如何快速学习python。 其中就有说到我们为什么不要执迷于框架、模块的调用,而要自己先去造轮子。那今天就给大家造一个。 验证码是web开发中不可缺少的元素,而python又提供了非常多的验证码模块帮助大家快速生成各种验证码。 那你知道验证码生成的原理吗?所谓知其然,还要知其所以然。面试中,面试官不会因为你对框架很熟悉就夸赞你。 那今天小胖就带大家一层一层拨开验证码的衣服,看看其中的小奥秘 -<- 演示环境 操作系统:windows10 python版本:python 3.7 代码编辑器:pycharm 2018.2 使用第三方模块:pillow 验证码的必须元素 一张图片 文本 干扰元素 线条干扰 小圆点干扰 熟悉pillow库 我们既然需要使用pillow库制作验证码,那么首先我们先来熟悉一下我们需要用到的方法。 Image.new(): 这个方法可以生成一张图片,有三个参数。 mode:颜色空间模式,可以是 'RGBA','RGB','L' 等等模式 size:图片尺寸,接收一个两个整数的元祖 color:图片的填充颜色,可以是 red,green 等,也可以是rgb的三个整数的元祖。也就是背景颜色 from PIL import Image captcha = Image.new(

Generating a 3D CAPTCHA [pic]

独自空忆成欢 提交于 2019-11-29 00:46:53
问题 I would like to write a Python script that would generate a 3D CAPTCHA like this one: Which graphics libraries can I use? Source: ocr-research.org.ua 回答1: There are many approaches. I would personally create the image in Python Imaging Library using ImageDraw's draw.text, convert to a NumPy array (usint NumPy's asarray) then render with Matplotlib. (Requires Matplotlib maintenance package). Full code (in 2.5): import numpy, pylab from PIL import Image, ImageDraw, ImageFont import matplotlib

What is the best/recommended CAPTCHA component for ASP.NET [closed]

一笑奈何 提交于 2019-11-29 00:20:32
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 months ago . Does anyone have any recommendations for CAPTCHA components for use in ASP.NET projects? 回答1: I've been using recaptcha for a couple of sites with great success. I really recommend it. There is a recaptcha control for asp.net here. I've also used this captcha with success. 回答2: Before you evaluate any captcha