iptables: Linux VPN VPN client connected as a gateway for other devices

I followed this tutorial https://support.hidemyass.com/hc/en-us/articles/202721486-Using-Linux-Virtual-Machine-instead-of-a-router-for-VPN.

I set the default gw for the connected VPNClient in a test client.
If I now try to ping 8.8.8.8 I always get a "request timeout" error.

Everything I found indicates the same commands, did I miss something?

Objective:
Other devices can use the connected VPN to access the Internet without installing a VPN client.

Prepare:

Client X --Default GW--> Connected VPNClient --VPN--> Internet 
Client X: Windows
VPNClient: Debian Stable

As indicated in the tutorial, I did the following:

sysctl -w net.ipv4.ip_forward=1
iptables -A FORWARD -o tun0 -i enp0s3 -s 192.168.1.0/24 -m conntrack --ctstate NEW -j ACCEPT
iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -A POSTROUTING -t nat -j MASQUERADE

Route:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.8.8.1        128.0.0.0       UG    0      0        0 tun0
default         192.168.1.1     0.0.0.0         UG    0      0        0 enp0s3
10.8.8.0        0.0.0.0         255.255.255.0   U     0      0        0 tun0
82.102.16.198   192.168.1.1     255.255.255.255 UGH   0      0        0 enp0s3
128.0.0.0       10.8.8.1        128.0.0.0       UG    0      0        0 tun0
link-local      0.0.0.0         255.255.0.0     U     1000   0        0 enp0s3
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 enp0s3

ip addr:

2: enp0s3:  mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 08:00:27:a4:37:0c brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.24/24 brd 192.168.1.255 scope global dynamic enp0s3
       valid_lft 86081sec preferred_lft 86081sec
    inet6 fe80::a00:27ff:fea4:370c/64 scope link 
       valid_lft forever preferred_lft forever
3: tun0:  mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 100
    link/none 
    inet 10.8.8.4/24 brd 10.8.8.255 scope global tun0
       valid_lft forever preferred_lft forever
    inet6 fe80::e5a1:abcf:ceaa:708c/64 scope link stable-privacy 
       valid_lft forever preferred_lft forever

VPN:

Protonvpn cli
OpenVPN configuration, same problem

iptables -L -v -n

Chain INPUT (policy ACCEPT 567 packets, 61034 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 ACCEPT     all  --  enp0s3 tun0    192.168.1.0/24       0.0.0.0/0            ctstate NEW
    0     0 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED

Chain OUTPUT (policy ACCEPT 596 packets, 84473 bytes)
 pkts bytes target     prot opt in     out     source               destination   

iptables -t nat -L

Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination         

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination         
MASQUERADE  all  --  anywhere             anywhere 

client: send or receive bitcoins with bitcoin-cli without downloading complete blockchain

I have successfully downloaded, compiled and installed bitcoin-cli from github.

I can send or receive bitcoins with sendtoaddress and getnewaddress methods.

It works very well and I am happy to do it without installing third-party software (I don't trust them)

But I have a problem: I need to download the complete blockchain files (with bitcoind) on my computer.

Is there any way to run sendtoaddress and getnewaddress just by having the wallet.dat file on my computer? I don't want to download the complete blockchain files. It's possible ?

How does the ledger wallet key work? This small key does not contain a copy of the blockchain. And works !

Thank you

jwt symmetric signature security risks (client side)

I am currently implementing an iOS application, which integrates with a backend system hosted in the blue .net cloud, which.

The API logon endpoint takes user / pass -> replies with a signed HS256 jwt token. All subsequent calls to the endpoint require a type bearer authorization header, and the endpoint supports the renewal of this token, provided the token has not expired, so it appears to be an infinite amount of time.
(which in itself is not great). The server side seems to validate the signature of this token on each request.

In the past, having used only RSA tokens, we always shared the public key with customers so they could verify the signature of the token. However, since this API only supports HS256, this is not possible.

What security risks would a customer incur if it does not verify the signature for the client side?
An obvious one is to access the data in cache within the screens. But would there be more serious?
Thanks in advance.

vpn: decrypt DTLS traffic when using the Cisco AnyConnect client

I am using Cisco AnyConnect Client 4.7 to connect to a VPN. I need to decrypt the traffic to examine the packets and understand how the VPN works. I have read about providing the PSK to Wireshark, but I cannot find a place that explains how to obtain it when I use this Cisco Client.

In addition, I need to do the same with the discontinued Cisco VPN client that supports IPsec. Again, I don't know how to get session keys to decrypt ESP traffic.

Just to clarify, I am not trying to perform a mitm attack, I have credentials and I am connected to the VPN as a legitimate user.

blockchain: is it possible to install and work with the Hyperledger browser from the Fabric client node?

Is it possible to install the fabric client node? I am working with the Aamzon managed blockchain and I don't see a way to use or have the Hyperledger browser ready in the AWS managed blockchain. Is it possible to have the endpoint for it on this network and how? I have seen people using AWS hyperledger blockchain templates to generate the endpoint, but not in the managed version. If this is not possible, is it possible to install and use it on the structure client node and not on the network?

It would be a priority to generate a hyperledger browser endpoint in the AWS-managed blockchain network if this is not possible, how to do it in the fabric client node or if it is ok or possible? Any idea or suggestion is welcome !

Get the tax identification options of the client group in Magento2

Recently I built a page that allows the user to create a group of customers from a custom module. I have a drop-down menu in the front-end that retrieves a list of tax classes and identifiers. I just realized that I have the wrong classes and I have the product tax classes:

public function getTaxClasses(){
        $taxClasses = $this->productTaxClassSource->getAllOptions();
        foreach($taxClasses as $t){
            echo "";
        }
    }

Instead of using productTaxClassSource, is there a collection or list where you can get the options for CLIENT GROUP TAX CLASSES, which are found in customers-> customer groups-> tax class? Or can someone point me to the table where I can find that information if I have to make a selection?

working with css.less in the client side compilation mode and then transitioning to the server side

I need to compile CSS.less files, however, node.js consumes many resources, so it cannot be used in our current hosted account. To work on issues, the documentation recommends changing the mode to the client side compilation. Consequently, apart from node.js, what do I need to install on Windows 10 and how do the revisions take effect once I switch to server-side compilation as it goes from development mode to production mode?

Consequently, revisions of the style sheet when the frontend development workflow is configured on the server side throws errors, and when changed to the client side less compilation also produces errors, however, when it is changed again next to the server less compilation, the editions are "compiled", although this seems like an atrocious way to do it. This is not clear exactly how the CSS is being compiled.

All I need are minor revisions to a template that should be done by inspecting items in the browser and then making revisions to the files less or adding a custom css file when necessary.

Magento 1.9.4.3 – Unable to edit the client in Adminside or backend

I have many clients but when I edit the client’s thinking
backend as administrator but I can't edit I face some problem
And when Add New Address can't do anything, see the add-on below.

enter the description of the image here

enter the description of the image here
when editing the customer address cannot be edited, see the image above and you cannot add the new address
see the addon below I tried to find solutions but I can't get the solution
Please give me a suggestion on how I can fix it as soon as possible.

Thank you.

serialization – C # Rest Client Benchmarking

I build a C # Rest Client library / framework. I realized that it seemed to be significantly faster than RestSharp for GET at least. So, I decided to build some benchmarks by comparing it with other clients. I'm a bit new to benchmarking, but I don't want to become obsessed with best practices. Just wanna know

A) Have I introduced bias here?
B) Have I made any obvious mistake?

The four libraries are RestSharp, DalSoft RestClient and my RestClient.Net library. The platform is .NET Core 3.1. I have included a serialization test with the new System.Text.Json (properties that are not case sensitive). I am testing the asynchronous, task-based version of all libraries. These results come from a parallel Windows machine, but will publish OSX results when they are ready. Here I run 6 lots of tests, and I exclude the first batch for each library to eliminate the engine start time bias. The results are the average of the total time. The results are in milliseconds with 250 repetitions.

Here are the results for GET

DalSoft 3527.41

Flurl 1500.3981

RestClient.Net System.Text.Json 2092.2710

RestClient.Net Newtsonsoft 1606.2478

Restharp 9033.2331

Here are the results for POST

DalSoft 850.5417

Flurl 830.1859

RestClient.Net System.Text.Json 1699.9605

RestClient.Net Newtsonsoft 917.9309

Restharp 894.0506

Code reference

(TestClass)
public class PerformanceTests
{
    #region Misc
    (AssemblyInitialize)
    public static void Initialize(TestContext testContext)
    {
        //Load all the assemblies in to the app domain so this loading doesn't skew results
        var flurlClient = new FlurlClient(PeopleUrl);
        var countryCodeClient = new Client(new NewtonsoftSerializationAdapter(), new Uri(PeopleUrl));
        var restSharpClient = new RestSharp.RestClient(PeopleUrl);
        var dalSoftClient = new DalSoft.RestClient.RestClient(PeopleUrl);
        var personJson = JsonConvert.SerializeObject(new Person());
        personJson = System.Text.Json.JsonSerializer.Serialize(new Person());
    }

    private const int Repeats = 250;
    private const string PeopleUrl = "https://localhost:44337/JsonPerson/people";
    private const string Path = "Results.csv";
    private static FileStream stream;

    static PerformanceTests()
    {
        if (File.Exists(Path)) File.Delete(Path);
        stream = new FileStream(Path, FileMode.Append);
        WriteText("Client,Method,First Call,All Calls,Totalrn");
    }

    private static void WriteText(string text)
    {
        var bytes = Encoding.UTF8.GetBytes(text);
        stream.Write(bytes, 0, bytes.Length);
    }

    (AssemblyCleanup())
    public static void AssemblyCleanup() 
    {
        stream.Close();
    }
    #endregion

    #region Flurl
    (TestMethod)
    (DataRow)
    (DataRow)
    (DataRow)
    (DataRow)
    (DataRow)
    (DataRow)
    public async Task TestGetFlurl()
    {
        var startTime = DateTime.Now;
        var originalStartTime = DateTime.Now;
        var flurlClient = new FlurlClient(PeopleUrl);

        startTime = DateTime.Now;
        var people = await flurlClient.Request().GetJsonAsync>();
        var timesOne = (DateTime.Now - startTime).TotalMilliseconds;

        startTime = DateTime.Now;
        for (var i = 0; i < Repeats; i++)
        {
            people = await flurlClient.Request().GetJsonAsync>();
            Assert.IsTrue(people != null);
            Assert.IsTrue(people.Count > 0);
        }

        var timesRepeats = (DateTime.Now - startTime).TotalMilliseconds;
        var total = (DateTime.Now - originalStartTime).TotalMilliseconds;

        var message = $"Flurl,GET,{timesOne},{timesRepeats},{total}rn";
        WriteText(message);
        Console.WriteLine(message);
    }

    (TestMethod)
    (DataRow)
    (DataRow)
    (DataRow)
    (DataRow)
    (DataRow)
    (DataRow)
    public async Task TestPostFlurl()
    {
        var startTime = DateTime.Now;
        var originalStartTime = DateTime.Now;
        var countryCodeClient = new FlurlClient(PeopleUrl);

        var peopleRequest = new List();
        for (var i = 0; i < 10; i++)
        {
            peopleRequest.Add(new Person { FirstName = "Test" + i });
        }

        startTime = DateTime.Now;
        var people = await ReadPostResponseAsync(countryCodeClient, peopleRequest);
        var timesOne = (DateTime.Now - startTime).TotalMilliseconds;

        for (var i = 0; i < Repeats; i++)
        {
            people = await ReadPostResponseAsync(countryCodeClient, peopleRequest);
            Assert.IsTrue(people != null);
            Assert.IsTrue(people.Count > 0);
        }

        var timesRepeats = (DateTime.Now - startTime).TotalMilliseconds;
        var total = (DateTime.Now - originalStartTime).TotalMilliseconds;

        var message = $"Flurl,POST,{timesOne},{timesRepeats},{total}rn";
        WriteText(message);
        Console.WriteLine(message);
    }

    private static async Task> ReadPostResponseAsync(FlurlClient countryCodeClient, List peopleRequest)
    {
        var response = await countryCodeClient.Request().PostJsonAsync(peopleRequest);
        var json = await response.Content.ReadAsStringAsync();
        var people = JsonConvert.DeserializeObject>(json);
        return people;
    }
    #endregion

    #region RestClient.Net
    (TestMethod)
    (DataRow)
    (DataRow)
    (DataRow)
    (DataRow)
    (DataRow)
    (DataRow)
    public async Task TestGetRestClientNewtonSoft()
    {
        var startTime = DateTime.Now;
        var originalStartTime = DateTime.Now;
        var countryCodeClient = new Client(new NewtonsoftSerializationAdapter(), new Uri(PeopleUrl));

        startTime = DateTime.Now;
        List people = await countryCodeClient.GetAsync>();
        var timesOne = (DateTime.Now - startTime).TotalMilliseconds;

        for (var i = 0; i < Repeats; i++)
        {
            people = await countryCodeClient.GetAsync>();
            Assert.IsTrue(people != null);
            Assert.IsTrue(people.Count > 0);
        }

        var timesRepeats = (DateTime.Now - startTime).TotalMilliseconds;
        var total = (DateTime.Now - originalStartTime).TotalMilliseconds;

        var message = $"RestClient.Net Newtonsoft,GET,{timesOne},{timesRepeats},{total}rn";
        WriteText(message);
        Console.WriteLine(message);
    }

    (TestMethod)
    (DataRow)
    (DataRow)
    (DataRow)
    (DataRow)
    (DataRow)
    (DataRow)
    public async Task TestGetRestClient()
    {
        var startTime = DateTime.Now;
        var originalStartTime = DateTime.Now;
        var countryCodeClient = new Client(new Uri(PeopleUrl));

        startTime = DateTime.Now;
        List people = await countryCodeClient.GetAsync>();
        var timesOne = (DateTime.Now - startTime).TotalMilliseconds;

        for (var i = 0; i < Repeats; i++)
        {
            people = await countryCodeClient.GetAsync>();
            Assert.IsTrue(people != null);
            Assert.IsTrue(people.Count > 0);
        }

        var timesRepeats = (DateTime.Now - startTime).TotalMilliseconds;
        var total = (DateTime.Now - originalStartTime).TotalMilliseconds;

        var message = $"RestClient.Net,GET,{timesOne},{timesRepeats},{total}rn";
        WriteText(message);
        Console.WriteLine(message);
    }

    (TestMethod)
    (DataRow)
    (DataRow)
    (DataRow)
    (DataRow)
    (DataRow)
    (DataRow)
    public async Task TestPostRestClient()
    {
        var startTime = DateTime.Now;
        var originalStartTime = DateTime.Now;
        var countryCodeClient = new Client(new Uri(PeopleUrl));

        var peopleRequest = new List();
        for (var i = 0; i < 10; i++)
        {
            peopleRequest.Add(new Person { FirstName = "Test" + i });
        }

        startTime = DateTime.Now;
        List people = await countryCodeClient.PostAsync, List>(peopleRequest);
        var timesOne = (DateTime.Now - startTime).TotalMilliseconds;

        for (var i = 0; i < Repeats; i++)
        {
            people = await countryCodeClient.PostAsync, List>(peopleRequest);
            Assert.IsTrue(people != null);
            Assert.IsTrue(people.Count > 0);
        }

        var timesRepeats = (DateTime.Now - startTime).TotalMilliseconds;
        var total = (DateTime.Now - originalStartTime).TotalMilliseconds;

        var message = $"RestClient.Net,POST,{timesOne},{timesRepeats},{total}rn";
        WriteText(message);
        Console.WriteLine(message);
    }

    (TestMethod)
    (DataRow)
    (DataRow)
    (DataRow)
    (DataRow)
    (DataRow)
    (DataRow)
    public async Task TestPostRestClientNewtonsoft()
    {
        var startTime = DateTime.Now;
        var originalStartTime = DateTime.Now;
        var countryCodeClient = new Client(new NewtonsoftSerializationAdapter(), new Uri(PeopleUrl));
        countryCodeClient.SetJsonContentTypeHeader();

        var peopleRequest = new List();
        for (var i = 0; i < 10; i++)
        {
            peopleRequest.Add(new Person { FirstName = "Test" + i });
        }

        startTime = DateTime.Now;
        List people = await countryCodeClient.PostAsync, List>(peopleRequest);
        var timesOne = (DateTime.Now - startTime).TotalMilliseconds;

        for (var i = 0; i < Repeats; i++)
        {
            people = await countryCodeClient.PostAsync, List>(peopleRequest);
            Assert.IsTrue(people != null);
            Assert.IsTrue(people.Count > 0);
        }

        var timesRepeats = (DateTime.Now - startTime).TotalMilliseconds;
        var total = (DateTime.Now - originalStartTime).TotalMilliseconds;

        var message = $"RestClient.Net Newtonsoft,POST,{timesOne},{timesRepeats},{total}rn";
        WriteText(message);
        Console.WriteLine(message);
    }
    #endregion

    #region RestSharp
    (TestMethod)
    (DataRow)
    (DataRow)
    (DataRow)
    (DataRow)
    (DataRow)
    (DataRow)
    public async Task TestGetRestSharp()
    {
        var startTime = DateTime.Now;
        var originalStartTime = DateTime.Now;
        var countryCodeClient = new RestSharp.RestClient(PeopleUrl);

        startTime = DateTime.Now;
        var people = await countryCodeClient.ExecuteGetTaskAsync>(new RestRequest { Method = Method.GET });
        var timesOne = (DateTime.Now - startTime).TotalMilliseconds;

        for (var i = 0; i < Repeats; i++)
        {
            people = await countryCodeClient.ExecuteGetTaskAsync>(new RestRequest { Method = Method.GET });
            Assert.IsTrue(people != null);
            Assert.IsTrue(people.Data.Count > 0);
        }

        var timesRepeats = (DateTime.Now - startTime).TotalMilliseconds;
        var total = (DateTime.Now - originalStartTime).TotalMilliseconds;

        var message = $"RestSharp,GET,{timesOne},{timesRepeats},{total}rn";
        WriteText(message);
        Console.WriteLine(message);
    }

    (TestMethod)
    (DataRow)
    (DataRow)
    (DataRow)
    (DataRow)
    (DataRow)
    (DataRow)
    public async Task TestPostRestSharp()
    {
        var startTime = DateTime.Now;
        var originalStartTime = DateTime.Now;
        var countryCodeClient = new RestSharp.RestClient(new Uri(PeopleUrl));

        var peopleRequest = new List();
        for (var i = 0; i < 10; i++)
        {
            peopleRequest.Add(new Person { FirstName = "Test" + i });
        }

        startTime = DateTime.Now;
        var peopleRestRequest = new RestRequest { Method = Method.POST, Body = new RequestBody("application/json", "Person", peopleRequest) };
        var people = await countryCodeClient.ExecutePostTaskAsync>(peopleRestRequest);
        var timesOne = (DateTime.Now - startTime).TotalMilliseconds;

        for (var i = 0; i < Repeats; i++)
        {
            people = await countryCodeClient.ExecutePostTaskAsync>(peopleRestRequest);
            Assert.IsTrue(people != null);
            Assert.IsTrue(people.Data.Count > 0);
        }

        var timesRepeats = (DateTime.Now - startTime).TotalMilliseconds;
        var total = (DateTime.Now - originalStartTime).TotalMilliseconds;

        var message = $"RestSharp,POST,{timesOne},{timesRepeats},{total}rn";
        WriteText(message);
        Console.WriteLine(message);
    }
    #endregion

    #region DALSoft
    (TestMethod)
    (DataRow)
    (DataRow)
    (DataRow)
    (DataRow)
    (DataRow)
    (DataRow)
    public async Task TestGetDALSoft()
    {
        var startTime = DateTime.Now;
        var originalStartTime = DateTime.Now;
        var countryCodeClient = new DalSoft.RestClient.RestClient(PeopleUrl);

        startTime = DateTime.Now;
        var people = await countryCodeClient.Get>();
        var timesOne = (DateTime.Now - startTime).TotalMilliseconds;

        for (var i = 0; i < Repeats; i++)
        {
            people = await countryCodeClient.Get>();
            Assert.IsTrue(people != null);
            Assert.IsTrue(people.Count > 0);
        }

        var timesRepeats = (DateTime.Now - startTime).TotalMilliseconds;
        var total = (DateTime.Now - originalStartTime).TotalMilliseconds;

        var message = $"DalSoft,GET,{timesOne},{timesRepeats},{total}rn";
        WriteText(message);
        Console.WriteLine(message);
    }

    (TestMethod)
    (DataRow)
    (DataRow)
    (DataRow)
    (DataRow)
    (DataRow)
    (DataRow)
    public async Task TestPostDALSoft()
    {
        var startTime = DateTime.Now;
        var originalStartTime = DateTime.Now;
        var countryCodeClient = new DalSoft.RestClient.RestClient(PeopleUrl);

        var peopleRequest = new List();
        for (var i = 0; i < 10; i++)
        {
            peopleRequest.Add(new Person { FirstName = "Test" + i });
        }

        startTime = DateTime.Now;
        var people = await countryCodeClient.Post, List>(peopleRequest);
        var timesOne = (DateTime.Now - startTime).TotalMilliseconds;

        for (var i = 0; i < Repeats; i++)
        {
            people = await countryCodeClient.Post, List>(peopleRequest);
            Assert.IsTrue(people != null);
            Assert.IsTrue(people.Count > 0);
        }

        var timesRepeats = (DateTime.Now - startTime).TotalMilliseconds;
        var total = (DateTime.Now - originalStartTime).TotalMilliseconds;

        var message = $"DalSoft,POST,{timesOne},{timesRepeats},{total}rn";
        WriteText(message);
        Console.WriteLine(message);
    }
    #endregion
}

System.Text.Json looks promising in upper and lower case mode. It seems to be faster than Newtonsoft without distinction between upper and lower case. But, we still have to investigate whether it can be faster or not in other situations.

Game server: I created a TCP server-client connection, but it only works if both the server and the client are on the same machine. Any ideas?

So I want to start by saying that I am a complete beginner in terms of networks.

I am creating a game in C ++, using SFML for networks (both the server and the client are in C ++, SFML). And I successfully created a server-client connection, to be able to send packets from one to another, but it only works when the server and the client are on the same machine (or the same Internet connection (router)).

What I would like to achieve is a server on my machine that, once started, can establish connections with my friends (who are not on the same router) clients.

I tried to resend the port I am using from the PC on which the server is running, but it seems to not work.

Any ideas?