CTF Character Statistics 2

Source: Internet
Author: User

Title Address: http://sec.hdu.edu.cn/question/web/1076/

This question is a bit similar to the previous one, look at the source code:

The HTML tag where the character was found is changed, and the previous question is a GET request, which is a POST request.

Then modify the Python code as follows:

 #Coding=utf-8ImportRequests fromBs4ImportBeautifulsoupurl="http://sec.hdu.edu.cn/question/web/1076/"Q=requests.session () Webcontext= Q.get (URL). text#Get page ContentContent=webcontext.split ('') A=content[1]unicode2str=a.encode ("Utf-8") Ln=Len (a) s=0e=0c=0l=0a=0b=0 forIinchRange (LN):if(Unicode2str[i] = ='s'): S=s+1elif(unicode2str[i]=='e'): E=e+1elif(Unicode2str[i] = ='C'): C=c+1elif(unicode2str[i]=='L'): L=l+1elif(Unicode2str[i] = ='a'): A=a+1elif(unicode2str[i]=='b'): b=b+1Else:        Continuevalue='%d'%s +'%d'%e +'%d'%c +'%d'%l +'%d'%a +'%d'%Bgetdata={'Answer': Value}result=q.post (url,data=GetData) Z=RESULT.TEXTX=z.encode ('GBK','Ignore')PrintX

Run to get flag.

CTF Character Statistics 2

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.