主頁 >  其他 > Spring Security,沒有看起來那么復雜(附原始碼)

Spring Security,沒有看起來那么復雜(附原始碼)

2021-01-28 06:36:32 其他

權限管理是每個專案必備的功能,只是各自要求的復雜程度不同,簡單的專案可能一個 Filter 或 Interceptor 就解決了,復雜一點的就可能會引入安全框架,如 Shiro, Spring Security 等,
其中 Spring Security 因其涉及的流程、類過多,看起來比較復雜難懂而被詬病,但如果能捋清其中的關鍵環節、關鍵類,Spring Security 其實也沒有傳說中那么復雜,本文結合腳手架框架的權限管理實作(jboost-auth 模塊,原始碼獲取見文末),對 Spring Security 的認證、授權機制進行深入分析,

使用 Spring Security 認證、鑒權機制

Spring Security 主要實作了 Authentication(認證——你是誰?)、Authorization(鑒權——你能干什么?)

認證(登錄)流程

Spring Security 的認證流程及涉及的主要類如下圖,

SpringSecurity認證

認證入口為 AbstractAuthenticationProcessingFilter,一般實作有 UsernamePasswordAuthenticationFilter

  1. filter 決議請求引數,將客戶端提交的用戶名、密碼等封裝為 Authentication,Authentication 一般實作有 UsernamePasswordAuthenticationToken
  2. filter 呼叫 AuthenticationManager 的 authenticate() 方法對 Authentication 進行認證,AuthenticationManager 的默認實作是
    ProviderManager
  3. ProviderManager 認證時,委托給一個 AuthenticationProvider 串列,呼叫串列中 AuthenticationProvider 的 authenticate()
    方法來進行認證,只要有一個通過,則認證成功,否則拋出 AuthenticationException 例外(AuthenticationProvider 還有一個 supports() 方法,用來判斷該 Provider
    是否對當前型別的 Authentication 進行認證)
  4. 認證完成后,filter 通過 AuthenticationSuccessHandler(成功時) 或 AuthenticationFailureHandler(失敗時)來對認證結果進行處理,如回傳 token 或 認證錯誤提示

認證涉及的關鍵類

  1. 登錄認證入口 UsernamePasswordAuthenticationFilter

專案中 RestAuthenticationFilter 繼承了 UsernamePasswordAuthenticationFilter, UsernamePasswordAuthenticationFilter 將客戶端提交的引數封裝為
UsernamePasswordAuthenticationToken,供 AuthenticationManager 進行認證,

RestAuthenticationFilter 覆寫了 UsernamePasswordAuthenticationFilter 的 attemptAuthentication(request,response) 方法邏輯,根據
loginType 的值來將登錄引數封裝到認證資訊 Authentication 中,(loginType 為 USER 時為 UsernameAuthenticationToken,
loginType 為 Phone 時為 PhoneAuthenticationToken),供下游 AuthenticationManager 進行認證,

  1. 認證資訊 Authentication

使用 Authentication 的實作來保存認證資訊,一般為 UsernamePasswordAuthenticationToken,包括

  • principal:身份主體,通常是用戶名或手機號
  • credentials:身份憑證,通常是密碼或手機驗證碼
  • authorities:授權資訊,通常是角色 Role
  • isAuthenticated:認證狀態,表示是否已認證

本專案中的 Authentication 實作:

  • UsernameAuthenticationToken: 使用用戶名登錄時封裝的 Authentication

    • principal => username
    • credentials => password
    • 擴展了兩個屬性: uuid, code,用來驗證圖形驗證碼
  • PhoneAuthenticationToken: 使用手機驗證碼登錄時封裝的 Authentication

    • principal => phone(手機號)
    • credentials => code(驗證碼)

兩者都繼承了 UsernamePasswordAuthenticationToken,

  1. 認證管理器 AuthenticationManager

認證管理器介面 AuthenticationManager,包含一個 authenticate(authentication) 方法,
ProviderManager 是 AuthenticationManager 的實作,管理一個 AuthenticationProvider(具體認證邏輯提供者)串列,在其 authenticate(authentication ) 方法中,對 AuthenticationProvider 串列中每一個 AuthenticationProvider,呼叫其 supports(Class<?> authentication) 方法來判斷是否采用該
Provider 來對 Authentication 進行認證,如果適用則呼叫 AuthenticationProvider 的 authenticate(authentication)
來完成認證,只要其中一個完成認證,則回傳,

  1. 認證提供者 AuthenticationProvider

由3可知認證的真正邏輯由 AuthenticationProvider 提供,本專案的認證邏輯提供者包括

  • UsernameAuthenticationProvider: 支持對 UsernameAuthenticationToken 型別的認證資訊進行認證,同時使用 PasswordRetryUserDetailsChecker
    來對密碼錯誤次數超過5次的用戶,在10分鐘內限制其登錄操作
  • PhoneAuthenticationProvider: 支持對 PhoneAuthenticationToken 型別的認證資訊進行認證

兩者都繼承了 DaoAuthenticationProvider —— 通過 UserDetailsService 的 loadUserByUsername(String username) 獲取保存的用戶資訊
UserDetails,再與客戶端提交的認證資訊 Authentication 進行比較(如與 UsernameAuthenticationToken 的密碼進行比對),來完成認證,

  1. 用戶資訊獲取 UserDetailsService

UserDetailsService 提供 loadUserByUsername(username) 方法,可獲取已保存的用戶資訊(如保存在資料庫中的用戶賬號資訊),

本專案的 UserDetailsService 實作包括

  • UsernameUserDetailsService:通過用戶名從資料庫獲取賬號資訊
  • PhoneUserDetailsService:通過手機號碼從資料庫獲取賬號資訊
  1. 認證結果處理

認證成功,呼叫 AuthenticationSuccessHandler 的 onAuthenticationSuccess(request, response, authentication) 方法,在 SecurityConfiguration 中注入 RestAuthenticationFilter 時進行了設定, 本專案中認證成功后,生成 jwt token回傳客戶端,

認證失敗(賬號校驗失敗或程序中拋出例外),呼叫 AuthenticationFailureHandler 的 onAuthenticationFailure(request, response, exception) 方法,在 SecurityConfiguration 中注入 RestAuthenticationFilter 時進行了設定,回傳錯誤資訊,

以上關鍵類及其關聯基本都在 SecurityConfiguration 進行配置,

  1. 工具類

SecurityContextHolder 是 SecurityContext 的容器,默認使用 ThreadLocal 存盤,使得在相同執行緒的方法中都可訪問到 SecurityContext,
SecurityContext 主要是存盤應用的 principal 資訊,在 Spring Security 中用 Authentication 來表示,在
AbstractAuthenticationProcessingFilter 中,認證成功后,呼叫 successfulAuthentication() 方法使用 SecurityContextHolder 來保存
Authentication,并呼叫 AuthenticationSuccessHandler 來完成后續作業(比如回傳token等),

使用 SecurityContextHolder 來獲取用戶資訊示例:

Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();
if (principal instanceof UserDetails) {
    String username = ((UserDetails)principal).getUsername();
} else {
    String username = principal.toString();
}

鑒權流程

Spring Security 的鑒權(授權)有兩種實作機制:

  • FilterSecurityInterceptor:通過 Filter 對 HTTP 資源的訪問進行鑒權
  • MethodSecurityInterceptor:通過 AOP 對方法的呼叫進行鑒權,在 GlobalMethodSecurityConfiguration 中注入,
    需要在配置類上添加注解 @EnableGlobalMethodSecurity(prePostEnabled = true) 使 GlobalMethodSecurityConfiguration 配置生效,

鑒權流程及涉及的主要類如下圖,

springsecurity鑒權

  1. 登錄完成后,一般回傳 token 供下次呼叫時攜帶進行身份認證,生成 Authentication
  2. FilterSecurityInterceptor 攔截器通過 FilterInvocationSecurityMetadataSource 獲取訪問當前資源需要的權限
  3. FilterSecurityInterceptor 呼叫鑒權管理器 AccessDecisionManager 的 decide 方法進行鑒權
  4. AccessDecisionManager 通過 AccessDecisionVoter 串列的鑒權投票,確定是否通過鑒權,如果不通過則拋出 AccessDeniedException 例外
  5. MethodSecurityInterceptor 流程與 FilterSecurityInterceptor 類似

鑒權涉及的關鍵類

  1. 認證資訊提取 RestAuthorizationFilter

對于前后端分離專案,登錄完成后,接下來我們一般通過登錄時回傳的 token 來訪問介面,

在鑒權開始前,我們需要將 token 進行驗證,然后生成認證資訊 Authentication 交給下游進行鑒權(授權),

本專案 RestAuthorizationFilter 將客戶端上報的 jwt token 進行決議,得到 UserDetails, 并對 token 進行有效性校驗,并生成
Authentication(UsernamePasswordAuthenticationToken),通過
SecurityContextHolder 存入 SecurityContext 中供下游使用,

  1. 鑒權入口 AbstractSecurityInterceptor

三個實作:

  • FilterSecurityInterceptor:基于 Filter 的鑒權實作,作用于 Http 介面層級,FilterSecurityInterceptor 從 SecurityMetadataSource 的實作 DefaultFilterInvocationSecurityMetadataSource 獲取要訪問資源所需要的權限
    Collection,然后呼叫 AccessDecisionManager 進行授權決策投票,若投票通過,則允許訪問資源,否則將禁止訪問,
  • MethodSecurityInterceptor:基于 AOP 的鑒權實作,作用于方法層級,
  • AspectJMethodSecurityInterceptor:用來支持 AspectJ JointPoint 的 MethodSecurityInterceptor
  1. 獲取資源權限資訊 SecurityMetadataSource

SecurityMetadataSource 讀取訪問資源所需的權限資訊,讀取的內容,就是我們配置的訪問規則,如我們在配置類中配置的訪問規則:

@Override
protected void configure(HttpSecurity http) throws Exception{
    http.authorizeRequests()
        .antMatchers(excludes).anonymous()
        .antMatchers("/api1").hasAuthority("permission1")
        .antMatchers("/api2").hasAuthority("permission2")
        ...
}

我們可以自定義一個 SecurityMetadataSource 來從資料庫或其它存盤中獲取資源權限規則資訊,

  1. 鑒權管理器 AccessDecisionManager

AccessDecisionManager 介面的 decide(authentication, object, configAttributes) 方法對本次請求進行鑒權,其中

  • authentication:本次請求的認證資訊,包含 authority(如角色) 資訊
  • object:當前被呼叫的被保護物件,如介面
  • configAttributes:與被保護物件關聯的配置屬性,表示要訪問被保護物件需要滿足的條件,如角色

AccessDecisionManager 介面的實作者鑒權時,最終是通過呼叫其內部 List<AccessDecisionVoter<?>> 串列中每一個元素的 vote(authentication, object, attributes)
方法來進行的,根據決策的不同分為如下三種實作

  • AffirmativeBased:一票通過權策略,只要有一個 AccessDecisionVoter 通過(AccessDecisionVoter.vote 回傳 AccessDecisionVoter.
    ACCESS_GRANTED),則鑒權通過,為默認實作
  • ConsensusBased:少數服從多數策略,多數 AccessDecisionVoter 通過,則鑒權通過,如果贊成票與反對票相等,則根據變數 allowIfEqualGrantedDeniedDecisions
    的值來決定,該值默認為 true
  • UnanimousBased:全票通過策略,所有 AccessDecisionVoter 通過或棄權(回傳 AccessDecisionVoter.
    ACCESS_ABSTAIN),無一反對則通過,只要有一個反對就拒絕;如果全部棄權,則根據變數 allowIfAllAbstainDecisions 的值來決定,該值默認為 false
  1. 鑒權投票者 AccessDecisionVoter

