you have been pawned? FACEBOOK data leak search

JAY BHATT
3 min readApr 22, 2021

Hello everyone!

This year private information from 533 million accounts from 106 countries has been leaked online for free. Even Facebook founder Mark Zuckerberg’s private information like Mob. Number and location are part of the larger data leaked.

with Facebook data leak I have built 1 site with python-flask and react.js which works like https://haveibeenpwned.com
you can find it here:- https://data-leak-search.herokuapp.com/
code is available here:- https://github.com/BhattJayD/Facebook-Data-Leak-search this site only works for a user from India

let us have a look at how my project works

code explanation from scraping.py :-

f1 = open("DATA LEAK FILE HERE.txt", "r") #add your file here                       data=[]
for x in f1:
read_line=f1.readline()
data_to_list=read_line.split(':')
data.append(data_to_list)

in the above code, we are opening a file in reading mode
and scraping the content of a file into a list

length=len(data)
number=[]
for i in range(0,length):
number.append(data[i][0])

here we are finding the length of scraped data and in the loop, we are scraping numbers from data leak

with open ("number.txt",'a') as file:
for i in number:
file.write("%s \n"%i)

here we are creating 1 file named number.txt which content number of all users who were in the data leak. The file is in append mode because if you have multiple data leak files then the content of it will be appended at the end of the file

code explanation from app.py : -

here we are using 4 modules Flask,request,jsonify,os
flask for creating flask server
request for accessing parameters from the address bar
jsonify for sending JSON response to front-end
os for getting the available port

from flask import Flask,request,jsonify
import os
app=Flask(__name__, static_folder=’./gui/build’,static_url_path=’/’)
@app.route(‘/’)
def index():
return app.send_static_file(‘index.html’)

if __name__==”__main__”:
app.run(debug=True,port=os.environ.get(‘PORT’,5000),host=”0.0.0.0")

here we are creating a simple react app with root as API point
static_folder=’./gui/build’
is the location of react.js build
return app.send_static_file(‘index.html’)
here we are returning the content of index.html which is our react build app
port=os.environ.get
here we are getting an available port for deployment

def check(fname, txt):
with open(fname) as datafile:
return any(txt in line for line in datafile)
@app.route('/search', methods=['get'])
def get_query_string():
output = ""
number = request.query_string.decode("utf-8")
print(number,"no.")
x=True
limit=10
while x:
n=len(number)
if n>=limit:
x=False
if check('number.txt', number):
output="You have been pawned! in FACEBOOK data leak"
else:
output="You haven't been pawned in FACEBOOK data leak *THIS TIME*"
return jsonify({"response":output})

Here we are creating a search API point that will fetch query from the address bar and find if the number present in the number.txt file is present it will send response “You have been pawned! in FACEBOOK data leak” or else it will send “You haven’t been pawned in FACEBOOK data leak *THIS TIME*”

Have a look at my react app

HOME page
search number not pawned
search number pawned

you can access my app from here:-
https://data-leak-search.herokuapp.com/
feel free to use my code from here:-
https://github.com/BhattJayD/Facebook-Data-Leak-search
you will be needing a data leak file for scraping (i guess you can find it on the internet)

this is it thank you so much for reading
happy building!

--

--

JAY BHATT

Cyber Security Enthusiast |Top 1% on TryHackMe |CTF Player