python for web topic to write decryption script

Questions from bugku in the WEB3

Select the option to let him stop, the following code after the F12, a look at the figures that this is ASC:

Copy it, write pyhton script as follows, running about in the compiler

S = ' & # 75; & # 69; & # 89; & # 123; & # 74; & # 50; & # 115; & # 97; & # 52 is; & # 50; & # 97; & # 104 ; & # 74; & # 75; & # 45; & # 72; & # 83; & # 49; & # 49; 73 is & #; 73 is & #; 73 is & #; & # 125 ' 
Key = s.split ( ' ; ' )
#py which all variables are objects, a representation of the object s.split ();
#split function is the function () to add a breakpoint location indicated within this string of characters separated into a list of strings, then Key: { '# 75 &', '# 69 &', '# 89 &'} balabala
in Flag
= ''
# advance not declare a variable length, followed next know when contact is then behind the string type, use '+ =' symbol of advance declare a variable type
for I in Key: in Flag + = CHR (int (I [2 :]))
#for phrase "for temporary variables may be in iterables: "Do not forget to add: if and else shall be added back: back while also adding
#i [2:] Slicing string is, in fact, three containing the variable i [a: b: c] wherein the subscript a is started (starting from 0) b is the end of the subscript c is the step size (several compartments take a)
] Slicing string is, in fact, three containing the variable i [a: b: c] wherein the subscript a is started (starting from 0) b is the end of the subscript c is the step size (several compartments take a) # where a, b if the blank is the default start and end, c 1 is the default is not to write each must # This is taken of all elements in the list of numbers, and these numbers in the character string is converted into a digital int type, int digital asc changed as char type, it is to be noted that the function is CHR () instead of char ()
Print (Flag)
# to brackets

The second script:

Into a string array to provide split Python () function can be split into a plurality of strings of a string list { '# 75 &', '# 69 &', '& # 89' . . . }. 
strr
 

 
= "" 
For in CH CHS: 
    Strr = Strr + CHR (int (CH)) 
 # . 4, the character is converted to ascii code, is written on a scripting digital part of each string sections that carry out; this species is a traverse of the characters directly, because the rest are numeric characters. 
# The py for statement can be traversed by a temporary variable in the back of the iterable, very flexible, here is traversed every character
{ '75', '69', '89'. . . } Print (Strr)

 

To give flag: KEY {J2sa42ahJK-HS11III}

 

More about the use python string, this blog is very well written: https://www.jianshu.com/p/093702933003

 

Guess you like

Origin www.cnblogs.com/2019go5/p/11370167.html