Check HMAC after completing decryption or before?

Obligatory disclaimer: If at all possible, don't implement your own crypto.

Verifying the validity of the decrypted file first and then decrypting it regardless of whether the MAC matches is the most secure way of doing this. After this, make sure that if any error occurs the same kind of error is always returned.

Disclosing any information on the reason of a failure is a serious security risk. For example if a bad MAC and bad padding in the decrypted file return different error messages a padding oracle attack can be mounted. Some padding oracle attacks, like lucky thirteen, only need to notice a difference in time in order to mount an attack on your crypto. This is why it's safest to always also decrypt the file regardless of MAC mismatch.

Depending on the crypto primitive and the mode of operation you are using different attacks should be considered.


Simple Authentication Method to Secure REST API

If you are not logging the RESTful GET that queries the data in your database and that data is intended to be public, then you can expose an HTTP GET and use the security built into the web server to keep harm from occurring during that operation.

For the RESTful POST, use TLS, the contemporary of SSL, but don't implement it yourself.  You can set up an HTTPS POST on any modern web server with ease.  Help desk support for installing the server-side certificate is usually supported by the CA.  Because people all over the world implement HTTPS POSTs every day, the support for that operation makes it easier to set up and maintain than doing something simple that's actually secure.

What you coded is not secure, which you may not think is important.

To exercise due diligence in answering your question, be warned that giving people credentials over the phone or on a piece of paper is not secure without employing a secure protocol such as HTTPS.  Relying on testing the value of a credential on the server leaves a gaping security hole that can lead to consequences you may have overlooked.

Attackers can easily identify the password on route and then wreck havoc on your client/customer/visitor's account and data.  Even if the data is not business critical, unprotected writes might end badly.  Someone could, for any number of reasons, place child porn or some military secret in your database, which you intend to leave open to the public.  You wouldn't be able to prove that you or one of the trusted users didn't put it there.


Floppy disk partition showed up when USB Flash drive inserted

If the USB sticks are second-hand, it is possible that you obtained a wiped one that used to have encryption software. They would frequently have two partitions, an unencrypted one to handle the authentication, and once you were authenticated, the software would mount the encrypted partition for use. USB Devices are also serial-bus, so you can have multiple devices plugged into one port at the same time. (Beautiful isn't it?)

First thing, if you were worried about sticking the thing in your computer to begin with, I wouldn't have done it. (It's actually kind of insensitive/rude for the professor to hand out USB sticks that could be infected with malware to all of the students just for his/her convenience...) Since we're past that stage, here are some options you can take: Format the bugger. Just wipe it clean and all will be forgiven. You can also try to use the Windows Disk Management software (or FDISK in the command-line) to re-partition the drives together, but that may not work if they are both genuinely different devices stuffed into the stick.

Enjoy your project!


I connected to an apparently password protected WiFi without giving a password

I believe what happened is that your partners phone is connecting to this network through the use of 802.11u/Hotspot 2.0/Passpoint. Passpoint allows a device to learn details about a wireless network and if the conditions are right authenticate to it prior to automatically joining the network.

While the evidence is circumstantial unless you can provide a lot more information, this matches up with the capabilities of the devices you mention or that are probable based on the information you provide. It also explains why your partners phone automatically connected to this network in a secure fashion without any action on her part.

For some period of time, Passpoint support was only implemented in a handful of Android devices by the device manufacturers (AFAIK, only in LG and Samsung devices). Google officially added Passpoint support in it's Android "Oreo" v8.0 release, even if it is up to the OEMs if they actually implement this feature.

Your Motorola Moto G 2nd Gen is neither capable of running Oreo nor is it one of the devices where support was added prior to Google's implementation. However, from what I can find, your partners Huawei Google Nexus 6P's officially supported current version is listed as Oreo. I can't find details about if the Nexus implemented the Passpoint feature, but as a device co-developed by Google, the chances are probably good.

The generic "NetComm Wireless" network you mention is likely a ISP/carrier provided CPE device. NetCommWireless is a company that produces hardware for both Carriers and ISPs. Many ISP/carriers are implementing features that turn your local wireless into a public Wi-Fi hotspot, specifically to offload traffic from cellular networks where possible. It is likely that this network is such a device.

You aren't really "mooching" off your neighbors. The ISP/Carrier is likely quietly providing additional bandwidth above and beyond your neighbors contracted bandwidth to support such a service. Since the connection uses WPA2-Enterprise/AES based encryption, the wireless connection is more secure than connecting to your phone's hotspot. And most likely, as part of the authentication process, your traffic is isolated from your neighbors traffic (for instance by a different VLAN assignment returned by the RADIUS server).


It is common for an account to be locked after X amount of failed logins, what are the best practice of selecting x?

It depends upon environment and intent.
High security environments often use 3 failures to lock and require contacting an admin and verifying your identity to unlock.
More automated systems may use 5 failures with a timed unlock after some time, typically in the region of 15 minutes to 1 hour.
I usually set Fail2ban to block remote access after 5 failures within 5 minutes with a timeout unblock of 30 minutes, under the theory that if a person screws up 5 times then waiting 30 minutes to try again is acceptable but 30 minutes is long enough to send brute force bots along their way as not viable.


The operator of the domain either uses Cloudflare as registrar or user another registrar and points the domain to Cloudflare's authoritative DNS servers.

This gives Cloudflare control over the domain, and they are able to issue valid TLS certificates for the domain, as they host it.

Cloudflare also host the authoritative DNS servers that reply with Cloudflare IP addresses to recursive DNS resolvers looking up the domain (maybe you use Cloudflare also for DNS resolving, but that is another thing entirely).

Cloudflare will even host DNS for you if you don't use Cloudflare as a reverse proxy / man-in-the-middle, but then of course they can't provide all the additonal services and they explain that.

Cloudflare uses anycast, and connections to Cloudflare IP addresses go to one of the ~200 Points of Presence (server farms) around the world, ideally the one closest in network topology terms (latency) to the client.

When a site uses Cloudflare, clients (browsers) only connect to Cloudflare's servers, never directly to the origin server. Requests go from the browser to Cloudflare's server and from Cloudflare's server to the origin server. Responses go back from the origin server to Cloudflare's server and from Cloudflare's server to the browser. The services Cloudflare provides are in filtering the requests and transforming and caching (storing for later) the responses, to make Cloudflare's server handle as much of the work as possible, to leave as little work as possible for the origin server. Depending on the site or application, a small origin server behind Cloudflare can handle a lot of user traffic and stand up to a big DDoS effort from attackers.

So, when a client (e.g. a web browser) connects to a site hosted by Cloudflare, the client connects to Cloudflare's servers. Cloudflare's servers perform DDoS protection, WAF, page rules, caching, CSS and JS minification, image optimization, data compression, run arbitrary javascript or WASM code provided by the site operator, and if needed, Cloudflare's server connect to the origin server, using TLS if possible, using mutual TLS authentication if desired, and performs an HTTP request that is processed and cached. The processed response is forwarded to the waiting client and potentially used to respond to other requests by other clients that reach the same Point of Presence (server farm).

Cloudflare is willing to connect to the origin server over cleartext HTTP, exposing user information to the internet, and then serve the response over HTTPS to the client, who sees a green lock icon. Some people don't like that. But Cloudflare also help site operators to set up TLS certificates (either trusted ones like Let's Encrypt or issued by Cloudflare's internal not-trusted CA) for the origin server. Cloudflare has a mode for their customers to maintain physical possession of their TLS keys, for example if required by regulation. And as I wrote, Cloudflare can use a client TLS certificate when performing "origin pull", if you setup your origin server appropriately.

Cloudflare is a CDN, yes, but it's more of a man-in-the-middle-as-a-service.


Clarification about the post: Russian hackers use ‘zero-day’ to hack NATO, Ukraine in cyber-spy campaign

A description from isightpartners (English), and description from Eset's blog (Russian).

Embedded OLE object in Power Point document somehow can download and install .inf files and executable files.


Efficacy of self-made ransomware protection

Yes it is completely unfeasible. Your suggestion bases on you knowing the contents of a particular file. You want to use this and the encrypted file to decrypt the other files. There would be two ways to approach this. One would be to use weaknesses of the encryption algorithm in a known plaintext attack, the second, which you are addressing in your last paragraph, would be trying every key in a brute-force attack. However, both approaches can be rendered practically impossible. Brute force is hopeless with a large enough keyspace, and known plaintext attacks don't work on sophisticated algorithms like RSA. So when your ransomware is "well" implemented, it can indeed lock up your data in a way nobody except the ransomware writer can decrypt it.

Btw, knowing the encryption algorithm for any system is not supposed to weaken it. In fact, public (agreed-upon) algoritms are considered stronger as they can be reviewed by researchers around the globe. Its unlikely you can afford similar reviews for your secret algorithm.

Best ransomware protection are offline backups. Online backups (drive always connected to computer, automatically mounted NAS, etc.) won't help as they are likely to be be accessed by the ransomware. Only exception are online services like Dropbox which store file history.


Is it possible to hide my physical location from my ISP?

With few exceptions, your ISP most certainly can - and in all likelihood probably does - know your physical location at any given time. This stems from two general facts:

They are providing a service that you signed up for. During the subscription process, you most likely already gave them your location for installation and/or billing purposes.
They most likely own the infrastructure devices that are directly connected to your device, or the gateway device you're connecting to.

Essentially, the only relatively convenient, usually legal, and reasonably inexpensive way to avoid location tracking by your ISP is to not use your ISP. This means hooking up to the Internet at a friend's house, or some other location that provides free or guest network access. Unfortunately, that also means never using the Internet from home or on your cell phone.

Breaking this down into a bit more detail, you'll see how it's quite clear that your ISP not only can but most often must be capable of knowing your physical location. There are a few ways to get around this, but they're generally inconvenient, costly, and/or illegal.

1. Billing

Apart from courtesy "guest networks", Internet services are rarely just given away for free. (Even most guest networks aren't really free, or at least not intended to be - you're just not paying for the Internet service explicitly.) So, the ISP must have some way of charging you for the service.

Unless your ISP permits you to physically visit their offices and pay them in cash every month, the billing process will usually require some collection of personal information. Normally, this includes the mailing address that is associated with your payment mechanism. For most people, this also happens to be their business or residential address. In the case of non-wireless services, this is also probably the location from which you'll be consuming the service (i.e.: connecting to the Internet).

In some cases, you may be able to avoid giving away your physical location through billing processes. For example, you could use a P.O. Box as your mailing address. However, some ISPs and/or payment providers (e.g.: credit card companies or banks) may not permit this.

2. Installation

Non-wireless broadband Internet services generally require some amount of equipment to be installed, or special cables run, at the location from which the services will be used. This necessitates telling the ISP where you're going to be connecting from, so that they can send technicians out to set up the devices and cables necessary for you to connect.

You can get around this by using wireless services, such as your cellular phone provider, but these connections are usually slower and less reliable and they often can still be traced. Another work-around could be using dial-up connections, but these will likely be even slower and again are still not immune to other tracking mechanisms.

3. Emergency Services

If your ISP is also providing cellular, VoIP, or other phone services, they may be required by law to know your location in order to properly route emergency calls and direct police and rescue personnel to you when needed.

One way that providers may do this is through a GPS receiver in the device that is used to initiate the emergency call. In the case of VoIP services, the receiver may be built into the VoIP gateway. This is why some providers will recommend that you place your gateway device near a window during setup (if not permanently) - that enables the built-in GPS receiver to have better visibility to the satellites required to determine its location.

