📜 ⬆️ ⬇️

Upload pictures on the wall VKontakte

Do you receive messages from friends asking you to send SMS somewhere or to look in the gallery where your friend poses nude? And all because they use questionable software and go to questionable sites.

We will now write a script that will place graffiti images on the wall. I wrote for myself, so that lovers of convenience file in hand and good luck. We will write in PHP (yes, in this stupid inhibited language for govnokoder and schoolchildren) and at the same time we will learn how to work with cURL, and upload files to the server with it.

So, from the tools we need a sniffer and a flash decompiler. The sniffer will give us the request parameters:
'Signature' => digital signature of the image sent to the server,
'Filedata' => the actual image in PNG format and size 586293,
'Upload' => 'Submit Query' string
... and a flash decompiler in order to find out how a digital signature is formed:
Signature = md5 from the first kilobyte base64-code PNG-pictures
')
Actually code:

UPD: In connection with the change of the authorization system in the contact, the script is no longer working. In the future I will redo it.

<? //http://vkontakte.ru/graffiti.php?act=last $userID = 'komu_ID'; $myID = 'otkogo_ID'; $myEMail = 'moi_login_v_kontakte%40mail.ru'; $myRemixId = 'f2a72a32c5b112da4e1701b0815614f34c680278918fbc08c4d3ed70'; $myPassword = md5('pass'); $graffitiFile = 'graffiti.png'; $vh = curl_init(); $options = Array ( CURLOPT_URL => 'http://vkontakte.ru/graffiti.php?to_id=' . $userID . '&group_id=0', CURLOPT_POST => 1, CURLOPT_POSTFIELDS => Array ( 'Signature' => md5(substr(base64_encode(file_get_contents($graffitiFile)), 0,1024)), //'Filedata' => file_get_contents($graffitiFile), 'Filedata' => '@' . realpath($graffitiFile), 'Upload' => 'Submit Query', ), CURLOPT_REFERER => 'http://vkontakte.ru/swf/Graffiti.swf?15', CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.8 (.NET CLR 3.5.30729) FirePHP/0.2.4', CURLOPT_COOKIE => 'remixlang=0; remixchk=5; remixautobookmark=14; remixmid=' . $myID. '; remixemail=' . $myEMail. '; remixpass=' . $myPassword . '; remixid=' . $myRemixId . ';', CURLOPT_HTTPHEADER => Array ( 'Host: vkontakte.ru', 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language: ru,en-us;q=0.7,en;q=0.3', 'Accept-Encoding: gzip,deflate', 'Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7', 'Keep-Alive: 300', 'Connection: keep-alive', ), CURLOPT_RETURNTRANSFER => true, ); curl_setopt_array($vh, $options); curl_exec($vh); curl_close($vh); Header("Location: http://vkontakte.ru/graffiti.php?act=last"); ?> 


Next to the script, put a PNG file of size 586293 and the name graffiti.png. Run from the console.
When the script runs, you need to go to the address vkontakte.ru/graffiti.php?act=last and confirm the downloaded picture. If not loaded, perhaps the picture is too big in weight. The weight limit was not calculated, but a kilobyte of 100-150 is quiet ...

Thanks to all. Happy Victory Day.

Source: https://habr.com/ru/post/59248/


All Articles