CN111428228A - Cracking method, device, equipment and storage medium of extreme-test sliding verification code - Google Patents

Cracking method, device, equipment and storage medium of extreme-test sliding verification code Download PDF

Info

Publication number
CN111428228A
CN111428228A CN202010134750.3A CN202010134750A CN111428228A CN 111428228 A CN111428228 A CN 111428228A CN 202010134750 A CN202010134750 A CN 202010134750A CN 111428228 A CN111428228 A CN 111428228A
Authority
CN
China
Prior art keywords
coordinate
sliding
notch
verification
picture
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010134750.3A
Other languages
Chinese (zh)
Inventor
杨勇
刘勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202010134750.3A priority Critical patent/CN111428228A/en
Publication of CN111428228A publication Critical patent/CN111428228A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/31User authentication
    • G06F21/36User authentication by graphic or iconic representation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics

Abstract

The invention discloses a cracking method, a device, equipment and a storage medium of a high-experience sliding verification code, wherein the method comprises the following steps: in the automatic testing process of the web page, when a pole-test sliding verification code is detected to be displayed in a screen, screenshot is carried out on the screen to obtain a verification picture, and the verification picture comprises a sliding block and a notch; comparing the verification picture with an original picture to obtain a slider x coordinate of the slider and a notch x coordinate of the notch; and calculating a sliding distance according to the x coordinate of the slide block and the x coordinate of the notch, sliding the slide block to the position of the notch according to the sliding distance, and verifying the polar experiment sliding verification code. Therefore, based on internet safety, when the webpage which is authenticated by the slide verification code is automatically tested, the technical scheme provided by the invention can improve the cracking success rate of the slide verification code and reduce the workload of automatic testing.

Description

