Pivoting with ptunnel

I have established a tunnel between the two hosts, however, when I try to connect the the ubuntu server through the port 2222 of the attacker , the ubuntu server keeps saying:

[inf]: Destination administratively prohibited!

Any help? thanks.

The error message you’re encountering, “[inf]: Destination administratively prohibited!” suggests that the connection is being blocked by some kind of administrative policy on the Ubuntu server. This error typically occurs when the server’s firewall or network configuration is preventing the connection.

Here are a few steps you can take to troubleshoot and resolve the issue:

  1. Verify the tunnel configuration: Double-check that your tunnel is properly established and configured. Ensure that the tunnel endpoints, protocols (e.g., SSH), and port forwarding settings are correctly set up.

  2. Check server firewall settings: Determine if there are any firewall rules in place on the Ubuntu server that may be blocking incoming connections on port 2222. You can use the ufw (Uncomplicated Firewall) command to manage the firewall rules. Verify if the port 2222 is allowed and properly forwarded to the appropriate destination.

    Run the following command to see the current firewall rules:

    sudo ufw status
    

    If port 2222 is not listed as “ALLOW,” you can add a rule to allow incoming connections on that port using this command:

    sudo ufw allow 2222
    
  3. Check network configuration: Confirm that the Ubuntu server’s network configuration allows incoming connections. Check if there are any specific network restrictions, such as IP whitelisting or access control lists (ACLs), that might be preventing access.

  4. Verify SSH service: Make sure the SSH service is running and properly configured on the Ubuntu server. You can check the status of the SSH service with the following command:

    sudo service ssh status
    

    If it’s not running, you can start it using:

    sudo service ssh start
    
  5. Log analysis: Examine the server’s logs, such as /var/log/auth.log, for any relevant error messages or indications of blocked connections. These logs can provide more details on why the connection is being prohibited.

  6. Temporary firewall rule: As a temporary test, you can try temporarily disabling the firewall on the Ubuntu server to see if that resolves the issue. However, it’s crucial to re-enable the firewall and implement appropriate rules once testing is complete.

If you’re still experiencing issues after going through these steps, you may need to provide more details about your network setup, the specific tunneling method you’re using, and any relevant configuration files or error messages to help diagnose the problem further.