Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DMP: 2024] Pen Testing Framework #1

Open
singhalkarun opened this issue Apr 22, 2024 · 4 comments
Open

[DMP: 2024] Pen Testing Framework #1

singhalkarun opened this issue Apr 22, 2024 · 4 comments

Comments

@singhalkarun
Copy link

singhalkarun commented Apr 22, 2024

Ticket Contents

Description

Design a framework to make Penetration testing part of CI (Github Actions)

Reference: https://github.com/olacabs/jackhammer

Goals & Mid-Point Milestone

Mid Point Milestone

Goals

Setup/Installation

No response

Expected Outcome

Acceptance Criteria

Implementation Details

Mockups/Wireframes

No response

Product Name

BharatSahAIyak

Organisation Name

SamagraX

Domain

Open Source Library

Tech Skills Needed

Linux - Internals, Networking
Github Actions

Mentor(s)

@singhalkarun

Category

Security

@aayushk9
Copy link

aayushk9 commented Apr 22, 2024

@singhalkarun @ChakshuGautam Is this framework supposed to be designed/developed from scratch?

@AbhimanyuSamagra
Copy link

Do not ask process related questions about how to apply and who to contact in the above ticket. The only questions allowed are about technical aspects of the project itself. If you want help with the process, you can refer instructions listed on Unstop and any further queries can be taken up on our Discord channel titled DMP queries. Here's a Video Tutorial on how to submit a proposal for a project.

@unibik
Copy link

unibik commented Apr 27, 2024

Hello @ singhalkarun , I would like to contribute to this project . I'm interested in the idea of penetration testing frameworks. However I'm pursuing bachelor's degree in Cyber security . I would be glad if you share the idea of this project.
Do we need to write code from scratch? If so help me how to start the project. Thank you

@Himasnhu-AT
Copy link

Himasnhu-AT commented Apr 30, 2024

Hi @singhalkarun ,
I have a question regarding this project. Do we need to incorporate Jackhammer into our testing process?
Here's a demo implementation I have in mind based on if we are incorporating it or not. And improvements or this I should keep in mind?


Using Jackhammer

If required, we can set up GitHub Actions to pull Jackhammer's image and perform comprehensive testing against our codebase.

name: Automated Testing with Jackhammer

on:
  push:
    branches:
      - main

jobs:
  test:
    runs-on: ubuntu-latest
    
    steps:
    - name: Checkout code
      uses: actions/checkout@v2
      
    - name: Build Docker image for testing
      run: yarn setup:docker:testing
      
    - name: Run Jackhammer tests
      uses: docker://jackhammer/jackhammer # image address
      with:
        args: |
          --port 3004
          --test-type hard
          --url http://localhost:3004

Alternatively, Without Jackhammer

We could use a Docker image with a Linux environment and execute the following script:

#!/bin/bash
# Function to scan Docker image for open ports using nmap
scan_ports() {
    docker_image=$1
    nmap_output=$(docker run --rm $docker_image nmap -p- --open localhost | grep '^[0-9]' | cut -d'/' -f1)
    echo "Open ports for $docker_image:"
    echo "$nmap_output"
}

# Function to run Nikto on specified port
run_nikto() {
    target_port=$1
    docker run --rm c4pt/nikto -h localhost:$target_port
}

# Main function
main() {
    docker_image=$1
    scan_ports $docker_image

    read -p "Enter the port to run Nikto test on: " port
    run_nikto $port
}

# Call the main function with the Docker image name as an argument
main $1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants