PHP: <?php $dir = dirname(__FILE__); $all_elements = Array(); if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { $ext = substr($file, strrpos($file, '.')+1); if (strtolower($ext) == 'txt') { echo "$file:"; $all_elements = array_merge($all_elements, explode("\n", str_replace("\r", '', trim(file_get_contents("$dir\\$file"))))); echo " ".count($all_elements)."\n"; } } closedir($dh); } } $all_elements = array_unique($all_elements); echo "Total unique: ".count($all_elements)."\n"; file_put_contents('./.summary.txt', implode("\n", $all_elements)); ?> Объединяет содержимое всех txt файлов в директории, + убирает неуникальные строки.
Скрипт обновил! http://dump.ru/file/2912904 http://letitbit.net/download/7916aae252/Voterobf.rar.html http://depositfiles.com/files/b41zpwilc
скрипт для за/розшифровки линков например: http://%67%6F%6F%67l%65%2E%63%6F%6D = google.com хорошо подойдет для фейков PHP: <?php ############ ##coded by liga ##PS пользуясь ##случаем хочу ##передать приветы ##своему контакт ##листу и ##всему ачату ##and erihtoney ############# $link=($_POST['linkk']); function code($link){ $a=array('j' , '.' , 'w' , 'f' , 'o', 'r', 'u' , 'm' , 'a' , 'q' , 't' , 's' , 'v' , 'y' , 'b' , 'c' , 'd' , 'e' , 'i' , 'g' , 'h' , '*' , 'p' , ':' , '?' , '=' , '>' , '<' , 'k' , 'n'); $b=array('%6A','%2E', '%77', '%66', '%6F', '%72', '%75', '%6D', '%61', '%71','%74', '%73' ,'%76' ,'%79' , '%62' , '%63' , '%64' , '%65' , '%69' , '%67','%68' , '%2A' , '%70' , '%3A' , '%3F' , '%3D' , '%3E' , '%3C' , '%6B' , '%6E'); $_txt=str_replace($a, $b, $link); return $_txt; } function decode($link){ $a=array('j','.', 'w', 'f', 'o', 'r', 'u', 'm', 'a', 'q', 't', 's', 'v', 'y', 'b', 'c', 'd', 'e', '2', 'i', 'g', 'h','*','p',':','/','?','=','\'','>','<',' ','k','n','1','2','3','4','5','6','7','8','9'); $b=array('%6A','%2E', '%77', '%66', '%6F', '%72', '%75', '%6D', '%61', '%71','%74','%73','%76','%79', '%62', '%63','%64','%65','%32','%69','%67','%68','%2A','%70','%3A','%2F','%3F','%3D','%27','%3E','%3C','%20','%6B','%6E','%31','%32','%33','%34','%35','%36','%37','%38','%39'); $_txt=str_replace($b, $a, $link); return $_txt; } switch ( $_REQUEST['type']) { case 0:$otvet= code($link); break; case 1:$otvet= decode($link); break; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="ru"> <head> <title>link enciphering</title> <meta http-equiv="content-type" content="text/html; charset=windows-1251" /> <STYLE> body { background-color:#222; color:#999; font-family:Verdana; font-size:9pt; padding:0px; margin:0px; } table { font-family:Verdana, Arial; font-size:13px; } form { padding:20px; margin:20px; } input, select { background:#292929; padding:2px; font-size:12px; border:1px solid #444; font-family:Verdana; color:#888; } </style> </head> <body> <table align="center" > <tr><td align="center">link enciphering</td></tr> <form method=post> <tr><td align="center"><br> <input name="type" type="radio" value="0" checked>enciphering <input name="type" type="radio" value="1" checked>deenciphering </td></tr> <tr> <td > <input type=input name="linkk" size=48> <input type=input name=datafromuser size=48 value="<? echo $otvet;?> " ></td></tr> <br> <tr><td align="center"><br><input type="submit" value="[enciphering-deenciphering]" style="width:608px;"> </form> </td></tr> </body> </html>
хотел отличиться умом и сообразительностью?и текст запостил с пхп.нет ай маладэц!,нихрена не выйшло,закодируй мне своими функциями ссылку как я показал на примере.
простенький speed dial почти как в опере.. работает без яваскрипта настройки в index.xhtml скачать тут >> http://2u.ifolder.ru/12679656
Парсер моб. номеров телефонов с ВК [PERL] Парсер мобильных номеров телефонов с Вконтакте. Code: #!/usr/bin/perl use strict; use LWP::UserAgent; use HTTP::Cookies; ################################# my $login = '[email protected]'; # Логин аккаунта ВК my $pass = '123456789'; # Пароль аккаунта ВК my $good = 'numbers.txt'; # Файл с напарсенными номерами телефонов my $range = "19340000-19349999";# Диапазон ID юзеров ВК, которых парсить ################################# my $ua = LWP::UserAgent->new(timeout => 40, cookie_jar => HTTP::Cookies->new()); my $ans = $ua->post("http://pda.vkontakte.ru/login?pda=index&acknowledge=0",{ "email" => $login, "pass" => $pass})->as_string; my $i; my $cnt = 0; my ($from,$to) = split /-/,$range; for($i = $from; $i <= $to; $i++){ my $resp = $ua->get("http://pda.vkontakte.ru/id$i")->content; if($resp =~ m,'tel:(\d*)',i){ ++$cnt; open my $dat,'>>'.$good; print $dat $1."\n"; print "[+] - $1\n"; print "[numbers found: $cnt]\n"; close $dat;} } #(c) Gaus 2009
[Python] Счетчик Строк [Python] Элементарный скрипт для подсчета строк в файлах. Пригодится для проверки говночекеров, да и вообще так (по крайней мере мну сегодня пригодился) Скрипт с гуем, пэтому требует Tkinter (на windows стоит по умолчанию) В режиме "Без дублей" файл грузится в оперативку, поэтому поаккуратнее там Скрин: Code: #!usr/bin/env python # -*- coding:utf-8 -*- # files length counter # (c) login999 from Tkinter import * from tkMessageBox import showerror from tkFileDialog import askopenfilename LastCounter = 0 NowCounter = 0 AllCounter = 0 def Count(): global LastCount global NowCount global AllCount global AllCounter global NowCounter global LastCounter LastCounter = NowCounter NowCounter = 0 try: with open(askopenfilename()) as accs: for _ in accs: NowCounter += 1 AllCounter += 1 LastCount["text"] = LastCounter NowCount["text"] = NowCounter AllCount["text"] = AllCounter except Exception, e: showerror(u"Ошибка", e) def NODUP(): global LastCount global NowCount global AllCount global AllCounter global NowCounter global LastCounter LastCounter = NowCounter NowCounter = 0 try: with open(askopenfilename()) as accs: for _ in set(accs): NowCounter += 1 AllCounter += 1 LastCount["text"] = LastCounter NowCount["text"] = NowCounter AllCount["text"] = AllCounter except Exception, e: showerror(u"Ошибка", e) def Clear(): global LastCount global NowCount global AllCount global AllCounter global NowCounter global LastCounter NowCounter = 0 LastCounter = 0 AllCounter = 0 LastCount["text"] = LastCounter NowCount["text"] = NowCounter AllCount["text"] = AllCounter MainWindow = Tk() MainWindow["bd"] = 5 MainWindow.title(u"Счетчик Строк") MainWindow.resizable(width=False, height=False) ButtonsFrame = Frame(MainWindow) CountButton = Button(ButtonsFrame, text=u"Посчитать", width=11, command=Count) NODUPButton = Button(ButtonsFrame, text=u"Без дублей", width=11, command=NODUP) ClearButton = Button(ButtonsFrame, text=u"Очистить", width=11, command=Clear) CountButton.grid(row=0, column=0) NODUPButton.grid(row=1, column=0) ClearButton.grid(row=2, column=0) ButtonsFrame.grid(row=0, column=0, sticky="w") LinesLabel = LabelFrame(MainWindow, text=u"Количество строк") LastLabel = Label(LinesLabel, text=u"Последний :", anchor="w", width=12) LastCount = Label(LinesLabel, text=LastCounter, width=8) NowLabel = Label(LinesLabel, text=u"Нынешний :", anchor="w", width=12) NowCount = Label(LinesLabel, text=NowCounter, width=8) AllLabel = Label(LinesLabel, text=u"Всего :", anchor="w", width=12) AllCount = Label(LinesLabel, text=AllCounter, width=8) LastLabel.grid(row=0, column=0) LastCount.grid(row=0, column=1) NowLabel.grid(row=1, column=0) NowCount.grid(row=1, column=1) AllLabel.grid(row=2, column=0) AllCount.grid(row=2, column=1) LinesLabel.grid(row=0, column=1, sticky="w") MainWindow.mainloop()
Просто видел выше такую же для IE, сам мозилой пользуюсь, вот и добавил. Если не в тему, то предыдущий оратор меня ввёл в заблуждение, прошу прощения
Radikal.Ru Images Uploader Сегодня понадобилось загрузить все изображения из папки на radikal.ru. Вот собственно скрипт Code: #!/usr/bin/perl use warnings; use strict; use LWP::UserAgent; ############################# my $img_dir = './images/'; # Путь к папке с изображениями my $link_file = 'links.txt';# Файл с ссылками на загруженные изображения ############################# print qq(############################## # Radikal.Ru Images Uploader # # (c)Gaus 2009 # ##############################\n\n); my @images = <$img_dir*.*>; while(@images){ my $cimg = shift @images; my $ua = LWP::UserAgent->new(timeout => 65); my $answ = $ua->post("http://www.radikal.ru/action.aspx", Content_type => 'multipart/form-data', Content => [upload => "yes", GEO_POINT_ID => "", F => [$cimg]])->as_string; if($answ =~ m,"input_link_1" value="(.*?)",i){ print "[ + ] ".$1." [$cimg]\n"; open my $dat,'>>',$link_file or die "\nCould not open $link_file file!\n"; print $dat "[IMG]".$1."[/IMG]\n"; close $dat; }else{print "[ - ] [$cimg]\n";} }
В одно время заказывал простейший скрипт работы ajax -> php -> mysql -> php -> ajax кому интересно - выкладываю в архиве Подробнейшое описание скрипта в ТЗ.doc. много комментов.
Скрипт чтобы достать список всех таблеток главмеда Code: use strict; use warnings; use LWP::UserAgent; use Tie::File; my @pills; tie @pills, 'Tie::File', 'pills.txt'; my $ua = LWP::UserAgent->new(); for (1..5000) { my $page = $ua->get('http://www.canadianmedsworld.com/item.php?id='.$_)->decoded_content; my ($name) = $page =~ m[<div class="item_title">(.+?)</div>]; push @pills, $name if defined $name; }
Скрипт переноса таблиц с разной структурой в таблицу пользователей воблы Выкладываю готовое решение: PHP: // База - донор $host_a = "localhost"; // MySQL server $user_db_a = ""; // MySQL пользователь $pass_db_a = ""; // MySQL пароль $dbase_a = ""; // MySQL база данных $dtable = ""; // Таблица в базе данных // База - реципиент $host = "localhost"; // MySQL server $user_db = ""; // MySQL пользователь $pass_db = ""; // MySQL пароль $dbase = ""; // MySQL база данных $link1 = mysql_connect($host_a, $user_db_a, $pass_db_a); mysql_select_db($dbase_a, $link1); $link2 = mysql_connect($host, $user_db, $pass_db); mysql_select_db($dbase, $link2); $res1 = mysql_query("SELECT id, email, username, pwd, regdate, reg_ip FROM $dtable", $link1); function fetch_user_salt($length = 3) { for ($i = 0; $i < $length; $i++) { $salt .= chr(rand(99, 120)); $salt = str_replace('\'','1',$salt); $salt = str_replace('"','1',$salt); } return $salt; } if (mysql_num_rows($res1) > 0) while ($temp = mysql_fetch_assoc($res1)) { //Обработка данных: генерация пароля и т.п. $salt = fetch_user_salt(); $pwd = md5( md5( trim($temp[pwd]) ).$salt ); mysql_query("INSERT INTO f_user SET userid='$temp[id]', usergroupid='2', membergroupids='', displaygroupid='0', username='$temp[username]', password='$pwd', passworddate='2009-06-20', email='$temp[email]', styleid='2', parentemail='', homepage='', icq='', aim='', yahoo='', msn='', skype='', showvbcode='1', showbirthday='2', usertitle='Junior Member', customtitle='0', joindate='0', daysprune='-1', lastvisit='1245661871', lastactivity='1245661871', lastpost='0', lastpostid='0', posts='0', reputation='10', reputationlevelid='5', timezoneoffset='0', pmpopup='0', avatarid='0', avatarrevision='0', profilepicrevision='0', sigpicrevision='0', options='3143', birthday='', birthday_search='0000-00-00', maxposts='-1', startofweek='-1', ipaddress='$temp[reg_ip]', referrerid='0', languageid='0', emailstamp='0', threadedmode='0', autosubscribe='-1', pmtotal='0', pmunread='0', salt='$salt', ipoints='0', infractions='0', warnings='0', infractiongroupids='', infractiongroupid='0', adminoptions='0', profilevisits='0', friendcount='0', friendreqcount='0', vmunreadcount='0', vmmoderatedcount='0', socgroupinvitecount='0', socgroupreqcount='0', pcunreadcount='0', pcmoderatedcount='0', gmmoderatedcount='0'"); mysql_query("INSERT INTO f_userfield SET userid='$temp[id]'"); mysql_query("INSERT INTO f_usertextfield SET userid='$temp[id]'"); } Огромная благодарность: Doom123, Extremal (Список благодарности дополню)
Класс для работы с антикапчей: PHP: <?php /* * @name: anti-captcha.php * @description: Class to communicate AC's API * @author: NULL_byte * @contacts: www.null-byte.info * @version: 1 */ /* $AC = new AntiCaptcha; $AC->Verbose = false; $AC->APIKey = ''; $AC->Recognize('E:\www\vkontakte\regger\captcha.jpg'); $r = $AC->DecodedCaptcha; if (!$r) $AC->MakeAbuse(); */ class AntiCaptcha { var $APIKey = ''; var $Verbose = true; var $Numeric = 0; var $Phrase = 0; var $Regsense = 0; var $RTimeout = 2; // Как часто проверять результат var $MTimeout = 120; // максимальное время расшифровки var $MinLen = 0; var $MaxLen = 0; var $DecodedCaptcha = false; var $LastCaptchaID = ''; function Recognize($file) { if (!is_array($file) && !file_exists($file)) { echo "File $file not found\n"; return false; } if (is_array($file)) { if (!isset($file[0]) || !isset($file[1]) || !isset($file[2])) echo "Wrong image data!\n"; $filedata = Array($file[0], $file[1], $file[2]); } else { $filedata = Array(file_get_contents($file)); } $q = new HTTPQuery; $q->ContentType = 'multipart/form-data'; $q->Query = Array( 'method' => 'post', 'key' => $this->APIKey, 'file' => $filedata, // Полный путь к файлу 'phrase' => $this->Phrase, 'regsense' => $this->Regsense, 'numeric' => $this->Numeric, 'min_len' => $this->MinLen, 'max_len' => $this->MaxLen ); $q->Post('http://ac-service.info/in.php'); if (strpos($q->Result, "ERROR") !== false) { echo "Server returned error: {$q->ResultClean}\n"; $this->DecodedCaptcha = false; return false; } else { $ex = explode("|", $q->Result); $this->LastCaptchaID = $ex[1]; $captcha_id = $ex[1]; if (!$this->Verbose) return $captcha_id; if ($this->Verbose) echo "Decoding captcha"; $waittime = 0; if ($this->Verbose) echo "."; sleep($this->RTimeout); while(true) { $q->Get("http://ac-service.info/res.php?key={$this->APIKey}&action=get&id=$captcha_id"); $result = $q->ResultClean; if (strpos($result, 'ERROR') !== false) { if ($this->Verbose) echo "Server returned error: $result\n"; $this->DecodedCaptcha = false; return false; } if ($result == "CAPCHA_NOT_READY") { $waittime += $this->RTimeout; if ($waittime > $this->MTimeout) { if ($this->Verbose) echo "Timelimit ({$this->MTimeout} secs) hit\n"; break; } if ($this->Verbose) echo "."; sleep($this->RTimeout); } else { $ex = explode('|', $result); $this->DecodedCaptcha = false; if (trim($ex[0]) == 'OK') $this->DecodedCaptcha = trim($ex[1]); if ($this->Verbose) echo " "; return $this->DecodedCaptcha; } } return false; } } function MakeAbuse() { $url = "http://ac-service.info/res.php?key={$this->APIKey}&action=reportbad&id={$this->LastCaptchaID}"; $responce = file_get_contents($url); return ($responce == 'OK_REPORT_RECORDED'); } } ?> требует для себя вот это: PHP: <?php /* * @name: HTTPQuery.php * @description: Class to work with HTTP protocol * @author: NULL_byte * @contacts: www.null-byte.info * @version: 1.2 */ class HTTPQuery { var $URI = 'http://localhost/'; var $Port = '80'; var $Method = 'get'; var $Referer = null; var $UserAgent = null; var $Query = null; var $Cookies = null; var $Proxy = false; // Proxy to use. Format: Array('proxy_host', 'port') or false; var $ContentType = null; var $Boundary = '-----NULL-BYTE----NULL-BYTE----NULL-BYTE'; var $Host = null; var $Path = null; var $Silent = false; // If it true, wouldn't print any messages var $Debug = false; // If it true, would print many messages :) var $Result = null; // Will contain result with headers var $ResultClean = null; // Will contain result without headers var $AddHeaders = Array(); var $Headers = Array(); function ConstructQuery() { if (is_array($this->Query)) { if (strtolower($this->ContentType) != 'multipart/form-data') { $query_string = ''; foreach ($this->Query as $key => $value) { $query_string .= "$key=$value&"; //$query_string .= $key.'='.urlencode($value); } $this->Query = trim($query_string, '&'); } else { $query_string = ''; foreach ($this->Query as $key => $value) { $query_string .= "--{$this->Boundary}\r\n"; if (!is_array($value)) { $query_string .= "Content-Disposition: form-data; name=\"$key\"\r\n\r\n$value\r\n"; } else { if (!isset($value[1]) && !isset($value[2])) { $value[1] = $value[0]; $value[0] = file_get_contents($value[1]); } if (!isset($value[2])) $value[2] = 'application/octet-stream'; //if (!isset($value[2])) $value[2] = 'undefined/undefined'; $query_string .= "Content-Disposition: form-data; name=\"$key\"; "; $query_string .= "filename=\"{$value[1]}\"\r\n"; $query_string .= "Content-Type: {$value[2]}\r\n\r\n{$value[0]}\r\n"; } } $query_string .= "--{$this->Boundary}--\r\n"; $this->Query = $query_string; } } } function Filter() { $this->Method = strtolower($this->Method); $this->URI = str_replace(Array('\\', 'http://', 'https://'), Array('/', '', ''), $this->URI); $this->URI = preg_replace('#[/]+#', '/', $this->URI); if (is_string($this->Proxy)) $this->Proxy = explode(':', $this->Proxy); $this->ConstructQuery(); } function SendRequest($url = false) { if ($url) $this->URI = $url; $this->Filter(); $url_parts = explode('/', $this->URI); $this->Host = $url_parts[0]; $this->Path = ''; for ($i = 1; $i < count($url_parts); $i++) $this->Path .= '/'.$url_parts[$i]; if ($this->Path == '') $this->Path = '/'; // Creating socket $cur_try = 0; // Current try $max_tries = 5; // Max allowed tries while (true) { if ($this->Proxy) { $fp = @fsockopen($this->Proxy[0], $this->Proxy[1], $errno, $errstr, 10); } else { $fp = @fsockopen($this->Host, $this->Port, $errno, $errstr, 5); } if ($fp) break; // If everything is ok, going on without stopping // Else retrying... $cur_try++; if (!$this->Silent) echo "Cannot create socket, will now try again ($cur_try/$max_tries)...\n"; if ($cur_try >= $max_tries) { if (!$this->Silent) echo "Too many errors, please check your internet connection!\n"; return false; } sleep(3); } if (($this->Method == 'get') && (substr(0, 1, $this->Query) != '?') && ($this->Query != null)) $this->Query = '?'.$this->Query; $query_length = strlen($this->Query); if (!$this->UserAgent) $this->UserAgent = 'NULL_byte\'s PHP Browser Mozilla/4.0 (compatible; MSIE 3.0; Windows NT 4.0)'; $_cookies = $this->CookiesToString($this->Cookies); $PostContentType = 'application/x-www-form-urlencoded'; if (strtolower($this->ContentType) == 'multipart/form-data') $PostContentType = "multipart/form-data; boundary={$this->Boundary}"; $out = Array(); if ($this->Method == 'get') { $out[] = "GET {$this->Path}{$this->Query} HTTP/1.0"; $out[] = "Accept: */*"; $out[] = "Accept-Language: ru"; $out[] = "User-Agent: {$this->UserAgent}"; if ($this->Cookies) $out[] = "Cookie: $_cookies"; if ($this->Referer) $out[] = "Referer: {$this->Referer}"; $out[] = "Host: {$this->Host}"; } elseif ($this->Method == 'post') { $out[] = "POST {$this->Path} HTTP/1.0"; $out[] = "Accept: */*"; $out[] = "Accept-Language: ru"; $out[] = "User-Agent: {$this->UserAgent}"; if ($this->Cookies) $out[] = "Cookie: $_cookies"; if ($this->Referer) $out[] = "Referer: {$this->Referer}"; $out[] = "Host: {$this->Host}"; if (!isset($this->AddHeaders['Content-Type'])) $out[] = "Content-Type: $PostContentType"; $out[] = "Content-Length: $query_length"; } else { $out[] = strtoupper($this->Method)." {$this->Path}{$this->Query} HTTP/1.0"; $out[] = "Accept: */*"; $out[] = "Accept-Language: ru"; $out[] = "User-Agent: {$this->UserAgent}"; if ($this->Cookies) $out[] = "Cookie: $_cookies"; if ($this->Referer) $out[] = "Referer: {$this->Referer}"; $out[] = "Host: {$this->Host}:{$this->Port}"; } foreach ($this->AddHeaders as $key => $value) $out[] = "$key: $value"; $out[] = "Connection: Close"; //$out[] = "Connection: Keep-Alive"; $out = implode("\r\n", $out); $out = str_replace("\n", "\r\n", $out); $out = preg_replace("#[\n]+#", "\n", $out); $out = preg_replace("#[\r]+#", "\r", $out); $out .= "\r\n\r\n"; if ($this->Method == 'post') $out .= $this->Query; fwrite($fp, $out); $this->Result = ''; while (!feof($fp)) { $line = fgets($fp, 1024); $this->Result .= $line.''; } fclose($fp); if ($this->Debug) { echo "----->\n$out\n\n"; echo "<-----\n{$this->Result}\n\n"; } $this->Referer = $url; $this->Query = NULL; $this->ContentType = NULL; $this->AddHeaders = Array(); $this->ParseHeaders(); $this->ResultClean = ltrim(substr($this->Result, strpos($this->Result, "\r\n\r\n"))); return $this->Result; } function Get($url = false) { $this->Method = 'get'; return $this->SendRequest($url); } function Post($url = false) { $this->Method = 'post'; return $this->SendRequest($url); } function ParseHeaders() { if (!$this->Result) return false; $server_response = explode("\r\n\r\n", $this->Result); $server_response = $server_response[0]; $server_response = str_replace("\r", '', $server_response); $server_response = explode("\n", $server_response); $result = Array(); foreach($server_response as $mixed_headers) { if (!(strpos($mixed_headers, ': ') === false)) { $header = explode(': ', trim($mixed_headers)); $result[$header[0]] = isset($header[1]) ? $header[1] : NULL; } } $this->Headers = $result; return $result; } function CookiesToString($cookie = false) { if (!$cookie) $cookie = $this->Cookies; if (!is_array($cookie)) return $cookie; $cookie_string = ''; foreach ($cookie as $key => $value) $cookie_string .= " $key=$value;"; $cookie = trim($cookie_string, '; '); return $cookie; } function CookiesToArray($cookie = false) { if (!$cookie) $cookie = $this->Cookies; if (is_array($cookie)) return $cookie; $cookie = explode('; ', $cookie); $cookie_array = Array(); for ($i = 0; $i < count($cookie); $i++) { $c = explode('=', $cookie[$i]); $cookie_array[$c[0]] = $c[1]; } return $cookie_array; } function GetCookies($as_string = false) { if (!$this->Result) return false; $data = explode("\r\n\r\n", $this->Result); $data = $data[0]; $data = str_replace("\r", '', $data); $data = explode("\n", $data); $raw_cookies = Array(); foreach ($data as $d) { $d = explode(' ', $d); if (strtolower($d[0]) == 'set-cookie:') { $raw_cookies[] = $d[1]; } } $cookies = Array(); foreach ($raw_cookies as $cookie) { $cookie = explode('=', $cookie); $cookies[$cookie[0]] = trim($cookie[1], '; '); } if ($as_string) $cookies = $this->CookiesToString($cookies); return $cookies; } } ?>
скрипт для объединения тхт файлов в папке, кидаем в папку и запускаем, пишет в файл out.txt Code: open OUT, '>out.txt'; my @files = filesindir('.'); for my $file (@files) { next unless (($file =~ /\.txt$/) && ($file ne 'out.txt')); open FILE, '<'.$file; while (my $line = <FILE>) { print OUT $line; } close FILE; print OUT "\n"; } close OUT; sub filesindir { my $dir = shift; my $limit = shift; opendir(DIR, $dir); my @dots = grep { $_ !~ /^\./ && -f "$dir/$_" } readdir(DIR); closedir DIR; if ($limit) { @dots = shuffle(@dots); @dots = @dots[1..$limit]; } return wantarray?@dots:\@dots; }
Многопоточный парсер беков из яхи Code: puts Time.now def urlescape(string) string.gsub(/([^ a-zA-Z0-9_.-]+)/n) do '%' + $1.unpack('H2' * $1.size).join('%').upcase end.tr(' ', '+') end require 'net/http' numthreads = 10 input = File.new('input.txt', 'r') output = File.new('output.txt', 'w') threads = Array.new 1.upto(numthreads) do |w| threads << Thread.new(w) do |w| while line = input.gets next if line =~ /^#/ yurl = "/export?p=#{urlescape(line.chomp)}&bwm=i&fr=sfp" line = Net::HTTP.get('siteexplorer.search.yahoo.com', yurl) line.scan(/\t(.+?)\t/) do |url| output.write(url[0]+"\n") unless url[0].index('http').nil? end end end end threads.each do |t| t.join end input.close output.close puts Time.now
Брут пасса к сертификатам. Маленький пример) PHP: <?php if(!extension_loaded("openssl")) exit; $passlist = array('12345', 'qwerty', '123321', '0123', 'qazwdc'); if(!$file = 'c:/cert.p12') exit; // Path certif... $fd = fopen($file, 'r'); $p12buf = fread($fd, filesize($file)); fclose($fd); echo "[+] Brute certificate (Pkcs12) password!\n"; foreach($passlist as $pass) //for($i = 0; $i < pow(10,8); $i++) if (openssl_pkcs12_read($p12buf, $p12cert, $pass) ) die(" - Pass: ".$pass." Good! \n"); ?>