Cracking method, device, equipment and storage medium of extreme-test sliding verification code
Technical Field
The invention relates to the technical field of internet security, in particular to a cracking method, a cracking device, cracking equipment and a storage medium of an extreme-test sliding verification code.
Background
The sliding verification code is a popular technology in the current internet service, and the sliding verification code needs to be automatically processed when a website with the sliding verification code is automatically tested. The existing sliding verification code cracking is mainly based on Selenium (an open source automatic testing tool), the verification code picture needs to be cut and spliced, the operation is complex, the workload is high, the success rate is not high, and the large-batch automatic testing is not facilitated.
Disclosure of Invention
The invention provides a cracking method, a cracking device, equipment and a storage medium of a high-experience sliding verification code, aiming at improving the cracking success rate of the sliding verification code and reducing the workload of automatic testing.
In order to achieve the above object, the present invention provides a method for cracking a high-experience sliding verification code, including:
in the automatic testing process of the web page, when a pole-test sliding verification code is detected to be displayed in a screen, screenshot is carried out on the screen to obtain a verification picture, and the verification picture comprises a sliding block and a notch;
comparing the verification picture with an original picture to obtain a slider x coordinate of the slider and a notch x coordinate of the notch;
and calculating a sliding distance according to the x coordinate of the slide block and the x coordinate of the notch, sliding the slide block to the position of the notch according to the sliding distance, and verifying the polar experiment sliding verification code.
Preferably, when detecting that the slide validation code is displayed on the screen, the step of capturing the screen to obtain the validation picture further includes:
and modifying the display attribute in the page script, displaying the original picture corresponding to the verification picture on the screen, and capturing the picture to obtain the original picture.
Preferably, the step of comparing the verification picture with the original picture to obtain a slider x coordinate of the slider and a notch x coordinate of the notch includes:
calling a getlocation (position acquisition) command in a Selenium (open source automated testing tool) to obtain a first position coordinate of the verification picture and a second position coordinate of the original picture;
comparing the three primary colors of the pixel points at the same position in the verification picture and the original picture according to the first position coordinate and the second position coordinate in a preset sequence;
if the absolute difference value of the three primary colors is larger than a preset difference value, judging that the same position is different pixel points;
and if the same position is different pixel points, marking the obtained x coordinate of the first different pixel point as the corresponding slider x coordinate or the notch x coordinate according to the preset sequence.
Preferably, the step of marking the pixel points as the corresponding slider x coordinate or the notch x coordinate according to the preset sequence includes:
if the preset sequence is from top to bottom along the y axis and from left to right along the x axis in the coordinate system, marking the pixel point as a first slider x coordinate;
if the preset sequence is from top to bottom along the y axis and from right to left along the x axis in the coordinate system, marking the pixel point as a first notch x coordinate;
obtaining a middle point x coordinate of a middle point of the slide block and the notch according to the first slide block x coordinate and the first notch x coordinate;
if the preset sequence is from top to bottom along the y axis and from left to right along the x axis from the middle point in the coordinate system, marking the pixel point as a second notch x coordinate;
and if the preset sequence is from top to bottom along the y axis and from right to left along the x axis from the middle point in the coordinate system, marking the pixel point as a second slider x coordinate.
Preferably, the step of sliding the sliding block to the position of the notch according to the sliding distance includes:
dividing the sliding distance into a first sliding distance and a second sliding distance;
and controlling the sliding block to slide at a first acceleration in the first sliding distance and at a first acceleration in the first sliding distance until the sliding block reaches the position of the notch.
Preferably, the step of calculating a sliding distance according to the x coordinate of the slider and the x coordinate of the notch, sliding the slider to the position of the notch according to the sliding distance, and verifying the polar test sliding verification code further includes:
if the verification fails, starting a fault tolerance system to increase or decrease the sliding distance value according to gradient to obtain a corrected sliding distance;
and sliding the sliding block to the position of the notch according to the corrected sliding distance, and verifying the pole-test sliding verification code.
Preferably, the step of calculating a sliding distance according to the x coordinate of the slider and the x coordinate of the notch, sliding the slider to the position of the notch according to the sliding distance, and verifying the polar test sliding verification code further includes:
if the verification fails, clicking a refresh button to obtain a corrected verification picture and a corrected original picture again;
and calculating a correction sliding distance according to the correction verification picture, sliding the sliding block to the position of the notch according to the correction sliding distance, and verifying the extreme-test sliding verification code.
In addition, in order to achieve the above object, the present invention provides a cracking device for a slide verification code with a high test, including:
the screen capture module is used for capturing a screen to obtain a verification picture when a pole-checking sliding verification code is detected to be displayed in the screen in the automatic testing process of the web page, wherein the verification picture comprises a sliding block and a gap;
the comparison module is used for comparing the verification picture with an original picture to obtain a slider x coordinate of the slider and a notch x coordinate of the notch;
and the verification module is used for calculating the sliding distance according to the x coordinate of the sliding block and the x coordinate of the notch, sliding the sliding block to the position of the notch according to the sliding distance and verifying the polar experiment sliding verification code.
In addition, in order to achieve the above object, the present invention implements a cracking device of a slide verification code with a high test, the cracking device of a slide verification code with a high test includes a processor, a memory, and a cracking program of the slide verification code with a high test stored in the memory, and when the cracking program of the slide verification code with a high test is executed by the processor, the steps of the method for cracking the slide verification code with a high test as described above are implemented.
In addition, to achieve the above object, the present invention implements a computer storage medium having stored thereon a cracking program of the slide verification code for the high test, which when executed by a processor, implements the steps of the method for cracking the slide verification code as described above.
Compared with the prior art, the invention provides a cracking method, a device, equipment and a storage medium of a high-experience sliding verification code, wherein the method comprises the following steps: in the automatic testing process of the web page, when a pole-test sliding verification code is detected to be displayed in a screen, screenshot is carried out on the screen to obtain a verification picture, and the verification picture comprises a sliding block and a notch; comparing the verification picture with an original picture to obtain a slider x coordinate of the slider and a notch x coordinate of the notch; and calculating a sliding distance according to the x coordinate of the slide block and the x coordinate of the notch, sliding the slide block to the position of the notch according to the sliding distance, and verifying the polar experiment sliding verification code. Therefore, based on internet safety, when the webpage which is authenticated by the slide verification code is automatically tested, the technical scheme provided by the invention can improve the cracking success rate of the slide verification code and reduce the workload of automatic testing.
Drawings
Fig. 1 is a schematic diagram of a hardware structure of a cracking device for a high-experience sliding verification code according to various embodiments of the present invention;
FIG. 2 is a flowchart illustrating a first embodiment of a method for cracking a slide passcode according to the present invention;
FIG. 3 is a schematic view of a scenario of an embodiment of a cracking method of the slide verification code for the extreme test of the present invention;
FIG. 4 is a flowchart illustrating a second embodiment of a method for cracking a slide passcode according to the present invention;
FIG. 5 is a scene schematic diagram of a third embodiment of a cracking method of the high-experience sliding verification code according to the present invention;
fig. 6 is a functional block diagram of a cracking device of the extreme-test sliding verification code according to a first embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The cracking equipment of the high-experience sliding verification code mainly related to the embodiment of the invention is network connection equipment capable of realizing network connection, and the cracking equipment of the high-experience sliding verification code can be a server, a cloud platform and the like. In addition, the mobile terminal related to the embodiment of the invention can be mobile network equipment such as a mobile phone, a tablet personal computer and the like.
Referring to fig. 1, fig. 1 is a schematic diagram of a hardware structure of a cracking device for a slide verification code for extreme experience according to various embodiments of the present invention. In the embodiment of the present invention, the cracking device of the extremely-verified sliding verification code may include a processor 1001 (e.g., a Central Processing Unit, CPU), a communication bus 1002, an input port 1003, an output port 1004, and a memory 1005. The communication bus 1002 is used for realizing connection communication among the components; the input port 1003 is used for data input; the output port 1004 is used for data output, the memory 1005 may be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as a magnetic disk memory, and the memory 1005 may optionally be a storage device independent of the processor 1001. Those skilled in the art will appreciate that the hardware configuration depicted in FIG. 1 is not intended to be limiting of the present invention, and may include more or less components than those shown, or some components in combination, or a different arrangement of components.
With continued reference to fig. 1, the memory 1005 of fig. 1, which is a readable storage medium, may include an operating system, a network communication module, an application program module, and a cracking program of the extreme-test sliding verification code. In fig. 1, the network communication module is mainly used for connecting to a server and performing data communication with the server; the processor 1001 may call a cracking program of the high-experience sliding verification code stored in the memory 1005, and execute the cracking method of the high-experience sliding verification code according to the embodiment of the present invention.
The embodiment of the invention provides a cracking method of an extreme-test sliding verification code.
Referring to fig. 2, fig. 2 is a flowchart illustrating a first embodiment of a cracking method of the high-experience sliding verification code according to the present invention.
With the development of internet industry and computer technology, loss cases caused by the security of an internet system are more and more, and the amount of money is larger and larger, so that the security of the internet system is more and more emphasized in various industries, and in order to prevent a series of security problems such as database collision attack, malicious registration, registered account number scanning and the like as much as possible, more and more companies introduce extreme experience (geetest) sliding verification codes to improve the security of the system. But the system is difficult to automatically test the web (web page), and the verification code needs to be cracked in an automatic mode to automatically test the web.
At present, a plurality of cracking methods are also available on the internet, most of the cracking methods are based on the Selenium, are basically uniform, and are redundant, complex and fussy. The main disadvantages are the following: the intercepted verification code picture needs to be cut and spliced, the operation is complicated, and the accuracy of the obtained distance value between the sliding block and the notch is low; a fault-tolerant processing mechanism is lacked under the condition that the sliding distance is inaccurate; the moving slider does not go beyond the extreme human-machine verification. Therefore, the success rate is very low, and the requirement of cracking cannot be met at all.
In this embodiment, the cracking method of the slide validation code for the polar experiment is applied to a cracking device of the slide validation code for the polar experiment, and the method includes:
step S101, in the process of automatic testing of a web page, when a pole-test sliding verification code is detected to be displayed in a screen, screenshot is carried out on the screen to obtain a verification picture, and the verification picture comprises a sliding block and a notch;
in the process of automatic testing of the web pages, the web pages which can be opened after being verified by the verification codes are frequently encountered. The extreme-test verification code mainly comprises click-press, sliding, character selection, picture selection, character learning and word composition and the like. And when detecting the extreme-test sliding verification code which needs to be verified in a sliding mode, carrying out screenshot on the screen to obtain a verification picture. The verification picture comprises a slider, a notch and a base map. Generally, the sliding block corresponds to the notch, and the sliding block is dragged into the notch to be matched and restored into a complete picture. The pattern of the sliding block and/or the notch can be freely arranged, such as a small square with concave points and convex points.
Further, when detecting that the slide verification code is displayed on the screen, the step of capturing the screen to obtain a verification picture further comprises:
and modifying the display attribute in the page script, displaying the original picture corresponding to the verification picture on the screen, and capturing the picture to obtain the original picture.
Specifically, if the display attribute in the page script is modified to display the display attribute of the original picture, the original picture may be displayed in the screen. And after the original picture is displayed in the screen, screenshot is carried out on the current screen to obtain the original picture.
Step S102, comparing the verification picture with an original picture to obtain a slider x coordinate of the slider and a notch x coordinate of the notch;
and when the verification picture and the original picture are obtained, comparing the verification picture and the original picture to obtain the coordinates of the sliding block and the notch.
Specifically, the step of comparing the verification picture with the original picture to obtain a slider x coordinate of the slider and a notch x coordinate of the notch includes:
step S102 a: calling a getlocation (position acquisition) command in a Selenium (open source automated testing tool) to obtain a first position coordinate of the verification picture and a second position coordinate of the original picture;
the first position coordinates comprise coordinates of four corner points in the verification picture. The upper right-corner coordinate of the verification picture can be obtained first, and then the lower right-corner coordinate, the upper left-corner coordinate and the lower left-corner coordinate of the verification picture are obtained through calculation according to the width and the length of the verification picture.
Likewise, the second position coordinates comprise coordinates of four corner points in the original picture. The upper right corner coordinate of the original picture can be obtained first, and then the lower right corner coordinate, the upper left corner coordinate and the lower left corner coordinate of the original picture are obtained through calculation according to the width and the length of the original picture.
Step S102 b: comparing the three primary colors of the pixel points at the same position in the verification picture and the original picture according to the first position coordinate and the second position coordinate in a preset sequence;
the three primary colors in this embodiment refer to red (R), green (G), and blue (B). The preset order is based on the verification picture in a combined order from top to bottom, from left to right, and both. Normalizing the first position coordinate and the second position coordinate into the same coordinate system, if a certain position coordinate is the same, considering the position as the same position of the verification picture and the original picture, for example, if the first position of the verification picture and the second position of the original picture are the same in the same coordinate system, considering the first position and the second position as the same position. And comparing the three primary colors of the pixel points at the same position after the same position is obtained. In this embodiment, the three primary colors of the verification picture are respectively marked as RAuthentication,GAuthentication,BAuthentication(ii) a Respectively marking the three primary colors of the original picture as ROriginal,GOriginal,BOriginal
Step S102 c: if the absolute difference value of the three primary colors is smaller than or equal to a preset difference value, judging that the same position is different pixel points;
comparing the three primary colors of the pixel points at the same position to obtain the difference value of the single primary color, wherein the difference value R is ROriginal-RAuthenticationThe difference G ═ GOriginal-GAuthenticationThe difference B is BOriginal-BAuthentication. Then, calculating absolute difference values of the three primary colors, firstly calculating the sum of the difference values of the three single primary colors, and then taking an absolute value of the sum result to obtain the absolute difference value: the absolute difference value R + the difference value G + the difference value B i.
In this embodiment, the preset difference may be set between 180 and 250, and default to 190. According to experience, 190 has a high accuracy.
If the absolute difference value of the three primary colors is larger than the preset difference value, judging that the same position is different pixel points; and if the absolute difference value of the three primary colors is smaller than or equal to the preset difference value, judging that the same position is the same pixel point.
Step S102 d: and if the same position is different pixel points, marking the obtained x coordinate of the first different pixel point as the corresponding slider x coordinate or the notch x coordinate according to the preset sequence.
Specifically, the step of recording the obtained x coordinate of the first different pixel point mark as the corresponding slider x coordinate or the corresponding notch x coordinate according to the preset sequence includes:
if the preset sequence is from top to bottom along the y axis and from left to right along the x axis in the coordinate system, marking the x coordinate of the first different pixel point obtained by comparison as a first slider x coordinate;
if the preset sequence is from top to bottom along the y axis and from right to left along the x axis in the coordinate system, marking the x coordinate of the first different pixel point obtained by comparison as a first notch x coordinate;
obtaining a middle point x coordinate of a middle point of the slide block and the notch according to the first slide block x coordinate and the first notch x coordinate;
if the preset sequence is from top to bottom along the y axis and from left to right along the x axis from the middle point in the coordinate system, marking the x coordinate of the first different pixel point obtained by comparison as a second notch x coordinate;
and if the preset sequence is from top to bottom along the y axis and from right to left along the x axis from the middle point in the coordinate system, marking the x coordinate of the first different pixel point obtained by comparison as the x coordinate of the second slider.
Specifically, referring to fig. 3, fig. 3 is a scene schematic diagram of an embodiment of a cracking method of the extremely-tested sliding verification code according to the present invention. The first position coordinates of the verification picture comprise an upper left A1 coordinate, an upper right B1 coordinate, a lower left C1 coordinate, and an upper right D1 coordinate, and the second position coordinates of the original picture comprise an upper left A2 coordinate, an upper right B2 coordinate, a lower left C2 coordinate, and an upper right D2 coordinate. And normalizing the coordinates into the same coordinate system, and comparing the three primary colors of the pixel points at the same position of the verification picture and the original picture according to the following sequence.
If the preset sequence is from top to bottom along the y-axis, i.e. from the top left corner a1 to the bottom left corner C1 of the verification picture; from left to right along the x-axis, i.e. the top left corner a1 to the top right corner B1 of the verification picture, the x-coordinate of the first different pixel point (point 1 in fig. 3) obtained by comparison is marked as the first slider x-coordinate: x is the number ofSlider 1
If the preset sequence is from top to bottom along the y-axis, i.e. from the top left corner a1 to the bottom left corner C1 of the verification picture; from right to left along the x-axis, i.e., from the top right corner B1 to the top left corner a1 of the verification picture, the x-coordinate of the first different pixel point (point 3 in fig. 3) obtained by the comparison is marked as a first notch x-coordinate x notch 1;
obtaining a middle point of a middle point (point 5 in fig. 3) of the slider and the notch according to the first slider x coordinate x slider 1 and the first notch x coordinate x notch 1x-coordinate x middle point: x middle point ═ xGap1-xSlider 1)/2。
If the preset sequence is from top to bottom along the y-axis, that is, the verification picture goes from the top left corner A1 to the bottom left corner C1; and starting from the middle point from left to right along the x-axis, that is, from the middle point 5 to the upper right corner B1 of the verification picture, the x coordinate of the first different pixel point (point 2 in fig. 3) obtained by comparison is marked as a second notch coordinate x notch 2;
if the preset sequence is from top to bottom along the y-axis, i.e. from the top left corner a1 to the bottom left corner C1 of the verification picture; and starting from the middle point along the x-axis from right to left, that is, from the middle point 5 to the upper left corner a1 of the verification picture, the x-coordinate of the first different pixel point (point 4 in fig. 3) obtained by comparison is marked as the second slider coordinate xSliding block 2
It is understood that the execution steps of the preset sequences can be set by themselves. And the preset sequence can be adjusted to mark other reference points in the verification picture, and the sliding distance is calculated according to the other reference points.
And S103, calculating a sliding distance according to the x coordinate of the slide block and the x coordinate of the notch, sliding the slide block to the position of the notch according to the sliding distance, and verifying the polar experiment sliding verification code.
Specifically, there are two calculation methods for the sliding distance:
the method comprises the following steps: the sliding distance is equal to the x coordinate x of the first notchNotch 1-second slider coordinate xSliding block 2(ii) a Alternatively, the first and second electrodes may be,
the second method comprises the following steps: the sliding distance is equal to the x coordinate x of the second notchNotch 2-second slider coordinate xA slider 1.According to experience, the calculation method of the first method has high accuracy because the upper left part of the notch edge is extremely faded.
In this embodiment, the step of sliding the slider to the position of the notch according to the sliding distance includes:
dividing the sliding distance into a first sliding distance and a second sliding distance; and controlling the sliding block to slide at a first acceleration in the first sliding distance and at a first acceleration in the first sliding distance until the sliding block reaches the position of the notch.
In the embodiment, an algorithm simulating an artificial moving track is added in the sliding process, the human-computer verification of the sliding track by extreme experiments is bypassed, retry is performed again under the condition of failing to pass the human-computer identification (the times can be specifically configured as required), and the success rate is improved.
Specifically, the sliding distance is divided into a first sliding distance and a second sliding distance according to a preset decomposition point, which may be specifically set, for example, at 3/5, 1/2, 3/4, or the like of the sliding distance. And controlling the sliding block to slide at a first acceleration in the first sliding distance, and sliding at the first acceleration in the first sliding distance to simulate an artificial sliding track. The first acceleration and the second acceleration may also be specifically set. The initial velocity may be set to 0 m/s. And in the sliding process, setting a sampling time interval t, acquiring the sliding subsection distance of the sliding block in each time period, and judging that the sliding block reaches the position of the notch when the sum of the subsection distances is equal to the sliding distance. The cut-off point and the acceleration can be adjusted according to the actual situation. For example, the decomposition point is 3/5, the first acceleration is 3m/s2The second acceleration is-5 m/s2The sampling time interval t takes the value 0.2 s.
It will be appreciated that the sliding distance may also be divided into more segments, and that the acceleration of each segment may be the same or different.
Furthermore, after the extreme-test sliding verification code passes verification, the webpage corresponding to the extreme-test sliding verification code can be opened, and then performance test, security test, basic test and website optimization test are carried out on the webpage. For example, the performance test includes a connection speed test, a load test, a pressure test, and the like, wherein the connection speed test is related to the speed of connecting the user to the webpage and the internet access mode; the load test is to detect the actual performance of the webpage under a certain load level; the stress test is to test the limits and fault recovery capabilities of the system. The security test needs to test the security, the vulnerability, the aggressivity and the error of the webpage and also comprises the test of an application program, data, a server, a network and a firewall of the webpage; the basic tests comprise color matching, connection correctness and the like; the website optimization test comprises engine optimization, webpage architecture, column, static condition and the like. According to the scheme, in the automatic testing process of the web page, when the extreme-test sliding verification code displayed in the screen is detected, screenshot is carried out on the screen to obtain a verification picture, wherein the verification picture comprises a sliding block and a notch; comparing the verification picture with an original picture to obtain a slider x coordinate of the slider and a notch x coordinate of the notch; and calculating a sliding distance according to the x coordinate of the slide block and the x coordinate of the notch, sliding the slide block to the position of the notch according to the sliding distance, and verifying the polar experiment sliding verification code. Therefore, based on internet safety, when the automatic testing is performed on the webpage which is subjected to identity authentication through the extreme-test sliding verification code, the technical scheme provided by the embodiment can improve the cracking success rate of the sliding verification code and reduce the workload of the automatic testing.
As shown in fig. 4, a second embodiment of the present invention provides a method for cracking a polar experiment sliding verification code, based on the first embodiment shown in fig. 1, where the step of calculating a sliding distance according to the x coordinate of the slider and the x coordinate of the notch, sliding the slider to a position where the notch is located according to the sliding distance, and verifying the polar experiment sliding verification code further includes:
step S1041: if the verification fails, starting a fault-tolerant mechanism to increase or decrease the sliding distance value according to gradient to obtain a corrected sliding distance;
in practical applications, since the accuracy of the sliding distance is difficult to reach one hundred percent, the situation of verification failure may occur. For example, when the pixel point at the edge of the notch is very close to the pixel point of the original picture, the pixel point is misjudged, and the calculated sliding distance has deviation.
When the verification fails, a fault tolerance mechanism needs to be started. Specifically, a fault tolerance range is set first, and the fault tolerance range is specifically set according to needs, for example, the fault tolerance range is ± 6. And adding/subtracting the sliding distance according to a preset gradient in the fault tolerance range to obtain a corrected sliding distance. And a correction rule is also set in the fault-tolerant mechanism, and the correction rule comprises a correction gradient and a correction sequence. The modified gradient may be 1, 2 or 3. The modification sequence can be gradually increased, gradually decreased or increased and decreased alternately. For example, first 1 is added to the sliding distance to obtain a first corrected sliding distance.
Step S1051: and sliding the sliding block to the position of the notch according to the corrected sliding distance, and verifying the pole-test sliding verification code.
And after the corrected sliding distance is obtained, the sliding block is slid to the position of the notch according to the corrected sliding distance, and the extreme-test sliding verification code is verified.
Understandably, if sliding according to the first corrected sliding distance, the verification still fails; then the correction can be continued according to the correction rule in the fault-tolerant mechanism to obtain a second correction sliding distance. And stopping verification until the verification is successful or the maximum fault tolerance range is reached.
According to the scheme, in the automatic testing process of the web page, when the extreme-test sliding verification code displayed in the screen is detected, screenshot is carried out on the screen to obtain a verification picture, wherein the verification picture comprises a sliding block and a notch; comparing the verification picture with an original picture to obtain a slider x coordinate of the slider and a notch x coordinate of the notch; calculating a sliding distance according to the x coordinate of the sliding block and the x coordinate of the notch, sliding the sliding block to the position of the notch according to the sliding distance, and verifying the polar test sliding verification code; if the verification fails, starting a fault tolerance system to increase or decrease the sliding distance value according to gradient to obtain a corrected sliding distance; the slider slides to the position of the notch according to the corrected sliding distance, and the extreme-test sliding verification code is verified, so that the success rate of cracking of the sliding verification code can be improved and the workload of automatic testing is reduced through the technical scheme provided by the embodiment when the webpage subjected to identity authentication through the extreme-test sliding verification code is automatically tested on the basis of internet safety.
As shown in fig. 5, a third embodiment of the present invention provides a method for cracking a polar experiment sliding verification code, based on the first embodiment and the second embodiment shown in fig. 1 and fig. 2, where the step of calculating a sliding distance according to the x coordinate of the slider and the x coordinate of the notch, sliding the slider to a position where the notch is located according to the sliding distance, and verifying the polar experiment sliding verification code further includes:
step S1042: if the verification fails, clicking a refresh button, obtaining a corrected verification picture and a corrected original picture again, and comparing the corrected verification picture with the corrected original picture to obtain a corrected notch coordinate and a corrected slider coordinate;
the extreme-test sliding verification code is generally provided with a refresh button so that a user can obtain the extreme-test sliding verification code again and verify the extreme-test sliding verification code again after the verification fails.
And when the verification fails, clicking a refresh button provided by the webpage, and carrying out screenshot again to obtain a corrected verification picture. And modifying the display attribute in the page script again, displaying the corrected original picture corresponding to the correction verification picture on the screen, and capturing the picture to obtain the corrected original picture.
Calling a getlocation command in the Selenium again to obtain a third position coordinate of the corrected verification picture and a fourth position coordinate of the corrected original picture; comparing the three primary colors of the pixel points at the same position in the correction verification picture and the correction original picture according to the third position coordinate and the fourth position coordinate in a preset sequence; if the absolute difference value of the three primary colors is larger than a preset difference value, judging that the same position is different pixel points; and if the same position is different pixel points, marking the obtained x coordinate of the first different pixel point as the corresponding correction slider coordinate or correction notch coordinate according to the preset sequence. In this embodiment, either the calibration slider coordinates or the calibration notch coordinates may be recorded only in the x coordinate.
Step S1052: and calculating a correction sliding distance according to the correction notch coordinate and the correction slide block coordinate, sliding the slide block to the position of the notch according to the correction sliding distance, and verifying the polar test sliding verification code.
If the preset sequence is from top to bottom along the y axis and from left to right along the x axis in the coordinate system, marking the pixel point as a third slider x coordinate; if the preset sequence is from top to bottom along the y axis and from right to left along the x axis in the coordinate system, marking the pixel point as a third notch x coordinate; obtaining a middle point x coordinate of a middle point of the slide block and the notch according to the third slide block x coordinate and the third notch x coordinate; if the preset sequence is from top to bottom along the y axis and from left to right along the x axis from the middle point in the coordinate system, marking the pixel point as a fourth notch x coordinate; and if the preset sequence is from top to bottom along the y axis and from right to left along the x axis from the middle point in the coordinate system, marking the pixel point as a fourth slider x coordinate.
Preferably, in this embodiment, the corrected sliding distance is equal to the x coordinate of the third notch to the x coordinate of the fourth slider. Or after the sliding distance is corrected, the sliding block is slid to the position of the notch according to the corrected sliding distance, and the extreme-test sliding verification code is verified.
According to the scheme, in the automatic testing process of the web page, when the extreme-test sliding verification code displayed in the screen is detected, screenshot is carried out on the screen to obtain a verification picture, wherein the verification picture comprises a sliding block and a notch; comparing the verification picture with an original picture to obtain a slider x coordinate of the slider and a notch x coordinate of the notch; calculating a sliding distance according to the x coordinate of the sliding block and the x coordinate of the notch, sliding the sliding block to the position of the notch according to the sliding distance, verifying the polar test sliding verification code, and clicking a refresh button if the verification fails to obtain a corrected verification picture and a corrected original picture again; and calculating a correction sliding distance according to the correction verification picture, sliding the sliding block to the position of the notch according to the correction sliding distance, and verifying the extreme-test sliding verification code. Therefore, based on internet safety, when the webpage which is authenticated by the slide verification code is automatically tested, the technical scheme provided by the invention can improve the cracking success rate of the slide verification code and reduce the workload of automatic testing.
In addition, the embodiment also provides a cracking device for the extremely-tested sliding verification code. Referring to fig. 5, fig. 5 is a functional block diagram of a cracking device of the slide-experienced verification code according to a first embodiment of the present invention.
In this embodiment, the cracking device of the slide verification code with the high test is a virtual device, and is stored in the memory 1005 of the cracking device of the slide verification code with the high test shown in fig. 1, so as to realize all functions of cracking and saving the program of the slide verification code with the high test: the method comprises the steps that during the automatic testing process of the web page, when the extreme-test sliding verification code displayed in a screen is detected, screenshot is conducted on the screen to obtain a verification picture, wherein the verification picture comprises a sliding block and a notch; the verification picture is compared with the original picture to obtain a slider x coordinate of the slider and a notch x coordinate of the notch; and the slide block is used for calculating a sliding distance according to the x coordinate of the slide block and the x coordinate of the notch, sliding the slide block to the position of the notch according to the sliding distance and verifying the polar test sliding verification code.
Specifically, the cracking device of the extremely-tested sliding verification code comprises:
the screen capture module 10 is used for capturing a screen to obtain a verification picture when a pole-checking sliding verification code is detected to be displayed in the screen in the automatic testing process of the web page, wherein the verification picture comprises a sliding block and a gap;
the comparison module 20 is configured to compare the verification picture with an original picture to obtain a slider x coordinate of the slider and a notch x coordinate of the notch;
and the verification module 30 is used for calculating a sliding distance according to the x coordinate of the slide block and the x coordinate of the notch, sliding the slide block to the position of the notch according to the sliding distance and verifying the polar experiment sliding verification code.
Further, the screenshot module is further configured to:
and modifying the display attribute in the page script, displaying the original picture corresponding to the verification picture on the screen, and capturing the picture to obtain the original picture.
Further, the comparison module is further configured to:
calling getlocation (position acquisition) in a Selenium (open source automated testing tool) to obtain a first position coordinate of the verification picture and a second position coordinate of the original picture;
comparing the three primary colors of the pixel points at the same position in the verification picture and the original picture according to the first position coordinate and the second position coordinate in a preset sequence;
if the absolute difference value of the three primary colors is larger than a preset difference value, judging that the same position is different pixel points;
and if the same position is different pixel points, marking the obtained x coordinate of the first different pixel point as the corresponding slider x coordinate or the notch x coordinate according to the preset sequence.
Further, the comparison module is further configured to:
if the preset sequence is from top to bottom along the y axis and from left to right along the x axis in the coordinate system, marking the pixel point as a first slider x coordinate;
if the preset sequence is from top to bottom along the y axis and from right to left along the x axis in the coordinate system, marking the pixel point as a first notch x coordinate;
obtaining a middle point x coordinate of a middle point of the slide block and the notch according to the first slide block x coordinate and the first notch x coordinate;
if the preset sequence is from top to bottom along the y axis and from left to right along the x axis from the middle point in the coordinate system, marking the pixel point as a second notch x coordinate;
and if the preset sequence is from top to bottom along the y axis and from right to left along the x axis from the middle point in the coordinate system, marking the pixel point as a second slider x coordinate.
Further, the verification module is further configured to:
dividing the sliding distance into a first sliding distance and a second sliding distance;
controlling the sliding block to slide at a first acceleration within the first sliding distance and at a first acceleration within the first sliding distance until the sliding block reaches the position of the notch
Further, the verification module is further configured to:
if the verification fails, starting a fault tolerance system to increase or decrease the sliding distance value according to gradient to obtain a corrected sliding distance;
and sliding the sliding block to the position of the notch according to the corrected sliding distance, and verifying the pole-test sliding verification code.
Further, the verification module is further configured to:
if the verification fails, clicking a refresh button to obtain a corrected verification picture and a corrected original picture again;
and calculating a correction sliding distance according to the correction verification picture, sliding the sliding block to the position of the notch according to the correction sliding distance, and verifying the extreme-test sliding verification code.
In addition, an embodiment of the present invention further provides a computer storage medium, where a cracking program of the slide verification code with a high test is stored on the computer storage medium, and when the cracking program of the slide verification code with a high test is executed by a processor, the steps of the method for cracking the slide verification code with a high test are implemented, which are not described herein again.
Compared with the prior art, the cracking method, the device, the equipment and the storage medium of the extreme-test sliding verification code provided by the invention have the advantages that in the automatic testing process of the web page, when the extreme-test sliding verification code displayed in a screen is detected, screenshot is carried out on the screen to obtain a verification picture, and the verification picture comprises a sliding block and a gap; comparing the verification picture with an original picture to obtain a slider x coordinate of the slider and a notch x coordinate of the notch; and calculating a sliding distance according to the x coordinate of the slide block and the x coordinate of the notch, sliding the slide block to the position of the notch according to the sliding distance, and verifying the polar experiment sliding verification code. Therefore, based on internet safety, when the automatic testing is performed on the webpage which is subjected to identity authentication through the extreme-test sliding verification code, the technical scheme provided by the embodiment can improve the cracking success rate of the sliding verification code and reduce the workload of the automatic testing.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for causing a terminal device to execute the method according to the embodiments of the present invention.
The above description is only for the preferred embodiment of the present invention and is not intended to limit the scope of the present invention, and all equivalent structures or flow transformations made by the present specification and drawings, or applied directly or indirectly to other related arts, are included in the scope of the present invention.

