Introducing Integer Overflows

Introducing Integer Overflows

Buffer Overflow happens when a program allows data to be written into it beyond its limit, overwriting adjacent memory. Integer overflow is a similar case.

An integer overflow happens when the integer inputs are put to some mathematical operations and the result is too large that it wraps around or changes abruptly.

An integer can hold a maximum value in the C language up to 2,147,483,647 . If we add 1 to it, then we get -2,147,483,647 (32-bit). Interesting right.

This is today's picoCTF challenge:

Let's run the binary and check locally first.


Let's check the source code.

A sum will be calculated using two inputs. We need the sum of two positive numbers to be a negative number. Does this ring a bell? We discussed such a scenario at the top. Let's try those values.

Cool, that's a good introduction to integer overflows. Just letting you know integer overflows had great repercussions in the past. The Ariane 5 rocket failure (1995) was due to an integer overflow.

If you are writing code that handles numbers, then using long instead of int can be a game-saver.


Try out LiveAPI. Get your backend APIs documented automatically. It supports 90+ backend frameworks and 20+ programming languages. Please give it a try and provide your feedback.


要查看或添加评论,请登录

Sreedeep CV的更多文章

  • PicoCTF VNE & Picker IV

    PicoCTF VNE & Picker IV

    This is an interesting challenge; there is this binary file that lists the directory as root user. We are given a low…

  • PicoCTF Format String -1

    PicoCTF Format String -1

    Here is another easy format string vulnerability challenge from picoCTF. Let's try the challenge out in the terminal.

  • Learn Binary Exploitation with PicoCTF

    Learn Binary Exploitation with PicoCTF

    Let's learn something new today. Let's hit the most complicated and less explored Binary Explitation challenges.

  • PicoCTF RSA PopQuiz

    PicoCTF RSA PopQuiz

    Let's revise your knowledge on RSA understanding. This is a hard challenge in picoCTF.

    1 条评论
  • Introducing RSA Encryption

    Introducing RSA Encryption

    Security in general is very dependent on cryptography. Every complex challenge, every malware ever written always…

  • PicoCTF Very Very Very Hidden: Forensic Challenge

    PicoCTF Very Very Very Hidden: Forensic Challenge

    We are given a huge pcap file (10 MB) in this challenge. Here is the description : Finding a flag may take many steps…

  • Learn SQLi: PicoCTF Web Gauntlet

    Learn SQLi: PicoCTF Web Gauntlet

    Welcome back, ctf enthusiasts and hackers. Let's learn some manual gamified SQL challenges from PicoCTF.

  • PicoCTF Android Reverse Engineering Challenges Part 3

    PicoCTF Android Reverse Engineering Challenges Part 3

    This is the final android reversing challenge in PicoCTF. Checkout the part 1 and part 2 of the article to see progress…

  • PicoCTF Android Reverse Engineering Challenges Part 2

    PicoCTF Android Reverse Engineering Challenges Part 2

    Today we will try some medium difficult Android challenges from PicoCTF. We completed droids0 and droids1 in the…

    2 条评论
  • PicoCTF Android Reverse Engineering Challenges

    PicoCTF Android Reverse Engineering Challenges

    Let's try some android related ctf challenges today. We are given APK files, we need to reverse-engineer the apk to get…