Skip to content

Hack The Box | Addition

In this walkthrough, we will be going through the Addition box on Hack The Box.


Successfully Pwned Addition

Completed and pwned this challenge on Hack The Box.

Owned

Hack The Box

Pwned

Challenge Description

Two ancient runes hold hidden powers. Combine them to unlock the sum and reveal their secret.

Challenge Overview

This challenge is pretty simple we got a web page where we have a code editor. We need to create a script that will addition the input given.

Addition - Overview

Automation Script

To resolve this challenge, we can create a simple script that will addition the inputs.

python
# take in the number
a = int(input())
b = int(input())

# calculate answer
answer = a + b

# print answer
print(answer)
c
#include <stdio.h>
#include <string.h>

int main() {
    // take in the number
    char a[100], b[100];
    scanf("%s", a);
    scanf("%s", b);

    // calculate answer
    int answer = atoi(a) + atoi(b);
    
    // print answer
    printf("%d", answer);
    return 0;
}
cpp
#include <iostream>
#include <string>

int main() {
    // take in the number
    std::string a, b;
    std::cin >> a;
    std::cin >> b;

    // calculate answer
    int answer = std::stoi(a) + std::stoi(b);
    
    // print answer
    std::cout << answer;
    return 0;
}

After sumbitting the script, we will get the flag.