This article mainly introduces the website Trojan Detection program implemented by Python. if you need it, you can refer to the system administrator who usually retrieves code from svn/git, after a site is deployed, the MD5 value of all files on the site is usually generated. if the content of the website page is tampered with (such as Trojans) after the site is launched, you can quickly find the files that
#!/usr/bin/python#coding: Utf-8TryX=int (Raw_input ("Please enter user name:"))Print 3/xExcept Keyboardinterrupt:Print "You have entered Crtl+c, please try again"Except Eoferror:Print "You have entered Ctrl+d, please try again"Except ValueError:Print "Not a number you entered"Except Zerodivisionerror,e: #把自带报错存入变量Print "Divisor cannot enter 0:", e #打印自带报错信息ElsePrint "No Problem" #不出错执行FinallyPrint "Game over" #出不出错都执行#!/usr/bin/
face and eye detector.First we need to load the required XML classifier. The input image or video is then loaded in grayscale format.Import NumPy as NP Import = Cv2. Cascadeclassifier ('haarcascade_frontalface_default.xml'= Cv2. Cascadeclassifier ('haarcascade_eye.xml'= cv2.imread (' Sachin.jpg'= Cv2.cvtcolor (img, Cv2. Color_bgr2gray)Now we detect the face in the image. If a face is detected, it returns the rectangle where the face is locatedRegion Rect (X,Y,W,H). Once we have this position,
This article about multithreading tools, is very suitable for novice learning, tool efficiency is also very high, the code is relatively perfect, title.
This article I spring signed writer--aedoo
0x00 PrefaceI published the original article some time ago, "[Python hacker] python hand-taught you to build your own multi-threaded batch Tool", received a lot of heat assessment, Portal:Https://bbs.
This article mainly introduces the Python prime number detection method. The example analyzes the skills related to Python prime number detection. If you need a friend, refer to the example in this article to describe the Python prime number
Git:https://github.com/linyi0604/computer-vision1 #Coding:utf-82 3 ImportCv24 5 6 #Detection i box contains O BOX7 defis_inside (o, i):8Ox, Oy, ow, OH =o9IX, IY, IW, ih =ITen returnOx > IX andOx + ow andOy + Oh IH One A - #draw out the box outside the man - defDraw_person (image, person): theX, Y, W, h = Person -Cv2.rectangle (Image, (x, y), (x+w, Y+h), (0, 255, 255), 2) - - + #read in picture -img = Cv2.imread (".. /data/people2.jpg") + #Get
motion #counterlastuploaded =timestamp Motioncounter=0#Otherwise, the hostel is not occupied Else: Motioncounter=0#Check to see if the frames should is displayed to screen ifconf["Show_video"]: #Display the security feedCv2.imshow ("Security Feed", frame) key= Cv2.waitkey (1) 0xFF#if the ' Q ' key is pressed, break from the Lop ifKey = = Ord ("Q"): Break #clear the stream in preparation for the next frameRawcapture.truncate (0)Conf.json{ "Sh
(rest.headers[' Location']) ifrest.headers[' Location'] =='http://www.baidu.com': Print('[*]there is a URL redirection vulnerability in this link') Else: Print('[+]there is no URL redirection vulnerability in this link') except: Print('[-]not location head') POC ()The results of the operation are as follows:Summarize:Although the vulnerability is not a high threat, it should be defended. There are several ways to defend against this:The state paramet
The time CV used by the Python line detection. Houghlinesp () function:
It has two parameters:
The shortest length of the minlinelength-line, shorter than this line will be ignored.
maxlinegap-the maximum interval between two lines, and if this value is less than this, the two lines are considered a line.
The return value of this function is the starting and ending point of the line.
See main program:
Analysis of Python prime number detection instances
This article describes how to check Python prime numbers. Share it with you for your reference. The details are as follows:
This program implements the prime number detector function. If the result is true, it is a prime number. If the result is false, it is not a prime number.
?
1 2 3 4 5
Recently in the study of Python network related programming, this code realizes the Telnet automatic connection detection root user password, the password is from the password book, one detects whether the password matches, until the match succeeds, the screen output stops.The code is as follows:#encoding =utf-8import telnetlibimport timeimport sysimport osdef do_telnet (Host, Port, username, password, fini
I used Python to write a game. Getting started with pygame (7): Collision Detection and pythonpygame
We have already completed most of the aircraft wars, but there is still no way to officially launch the game, because the bullets cannot be knocked out of the plane. Only after this is done can the game be basically formed.
Today's content is very simple, that is, the collision
Python provides two methods for simple text Detection: file header and cchardet library ],
This example describes how to check the text type in Python. We will share this with you for your reference. The details are as follows:
1. According to the file header.
# Whether it is an UTF8 file with BOM header def IsUtf8BomFile (pathfile): if B '\ xef \ xbb \ xbf' =
#!/usr/bin/env python#_*_ Coding:utf8 _*_#### The script needs to be installed with fping command if no installation required fping#### Yum Install Fpingimport Osip = "10.10.0.1/24" ips = ["10.10.0.1/24", "192.16.17.27/24"] # Input List of address segment status of IP that needs to be queried IPList = ' IPList ' # The file name of the storage IP Path = os.path.dirname (Os.path.abspath (__file__)) #得到当前文件夹路径sh_path = Os.path.join (path, iplist) #
:
Just start testing, encountered as long as it can not be wrong, or does not exist, the direct error to stop the program. It turned out to be a mistake when Response.status_code!= 200 took the status code here.
Because some Web sites can not be opened, will not return the status code. So the program doesn't know! ==200 how to deal with it.
Workaround:
Use try except else to catch exceptions
The specific code is:
Try:
response = Requests.get (Url[i].strip (), Verify=false, Allow_red
write in front of the articleThese days because the work needs to learn image detection, stupid I do not want to stare at OPENCV start to learn (; ′⌒ '), even the ability to check information is weak 〒▽〒Praise My best man ticket (*^▽^*) The man is not the image processing but love my stupid (the "contest")Let me give him the request (our store?? Omega??) Our store??? He put the game down and spent a day or two doing it for me and then wrote a detailed
Python scripts for cluster detection and managementThe python script implements cluster detection and management in the following scenario: A production machine room has many testing machines and production machines (about 30 machines ), because of the chaotic management, it is unclear which machine is used and which m
The shell version of See http://my.oschina.net/firxiao/blog/349727 The Project address: https://github.com/Firxiao/check_public_ip How to use: git clone https://github.com/Firxiao/check_public_ip.gitcd check_public_ipchmod +x CHECK_PUBLIC_IP.PYCP Conf.ini.example Conf.ini Change the configuration file Change the mailbox configuration to the right VI Conf.ini#url can return your public IP Address[url]url = http://ifconfig.me[mail_server]smtp_server = smtp.example.com Mail_user = Usermail_pass = P
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.