Tricky issue involving knockback and the player.

I am working on a project where I cannot alter the player character, and I cannot add anything to it. So I need to figure out a way to knock back the player when the player enters a collison.

I am having a lot of problems trying to figure this out because I can’t figure out how to get an object’s rigidbody that collides when it collides with the object that is supposed to knockback.

Here is the script I have so far
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Knockback : MonoBehaviour
{
    public float force = 30;

    void OnCollisionEnter(Collision col)
    {

    if (col.gameObject.tag == "Player")
    {
        Vector3 dir = col.contacts[0].point - transform.position;
        dir = -dir.normalized;
        GetComponent<Rigidbody>().AddForce(dir * force);
    }
  }
}

What I want to happen, is for the player to collide with an object, and knock them back. I cannot attach anything to the player, or attach any part of the player to the script in any way.
Does anyone have an idea of how to do this?
anything will help. thank you

Well, if you can’t attach this script to the player (can’t see why you couldn’t do that though), then you need to attach this script to an object which is supposed to knock the player back.
You also need to modify the script in that case.

public class Knockback : MonoBehaviour
{
     public float force = 30;

     void OnCollisionEnter(Collision col)
     {
         if (col.gameObject.tag == "Player")
         {
             Vector3 dir = col.contacts[0].point - transform.position;
             //dir = -dir.normalized; you don't need this here, because it will reverse the direction.
             //now, without this line the direction will point from the transform (object) to the player.

             col.rigidbody.AddForce(dir * force); 
             // that's how you get the player's rigidbody
         }
    }
}