Claims (10)

1. A method for cracking a high-experience sliding verification code, comprising the steps of:
in the automatic testing process of the web page, when a pole-test sliding verification code is detected to be displayed in a screen, screenshot is carried out on the screen to obtain a verification picture, and the verification picture comprises a sliding block and a notch;
comparing the verification picture with an original picture to obtain a slider x coordinate of the slider and a notch x coordinate of the notch;
and calculating a sliding distance according to the x coordinate of the slide block and the x coordinate of the notch, sliding the slide block to the position of the notch according to the sliding distance, and verifying the polar experiment sliding verification code.
2. The method of claim 1, wherein the step of capturing the screen to obtain the verification picture when detecting that the polar sliding verification code is displayed on the screen further comprises:
and modifying the display attribute in the page script, displaying the original picture corresponding to the verification picture on the screen, and capturing the picture to obtain the original picture.
3. The method according to claim 1 or 2, wherein the step of comparing the verification picture with an original picture to obtain a slider x-coordinate of the slider and a notch x-coordinate of the notch comprises:
calling a getlocation (position acquisition) command in a Selenium (open source automated testing tool) to obtain a first position coordinate of the verification picture and a second position coordinate of the original picture;
comparing the three primary colors of the pixel points at the same position in the verification picture and the original picture according to the first position coordinate and the second position coordinate in a preset sequence;
if the absolute difference value of the three primary colors is larger than a preset difference value, judging that the same position is different pixel points;
and if the same position is different pixel points, marking the obtained x coordinate of the first different pixel point as the corresponding slider x coordinate or the notch x coordinate according to the preset sequence.
4. The method of claim 3, wherein the step of marking the pixel points as the corresponding slider x-coordinate or the notch x-coordinate according to the preset order comprises:
if the preset sequence is from top to bottom along the y axis and from left to right along the x axis in the coordinate system, marking the pixel point as a first slider x coordinate;
if the preset sequence is from top to bottom along the y axis and from right to left along the x axis in the coordinate system, marking the pixel point as a first notch x coordinate;
obtaining a middle point x coordinate of a middle point of the slide block and the notch according to the first slide block x coordinate and the first notch x coordinate;
if the preset sequence is from top to bottom along the y axis and from left to right along the x axis from the middle point in the coordinate system, marking the pixel point as a second notch x coordinate;
and if the preset sequence is from top to bottom along the y axis and from right to left along the x axis from the middle point in the coordinate system, marking the pixel point as a second slider x coordinate.
5. The method of claim 1, wherein the step of sliding the slider to the position of the notch according to the sliding distance comprises:
dividing the sliding distance into a first sliding distance and a second sliding distance;
and controlling the sliding block to slide at a first acceleration in the first sliding distance and at a first acceleration in the first sliding distance until the sliding block reaches the position of the notch.
6. The method according to claim 1, wherein the step of calculating a sliding distance according to the x coordinate of the slider and the x coordinate of the notch, and sliding the slider to a position of the notch according to the sliding distance, and verifying the polar-test sliding verification code further comprises:
if the verification fails, starting a fault tolerance system to increase or decrease the sliding distance value according to gradient to obtain a corrected sliding distance;
and sliding the sliding block to the position of the notch according to the corrected sliding distance, and verifying the pole-test sliding verification code.
7. The method of claim 1, wherein the step of calculating a sliding distance according to the x coordinate of the slider and the x coordinate of the notch, and sliding the slider to a position of the notch according to the sliding distance further comprises, after the step of verifying the polar slide verification code:
if the verification fails, clicking a refresh button to obtain a corrected verification picture and a corrected original picture again;
and calculating a correction sliding distance according to the correction verification picture, sliding the sliding block to the position of the notch according to the correction sliding distance, and verifying the extreme-test sliding verification code.
8. The utility model provides a cracking device of slide identifying code is tested to utmost point, its characterized in that, cracking device of slide identifying code is tested to utmost point includes:
the screen capture module is used for capturing a screen to obtain a verification picture when a pole-checking sliding verification code is detected to be displayed in the screen in the automatic testing process of the web page, wherein the verification picture comprises a sliding block and a gap;
the comparison module is used for comparing the verification picture with an original picture to obtain a slider x coordinate of the slider and a notch x coordinate of the notch;
and the verification module is used for calculating the sliding distance according to the x coordinate of the sliding block and the x coordinate of the notch, sliding the sliding block to the position of the notch according to the sliding distance and verifying the polar experiment sliding verification code.
9. A cracking device of the slide-through verification code, which is characterized by comprising a processor, a memory and a cracking program of the slide-through verification code stored in the memory, wherein when the cracking program of the slide-through verification code is executed by the processor, the steps of the method for cracking the slide-through verification code according to any one of claims 1 to 7 are realized.
10. A computer storage medium, characterized in that the computer storage medium has stored thereon a cracking program of the slide verification code with a high test, which when executed by a processor implements the steps of the method for cracking the slide verification code with a high test according to any one of claims 1 to 7.
CN202010134750.3A 2020-02-28 2020-02-28 Cracking method, device, equipment and storage medium of extreme-test sliding verification code Pending CN111428228A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010134750.3A CN111428228A (en) 2020-02-28 2020-02-28 Cracking method, device, equipment and storage medium of extreme-test sliding verification code

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010134750.3A CN111428228A (en) 2020-02-28 2020-02-28 Cracking method, device, equipment and storage medium of extreme-test sliding verification code

