Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- set_time_limit(0);
- class Diesel{
- public $user;
- public $pass;
- public $post;
- public function login(){
- $authArray=array(
- 'ips_username' => $this->user,
- 'ips_password' => $this->pass,
- 'submit' => 'Войти'
- );
- $result=$this->request('http://diesel.elcat.kg/index.php?act=Login&CODE=01', $authArray,'POST');
- }
- public function findDeleteLink(){
- $res= $this->request($this->post."&st=9999",false,'GET');
- if(preg_match_all('/\<table\s+class(.*)\s+\<\/table\>/isU',$res,$pages)) {
- foreach($pages[0] as $k=>$v){
- if(preg_match('/onmousedown=\"ins\(\''.$this->user.'\'\);\s+return\s +false\"\>\<b\>'.$this->user.'\<\/b\>\<\/a\>/',$v,$out)){
- if(preg_match('/\<div\s+class=\"postcolor\"\s+id=\'post\-(.*)\'\ >\s+up\s+\<\!\-\-IBF\.ATTACHMENT_/isU',$v,$out2)){
- if(preg_match('/delete_post\(\'(.*)\'\)\"\>/isU',$v,$result)){
- return $result[1];
- }
- }
- }
- }
- }
- return false;
- }
- public function deleteLink($link){
- if($link!=false){
- $res=htmlspecialchars_decode($link);
- $out=$this->request($res,false,'GET');
- if(preg_match('/\<p\>Сообщение\s+удалено\<br/',$out)){
- return true;
- }
- }
- }
- public function newUp(){
- $parse=$this->request($this->post.'&st=99999','','GET',false);
- preg_match('/name=\"f\" value=\"(.*)\"/',$parse,$f);
- preg_match('/name=\"t\" value=\"(.*)\"/',$parse,$t);
- preg_match('/name=\"auth_key\" value=\"(.*)\"/',$parse,$auth_key);
- $action='http://diesel.elcat.kg/index.php';
- $f=$f[1];
- $t=$t[1];
- $auth_key=$auth_key[1];
- $upArray=array(
- 'act' => 'Post',
- 'CODE' => '03',
- 'f' => $f,
- 't' => $t,
- 'st' => '99999',
- 'auth_key' => $auth_key,
- 'fast_reply_used'=> 1,
- 'Post' => 'up',
- 'submit' => 'Отправить'
- );
- $result=$this->request($action,$upArray,'POST');
- return $result;
- }
- public function request($url,$params='',$method,$close=true){
- $ch = curl_init();
- curl_setopt($ch,CURLOPT_URL, $url);
- if($method=='POST'){
- curl_setopt($ch,CURLOPT_POST,1);
- curl_setopt($ch,CURLOPT_POSTFIELDS, $params); // post data
- }
- curl_setopt($ch, CURLOPT_REFERER, $url);
- curl_setopt($ch,CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36 OPR/48 .0.2685.52");
- curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($ch,CURLOPT_COOKIEJAR, "cookie-1.txt");
- curl_setopt($ch,CURLOPT_COOKIEFILE, "cookie-1.txt");
- curl_setopt($ch,CURLOPT_VERBOSE, false);
- curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch,CURLOPT_FOLLOWLOCATION, true);
- $result = curl_exec($ch);
- if($close==true){
- curl_close($ch);
- }
- return $result;
- }
- }
- $test=new Diesel();
- $test->user='upzap';
- $test->pass='123456';
- $test->login();
- $test->post='http://diesel.elcat.kg/index.php?showtopic=292062127'; // тема
- echo $link=$test->findDeleteLink();
- $test->deleteLink($link);
- sleep(5);
- $test->newUp();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement