간단하게 codeQL 사용법을 정리해보겠다.
세팅
https://github.com/github/codeql-cli-binaries
GitHub - github/codeql-cli-binaries: Binaries for the CodeQL CLI
Binaries for the CodeQL CLI. Contribute to github/codeql-cli-binaries development by creating an account on GitHub.
github.com
여기 release 페이지에서 최신 codeql을 다운받는다.
codeql 실행 파일의 환경 변수를 설정해준다.
그럼 위와 같이 다른 폴더에서도 codeql을 실행할 수 있다.
https://github.com/github/codeql
GitHub - github/codeql: CodeQL: the libraries and queries that power security researchers around the world, as well as code scan
CodeQL: the libraries and queries that power security researchers around the world, as well as code scanning in GitHub Advanced Security - github/codeql
github.com
이어서 위 깃허브 페이지를 clone 해준다. 여기서는 codeql 쿼리들이 모여 있다.
혹은
codeql pack download codeql/python-queries
로 최신 쿼리팩을 다운받아볼 수 있다. (지피티 피셜)
실행
codeql database create my_flask_db `
--language=python `
--source-root=.
위 명령어로 데이터베이스를 생성한다.
codeql database analyze my_flask_db `
C:\경로\codeql-suites\python-security-and-quality.qls `
--format=sarif-latest `
--output=results.sarif
위 명령과 같이 데이터베이스를 지정하고, 경로를 지정하고, 포맷을 지정하고, 결과 파일명을 지정해야한다. 그럼 결과값을 얻을 수 있다.
에러
https://github.com/github/codeql/discussions/13839
Error was: Unknown kind "Table". [UNSUPPORTED_KIND] · github codeql · Discussion #13839
When i try to analyse the database my code created i get this error for some .ql files. This round of scanning has taken hours to complete, i'm not sure if this is normal or not, but i have not cha...
github.com
간혹 `@kind` 관련한 에러가 발생하는데, 이럴 땐 경로를 디렉터리로 주기보단 필요한 부분들만 파일들만 추려서 수행해보자.
'웹 해킹 > 개념 노트장' 카테고리의 다른 글
[버그헌팅-초급] 5-2. 웹 취약점 이해 (0) | 2025.05.11 |
---|---|
[버그헌팅-초급] 5-1. 웹 취약점 이해 (0) | 2025.05.10 |
DOM Clobbering (1) | 2024.12.30 |
Relative Path Overwrite (3) | 2024.12.28 |
Web Cache Deception (0) | 2024.12.26 |