Publications (1)

Publication Number Publication Date
CN111428228A true CN111428228A (en) 2020-07-17

Family

ID=71553516

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010134750.3A Pending CN111428228A (en) 2020-02-28 2020-02-28 Cracking method, device, equipment and storage medium of extreme-test sliding verification code

Country Status (1)

Country Link
CN (1) CN111428228A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112785311A (en) * 2021-01-12 2021-05-11 北京首汽智行科技有限公司 Verification request verification method and system
CN113806713A (en) * 2021-09-01 2021-12-17 浪潮卓数大数据产业发展有限公司 Method and system for clicking verification code through code receiving platform and selenium breakthrough

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108280338A (en) * 2018-01-12 2018-07-13 上海大学 A kind of crack method of sliding identifying code
CN109858230A (en) * 2019-01-08 2019-06-07 平安科技(深圳)有限公司 Sliding block verification method, device, computer equipment and storage medium
CN109902474A (en) * 2019-03-01 2019-06-18 北京奇艺世纪科技有限公司 The determination method and device of the motion track of mobile object in a kind of sliding identifying code
CN109902471A (en) * 2019-01-08 2019-06-18 平安科技(深圳)有限公司 Detection method, device, computer equipment and the storage medium of sliding block verifying
CN110427746A (en) * 2019-08-08 2019-11-08 腾讯科技(深圳)有限公司 Sliding block verifies code verification method, device, storage medium and computer equipment
US20200065471A1 (en) * 2017-11-14 2020-02-27 Tencent Technology (Shenzhen) Company Limited Security verification method and relevant device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200065471A1 (en) * 2017-11-14 2020-02-27 Tencent Technology (Shenzhen) Company Limited Security verification method and relevant device
CN108280338A (en) * 2018-01-12 2018-07-13 上海大学 A kind of crack method of sliding identifying code
CN109858230A (en) * 2019-01-08 2019-06-07 平安科技(深圳)有限公司 Sliding block verification method, device, computer equipment and storage medium
CN109902471A (en) * 2019-01-08 2019-06-18 平安科技(深圳)有限公司 Detection method, device, computer equipment and the storage medium of sliding block verifying
CN109902474A (en) * 2019-03-01 2019-06-18 北京奇艺世纪科技有限公司 The determination method and device of the motion track of mobile object in a kind of sliding identifying code
CN110427746A (en) * 2019-08-08 2019-11-08 腾讯科技(深圳)有限公司 Sliding block verifies code verification method, device, storage medium and computer equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112785311A (en) * 2021-01-12 2021-05-11 北京首汽智行科技有限公司 Verification request verification method and system
CN113806713A (en) * 2021-09-01 2021-12-17 浪潮卓数大数据产业发展有限公司 Method and system for clicking verification code through code receiving platform and selenium breakthrough