You could try to negate the GPS lock by use of a Faraday cage or other GPS-opaque structure over the gateway device. However, if your service is coming through a wireless connection, this will most likely degrade or flat-out kill your Internet link as well. Besides, if a GPS lock is not available (or the system isn't using GPS to begin with) the provider will usually fall back to mechanisms listed in other sections of this answer.

4. Subscriber Authentication

When you connect to your ISP, the network will need some way of authenticating you before providing service. This allows them to verify that you are indeed one of their customers, and to determine what quality of service (e.g.: bandwidth allowances and caps) they should provide to the connection per the terms of your subscription.

This is practically unavoidable, without illegally hijacking someone else's authenticators. While it may not necessarily provide your ISP with your location directly, (except perhaps by way of items 1 and 2) it does enable the ISP to associate location data gathered from other sources (e.g.: items 3 and 5) with your identity.

5. ISP-Owned Infrastructure

This is the piece that is probably the hardest and most expensive to avoid, and is effectively the whole reason you have to pay someone else for Internet service. Chances are, the device that your system is directly connected to (if not, then probably the first hop outside of your LAN) is owned and maintained by your ISP.

Your ISP probably also controls the next few devices after that, and these devices are not likely to be easily accessible - lat alone movable - by you. By the very nature of their business, the ISP must know the locations of these devices in order to maintain and repair them in a timely fashion when needed. If these devices aren't actually in the same room or building you are in, they are still probably very close to you - within a couple miles or less.

This applies to most wired and wireless broadband services. For wired services, the "gateway" device that is on-premises is usually provided and maintained by the ISP. If not, then it will be the next hop after that and a few more from there.

For wireless services, the ISP will usually own the transceivers (e.g.: cell towers) that your device is directly communicating with. If your device is only within range of one or two provider-owned transceivers, they may not be able to pinpoint you very closely. Three or more, and they can usually nail you down pretty well. (Of course, your device is only ever actually using one of the ISP's transceivers at a given time, but they will often have several within "listening" range of your device in order to have good service coverage.)

The workarounds for this are usually fairly expensive, very inconvenient, or flat-out illegal. In some cases, it may be just plain impossible. Essentially, they all entail getting your device off of ISP-owned infrastructure for at least the first hop past your LAN.

For wired connections, this tracking will often not be avoidable because the gateway links that your device needs to connect to are unreachable outside of the ISP's networks. A likely exception to this would be dial-up networks. However, these links tend to be very slow and they are usually still traceable to some extent via Caller ID. (Caller ID can be spoofed, but that is often illegal.)

For wireless connections, avoiding ISP-owned infrastructure usually necessitates substantial physical relocation (or subscribing to a provider who does not have transceivers near your usual location) and will often incur additional fees (typically called "data roaming charges" or similar) as well as service degradation and/or limitation. If the wireless service is through a device also used to make phone calls (as most wireless Internet services tend to be), trying to avoid ISP collection of location data like this could ultimately be foiled by item 3 above anyway.


It ultimately depends on what you mean by "being monitored".

Here is a list of checks that you may need to make:

- Does the workstation respect its logging / policy configuration? Normally you should be able to trust that this is the case, i.e. that it raises the events that you expect given the configuration. There might be surprises in store though: I experienced the case where failed login was not getting logged - because we were using smartcards and the smartcard integration with Windows did not allow this event to be raised (the Bad PIN login failure was handled inside the smartcard and not exposed to the operating system)

- Has the workstation got the right logging / policy configuration? This depends on your requirements. I would verify that the configuration is applied correctly using a combination of provoking a subset of events that it is easy to provoke (successful login, failed login, for example), and examination of the security policy in the workstation local policy.

- Are workstation events being centralised to ArcSight? If you create an Active Channel from the smart connector that is monitoring the workstations, you should be able to see whether there are any events originating from each workstation.

- Is ArcSight filtering any events out at the point of import? Examine the smart connector configuration in ArcSight: you can check this from the Default tab of the configuration, then the Filter tab.

- Is ArcSight configured to react to particular events or chains of event? This depends on what correlation rules you have configured. The rule Conditions need to encompass workstation events. Only you know what you need to monitor. I presume you have been through the process of deciding this and then defining the correlation rules accordingly. If you want to test your rule set independently of the operational system, using synthetic events, then I believe that ArcSight provides the means to do this in a "sandboxed" fashion.


WhatsApp e2e encryption when forwarding video files

It is likely implemented something like this*:

Alice sends video to Bob

Alice generates a Data Encryption Key (DEK) uses it to encrypt the video
The encrypted video is uploaded and given an id
Alice sends the DEK and video id to Bob using the normal end to end encrypted channel
Bob retrieves the video from the server and uses the DEK to decrypt it

Bob forwards the video to Charlie

Bob sends the DEK and video id to Charlie using the normal end to end encrypted channel

As you can see, this means the video encryption isn't the same as the normal end to end encryption used, but has the advantage that it can be further shared simply by sharing the key and video id, eliminating the need to re-upload the video. This does leak some metadata, as the video host will be able to see that different people are downloading the same video.

* I don't know how it's actually done, this is a guess based on your observation that forwarding is instant


My S/MIME certificate (created with OpenSSL) does not match my email address

A certificate binds a public key to an identity. The notion of identity that S/MIME uses is email addresses. Namely, for your certificate to be usable with S/MIME, it should contain your email address.

The email address can be added in the subject name (simple but officially deprecated), like this:

openssl req -x509 -nodes -days 365 -subj '/C=DE/ST=state/L=city/CN=Sven/emailAddress=sven@svenisgreat.com' -newkey rsa:1024 -keyout mycert.pem -out mycert.pem

or (the "normal solution", but more complex) as part of a "Subject Alt Name" extension (with OpenSSL, this requires using the -extensions flag and a configuration file; see the documentation).


Yes, cross signing is possible.

What you need to do is let A sign a CA certificate which

uses the same key as B
uses the same subject as B

(and vice versa). If those intermediate certificates are made available, then there are two possible chains for each end entity certificate signed by either A or B which end in either of your roots.


From the headers shared , the IP sending mail form GMX console is 74.208.4.XX, this pool of IP address belong to ISP: 1&1 Internet Inc.

There have been recent abuse(Spam) reports from this pool of IPs. Might be the tenent of the IP 74.208.4.xx is using GMX to send you the mails.

Request you to report to GMX and the ISP regarding this abuse.

There is a strong possibility that the IP 74.208.4.xx is compromised.


Can SHA256 signature support be deduced from TLS cipher suites or any other part of ClientHello (if no signature_algorithm sent)?

The only reliable places to know which signature algorithms are supported you've already detected:

the signature_algorithms extension
and the TLS version offered by the client, which shows that the client implements (hopefully) at least the minimum requirements of this TLS version

Everything else is guessing. You might try to fingerprint the client based on the ciphers offered and on the order of the ciphers (see the SSLLabs client tests). You might add use of other extensions like SNI to the fingerprint. And then you could map the fingerprint to the supported signatures.

But I would recommend against such unreliable hacks. Lots of big sites like Facebook move or moved already to SHA-256 and those will break every client which does not support these signature algorithms. This should put a lot of pressure on the clients to support SHA-256.


Downloaded and (possibly) opened a .scr file. What did it do to my PC (report attached)

To give a more general explanation for those finding this question via google:

.scr files are a special variant of windows executable (like an .exe file) originally meant for windows screensaver modules. Once executed (directly or after having been configured to run via control panel), these can do everything (including damage) a windows application running under that user account could do.

The fact these are often misunderstood as a kind of video or data file by the average user (who understands that an .exe file from a doubtful source can be bad news) is nowadays used to spread malware.


LVM encryption would work, and probably other alternatives too (like truecrypt)

Hard to tell which one would be the best, since one might be easier to setup, another one could be faster, and so on.

Since your goal is to protect sensitive information, and LVM enc. could do the job, I'd stick with it.

Just be carefull if you loose your notebook and then recover it. Someone could insert some pre-ubuntu-boot app that could steal your password before the ubuntu takes action, for example.


Is it bad to reveal random bytes from a system?

A secure CSPRNG, like the ones currently and historically used in Linux and most other Unix operating systems, should not leak information from its output.  In other words, exposing part of its output (by running cat /dev/urandom) should not tell you anything about the rest of its output (used by other programs on the system).
Linux uses a frequently reseeded ChaCha20 stream cipher, and other Unix-like systems use Fortuna or Yarrow.  All of these designs are constructed such that even if the state of the PRNG is exposed (which it could not be without access to the kernel), assuming the state stops being exposed and sufficient entropy is regained after that exposure, future outputs will become secure (unpredictable) once again.
Having said that, in general we assume if the attacker is root, that they can execute arbitrary code on the system, including in the kernel, and as such the state of the PRNG is compromised.  That isn't necessarily true; for example, most distros configure their kernels such that if Secure Boot is used, the kernel is locked down and root cannot read or write arbitrary kernel memory or load untrusted modules.  However, most folks working in security will assume that a root compromise implies a full system compromise including kernelspace.
If the attacker is not root, then the CSPRNG is probably secure.


KeepassXC gpg verification with sig file

In both cases - your example and the one linked - it is only showing the one key. The reason the latter example seems longer is not because it shows multiple keys concatenated together, but because in your case the key fingerprint was truncated (the full line 40 character line is the fingerprint, in case that wasn't clear). The fingerprint is a convenient way to identify keys, but you typically do not need to see the full fingerprint in order to figure out which key is being referenced from a known subset.

Your case:

  C1E4 CBA3 AD78 D3AF D894  F9E0 B7A6 6F03 B590 76A8

Their example:

  C1E4 CBA3 AD78 D3AF D894  F9E0 B7A6 6F03 B590 76A8

The flag "--keyid-format long" indicates that the output should be a 16 character key id, so you get 16 characters. (I'm not familiar enough with gpg to know if the output in their example is the full amount because the flag is not present, or if the default behavior is different in that version of gpg).


Do certificates protect the keys, really?

They give a pretty short and confusing explanation of what to do if this is supposed to be prescriptive advice.  But it is basically correct.

If you encrypt bulk data records you are probably using a symmetric encryption algorithm like AES because it is fast.  The keys associated with that encryption could then be asymmetrically encrypted using the public key associated with a certificate.  That would meant possession of the corresponding private key is required to decrypt the symmetric encryption keys to then decrypt the data records.

So to your question, the 'certificate' doesn't really protect the public/private key pair but the symmetric key(s), and your source seems to be glossing over the distinction.  You'd still need some way to protect your private key.


Are Windows Updates susceptible to tampering, eg. using a MiTM attack.

All updates are digitally signed by Microsoft's private key, you will get warnings if any updates are not signed, or signed with the wrong key. Even if a MiTM was able to send fake updates they'd be rejected by the update utility for that reason.


Monitor incoming TCP/UDP flood attack and graph it

PhpChart(http://phpchart.net/) if you got Apache server.

pChart(http://pchart.sourceforge.net/) if you are willing to compile php to work with graphic lib

MRTG if you just want a png / jpg files to put in simple html web page.

Simple bash script to count specific trafic with tcpdump. Send output to the file and count lines to pass to the rendering engine.

I use something like this:

#!/bin/bash

/usr/local/sbin/tcpdump -l icmp >> icmp.log &

pid=$!

# will monitor the traffic for 60 seconds
sleep 60
kill -9 $pid &> /dev/null

packets=$( cat icmp.log | wc -l );
echo $packets
rm icmp.log

This will monitor the icmp traffic for 60 seconds then echo the number of packets. Pass the output to the file and make the chosen rendering engine generate the picture.

<?php
require_once("../phpChartX/conf.php");
?>
<!DOCTYPE HTML>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>tcpdump</title>

<?php

$max=0;
$file=file_get_contents("scripts/icmp.1h");

$file=explode( "\n" , $file );

$o1=explode(" ", $file[0]);
$o2=explode(" ", $file[1]);
$o3=explode(" ", $file[2]);
$o4=explode(" ", $file[3]);
$o5=explode(" ", $file[4]);
$o6=explode(" ", $file[5]);
$o7=explode(" ", $file[6]);
$o8=explode(" ", $file[7]);
$o9=explode(" ", $file[8]);
$o10=explode(" ", $file[9]);
$o11=explode(" ", $file[10]);
$o12=explode(" ", $file[11]);
$o13=explode(" ", $file[12]);
$o14=explode(" ", $file[13]);
$o15=explode(" ", $file[14]);
$o16=explode(" ", $file[15]);
$o17=explode(" ", $file[16]);
$o18=explode(" ", $file[17]);
$o19=explode(" ", $file[18]);
$o20=explode(" ", $file[19]);
$o21=explode(" ", $file[20]);
$o22=explode(" ", $file[21]);
$o23=explode(" ", $file[22]);
$o24=explode(" ", $file[23]);

//$all=array( $o1, $o2, $o3, $o4, $o5, $o6, $o7, $o8, $o9, $o10, $o11, $o12, $o13, $o14, $o15, $o16, $o17, $o18, $o19, $o20, $o21, $o22, $o23, $o24 );
$all=array( $o24, $o23, $o22, $o21, $o20, $o19, $o18, $o17, $o16, $o15, $o14, $o13, $o12, $o11, $o10, $o9, $o8, $o7, $o6, $o5, $o4, $o3, $o2, $o1 );

for ( $i = 0; $i < 23; $i++ )
{
        if ( $all[$i][1] > $max  )
        {
                $max=$all[$i][1];
        }
}
$max=$max+2;

    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //Line 1 Example
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    $pc = new C_PhpChartX(array(
                                array(
                                        array(24-$o1[0], $o1[1]),
                                        array(24-$o2[0], $o2[1]),
                                        array(24-$o3[0], $o3[1]),
                                        array(24-$o4[0], $o4[1]),
                                        array(24-$o5[0], $o5[1]),
                                        array(24-$o6[0], $o6[1]),
                                        array(24-$o7[0], $o7[1]),
                                        array(24-$o8[0], $o8[1]),
                                        array(24-$o9[0], $o9[1]),
                                        array(24-$o10[0], $o10[1]),
                                        array(24-$o11[0], $o11[1]),
                                        array(24-$o12[0], $o12[1]),
                                        array(24-$o13[0], $o13[1]),
                                        array(24-$o14[0], $o14[1]),
                                        array(24-$o15[0], $o15[1]),
                                        array(24-$o16[0], $o16[1]),
                                        array(24-$o17[0], $o17[1]),
                                        array(24-$o18[0], $o18[1]),
                                        array(24-$o19[0], $o19[1]),
                                        array(24-$o20[0], $o20[1]),
                                        array(24-$o21[0], $o21[1]),
                                        array(24-$o22[0], $o22[1]),
                                        array(24-$o23[0], $o23[1]),

                                )),'chart1');

    $pc->set_title(array('text'=>'icmp'));
    $pc->set_axes(array('yaxis'=> array('numberTicks'=>round(($max+1)/2),'min'=>0,'max'=>$max,'show'=>'false'),'xaxis'=> array('min'=>1,'max'=>23,'numberTicks'$
$pc->set_grid(array('background'=>'#fefbf3','borderWidth'=>2.5));
$pc->add_series(array('color'=>'rgba(68, 124, 147, 0.7)'));
$pc->set_series_default(array('fill'=>true,'shadow'=>false,'showMarker'=>false));
    $pc->draw(600,200);

?>

This is what i use to render the data (phpChart). It has 60 markers - one for each minute.
Hope this will help.


Fastest public-key algorithm for testing purposes

That's going to vary from machine to machine and GPG binary to GPG binary; does the machine offer AES-NI instructions, does your GPG binary use them, is it using 64-bit operations, are XOP or AVX instructions available and used by your binary, etc.

There is only one answer: benchmark it on your particular setup!

Daniel Kahn Gillmor posted just such a benchmark script on the gnupg users list in 2010, including a SHA1 sum and a signature, naturally.

Note that output is from the Unix time command, formatted as + in seconds.

If you want something different, then modify the script!

#!/bin/sh

# Author: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
# Date: Tue, 28 Sep 2010 14:25:19 -0400

# This script produces some roughly-formatted OpenPGP performance data
# against different algorithms and keysizes

set -e

REPEAT=100
ASYM_ALGOS="RSA DSA"
KEY_SIZES="1024 2048 3072 4096"
DIGESTS="SHA1 SHA224 SHA256 SHA384 SHA512"
CIPHERS="3DES AES AES192 AES256"

if gpg --debug-quick-random --version >/dev/null 2>/dev/null ; then
    QUICKRANDOM=--debug-quick-random
elif gpg --quick-random --version >/dev/null 2>/dev/null ; then
    QUICKRANDOM=--quick-random
else
    printf "don't know how to set quick random number generation"
    exit 2
fi

encalgo() {
    if [ "$1" = "DSA" ]; then
    printf "ELG-E"
    else
    printf "%s" "$1"
    fi
}

describe_system() {
    # FIXME: this is fairly Linux-specific.  it'd be better to use
    # something more generic to get info about the CPU and RAM
    # available:
    cat /proc/cpuinfo 2>&1 || :
    free 2>&1 || :
    uname -a
    gpg --version
}

# quick key creation:
setup() {
    rm -f testmsg
    for rep in $(seq 1 25) ; do
    echo "this is a test message for benchmarking OpenPGP signature validation times." >> testmsg
    done
    for algo in $ASYM_ALGOS; do
    for size in $KEY_SIZES; do
        if [ "$algo" = "DSA" ] && [ "$size" -gt 3072 ]; then
        # gpg can't do DSA > 3072 bits
        continue
        fi
        mkdir -m 0700 -p ${algo}-${size}
        if printf 'Key-Type: %s
Key-Length: %s
Key-Usage: sign
Subkey-Type: %s
Subkey-Length: %s
Subkey-Usage: encrypt
Name-Real: OpenPGP Benchmark Key %s %s bits
Name-Comment: DO NOT USE!
' "$algo" "$size" $(encalgo "$algo") "$size" "$algo" "$size" | GNUPGHOME=${algo}-${size} gpg $QUICKRANDOM --batch --gen-key ; then
        for digest in $DIGESTS; do
            output=${algo}-${size}/testmsg.${algo}-${size}-${digest}.asc
            if ! GNUPGHOME=${algo}-${size} gpg --digest-algo "$digest" --clearsign < testmsg > ${output} ; then
            rm -f ${output}
            fi
        done

        for cipher in $CIPHERS; do
            output=${algo}-${size}/testmsg.${algo}-${size}-${cipher}.asc
            if ! GNUPGHOME=${algo}-${size} gpg --armor --cipher-algo "$cipher" --encrypt -r 'Benchmark' < testmsg > ${output} ; then
            rm -f ${output}
            fi
        done
        else
        rm -rf ${algo}-${size}
        fi
    done
    done
}

signing() {
    for algo in $ASYM_ALGOS ; do
    printf '%s Signing (x%d)\n' $algo $REPEAT
    for length in 'digest:' $KEY_SIZES; do
        if [ -d "${algo}-${length}" ] || [ "$length" = 'digest:' ]; then
        printf '%s\t' "$length"
        for digest in $DIGESTS; do
            if [ "$length" = 'digest:' ]; then
            printf '%s\t' "$digest"
            else
            for x in ${algo}-${length}/*; do
                cat < "$x" > /dev/null
            done
            targfile=${algo}-${length}/testmsg.${algo}-${length}-${digest}.asc
            if [ -e $targfile ]; then
                stats=$(bash -c "time -p for seq in $(seq 1 $REPEAT | tr '\n' ' '); do
GNUPGHOME=${algo}-${length} gpg --digest-algo $digest --sign >/dev/null 2>/dev/null < ./testmsg
done" 2>&1)
                printf '%s+%s\t' $(printf "%s" "$stats" | grep ^user | cut -f2 -d' ') $(printf "%s" "$stats" | grep ^sys | cut -f2 -d' ')
            else
                printf 'X\t'
            fi
            fi
        done
        printf '\n'
        fi
    done
    done
}

verifying() {
    for algo in $ASYM_ALGOS ; do
    printf '%s Verifying (x%d)\n' $algo $REPEAT
    for length in 'digest:' $KEY_SIZES; do
        if [ -d "${algo}-${length}" ] || [ "$length" = 'digest:' ]; then
        printf '%s\t' "$length"
        for digest in $DIGESTS; do
            if [ "$length" = 'digest:' ]; then
            printf '%s\t' "$digest"
            else
            for x in ${algo}-${length}/*; do
                cat < "$x" > /dev/null
            done
            targfile=${algo}-${length}/testmsg.${algo}-${length}-${digest}.asc
            if [ -e $targfile ]; then
                stats=$(bash -c "time -p for seq in $(seq 1 $REPEAT | tr '\n' ' '); do
GNUPGHOME=${algo}-${length} gpg --verify >/dev/null 2>/dev/null < $targfile
done" 2>&1)
                printf '%s+%s\t' $(printf "%s" "$stats" | grep ^user | cut -f2 -d' ') $(printf "%s" "$stats" | grep ^sys | cut -f2 -d' ')
            else
                printf 'X\t'
            fi
            fi
        done
        printf '\n'
        fi
    done
    done
}

encrypting() {
    for algo in $ASYM_ALGOS ; do
    printf '%s Encrypting (x%s)\n' $(encalgo "$algo") $REPEAT
    for length in 'cipher:' $KEY_SIZES; do
        if [ -d "${algo}-${length}" ] || [ "$length" = 'cipher:' ]; then
        printf '%s\t' "$length"
        for cipher in $CIPHERS; do
            if [ "$length" = 'cipher:' ]; then
            printf '%s\t' "$cipher"
            else
            for x in ${algo}-${length}/*; do
                cat < "$x" > /dev/null
            done
            targfile=${algo}-${length}/testmsg.${algo}-${length}-${cipher}.asc
            if [ -e $targfile ]; then
                stats=$(bash -c "time -p for seq in $(seq 1 $REPEAT | tr '\n' ' '); do
GNUPGHOME=${algo}-${length} gpg --cipher-algo $cipher --encrypt -r Benchmark >/dev/null 2>/dev/null < ./testmsg
done" 2>&1)
                printf '%s+%s\t' $(printf "%s" "$stats" | grep ^user | cut -f2 -d' ') $(printf "%s" "$stats" | grep ^sys | cut -f2 -d' ')
            else
                printf 'X\t'
            fi
            fi
        done
        printf '\n'
        fi
    done
    done
}

decrypting() {
    for algo in $ASYM_ALGOS ; do
    printf '%s Decrypting (x%s)\n' $(encalgo "$algo") $REPEAT
    for length in 'cipher:' $KEY_SIZES; do
        if [ -d "${algo}-${length}" ] || [ "$length" = 'cipher:' ]; then
        printf '%s\t' "$length"
        for cipher in $CIPHERS; do
            if [ "$length" = 'cipher:' ]; then
            printf '%s\t' "$cipher"
            else
            for x in ${algo}-${length}/*; do
                cat < "$x" > /dev/null
            done
            targfile=${algo}-${length}/testmsg.${algo}-${length}-${cipher}.asc
            if [ -e $targfile ]; then
                stats=$(bash -c "time -p for seq in $(seq 1 $REPEAT | tr '\n' ' '); do
GNUPGHOME=${algo}-${length} gpg --decrypt >/dev/null 2>/dev/null < $targfile
done" 2>&1)
                printf '%s+%s\t' $(printf "%s" "$stats" | grep ^user | cut -f2 -d' ') $(printf "%s" "$stats" | grep ^sys | cut -f2 -d' ')
            else
                printf 'X\t'
            fi
            fi
        done
        printf '\n'
        fi
    done
    done
}

run() {
    WORKDIR=$(mktemp -d "${TMPDIR:-/tmp}/openpgp-benchmark.XXXXXX")
    OUTPUT=$(mktemp "$(pwd)/openpgp-benchmark.$(date +%F_%T | tr ':' '-').XXXXXX")
    printf 'Working in %s...\n' "$WORKDIR"
    cd "$WORKDIR"
    ( describe_system
        setup
        signing
        verifying
        encrypting
        decrypting ) | tee "$OUTPUT"
    printf 'log written to %s...\nPlease mail back to Daniel Kahn Gillmor <dkg@fifthhorseman.net>.\n' "$OUTPUT"
}

action="$1"
if [ "x$action" = "x" ]; then
    action=run
fi

case "$action" in
    setup|describe_system|signing|verifying|encrypting|run)
        "$action"
        ;;
    *)
        echo "Usage: $0 [setup|describe_system|signing|verifying|encrypting|run]  " >&2
        exit 2
        ;;
esac


How do hackers obtain the memory addresses of variables?

Start the program and use a debugger to find the memory locations. You base your hack around these locations. You then use this hack on a remote system and hope the locations are the same. There are many anti-exploitation defences though, so be careful, but there are also better hacking techniques to get around them. Hope this was helpful.


Is identification with NFC bank cards feasible?

The only thing available to you via a contactless bank card is an ID number (of the card). To get more, you have to follow the appropriate guidelines and security of the contactless cards.

This means that, while you can get the ID of the card, you cannot make further assumptions. It certainly doesn't provide a lot of security.

Having said that, there are plenty of applications that do use this method. The most common being "follow-me" printing and room booking systems (the ones that have screens outside the rooms). Both of these types of system common use the minimal data from the card. You register your card against your user id. This is fine since the risks of compromise are very low.

As always, this comes down to a risk analysis.


I am assuming that you are here talking about the "TDE" feature provided by Microsoft SQL Server.

TDE means Transparent Data Encryption, emphasis on "transparent". This is an encryption layer applied on data as it is stored; every single byte that SQL Server manages is encrypted before being written on disk, and decrypted when read. Applications which use SQL Server need not be aware of that process; it is a matter which resides purely in the dialogue between SQL Server and its storage files. Hence the transparency. The nice side of it is that it is easy to apply, and performs very well (small to negligible CPU overhead, no extra I/O, no extra space...). The dark side is that SQL Server itself, not the application, is the gatekeeper: whoever is granted access by SQL Server will be able to see the clear data.

For PCI compliance, see this document which includes this paragraph (at the end):

  Some cryptography solutions encrypt specific fields of informatio
  n stored in a database; others
  encrypt a singular file or even the entire disk where data is stored. If full-disk encryption is used,
  logical access must be managed independently of native operating system access control
  mechanisms. Decryption keys must not be tied to user accounts. Encryption keys used for
  encryption of cardholder data must be protected against both disclosure and misuse. All key
  management processes and procedures for keys used for encryption of cardholder data must be
  fully documented and implemented. For more details, see PCI DSS Requirement 3.

"Full-disk encryption" is what applies to TDE (TDE is nominally applied on files, but all of them). In TDE, the actual encryption key is managed by SQL Server, who will grant or not-grant logical access to users based on... its configuration, which may or may not map on user accounts. So I would say that whether TDE grants PCI compliance depends on how it is used.

I am not entitled to give a definitive answer on how PCI compliance can be achieved with TDE, but I note that the Wikipedia page includes an encouraging excerpt: "Enterprises typically employ TDE to solve compliance issues such as PCI DSS." So it can be surmised that meeting PCI requirements with TDE is possible, or at least many people appear firmly convinced that it is possible, which is almost as good.

Microsoft has documentation on how SQL Server should be configured and used in a compliance context. They also have a Webcast which may include a lot of useful information (I have not viewed it).


What's the security risk in password recovery attempts

Hacker's often test password recovery systems for possible account enumeration weaknesses. Though a bad design decision or misconfiguration, a password recovery can reveal the existance of a user account. Then a list of valid user accounts can be used later in a brute force attack.
An attacker may test if there are different responses for valid and invalid usernames. They may record the time it took for the application to respond, to identify valid and invalid accounts.
Besides account enumeration, an attacker may test a password recovery for SQL Injection vulnerabilities. Can they insert malicious code server-side by crafting a SQL query in the password recovery username/e-mail field for example.


If a bank says they do not have my login and password info, is that true?

Your bank probably don't have access to your plain text password but it isn't as simple as that.

It is unlikely that your bank store your password in plain text, so it would be a non-trivial task for them to look up your username and password and then login.

However, there are many other potential causes that could lead to an illegitimate transfer from your account - anything from vulnerable systems to rogue bank employees.

If your bank is claiming that they witnessed a login using your username and password that led to the transfer then the question of who's responsible will depend on your bank's fraud policy and the laws of the country you live in.

However, it does sound like you are describing a possible breach of your security so you should take immediate steps to fix this.


Sudo has no real security purpose against a malicious third-party. So yes, it is basically useless for that purpose. In the past I believed it was actually a security control to prevent escalation of privilege and make attacks harder, because some people keep on insisting it also has that purpose, but that's actually false. In fact, at the moment you only got one answer to your question, and that answer is propagating that myth. The only purpose of sudo is to protect you from yourself, that is, to avoid messing up your system by mistake. Gaining all the privileges with one click or one key press might be dangerous, while sudo will at least force you to consciously type your password. And if you (or a program or script) ends up touching system files or other users' files by mistake, without consciously using sudo, you will get a "permission denied" notice. So in the end it's just an administration tool, and not actually a security control meant to protect you from an attack.

Here's a very basic example of why sudo offers no real protection against malicious code:

# Create payload: replace sudo with an alias
payload='
    fake_sudo() {
        # Simulate a sudo prompt
        echo -n "[sudo] password for ${USER}: "
        read -s password
        echo
        # Run your command so you are happy
        echo "$password" | sudo -S "$@"
        # Do my evil stuff with your password
        echo "Done with your command, now I could use $password to do what I want"
    }
    alias sudo=fake_sudo
'

# Write the payload to the bashrc config file
echo "$payload" >> ~/.bashrc

That is a very basic example of code that an attacker could run on your machine. It's not perfect, it doesn't even handle every case (it won't work well if you enter the wrong password), but it just shows you that sudo can be replaced by an attacker. If you run that script, the next time you open your terminal and run sudo you will actually be running fake_sudo. An attacker can replace your programs with aliases, or replace the binary files (putting malicious versions in ~/bin or wherever they can be executed in your path), etc.

This is not even a real "escalation of privilege", because a user that can run sudo to become root already has the all the privileges. A real unprivileged user should not have sudo capabilities. To have a real separation of privileges you should run administration stuff on a totally separate account.


Should reverse connections be used to bypass NATs?

Having the client connect is the standard way of dealing with NATted connections. It can  also known as a 'Reverse Shell'.

BTW, I know you probably want to write your own RAT, but Metasploit might be a very effective demonstration ....


Potentially yes, the hash could indeed be stored in a database for malicious use.

Never input your password into a third party website unless you trust the provider of the service AND the service is using some sort of authentiation/encryption scheme(SSL, HTTPS).

You could easily generate your own hashes on your own system, using MD5 libraries of various programming languages.


Is it a security risk to give out ssh key and one of or both public and private keys to my webhosting provider?

The note at the bottom of your screenshot is says:

  Note: you don't have to import both keys. It is perfectly acceptable to just import a public OR private key if that is al you need on this server.

So it depends on what you need the keys for.

To log in to a server you only need to upload your public key (to an ~/.ssh/authorized_keys file or the equivalent), but when you're going to authenticate from that server to other services, a private key may be needed. (One scenario is for instance when you download code from a repository with git and authenticate with a private key file...)

Please note that cPanel is designed to simplify the process of managing a domain and hosting a web site to the website owner or the "end user" not for security experts, power users  and expert system administrators.

In that context offering the option to generate and manage SSH keys server-side from a web panel and providing an option to convert between the openssh format and PuTTY pkk files is, although not the most secure, a reasonable compromise between usability and security. It is certainly a big step up from authenticating with usernames and passwords over plain text FTP which was the standard in web hosting for far too long.


I don't believe the above solutions work very effectively individually. What I have noticed is that even if I use a different browser, I still get the same video suggestions when I sign in elsewhere. I think in addition to the above options, they also use the IP address to associate you with the videos you watch. So far the best way I've found is to use a VPN while watching youtube. The drawback is the streaming speed of course.


Traditionally a virus is malware which uses the infected host to replicate itself to other systems, i.e. by infecting files which might get shared, copying itself to network drives or USB sticks. It gets usually not knowingly executed by the user but gets executed when the user opens an infected file, runs an infected program etc.

A trojan is a malware which claims to be something different, like some malware claiming to be a virus scanner. It counts on the user to execute it knowingly by believing what the software claims to be.

In common language often any kind of malware is simply called virus, i.e. real viruses, trojans, ransomware etc. For example a virus scanner also cares about all types of malware, not only viruses.


Does adding a recovery phone number to a Gmail account make it less secure, in the case that I lose both my laptop and phone?

Laptop
If you use proper password on your laptop, then guessing it can take millions of years. The more realistic scenario would be to shut your laptop down, extract disk, read it in some other system. If your file system is not encrypted, then the attacker may read cookies and try to restore your session. If your laptop was stolen by some occasional people, not by some prepared attacker, it may take several days, until somebody get access to the data on your disk. You will have a lot of time to reset password.
Phone
If it is not some special agency, the chances to unlock your phone for occasional people are very low. You will have a lot of time to reset password.
When phone is needed?
Now suppose somebody has noticed the password you have typed, e.g. by recording you on smartphone during login. If they want to use your password, Google will see that IP or device has changed and will request confirmation and can send a request to your smartphone. You will just tell Google it was not you and the attacker will not be allowed to log in, or if logged it, will be logged out. Where as without phone the attacker would get normal access to your account.
TLDR
Your assumptions about compromising your account via stolen laptop ad phone are not quite correct. The problems without having any phone attached to the account can be more serious than in case of having it attached. That's why I would suggest to attach a phone to the account.


Interesting stuff. Should be rather flattering to become the target I suppose.

I've never caught anybody like that. Frankly I think the operative line is sample@email.tst'"()&%j9ml(9550) where they are apparently attempting to execute a function named "j9ml". Not exactly sure though. I wouldn't worry about it too much unless you need to maintain an ultra secure blog or there is egg on your face (spam happening or whatever).

I agree with @jcaron that the best defense is parameterizing all queries and stored procedures. Which is to say that you should use the question mark syntax which quotes all user inputs and will prevent this kind of attack.

Important to also acknowledge that it may not be a malicious attack. The kid is probably just playing around. Could conceivably even be an assignment, executing a function on a site is not necessarily malicious or illegal I don't think.


I suggest that you familiarize yourself with Popek and Goldberg's virtualization requirements.

In particular, the VMX instructions are sensitive instructions: they can provide privileged access to devices and system resources.  Therefore, access to the VMX instructions must be controlled.  If those instructions did not trap, and there were no other special provisions made, there would be no way to control access to those instructions.  In particular, in a trap-and-emulate architecture for virtualization, we need to ensure that those instructions trigger a trap, so that the VMM can emulate them properly when the guest executes one of them.

If they did not trap, and if no other special provisions were made, it could open up a security hole.  It could also cause a loss of fidelity for virtualized guests.

You might also be interested in learning about nested virtualized (aka recursive virtualization).


Help with successful Internal intrusions

The addresses seem to be hex-encoded numbers. The first is 20 bit and the second 64 bit (only the lower 48 bit are used). The first one is 777016 in decimal and the second 140735219692200.

They are unlikely to be network addresses. the first one is too large to be a port and too small to be an IP address. The second is too large to be an IPv4 address and too small for an IPv6 address.

But they could be 64bit memory addresses where the first one omits leading zeros. The attacker might have tried to exploit a vulnerability in the system(s) which required to know the exact location in the system memory of something he wanted to read or manipulate. He found these addresses somehow and wrote them down.

The second, however, is much too large for that. It would imply over 100 TB of memory.


HSTS preload and requisites on domain - subdomains must be added too?

If I recall correctly, when HSTS preload was launched, it did not need to have subdomains included.

Now, the requirements state :

  Serve all subdomains over HTTPS. In particular, you must support HTTPS
  for the www subdomain if a DNS record for that subdomain exists.

  Serve an HSTS header on the base domain for HTTPS requests:

  The max-age must be at least 31536000 seconds (1 year).
  The includeSubDomains directive must be specified.
  The preload directive must be specified.
  If you are serving an additional redirect from your HTTPS site, that redirect must still have the HSTS header (rather than the page it redirects to).

BUT, how are they going to check this ?

Say you want to register "example.com" but not "vuln.example.com" and other subdomains. I would recommend you trying :

Do not include subdomains in your DNS, but do a redirect upon request from your server
In your headers, do not include "subdomains"
on https://hstspreload.org Register only "example.com", and "www.example.com" if you have an entry for this in your DNS and do not register for subdomains

Then, if on hstspreload.org they tell you can't submit for your domain because subdomains is not included, I guess you're scr***d. :/

Please share if you manage to do it ! :)


PHP: password_hash() - do I need to define the cost?

According to the documentation for password_hash(), the default cost is 10. On my machine this takes about 60 ms to compute. While better than a non-adaptive hash function (think plain SHA1 or MD5), I'd prefer that be closer to 500-800ms (cost 13 on my machine). The general recommendation I make is to run some measurements on your production servers and set the cost to whatever you feel like you can reasonably handle without impacting the UX too much.


Why does Bouncy Castle have a separate download for the IDEA algorithm?

In some countries, IDEA is patented and redistributing an implementation of it requires it to be licensed. IDEA was a default cipher used in early versions of PGP. For backward compatibility, it is included in OpenPGP which Bouncy Castle implements.

For your case (a new application), get the distribution without it and use AES instead.


Will encrypted files on a volume still be encrypted when uploaded to a cloud service?

In most of the EFS solutions, the file is unencrypted before going to the memory, meaning that if you upload a file to a cloud platform, it will be decrypted in your computer's memory before being uploaded on the website.

What you may do is create an folder in your computer mapped to the DropBox folder you want to use. Then you use a solution such Veracrypt to create an encrypted volume inside the dropbox folder (which is mapped in your computer). In this way, the dropbox will see only a large encrypted file, while you will be able to decrypt it from your computer.


What is the format of an RSA public key?

$ cat > foo.txt
-----BEGIN PUBLIC KEY-----
MIIBBgKBgDI/ranPo8MDfguQfSzqg7mtNlUJLLBK7tlVALyk42agbLTSFcZbs9Yw
t3nSe9yNzZB9ZVrL3O9GXkEb6xvj3dqrog+wWOeFCqNV7BuJNYYC/ef4vlnUFQdw
yswbd7d198qjWBZ7MiZRXxX8qKRln+osTvsDYOMZk93k0cGZgyuJAoGAHkgFohgA
nH93kDPjN4sHaT9WsmZ4ailbMtcnWuLizTRJ2sdGjNrpuwT1R+x1nlYHOeDUSOu6
De0kQJX+HZuQCoha6THsdgcV297krN22FwsDZ1PItXLIr5oC7zcNQaDyAJOIv6BC
ufHQ0IR+L9b9esniMbF8yV0d7EVAaBJiyRk=
-----END PUBLIC KEY-----
$ openssl asn1parse -i -in foo.txt
    0:d=0  hl=4 l= 262 cons: SEQUENCE
    4:d=1  hl=3 l= 128 prim:  INTEGER           :323FADA9CFA3C3037E0B907D2CEA83B9AD3655092CB04AEED95500BCA4E366A06CB4D215C65BB3D630B779D27BDC8DCD907D655ACBDCEF465E411BEB1BE3DDDAABA20FB058E7850AA355EC1B89358602FDE7F8BE59D4150770CACC1B77B775F7CAA358167B3226515F15FCA8A4659FEA2C4EFB0360E31993DDE4D1C199832B89
  135:d=1  hl=3 l= 128 prim:  INTEGER           :1E4805A218009C7F779033E3378B07693F56B266786A295B32D7275AE2E2CD3449DAC7468CDAE9BB04F547EC759E560739E0D448EBBA0DED244095FE1D9B900A885AE931EC760715DBDEE4ACDDB6170B036753C8B572C8AF9A02EF370D41A0F2009388BFA042B9F1D0D0847E2FD6FD7AC9E231B17CC95D1DEC4540681262C919

There you go. I used these commands on a fairly regular Linux system.

Note that your file is weird. A RSA public key consists in two integers, the modulus (n) and the public exponent (e). It is normally encoded as an ASN.1 structure that is a SEQUENCE of two INTEGER values. That structure is then supposed to be DER-encoded, and the resulting sequence of bytes to become the contents of a BIT STRING in another, outer ASN.1 structure that also contains an explicit identifier for the key type (i.e. an indication that the key is really of type RSA). In your case, that outer structure is missing, so there is formally no indication, neither in the encoded ASN.1 structure, nor in the PEM header ("BEGIN PUBLIC KEY"), that the key is a RSA key.

As a RSA key, it looks a bit strange too. The first integer, purportedly the modulus, has length 1022 bits, which is not very common (developers and cryptographers really love powers of 2, so they won't accept a 1022-bit integer if there is any possibility that they could make a 1024-bit integer). The second integer, the public exponent, is quite large (1021 bits); this is formally supported by RSA, but very rare: public exponents can be very short with no ill effect on security, and this makes public key operations much faster, so there is no real reason for using a large exponent. Some widespread implementations (Windows CryptoAPI...) don't even support public exponents larger than 32 bits.

If what you have is really a RSA public key, then chances are that someone is pulling your leg -- or is doing things in uncommon and probably weak ways.


First time penetration testing code check

Without seeing the code it's impossible to say for sure what is going on.  Based on my own experience I suspect the following is what is happening.

Lets say you have a vulnerable piece of code that defines a query to be executed in the db like follows:

string commandText = "SELECT id from users where name = '" + tb_Name.text + "';

If you then pass in your attack string, commandText will become:

SELECT id from users where name = 'INSERT INTO Uploads VALUES ('Name'); DROP TABLE Upload --'

If you look closely at this sql string you can see that the first string it interperpates is INSERT INTO Uploads VALUES ( it then encounters Name which is not a string which is most likely why you are seeing the error you see.

If you instead change your attack string to:

'; DROP TABLE Upload;--

The commandText (in this specific example) would become:

SELECT id from users where name = ''; DROP TABLE Upload;--'

Which would be a valid attack baring permissions being set correctly.

Anyway - hope this helps clarify things.  The best way to become more familiar with this stuff is to spend a few years doing full stack web development.  You can jump in midstream, but you will lack the depth of knowledge that is often required to be a good pen tester.


If you're going to access to your CCTV system from your office, you have to configure it with a public IP address (available from any part of the world), and about security risks, it depends, if your camera is password protected the risk is lower, otherwise anyone with the public IP address can see the same images that you see, and your CCTV is could to end up like the ones in this Google dork: intitle:"Live View / – AXIS". If you expose some resource on the Internet, there will always be a risk.


EIP pointer is overwritten but EBP remains intact

Well, registers are not values in the memory waiting to be overwritten by your buffer!

In the context of a buffer overflow, you do not simply keep writing until you reach some EIP register "location": instead, you replace values on the stack and one of them may end up being the return address of your function. After you've overwritten the stack, the execution resumes as if nothing had happened. The instructions are carried on, and depending on what they are, EBP may or may not be modified.

Finally, provided no exception has occurred in between, you reach the ret of the function. That's when the return value is read from the stack and moved to EIP.

So in your case, if the ret instruction is never reached, there are still some ways to get command execution. The most likely candidate here is through SEH manipulation.

Have fun!


Is using 'echo' to display attacker-controlled data on the terminal dangerous?

Is it possible for an attacker, regardless of how unlikely it would be, to exploit this somehow by modifying the content of attackerControlledFile.txt? "Somehow" refers to things like:

  This code requires the output to be printed onto a specific terminal emulator

In fact, yes. Old terminals like vt100 have the ability to use ANSI escape sequences to do special things, like execute commands. The following site below documents this ability using a simple echo, like you describe.

https://www.proteansec.com/linux/blast-past-executing-code-terminal-emulators-via-escape-sequences/

The article is in depth with specific exploit instructions, but the general idea can be summarized from this excerpt from the site:

  Dangerous Escape Sequences
  Terminal emulators support multiple features as described below [8]:

  Screen Dumping: a screen dump escape sequence will open arbitrary file and write the current content of the terminal into the file. Some terminal emulators will not write to existing files, but only to new files, while others will simply overwrite the file with the new contents. An attacker might use this feature to create a new backdoor PHP file in the DocumentRoot of the web server, which can later be used to execute arbitrary commands.
  Window Title: an escape sequence exists for setting the window title, which will change the window title string. This feature can be used together with another escape sequence, which reads the current window title and prints it to the current command line. Since a carriage return character is prohibited in the window title, an attacker can store the command in a window title and print it to the current command line, but it would still require a user to press enter in order to execute it. There are techniques for making the command invisible, like setting the text color to the same color as the background, which increases the changes of user pressing the enter key.
  Command Execution: some terminal emulators could even allow execution of the command directly by using an escape sequence.

As pointed out in the comments, this particular exploit was fixed decades ago on modern terminal emulators.  This just happened to be a simple example that a 30 second Google search revealed that nicely demonstrates the concept that there's still software at work that could be exploitable even in something as simple as displaying a file.

Theoretically, there could be other problems with modern terminal emulators (buffer overflows?) that might be exploitable.


Dangers of XSS on the server-side vs client-side

The impact of XSS is the same regardless of whether it is stored/reflective or DOM-based/server-side - the attacker gets full control of the web session. Stored XSS is more readily exploitable (you don't need to get a user to click a link) so it's more serious. Whether a vulnerability is DOM-based or server-side doesn't greatly affect the severity.

You can have stored DOM-based XSS. As an example, consider a e-commerce site that allows users to post reviews of products. It's a single page application, so when you view a product, the JavaScript sends an Ajax request to fetch product information. The Ajax back-end returns JSON properly escaped, so it's not vulnerable. However, the JavaScript renders the returned data as HTML. This creates an XSS vulnerability: a malicious user can submit a review containing an XSS attack, and when a victim user views that product, the XSS payload executes in their browser.


If your company/university requires you to install root certificates what protects you from man in the middle attacks?

Assuming they're not evil, their MITM firewall will generally have the same set of trusted root certificates as your OS so any real MITM attacks or invalid certificates will be rejected by their MITM firewall.

It's not possible to "add" their certificate at the end. They will directly generate  a new certificate for the destination website signed with their root certificate.


What is it called when you give hackers a way in?

I believe the term you're looking for is "honeypot".


Is getting 1-2 outputs from a CSPRNG to seed another CSPRNG less entropy than getting say 5000 outputs from a CSPRNG and using that to seed?

Yes, more is more. Your terms are a bit off, as you can't generate entropy, and a Uint8 has 8 bits, but your basic assumption is correct. A larger seed will, in theory, produce less predictable results.

In practicals terms, you would need to watch out that your input seed to the CSPRNG accepts the format you generate. For numbers, this is often limited to 32 or 64 bits. If care is not taken in the conversion from 8 bits, you can easily lose entropy. The way around that is to use a modern CSPRNG like fortuna that cannot be over-seeded and is very forgiving about input format.


You already tagged your question correctly with the oauth tag. There is an OAuth 2.0 flow specific for machine-to-machine communication, called Client Credentials Flow. Details can be found in RFC6749, section 4.4.

The initial authentication takes place using a pre-shared key, called client-secret. OAuth 2.0 doesn't specify a token format, so any sufficiently complex static value (e.g. a random 512 bit string) will do. After successful authentication, the authorization server provides the access token to the system requesting access. This access token, which is used as a bearer token, is used to connect to the target APIs.


WebRTC doesn't require Internal IP Address for P2P communication. It's the STUN server that retrieves it. The purpose of webRTC is to let the client discover its public IP Address.

On the cloud side, STUN server has following work to do:

Discover client's private & public IP Address
Discover Internal and external ports
Behind what type of NAT client is sitting at

There is no way STUN server can be able to discover behind what type of NAT you are sitting at unless it knows your Int IP:int Ports.

You may feel that discovering type of NAT is unnecessary but for STUN protocol it is important. If STUN finds that you are behind a symmetric NAT, the P2P session cannot be initiated.

STUN server reports this to webRTC and webRTC switches from STUN to TURN using RTC Peer Connection Object API. It happens in case of symmetric NAT.

So, basically it's a STUN server who wants to know your Internal IP and not the P2P protocols. Your Internal IP is only visible to those sites who are operating the STUN server.


Should a windows IT shop have concerns about enabling WSL for users?

Depends how much they're trying to lock down Windows users, and how. If they limit which programs you can run, then WSL is a bypass for that; most tools that filter Windows programs will ignore Linux ones running on the same kernel. If they give you local admin, though, they may as well let you run WSL; you can't do anything in WSL that you can't do in Win32, with enough effort.

It's worth noting that WSL doesn't actually give any additional privileges. A WSL process launched as (Windows) Administrator has Admin privileges on the Windows filesystem (and any Windows processes it launches will inherit those Admin privileges), whether or not the WSL shell is running as root. Similarly, a non-admin WSL shell, even if elevated to root, has no more privileges on the Windows filesystem or kernel than the non-admin user that launched it. This actually caused bugs in early versions of WSL, where you got things like ping not working because its setuid root bit didn't actually give it the ability do anything extra with network sockets (which are controlled by the NT kernel's permissions).

Every Windows user gets their own, isolated WSL installation (if they use it), with its own users; you can't even attack other users on the same physical box using WSL (unless you'd be able to do that from within Win32 anyhow). The main things that WSL does for security impact are to confuse or bypass some monitoring and/or software restriction tools, and open up some additional kernel attack surface (as far as I know, nobody has used WSL as an exploit vector into the kernel, but I'd be surprised if there isn't one in there somewhere... just like I'm sure there's still more vulns to be found in Win32k.sys).


There are a number of companies that do this. Typically, the organization defines the scope of the team, clearly defines the activities, trains and supervises.

I have seen it done as part of the Security Awareness Champions programme that allows people who have been active in improving the security of their peers using the tools and processes available to everyone. This new level of training is a type of "reward" for being a leader in security among their peers.

By tapping into the Champions programme, you give employees something to aim for and you get those who are truly showing interest in security and not those who are attracted only to the "hacking" part.

After that, it all depends on what your organisation wants to tackle. I've seen phishing teams (phish your peers!), physical security teams (Mission Impossible your way into the building!), and application security teams (break our product!).


How safe is "trust this computer" option for websites?

Yes, the "remember me"/"trust this computer" option is safe to use, as long as you trust everyone else who might have access to your computer, and as long as it is implemented correctly.

It is generally implemented using a persistent cookie.  The cookie contains a random, unguessable token that identifies you securely.  If the website is implemented properly, it is sent over SSL and the cookie is marked secure.  However, many websites omit this step and send it over non-SSL connections (which is insecure if you ever use your computer over an insecure communication medium, e.g., over an insecure Wifi link) or forget to add the secure flag to the cookie (which is not secure against an active man-in-the-middle attack if you are using an insecure Wifi link).

This cookie can optionally have an expiration date, or can be expired server-side.  That's up to the web server.  Probably there is no great need to expire it, but you could expire it if it makes you feel more comfortable.

This feature adds a great deal of convenience, as it spares you from having to go through certain authentication steps.  The exact details of the security/convenience tradeoff and the security benefits will depend upon exactly how a particular web site uses the "remember me" feature, and cannot be answered generically in the abstract.

For instance, many websites may use the "remember me" feature so that you will be automatically logged in every time you visit from this same computer, without needing to type in your password.  That's convenient.  It also means you can reasonably choose a longer password: since you rarely have to enter in the password, you can make it as long as you want without worrying about the inconvenience of trying to memorize or type in the password.  So, in some sense, this does provide some security benefits.


Is it possible to create GnuPG keys from a x509 cert/key pair?

While X.509 and OpenPGP share the same cryptographic algorithms, both have incompatible formats and certification/trust models (hierarchical vs. web of trust). Theoretically you could convert the keys between the formats, but you would lose certificates on the key and still could not use the key to communicate with people using the other system. You would still handle the keys as a completely different key pair, but at the same time expose it to issues in both systems/implementations.

gpgsm is a GnuPG implementation of GnuPG, but not supported by Thunderbird and Enigmail. As you already realized, Thunderbird has built-in support for X.509 -- you can manage the keys in the preferences (Advanced, then Certificates).


Hashing a derived key is not a security issue because cryptographic hashes are one way. There are two ways people could attack the derived key.

Guess a password, process it using PBKDF2, SHA-512 hash the result and see if it matches
Guess a derived key (128 to 256 bits), SHA-512 hash it and see if it matches

The amount of work performed per guess with method 2 is much lower, but the probability of being successful within n guesses is only n / 2128. Since the total amount of work is n times the work-per-guess, method 1 is always less work in practice. (Method 2 is never practical because brute forcing 128-bit or larger keys isn't currently possible.)

I estimate that typical "good" user chosen passwords have 30-40 bit strength. So you can expect them to be guessed within 240 guesses instead of 2128. You would only "break even" if PBKDF2 were made to cost 288 times SHA-512. No user, legitimate or not, would be able to login if that were the case. It would just take too long.

(Not that "breaking even" matters in practice. Method 2 is already out of reach for real world adversaries so it's a strategy that no one is going to bother with. People's passwords are the weakest link in the chain. Not an algorithm as reliable as SHA-512.)

Another issue makes it possible to bypass the second level of PBKDF2 brute-force protection. Hashing the derived key and comparing it to the stored hash is not the only way for a hacker to determine if they have the correct derived key.

If they have access to ciphertext, then they instead could perform trial decryption to get a good idea of whether or not they have the correct key. It's not even required to decrypt all the ciphertext. A few bytes should suffice.

Alternatively, they could use the message authentication algorithm. (Encryption without authentication is a really bad idea. You do use an authenticated-encryption mode, right?)

Any place where key material is derived from a user's password provides a potential pathway a hacker can use to verify whether a guessed password is correct. Using any one of these avenues gets the person trying to crack a password the same answer. so they are going to use whatever option is easiest.

This is another weakest link in the chain situation. Whether you use PBKDF2/SHA-512 or PBKDF2/PBKDF2, expect that your level of brute-force protection is only as strong as the first layer of PBKDF2.

PBKDF2/SHA-512 can actually be made stronger than PBKDF2/PBKDF2. If you have only one second to budget to verifying a password, then it is preferable to put nearly 100% of that one second into the first PBKDF2.

Using SHA-512 for the second-level check lets you do this because its run time will be near-instantaneous compared to PBKDF2. (But again, a 128-bit key (or stronger) is not brute-force-able because the actual cost of SHA-512 is non-zero and 2128 SHA-512 evaluations adds up.)

If you instead let the first layer of PBKDF2 run for 0.5 seconds then ran the second layer for 0.5 seconds, then you'd really only have half the brute force protection of what you could otherwise afford.


How secure is e-mail landscape right now?

First, end-to-end decryption offered by PGP and S/MIME and hop-by-hop encryption provided by SMTP STARTTLS and the TLS use in IMAP and POP are totally different things. With end-to-end encryption the mail is encrypted by the sender and decrypted by the final recipient. With hop-by-hop encryption instead the mail is only encrypted during transit from one mail server to the next, which means it is accessible in plain on each mail server involved and it is also stored in plain at the providers mail server where it then gets retrieved using POP or IMAP.

That said, there are some kind of recent statistics about how much STARTTLS for SMTP is supported in practice:

SMTP-over-TLS usage stats (2017 edition):
83% support TLS  (down from 86% in 2015), of these 65% support TLS 1.2, ...
Measuring SMTP STARTTLS Deployment Quality from 2016:
around 82% of servers support TLS, of these around 20% have no valid publicly trusted certificate

While these statistics describe how much mail servers support receiving mail bei TLS they don't say how much mail is actually delivered by TLS. There are some interesting statistics from Google which describe how much TLS is used for incoming and outgoing mails from them. It shows for example that at the beginning of 2016 about 60% of incoming traffic was using TLS, beginning of 2017 already 80% and now about 92%. The current number for outgoing mails is around 88%. The last number means that for 12% of the recipients their mail server does not support TLS.

To get some real-life statistics of my own I had a look of some mails I have collected within the last 3 years, about 300.000 non-spam mails and about the same number of spam mails. From the non-spam mails around 77% where delivered with TLS while with spam mails this number was 42%. When only looking at the mails from this year 87% of incoming non-spam mails used TLS while only 53% of spam mails.


Since it was not specified, I will address both TUN and TAP VPN servers. You can read more about the difference at the OpenVPN wiki.

Typically, a VPN server using TUN will push static routes to one or more subnets, or potentially for the entire address space, as to act as the default gateway. The client configuration file may contain information about routes, or once connected to the VPN, the attacker's routing table may be populated with information about the remote subnets. This information could be used for enumeration and scanning of hosts on those subnets.

In the case where the VPN server only pushes routes to act as the default gateway (e.g. OpenVPN's redirect-gateway def1 option), you may have to resort to blindly performing host discovery on RFC1918 private networks, perhaps using Nmap or another scanner.

On the other hand, a VPN server using TAP may result in the attacker receiving an address directly on the target network, so the local tun0 interface or similar will display information about the remote subnet. The attacker can also start receiving broadcast/multicast traffic on the network, which may help with passive discovery of other hosts.


Is DHCP spoofing ever possible on VMware?

Short answer is no, you can't.

If your vm network adapter is NAT, your rogue DHCP server is only on natted network. To test if machines from your host's network are taking ip from your rogue DHCP server, your vm's network should be bridge.

With your current configuration using NAT on your vm, you are going to be able to get ip from your rogue DHCP only from other devices/hosts inside that network and being different than a vm created on same Vmware host. This is because is Vmware is who manages it so its own DHCP is going to have priority always... so you can't get ip from other vm even "natted" created on the same Vmware host.

To get an ip from your vm rogue DHCP you must create some kind of special environment. For example:

If you create a vm on your NAT network which has already a Vmware and inside you create a vm with bridge network mode... that vm inside the vm for sure can take ip from your rogue DHCP with 50% of possibilities.


Best Practice: ”separate ssh-key per host and user“ vs. ”one ssh-key for all hosts“

A private key corresponds to a single "identity" for a given user, whatever that means to you. If, to you, an "identity" is a single person, or a single person on a single machine, or perhaps a single instance of an application running on a single machine. The level of granularity is up to you.
As far as security is concerned, you don't compromise your key in any way[1] by using it to log in on a machine (as you would by using a password), so having separate keys for separate destinations doesn't make you any more safe from an authentication/security perspective.
Though having the same key authorized for multiple machines does prove that the same key-holder has access to both machines from a forensic perspective. Typically that's not an issue, but it's worth pointing out.
Also, the more places a single key is authorized, the more valuable that key becomes. If that key gets compromised, more targets are put at risk.
Also, the more places the private key is stored (say, your work computer, your laptop, and your backup storage, for example), the more places there are for an attacker to go to grab a copy. So that's worth considering as well.
As for universally-applicable guidelines on how to run your security: there are none. The more additional security you add, the more convenience you give up. The one piece of advice I can give categorically is this: keep your private key encrypted. The added security there is pretty significant.

[1]: There's one important way in which authorizing the same SSH key in different security contexts could be a problem, and that issue has to do with agent forwarding. The constraints and caveats around safely using agent forwarding is outside the scope of this question though.


Dealing with a DDoS: horizontal vs vertical scaling?

Short version:

When possible, horizontal is better because it has more scope to scale; vertical is limited by the amount of resources you can pack into a single instance.  But some applications cannot be scaled well horizontally, and for those applications vertical is the better choice.

Long version:

Can it go horizontally?

Many applications are not designed to go horizontally.  An application that uses local files, for example, cannot share them with an instance on another system.  If files are made available to another system using, say, NFS, the file locking available may not be sufficient for resource contention and coordination.

Designing an application to be horizontal imposes complexity.  And even an application that was defined to go horizontally - say, a web tier with a number of machines working with a backend database server - may have limits.  It may be that each web frontend consumes 1/10th of database server capacity - so what happens when you amp it up to 11?  The database becomes a bottleneck.  You go back to step 1 and repeat the horizontal architecture work you did to apply the database server as well, and the system again mushrooms in complexity.

Horizontal systems are hard.  Vertical systems are the default.  Therefore, often vertical scaling is the only thing you can throw in front of a DDoS.

Wins you get with horizontal scaling

If you can go horizontally, however, there are a number of wins that make it superior.

Cost - If you need 10, two 5x boxes are a little more expensive than one 10x box.  But if you need 20, four 5x boxes are probably cheaper than one 20x box.
Capability - Vertical scaling has limits; there may be no such thing as a 50x box, but ten 5x boxes is achievable.  Memory only comes in sticks so big, and you can only plug so many of them into a motherboard...
Path - If you have a vertical solution, you're generally limited to one datacenter and at most a small handful of networks coming in.  If you have a horizontal solution, and can spread across multiple sites, then you greatly increase the carrier redundancy available to you.
Robustness - by definition, if you designed your app to be horizontal, you probably designed it to cope with one or more component nodes becoming unavailable.  Once you've got that, then the loss of subsets of your horizontally spread architecture are survivable.


is there any 100% secure way for form authentication and sending information from client side to server side over internet pages?

No With current technology there is no 100% secure way to transfer data over the Internet.

The best you can hope for is to follow standard best practice. In which case you need to:

Secure your web server - apply patches, hardened config, firewall
Secure your application - code to the OWASP top 10, avoid SQL injection, etc.
Use SSL to protect data in transit

Despite all these precautions there remains some risk. For example, one of your users might have malware on their computer, which captures all their web traffic.


Depends on your definition of manual, but if I was looking for this on a penetration test, I'd be using Nmap's http-shellshock script.


How frequently install patches in an enterprise environment?

If it is a Microsoft environment, then you would benefit most by installing patches monthly, scheduling this just after Patch Tuesday each month.

Be prepared to break this schedule for critical, out of band patches though. Make sure that all patches are tested first in a pre-production environment before applying to production.

For other platforms you should do the same if there's a published update schedule. The aim is to patch production platforms as soon as possible once they have been tested.

Regarding standards, an example is PCI DSS v3 which states:

  6.2 Ensure that all system components and
  software are protected from known
  vulnerabilities by installing applicable vendor supplied
  security patches. Install critical
  security patches within one month of release

So at the very least you should be looking at once a month, but I recommend expediting this for critical bugs with publicly available exploits (e.g. ShellShock).


API's Security for API which are opened to Non-Logged in Users

You could use:

IP denylist/allowlist (by country for example or block all IP from common cloud providers such as GCP, AWS etc).
Rate limiting based on IP


Does PCI-DSS require that the telnet client be uninstalled from a server

I fail to see why you would want an insecure program/protocol like telnet when its easy to employ a secure alternative in the form of an open-SSH server.

Telnet has often been used to compromise a system even when the normal network operators did not use it. There simply is no way to secure a telnet session.

Since the telnet client of windows can be used through the COM system it has even been used to create remote callbacks to an attackers server. (e.a. make it easy for someone to actually do something with a compromised host) Only when its completely removed the risk is mitigated.

Update:

  Edit: To clarify this is meant in the context of using the telnet client as a troubleshooting tool to verify port access, not to actually use the telnet protocol. There are "better" tools for this, but as previously stated you can often wind up in a situation where using a quick telnet check can give you the info you need versus taking the time to download a heavier 3rd party utility. An "OpenSSH" server is not a suitable replacement for this use case.

For this use case a cUrl tool would better suffice. since you can get all the details (as opposed to some with telnet) and it is even lighter than telnet without the attached COM elements that telnet supports (yes you got the library, but that is small enough to put in an exploit and there for not a barrier for attackers).

The OpenSSH would replace all functionality of telnet as a management tool (and remote access), and replace this with a secure alternative.


It will be part of OpenSSL 3.0. The code is currently being contributed in chunks. Chunks 1-6 have already been merged into the OpenSSL master branch (which will eventually become OpenSSL 3.0). Chunk 7 is being reviewed right now:

https://github.com/openssl/openssl/pull/10620

There are 12 chunks planned:

https://github.com/mpeylo/cmpossl/wiki

OpenSSL 3.0 is scheduled for release at the end of this year. The release schedule is here (scroll down about 2/3 of the page):

https://www.openssl.org/policies/releasestrat.html


Is this an evidence of a Skype communication being spied on?

Given the information you have provided I'd say that it's google shortener visiting the url to check it for security purposes: "Our spam detection algorithms are automated, and routinely disable suspicious goo.gl short URLs" see here.

Back in 2013 it came out that Microsoft monitors skype conversations for HTTPS urls. It then visits these urls purportedly for "preventing spam, fraud or phishing links" (more info here, or on google), so regardless you need to be aware that skype is not suitable for secure text conversations.

UPDATE

So I've just seen your updated information in your question.

I'd still say that at some point known to themselves, something at google will probably hit the URL, either for indexing or security. However thinking about it I wouldn't have expected any of the google's own crawlers/bots to appear in their own statistics; as they're not clicks and they wouldn't want to affect the statistics they present you with, and the bot(s) would visit the destination of the shortened URL, not the shortened URL itself.

If the original shortened URL led to a system under my control I'd now be looking for web server log files to see what requests have been made.

There's always the possibility that there's something else on your machine, or on the machine of the person you sent the URL to, which is responsible for the activity. That could either be something benign or not.

Another thought is that since 2013 Microsoft have changed how their spam preventing system works, but I can't see it having a chrome user agent string!


Would verifying the integrity of my website by comparing digest on the client side work?

...to protect against tempering by my web host...

If you do not trust your hosting provider, all bets are off. They have full control over your website, and no clever tricks are going to change that.

  ...or other MITM attacks that SSL was not able to prevent.

TLS is not perfect, but it's good. You should focus your effort on using it properly (e.g. supported cipher suits, HSTS, etc.). Trying to build your own home brew fix for any weakneses in TLS is not a productive way to spend your time and energy.

  Basically I'm thinking of running my HTML through a hash function on load and compare the output to the correct digest that is sent along with the HTML file. If they do not match then I'll show a warning and offer to leave the site.

This offers no protection at all. If the attacker can modify the page, they can easily just disable this check or change the correct hash. Sure, that would require some special attention to your site in particular. But an attacker that can break TLS but not bypass this is not a realistic threat model. It's like assuming a bank robber will be able to cut through the steel door but not break a window.

  At least I don't think it makes matters worse.

In an of itself, it does not make things worse. But you have limited resources, and wasting them on things that are mostly pointless means you are not using them for things that would actually make you more secure.