Theme Layout

Boxed or Wide or Framed

Wide

Theme Translation

Display Featured Slider

Featured Slider Styles

Display Grid Slider

yes

Grid Slider Styles

Display Trending Posts

Display Author Bio

Display Instagram Footer

off

Dark or Light Style

Light
Powered by Blogger.

Thursday, December 15, 2016

[Pwnable.kr/Toddler's Bottle] Lotto ( Solved. 16.12.13 )


# Problem.

 : This program has a code problem.


# How To Solve.

 : The code where the vulnerability exists is in the followed section.

 // calculate lotto score
 int match = 0, j = 0;
 for(i=0; i<6; i++){
  for(j=0; j<6; j++){
   if(lotto[i] == submit[j]){
    match++;
In this part, even if only one out of six is matched by the for statement, the match can be increased to 6.


Note that the value of submit[6] in this program is character variables.
Since lotto ranges from 1 to 45, player can input one of the characters from 33 to 45 six times. 



The result is as follows.





QuickEdit
Unknown
0 Comments
Share This Post :

You Might Also Like

No comments:

Post a Comment

Follow @SunriseSunsetBlog