Similar Documents

Publication Publication Date Title
US9846634B2 (en) Visual graphical user interface verification
US10282284B2 (en) Test method, system, and device, and readable storage medium
CN107679418A (en) Data desensitization method, server and storage medium
US20140147051A1 (en) Method and system for webpage regression testing
KR102435365B1 (en) Certificate recognition method and apparatus, electronic device, computer readable storage medium
US9946637B2 (en) Automatic updating of graphical user interface element locators based on dimension comparison
US20150370694A1 (en) Automatic updating of graphical user interface element locators based on image comparison
CN106778151B (en) Handwriting-based user identity recognition method and device
CN111428228A (en) Cracking method, device, equipment and storage medium of extreme-test sliding verification code
CN106294317A (en) The form information method of calibration at a kind of cloud platform interface and system
CN111241873A (en) Image reproduction detection method, training method of model thereof, payment method and payment device
CN110378886B (en) Image comparison method, image comparison device, electronic device and medium
US20180210819A1 (en) System and method of controlling a web browser plug-in for testing analytics
CN110795706B (en) Hash-based verification method, equipment, storage medium and device
CN106878248A (en) A kind of verification method and equipment
JP4215255B2 (en) Degradation confirmation inspection method, degradation confirmation inspection system, and program therefor
CN116089920A (en) Sensitive field early warning method, system, computer equipment and medium
CN114663902B (en) Document image processing method, device, equipment and medium
CN112257768B (en) Method and device for identifying illegal financial pictures and computer storage medium
CN114661671A (en) File processing method and device, computer readable storage medium and electronic equipment
CN114255134A (en) Account number disassembling method and device and storage medium
KR101591678B1 (en) Apparatus and method for authenticating based on digital signature
TWI426764B (en) Randomly generate methods for verifying graphics and questionnaires
US10514779B2 (en) System and method for measuring association between screen resolution and mouse movement speed, recording medium, and computer program product
CN112308070B (en) Identification method and device for certificate information, equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination