【白嫖】GitHub Action 云扫描器

简介: GitHub Action介绍 GitHub Actions 是一种持续集成和持续交付 (CI/CD) 平台,可用于自动化构建、测试和部署应用程序,执行代码质量检查,创建和发布软件包,发送通知,执行持续集成和持续部署等等。 可以根据自己的需求和工作流程来定义和配置这些自动化任务 。 - 官方中文文档 (https //docs.github.com/zh/actions/quick

GitHub Action介绍

GitHub Actions 是一种持续集成和持续交付 (CI/CD) 平台,可用于自动化构建、测试和部署应用程序,执行代码质量检查,创建和发布软件包,发送通知,执行持续集成和持续部署等等。可以根据自己的需求和工作流程来定义和配置这些自动化任务

可以理解为GitHub提供了一台最长可以使用6小时的云服务器,每次push代码时,该云服务器都会按照你提前设定好的流程去执行一遍。

简单演示

以构建简单的 subfinder子域名收集 - nuclei漏扫 为例,先使用subfinder进行子域名收集,然后使用nuclei进行漏扫,最后将结果上传到GitHub的当前仓库中。

创建git项目,编写.github/workflows/blank.yml内容如下,基本上都能看懂每一步干啥,每个字段解读可参考官方文档

name: CI
on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - uses: actions/checkout@v3

      # Setup Go environment
      - name: Setup Go environment
        uses: actions/setup-go@v4.0.1
        with:
          go-version: 1.20.1

      # 安装subfinder 和 nuclei
      - name: Run Install
        run: |
          go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest
          go install -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei@latest

      # 使用
      - name: Run tools
        shell: bash
        run: |
          domain=$(cat input/domain.txt)
          subfinder -d $domain -o output/subdomains.txt
          nuclei -l output/subdomains.txt -o output/vuln.txt -s medium

      # push到当前仓库
      - name: Commit files
        run: |
          git config --local user.email "github-actions[bot]@users.noreply.github.com"
          git config --local user.name "github-actions[bot]"
          git add *
          git commit -m "commit change file"

      - name: GitHub Push
        # You may pin to the exact commit or the version.
        # uses: ad-m/github-push-action@40bf560936a8022e68a3c00e7d2abefaf01305a6
        uses: ad-m/github-push-action@v0.6.0
        with:
          # Token for the repo. Can be passed in using $\{
   
   { secrets.GITHUB_TOKEN }}
          github_token: ${
   
   {
   
    secrets.GITHUB_TOKEN }}
          branch: ${
   
   {
   
    github.ref }}

整体目录结构如下:

.
├── .github
│   └── workflows
│       └── blank.yml
├── .gitignore
├── input
│   └── domain.txt // 内容为gm7.org
└── output
    └── res.txt

上传到Github中,Github将会通过Action自动构建,按照我们设置的流程运行,结果如下。

res

结果push到仓库,可随时查看。

push

注意事项

创建workflow

如果要从头写一个workflow的话,建议在Github中新建模板后再改。

action

此外右边有语法参考,还可以直接从市场复制想要的东西,很方便。

cankao

remote: Write access to repository not granted.

需要在当前仓库的设置中,赋予workflow写权限。

image-20230602下午21707374

速度方面

个人感觉速度比较慢,比较欠缺,有这精力不如直接买台服务器配了,一劳永逸。

目录
相关文章
|
2月前
|
Linux C++ Docker
【Azure Developer】在Github Action中使用Azure/functions-container-action@v1配置Function App并成功部署Function Image
【Azure Developer】在Github Action中使用Azure/functions-container-action@v1配置Function App并成功部署Function Image
|
2月前
|
数据安全/隐私保护
【Azure Developer】Github Action使用Azure/login@v1插件登录遇见错误的替代方案
【Azure Developer】Github Action使用Azure/login@v1插件登录遇见错误的替代方案
|
2月前
|
存储
【Azure Developer】Github Action部署资源(ARM模板)到Azure中国区时,遇见登录问题的解决办法
【Azure Developer】Github Action部署资源(ARM模板)到Azure中国区时,遇见登录问题的解决办法
|
4月前
|
数据安全/隐私保护 开发者 Docker
国内docker公开镜像站的关闭!别急,docker_image_pusher 使用Github Action将国外的Docker镜像转存到阿里云私有仓库
通过使用 docker_image_pusher 这样的开源项目,我们能够轻松地解决国内访问 Docker 镜像拉取速度慢及拉去失败的问题,同时保证了镜像的稳定性和安全性。利用 Github Action 的自动化功能,使得这一过程更加简单和高效。
1456 2
|
4月前
【完美解决】Github action报错remote: Write access to repository not granted.
【完美解决】Github action报错remote: Write access to repository not granted.
600 1
|
4月前
|
jenkins 物联网 测试技术
干货分享!基于 Github Action 的 taosX CI 搭建
去年随着 3.1.1.0 版本的发布,TDengine 数据接入工具 taosX 正式推出。该工具具备强大的数据抓取、清洗、转换及加载(ETL)功能。它不仅能无缝对接物联网中的 MQTT 协议,更重要的是能够连接到工业数据源如 OPC-UA、OPC-DA、PI System 等。借助这一模块,工业场景中常用的 SCADA、DCS 等系统无需编写任何代码,仅需通过简单配置即可实现数据的实时、持续导入至 TDengine。
51 1
|
5月前
|
存储 JavaScript 测试技术
github action
github action
60 0
|
5月前
|
供应链 安全 jenkins
|
11月前
|
存储 运维 安全
GitHub与微信开启“秘密扫描”计划,来确保数据安全
GitHub与微信开启“秘密扫描”计划,来确保数据安全
70 0
|
缓存 前端开发 持续交付
白嫖github的Action做定时任务
白嫖github的Action做定时任务
白嫖github的Action做定时任务
下一篇
无影云桌面