與 AuthenticationProvider 類似,AccessDecisionVoter 也包含 supports(attribute) 方法(是否采用該 Voter 來對請求進行鑒權投票) 與 vote (authentication, object, attributes) 方法(具體的鑒權投票邏輯)

FilterSecurityInterceptor 的 AccessDecisionManager 的投票者串列(AbstractInterceptUrlConfigurer.createFilterSecurityInterceptor() 中設定)包括:

  • WebExpressionVoter:驗證 Authentication 的 authenticated,

MethodSecurityInterceptor 的 AccessDecisionManager 的投票者串列(GlobalMethodSecurityConfiguration.accessDecisionManager()
中設定)包括:

  • PreInvocationAuthorizationAdviceVoter: 如果 @EnableGlobalMethodSecurity 注解開啟了 prePostEnabled,則添加該 Voter,對使用了 @PreAuthorize 注解的方法進行鑒權投票
  • Jsr250Voter:如果 @EnableGlobalMethodSecurity 注解開啟了 jsr250Enabled,則添加該 Voter,對 @Secured 注解的方法進行鑒權投票
  • RoleVoter:總是添加, 如果 ConfigAttribute.getAttribute()ROLE_ 開頭,則參與鑒權投票
  • AuthenticatedVoter:總是添加,如果 ConfigAttribute.getAttribute() 值為
    IS_AUTHENTICATED_FULLYIS_AUTHENTICATED_REMEMBEREDIS_AUTHENTICATED_ANONYMOUSLY 其中一個,則參與鑒權投票
  1. 鑒權結果處理

ExceptionTranslationFilter 例外處理 Filter, 對認證鑒權程序中拋出的例外進行處理,包括:

  • authenticationEntryPoint: 對過濾器鏈中拋出 AuthenticationException 或 AccessDeniedException 但 Authentication 為
    AnonymousAuthenticationToken 的情況進行處理,如果 token 校驗失敗,如 token 錯誤或過期,則通過 ExceptionTranslationFilter 的 AuthenticationEntryPoint 進行處理,本專案使用 RestAuthenticationEntryPoint 來回傳統一格式的錯誤資訊
  • accessDeniedHandler: 對過濾器鏈中拋出 AccessDeniedException 但 Authentication 不為 AnonymousAuthenticationToken 的情況進行處理,本專案使用 RestAccessDeniedHandler 來回傳統一格式的錯誤資訊

如果是 MethodSecurityInterceptor 鑒權時拋出 AccessDeniedException,并且通過 @RestControllerAdvice 提供了統一例外處理,則將由統一例外處理類處理,因為
MethodSecurityInterceptor 是 AOP 機制,可由 @RestControllerAdvice 捕獲,

本專案中, RestAuthorizationFilter 在 Filter 鏈中位于 ExceptionTranslationFilter 的前面,所以其中拋出的例外也不能被 ExceptionTranslationFilter 捕獲, 由 cn.jboost.base.starter.web.ExceptionHandlerFilter 捕獲處理,

也可以將 RestAuthorizationFilter 放入 ExceptionTranslationFilter 之后,但在 RestAuthorizationFilter 中需要對 SecurityContextHolder.getContext().getAuthentication() 進行 AnonymousAuthenticationToken 的判斷,因為 AnonymousAuthenticationFilter 位于 ExceptionTranslationFilter 前面,會對 Authentication 為空的請求生成一個
AnonymousAuthenticationToken,放入 SecurityContext 中,

總結

安全框架一般包括認證與授權兩部分,認證解決你是誰的問題,即確定你是否有合法的訪問身份,授權解決你是否有權限訪問對應資源的問題,Spring Security 使用 Filter 來實作認證,使用 Filter(介面層級) + AOP(方法層級)的方式來實作授權,本文相對偏理論,但也結合了腳手架中的實作,對照查看,應該更易理解,

本文基于 Spring Boot 腳手架中的權限管理模塊撰寫,該腳手架提供了前后端分離的權限管理實作,效果如下圖,可關注作者公眾號 “半路雨歌”,回復 “jboost” 獲取原始碼地址,

jboost-admin-login
jboost-admin-main


[轉載請注明出處]
作者:雨歌,可以關注作者公眾號:半路雨歌
qrcode

轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/253417.html

標籤:其他

上一篇:十七、Linux的壓縮和解壓

下一篇:當表情符號成為密碼時,網友:這一次黑客要對著墻角哭了!

標籤雲
其他(157675) Python(38076) JavaScript(25376) Java(17977) C(15215) 區塊鏈(8255) C#(7972) AI(7469) 爪哇(7425) MySQL(7132) html(6777) 基礎類(6313) sql(6102) 熊猫(6058) PHP(5869) 数组(5741) R(5409) Linux(5327) 反应(5209) 腳本語言(PerlPython)(5129) 非技術區(4971) Android(4554) 数据框(4311) css(4259) 节点.js(4032) C語言(3288) json(3245) 列表(3129) 扑(3119) C++語言(3117) 安卓(2998) 打字稿(2995) VBA(2789) Java相關(2746) 疑難問題(2699) 细绳(2522) 單片機工控(2479) iOS(2429) ASP.NET(2402) MongoDB(2323) 麻木的(2285) 正则表达式(2254) 字典(2211) 循环(2198) 迅速(2185) 擅长(2169) 镖(2155) 功能(1967) .NET技术(1958) Web開發(1951) python-3.x(1918) HtmlCss(1915) 弹簧靴(1913) C++(1909) xml(1889) PostgreSQL(1872) .NETCore(1853) 谷歌表格(1846) Unity3D(1843) for循环(1842)

熱門瀏覽
  • 網閘典型架構簡述

    網閘架構一般分為兩種:三主機的三系統架構網閘和雙主機的2+1架構網閘。 三主機架構分別為內端機、外端機和仲裁機。三機無論從軟體和硬體上均各自獨立。首先從硬體上來看,三機都用各自獨立的主板、記憶體及存盤設備。從軟體上來看,三機有各自獨立的作業系統。這樣能達到完全的三機獨立。對于“2+1”系統,“2”分為 ......

    uj5u.com 2020-09-10 02:00:44 more
  • 如何從xshell上傳檔案到centos linux虛擬機里

    如何從xshell上傳檔案到centos linux虛擬機里及:虛擬機CentOs下執行 yum -y install lrzsz命令,出現錯誤:鏡像無法找到軟體包 前言 一、安裝lrzsz步驟 二、上傳檔案 三、遇到的問題及解決方案 總結 前言 提示:其實很簡單,往虛擬機上安裝一個上傳檔案的工具 ......

    uj5u.com 2020-09-10 02:00:47 more
  • 一、SQLMAP入門

    一、SQLMAP入門 1、判斷是否存在注入 sqlmap.py -u 網址/id=1 id=1不可缺少。當注入點后面的引數大于兩個時。需要加雙引號, sqlmap.py -u "網址/id=1&uid=1" 2、判斷文本中的請求是否存在注入 從文本中加載http請求,SQLMAP可以從一個文本檔案中 ......

    uj5u.com 2020-09-10 02:00:50 more
  • Metasploit 簡單使用教程

    metasploit 簡單使用教程 浩先生, 2020-08-28 16:18:25 分類專欄: kail 網路安全 linux 文章標簽: linux資訊安全 編輯 著作權 metasploit 使用教程 前言 一、Metasploit是什么? 二、準備作業 三、具體步驟 前言 Msfconsole ......

    uj5u.com 2020-09-10 02:00:53 more
  • 游戲逆向之驅動層與用戶層通訊

    驅動層代碼: #pragma once #include <ntifs.h> #define add_code CTL_CODE(FILE_DEVICE_UNKNOWN,0x800,METHOD_BUFFERED,FILE_ANY_ACCESS) /* 更多游戲逆向視頻www.yxfzedu.com ......

    uj5u.com 2020-09-10 02:00:56 more
  • 北斗電力時鐘(北斗授時服務器)讓網路資料更精準

    北斗電力時鐘(北斗授時服務器)讓網路資料更精準 北斗電力時鐘(北斗授時服務器)讓網路資料更精準 京準電子科技官微——ahjzsz 近幾年,資訊技術的得了快速發展,互聯網在逐漸普及,其在人們生活和生產中都得到了廣泛應用,并且取得了不錯的應用效果。計算機網路資訊在電力系統中的應用,一方面使電力系統的運行 ......

    uj5u.com 2020-09-10 02:01:03 more
  • 【CTF】CTFHub 技能樹 彩蛋 writeup

    ?碎碎念 CTFHub:https://www.ctfhub.com/ 筆者入門CTF時時剛開始刷的是bugku的舊平臺,后來才有了CTFHub。 感覺不論是網頁UI設計,還是題目質量,賽事跟蹤,工具軟體都做得很不錯。 而且因為獨到的金幣制度的確讓人有一種想去刷題賺金幣的感覺。 個人還是非常喜歡這個 ......

    uj5u.com 2020-09-10 02:04:05 more
  • 02windows基礎操作

    我學到了一下幾點 Windows系統目錄結構與滲透的作用 常見Windows的服務詳解 Windows埠詳解 常用的Windows注冊表詳解 hacker DOS命令詳解(net user / type /md /rd/ dir /cd /net use copy、批處理 等) 利用dos命令制作 ......

    uj5u.com 2020-09-10 02:04:18 more
  • 03.Linux基礎操作

    我學到了以下幾點 01Linux系統介紹02系統安裝,密碼啊破解03Linux常用命令04LAMP 01LINUX windows: win03 8 12 16 19 配置不繁瑣 Linux:redhat,centos(紅帽社區版),Ubuntu server,suse unix:金融機構,證券,銀 ......

    uj5u.com 2020-09-10 02:04:30 more
  • 05HTML

    01HTML介紹 02頭部標簽講解03基礎標簽講解04表單標簽講解 HTML前段語言 js1.了解代碼2.根據代碼 懂得挖掘漏洞 (POST注入/XSS漏洞上傳)3.黑帽seo 白帽seo 客戶網站被黑帽植入劫持代碼如何處理4.熟悉html表單 <html><head><title>TDK標題,描述 ......

    uj5u.com 2020-09-10 02:04:36 more
最新发布
  • 2023年最新微信小程式抓包教程

    01 開門見山 隔一個月發一篇文章,不過分。 首先回顧一下《微信系結手機號資料庫被脫庫事件》,我也是第一時間得知了這個訊息,然后跟蹤了整件事情的經過。下面是這起事件的相關截圖以及近日流出的一萬條資料樣本: 個人認為這件事也沒什么,還不如關注一下之前45億快遞資料查詢渠道疑似在近日復活的訊息。 訊息是 ......

    uj5u.com 2023-04-20 08:48:24 more
  • web3 產品介紹:metamask 錢包 使用最多的瀏覽器插件錢包

    Metamask錢包是一種基于區塊鏈技術的數字貨幣錢包,它允許用戶在安全、便捷的環境下管理自己的加密資產。Metamask錢包是以太坊生態系統中最流行的錢包之一,它具有易于使用、安全性高和功能強大等優點。 本文將詳細介紹Metamask錢包的功能和使用方法。 一、 Metamask錢包的功能 數字資 ......

    uj5u.com 2023-04-20 08:47:46 more
  • vulnhub_Earth

    前言 靶機地址->>>vulnhub_Earth 攻擊機ip:192.168.20.121 靶機ip:192.168.20.122 參考文章 https://www.cnblogs.com/Jing-X/archive/2022/04/03/16097695.html https://www.cnb ......

    uj5u.com 2023-04-20 07:46:20 more
  • 從4k到42k,軟體測驗工程師的漲薪史,給我看哭了

    清明節一過,盲猜大家已經無心上班,在數著日子準備過五一,但一想到銀行卡里的余額……瞬間心情就不美麗了。最近,2023年高校畢業生就業調查顯示,本科畢業月平均起薪為5825元。調查一出,便有很多同學表示自己又被平均了。看著這一資料,不免讓人想到前不久中國青年報的一項調查:近六成大學生認為畢業10年內會 ......

    uj5u.com 2023-04-20 07:44:00 more
  • 最新版本 Stable Diffusion 開源 AI 繪畫工具之中文自動提詞篇

    🎈 標簽生成器 由于輸入正向提示詞 prompt 和反向提示詞 negative prompt 都是使用英文,所以對學習母語的我們非常不友好 使用網址:https://tinygeeker.github.io/p/ai-prompt-generator 這個網址是為了讓大家在使用 AI 繪畫的時候 ......

    uj5u.com 2023-04-20 07:43:36 more
  • 漫談前端自動化測驗演進之路及測驗工具分析

    隨著前端技術的不斷發展和應用程式的日益復雜,前端自動化測驗也在不斷演進。隨著 Web 應用程式變得越來越復雜,自動化測驗的需求也越來越高。如今,自動化測驗已經成為 Web 應用程式開發程序中不可或缺的一部分,它們可以幫助開發人員更快地發現和修復錯誤,提高應用程式的性能和可靠性。 ......

    uj5u.com 2023-04-20 07:43:16 more
  • CANN開發實踐:4個DVPP記憶體問題的典型案例解讀

    摘要:由于DVPP媒體資料處理功能對存放輸入、輸出資料的記憶體有更高的要求(例如,記憶體首地址128位元組對齊),因此需呼叫專用的記憶體申請介面,那么本期就分享幾個關于DVPP記憶體問題的典型案例,并給出原因分析及解決方法。 本文分享自華為云社區《FAQ_DVPP記憶體問題案例》,作者:昇騰CANN。 DVPP ......

    uj5u.com 2023-04-20 07:43:03 more
  • msf學習

    msf學習 以kali自帶的msf為例 一、msf核心模塊與功能 msf模塊都放在/usr/share/metasploit-framework/modules目錄下 1、auxiliary 輔助模塊,輔助滲透(埠掃描、登錄密碼爆破、漏洞驗證等) 2、encoders 編碼器模塊,主要包含各種編碼 ......

    uj5u.com 2023-04-20 07:42:59 more
  • Halcon軟體安裝與界面簡介

    1. 下載Halcon17版本到到本地 2. 雙擊安裝包后 3. 步驟如下 1.2 Halcon軟體安裝 界面分為四大塊 1. Halcon的五個助手 1) 影像采集助手:與相機連接,設定相機引數,采集影像 2) 標定助手:九點標定或是其它的標定,生成標定檔案及內參外參,可以將像素單位轉換為長度單位 ......

    uj5u.com 2023-04-20 07:42:17 more
  • 在MacOS下使用Unity3D開發游戲

    第一次發博客,先發一下我的游戲開發環境吧。 去年2月份買了一臺MacBookPro2021 M1pro(以下簡稱mbp),這一年來一直在用mbp開發游戲。我大致分享一下我的開發工具以及使用體驗。 1、Unity 官網鏈接: https://unity.cn/releases 我一般使用的Apple ......

    uj5u.com 2023-04-20 07:40:19 more