Skip to content

Instantly share code, notes, and snippets.

@cryptolok
Last active February 4, 2024 12:12
Show Gist options
  • Save cryptolok/8a023875b47e20bc5e64ba8e27294261 to your computer and use it in GitHub Desktop.
Save cryptolok/8a023875b47e20bc5e64ba8e27294261 to your computer and use it in GitHub Desktop.
small tool to retreive vk.com (vkontakte) users hidden metadata (state, access, dates, counts, etc) anonymously (without login)
#!/bin/bash
# small tool to retreive vk.com (vkontakte) users hidden metadata (state, access, dates, counts, etc) anonymously (without login)
# sudo apt install curl
parse(){
local IFS=\>
read -d \< CELL VALUE
}
URL=$1
if [[ ! "$URL" ]]
then
echo 'USAGE : vMetaDate.sh vk.com/target_personal_page'
exit 1
fi
#ID=$(curl -s -A 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:52.0) Gecko/20100101 Firefox/52.0' $URL | grep 'user_id' | cut -d ':' -f 2 | cut -d ',' -f 1)
ID=$(curl -s -A 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:52.0) Gecko/20100101 Firefox/52.0' $URL | grep '?id=' | cut -d '=' -f 2 | cut -d '"' -f 1)
ID=$(echo $ID)
echo -e "\nPERMANENT DATA\n"
echo "ID : $ID"
DATA=$(curl -s -A 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:52.0) Gecko/20100101 Firefox/52.0' "https://vk.com/foaf.php?id=$ID")
while parse
do
if [[ "$VALUE" != " " && "$VALUE" ]]
then
CELL=$(echo $CELL | cut -d ':' -f 2)
echo "$CELL : $VALUE"
fi
done <<< $DATA
created=$(echo $DATA | grep -o -P 'dc:date=".*"' | cut -d '"' -f 2)
lastLoggedIn=$(echo $DATA | grep -o -P 'dc:date=".*"' | cut -d '"' -f 4)
modified=$(echo $DATA | grep -o -P 'dc:date=".*"' | cut -d '"' -f 6)
echo "created : $created"
echo -e "\nVARIABLE DATA\n"
echo "lastLoggedIn : $lastLoggedIn"
echo "modified : $modified"
title=$(echo $DATA | grep -o -P 'dc:title=".*;"' | cut -d '"' -f 2)
echo "title : $title"
image=$(echo $DATA | grep -o -P 'rdf:about=".*"' | cut -d '"' -f 2)
echo "image : $image"
locationOfBirth=$(echo $DATA | grep -o -P 'ya:city=".*"' | cut -d '"' -f 2)
location=$(echo $DATA | grep -o -P 'ya:city=".*"' | cut -d '"' -f 4)
echo "locationOfBirth : $location"
echo "location : $location"
school=$(echo $DATA | grep -o -P 'ya:school.*/>' | cut -d '"' -f 2)
schoolCountry=$(echo $DATA | grep -o -P 'ya:school.*/>' | cut -d '"' -f 6)
schoolCity=$(echo $DATA | grep -o -P 'ya:school.*/>' | cut -d '"' -f 8)
echo "school : $school"
echo "schoolCountry : $schoolCountry"
echo "schoolCity : $schoolCity"
university=$(echo $DATA | grep -o -P '<ya:university.*/>' | cut -d '"' -f 2)
caption=$(echo $DATA | grep -o -P '<ya:university.*/>' | cut -d '"' -f 4)
subCaption=$(echo $DATA | grep -o -P '<ya:university.*/>' | cut -d '"' -f 6)
grade=$(echo $DATA | grep -o -P '<ya:university.*/>' | cut -d '"' -f 8)
graduation=$(echo $DATA | grep -o -P '<ya:university.*/>' | cut -d '"' -f 10)
graduationCountry=$(echo $DATA | grep -o -P '<ya:university.*/>' | cut -d '"' -f 14)
graduationCity=$(echo $DATA | grep -o -P '<ya:university.*/>' | cut -d '"' -f 16)
echo "university : $university"
echo "caption : $caption"
echo "subCaption : $subCaption"
echo "grade : $grade"
echo "graduation : $graduation"
echo "graduationCountry : $graduationCountry"
echo "graduationCity : $graduationCity"
work=$(echo $DATA | grep -o -P '<ya:workPlace.*/>' | cut -d '"' -f 2)
job=$(echo $DATA | grep -o -P '<ya:workPlace.*/>' | cut -d '"' -f 4)
workCountry=$(echo $DATA | grep -o -P '<ya:workPlace.*/>' | cut -d '"' -f 8)
workCity=$(echo $DATA | grep -o -P '<ya:workPlace.*/>' | cut -d '"' -f 10)
echo "work : $work"
echo "job : $job"
echo "workCountry : $workCountry"
echo "workCity : $workCity"
military=$(echo $DATA | grep -o -P '<ya:military.*/>' | cut -d '"' -f 2)
militaryCountry=$(echo $DATA | grep -o -P '<ya:military.*/>' | cut -d '"' -f 6)
militaryCity=$(echo $DATA | grep -o -P '<ya:military.*/>' | cut -d '"' -f 8)
echo "military : $military"
echo "militaryCountry : $militaryCountry"
echo "militaryCity : $militaryCity"
@cryptolok
Copy link
Author

@0x7ff
I analyzed the result and it's normal
if the profile is deleted AND disallowed, then there is no more data stored on servers

@M1chael
Copy link

M1chael commented Aug 12, 2017

I have the same issue as @0x7ff have described for any profile. Curl is installed. Tried with:
./script.sh https://vk.com/<name>
./script.sh vk.com/<name>

@ankal65
Copy link

ankal65 commented Jun 5, 2021

@vOs4 and everyone else
it's pretty simple, from your command line:
$ sudo apt install curl
$ chmod u+x vMetaDate.sh
$ ./vMetaDate.sh https://vk.com/id1

Моргни два раза если знаешь русский. Кек

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment