1. Лучший говнокод

    В номинации:
    За время:
  2. Куча / Говнокод #28111

    +1

    1. 1
    Ёбаный openconnect

    openconnect -- это свободная реализация протоколоа CISCO AnyConnect VPN.

    В первом комменте опишу проблему.

    vistefan, 06 Апреля 2022

    Комментарии (64)
  3. Go / Говнокод #28110

    +1

    1. 1
    2. 2
    math.Min(float64, float64) float64
    math.Max(float64, float64) float64

    В goвне нету math.Min для integer. Даже в анскильном "Си" это есть.

    https://www.pixelstech.net/article/1559993656-Why-no-max-min-function-for-integer-in-GoLang

    3_dar, 05 Апреля 2022

    Комментарии (39)
  4. Java / Говнокод #28107

    +1

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    import org.springframework.core.Ordered;
       import org.springframework.core.annotation.Order;
       import org.springframework.web.bind.WebDataBinder;
       import org.springframework.web.bind.annotation.ControllerAdvice;
       import org.springframework.web.bind.annotation.InitBinder;
    
       @ControllerAdvice
       @Order(10000)
       public class BinderControllerAdvice {
          @InitBinder
          public void setAllowedFields(WebDataBinder dataBinder) {
    
              String[] denylist = new String[]{"class.", "Class.", ".class.", ".Class."};
    
              dataBinder.setDisallowedFields(denylist);
          }
       }

    Критическая 0-day уязвимость в Spring Framework, применяемом во многих Java-проектах

    Работа эксплоита сводится к отправке запроса с параметрами "class.module.classLoader.resources.cont ext.parent.pipeline.first.*", обработка которых при использовании "WebappClassLoaderBase" приводит к обращению к классу AccessLogValve. Указанный класс позволяет настроить логгер для создания произвольного jsp-файла в корневом окружении Apache Tomcat и записи в этот файл указанного атакующим кода. Созданный файл становится доступным для прямых запросов и может использоваться в качестве web shell. Для атаки на уязвимое приложение в окружении Apache Tomcat достаточно отправить запрос с определёнными параметрами при помощи утилиты curl.

    curl -v -d "class.module.classLoader.resources.context.parent.pipeline
    .first.pattern=код_для_вставки_в_файл
    &class.module.classLoader.resources.context.parent.pipeline.first.suffix=.jsp
    &class.module.classLoader.resources.context.parent.pipeline.first.directory=webapps/ROOT
    &class.module.classLoader.resources.context.parent.pipeline.first.prefix=tomcatwar
    &class.module.classLoader.resources.context.parent.pipeline.first.fileDateFormat="
    http://localhost:8080/springmvc5-helloworld-exmaple-0.0.1-SNAPSHOT/rapid7

    3_dar, 04 Апреля 2022

    Комментарии (4)
  5. Куча / Говнокод #28106

    +1

    1. 1
    Из-за вашей политоты Борманд ушёл.

    OCETuHCKuu_nemyx, 03 Апреля 2022

    Комментарии (49)
  6. PHP / Говнокод #28102

    +1

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    <?php defined('SYSPATH') or die('No direct script access.');
    /*
     * Базовый класс главной страницы
     */
    class Controller_Index extends Controller {
    
    
            public function before() {
                    parent::before();
                    I18n::lang('ru');
                    $settings = Kohana::config('settings');
                    Cookie::$salt = 'asd12d2';
                    Session::$default = 'cookie';
                    $this->session = Session::instance();
            }
    
        public function action_index() {
    
            //Путь до файла первоночального xml (xsl)
            $path_xml='tpl/xml.xsl';
            //Путь конечного xsl
            $path_xsl='tpl/index.xsl';
    
            $url = $this->request->param('stuff');
                    //print_r($_SERVER);
                    /*if($_SERVER ['REQUEST_URI']=='/'){
                            $this->request->redirect($_SERVER ['HTTP_X_FORWARDED_PROTO'].'://'.$_SERVER['HTTP_HOST'],'301');
                    }*/
            if(empty($url)){
                $url='/';
            }
    
    
            $htmlfile='cache-html/'.md5($url);
    $allurl=$_SERVER ['REQUEST_URI'];
    if($allurl=='/20-40-kvm') $this->request->redirect('/sadovye-domiki','301');
    if($allurl=='/40-80-kvm') $this->request->redirect('/sadovye-domiki','301');
    if($allurl=='/80-i-bolee-kvm') $this->request->redirect('/sadovye-domiki','301');
    
    if($allurl=='/nashi-proecty?searcher=48291&section=3924&destination%5B%5D=0&destination%5B%5D=1&destination%5B%5D=2&technology%5B%5D=0&floors%5B%5D=1&floors%5B%5D=1.5&floors%5B%5D=2&price=0-3000000&area=0-400') $this->request->redirect('/sadovye-domiki','301');
    
    if($allurl=='/nashi-proecty?searcher=48291&section=3924&destination%5B%5D=1&technology%5B%5D=0&technology%5B%5D=1&technology%5B%5D=2&floors%5B%5D=1&floors%5B%5D=1.5&floors%5B%5D=2&price=0-3000000&area=81-400') $this->request->redirect('/80-i-bolee-kvm','301');
    
    if($allurl=='/nashi-proecty?searcher=48291&section=3924&destination%5B%5D=1&technology%5B%5D=0&technology%5B%5D=1&technology%5B%5D=2&floors%5B%5D=1&floors%5B%5D=1.5&floors%5B%5D=2&price=0-3000000&area=40-80') $this->request->redirect('/40-80-kvm','301');
    
    if($allurl=='/nashi-proecty?searcher=48291&section=3924&destination%5B%5D=0&technology%5B%5D=0&technology%5B%5D=1&technology%5B%5D=2&floors%5B%5D=1&floors%5B%5D=1.5&floors%5B%5D=2&price=0-3000000&area=0-400') $this->request->redirect('/stroitelstvo-dachnyh-domov','301');
    
    if($allurl=='/nashi-proecty?searcher=48291&section=3924&destination%5B%5D=2&technology%5B%5D=0&technology%5B%5D=1&technology%5B%5D=2&technology%5B%5D=3&floors%5B%5D=1&floors%5B%5D=1.5&floors%5B%5D=2&price=0-3000000&area=0-400') $this->request->redirect('/kottedzhi','301');
    
    if($allurl=='/nashi-proecty?searcher=48291&section=3924&destination%5B%5D=3&technology%5B%5D=0&technology%5B%5D=2&technology%5B%5D=3&floors%5B%5D=1&floors%5B%5D=1.5&price=0-3000000&area=0-400') $this->request->redirect('/bani','301');
    
    if($allurl=='/nashi-proecty?searcher=48291&section=3924&destination%5B%5D=3&technology%5B%5D=2&floors%5B%5D=1&floors%5B%5D=1.5&price=0-3000000&area=0-400') $this->request->redirect('/bani-iz-profilirovannogo-brusa','301');
    
    if($allurl=='/nashi-proecty?searcher=48291&section=3924&destination%5B%5D=3&technology%5B%5D=0&floors%5B%5D=1&floors%5B%5D=1.5&price=0-3000000&area=0-400') $this->request->redirect('/karkasnye-bani','301');
    
    if($allurl=='/nashi-proecty?searcher=48291&section=3924&destination%5B%5D=3&technology%5B%5D=3&floors%5B%5D=1&floors%5B%5D=1.5&floors%5B%5D=2&price=0-3000000&area=0-400') $this->request->redirect('/bani-iz-ocilindrovannogo-brevna','301');
    
    if($allurl=='/nashi-proecty?searcher=48291&section=3924&destination%5B%5D=0&destination%5B%5D=1&destination%5B%5D=2&technology%5B%5D=2&floors%5B%5D=1&floors%5B%5D=1.5&floors%5B%5D=2&price=316018-3000000&area=0-400') $this->request->redirect('/brus','301');
    
    if($allurl=='/nashi-proecty?searcher=48291&section=3924&destination%5B%5D=0&destination%5B%5D=1&destination%5B%5D=2&technology%5B%5D=2&floors%5B%5D=1&floors%5B%5D=1.5&floors%5B%5D=2&price=0-3000000&area=0-400') $this->request->redirect('/kottedzhi-profilirovannyj-brus','301');
    
    if($allurl=='/nashi-proecty?searcher=48291&section=3924&destination%5B%5D=0&destination%5B%5D=1&destination%5B%5D=2&technology%5B%5D=0&floors%5B%5D=1&floors%5B%5D=1.5&floors%5B%5D=2&price=329056-3000000&area=0-400') $this->request->redirect('/dachnye-doma-karkasnaya-tehnologiya','301');
    
    if($allurl=='/nashi-proecty?searcher=48291&section=3924&destination%5B%5D=0&destination%5B%5D=1&destination%5B%5D=2&technology%5B%5D=1&floors%5B%5D=1&floors%5B%5D=1.5&floors%5B%5D=2&price=0-3000000&area=0-400') $this->request->redirect('/individualnye-proekty','301');

    Там ещё дальше веселье продолжается, но гк не дает запостить больше

    YpaHeLI_, 02 Апреля 2022

    Комментарии (22)
  7. Pascal / Говнокод #28100

    +1

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    function rand:LongInt;
    {$IFOPT J-} {$J+} {$DEFINE NoJ} {$ENDIF}
    const next:LongInt=1;
    {$IFDEF NoJ} {$J-} {$UNDEF NoJ} {$ENDIF}
    begin
    next:=next*1103515245+12345;
    Result:=(next div 65536) mod 32768;
    end;

    Краткая инструкция как сделать static unsigned long int на Delphi.

    KOTOM, 31 Марта 2022

    Комментарии (8)
  8. Куча / Говнокод #28092

    +1

    1. 1
    Петух иньо забыл продлить домен

    inho-pidar, 25 Марта 2022

    Комментарии (24)
  9. PHP / Говнокод #28082

    +1

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
    $mysql = new mysqli($host, $db_user, $db_pass, $db_name);
    mysqli_set_charset($mysql, "utf8");
    
    
    $region = mysqli_query($mysql, "SELECT *  FROM `rubric_subsection`");
    while ($rows_rubriki = mysqli_fetch_array($region)) 
    {
    	
    //	$razdel = mysqli_query($mysql, "SELECT *  FROM `city_region` LIMIT 1");
    	//while ($raz = mysqli_fetch_array($razdel)) {
    	
    $rubriki = mysqli_query($mysql, "SELECT `region`, `subsection`, COUNT(region) as count FROM `big_baza` where `region` =  'Республика Бурятия' AND `subsection` = '".$rows_rubriki['name']."'");
    $data = mysqli_fetch_assoc($rubriki);
    echo ''.$rows_rubriki['name'].' / '.$data['count'].'<br>';
    //mysqli_query($mysql,  "INSERT INTO `calculator_region`(`id`, `region_id`, `subsection_id`, `count`) VALUES ('','".$raz['id']."','".$rows_rubriki['id']."','".$data['count']."')");
    
    //	}
    
    }

    dlyaspama7771, 16 Марта 2022

    Комментарии (2)
  10. C# / Говнокод #28078

    +1

    1. 1
    https://habr.com/ru/post/655085/

    эксель быстрее шарпов, шах и мат дотнетчики...

    kcalbCube, 11 Марта 2022

    Комментарии (100)
  11. Си / Говнокод #28061

    +1

    1. 1
    2. 2
    3. 3
    4. 4
    #pragma aux __cdecl "_*"                            \
                    parm caller [ ]                          \
                    value struct float struct routine [eax] \
                    modify [eax ecx edx]

    kcalbCube, 28 Февраля 2022

    Комментарии (11)