Techniques for enumerating enabled apache modules

are there any general techniques which can be used on a black-box security test to identify/enumerate enabled modules on a running Apache server?

tl;dr: you cannot detect all installed/enabled modules, and you need to analyze headers manually, if you dont want to X-MISS something

we use a custom tool to investigate all server-headers; this tool, written in python, simulates a browser-request and displays everything send back from the server (examples below)

beside apache/module-version also X-Powered-by is interesting, because, if not filtered correctly, it might give you a hint on application-servers (if any) or php-version used (google: php easteregg). rack (as in ruby-on-rails), for example, leaks a lot of headers, showing that rails is used (X-Rack-*)

oh, and header-analysis is done manually; i dont know of any tool that might work
like (if header X then alert Y); it's just experience

  edit 1

detecting installed modules, based on headers

apache-only, since nginx only displays nginx or ǹginx/VERSION
please note: installed modules might also be displayed on default-error-pages, like the following extract from a html-page of a default 404-error-page, when ServerSignature On is set:
<address>Apache/2.2.22 (Debian) mod_fcgid/2.3.6 PHP/5.4.4-14+deb7u8 mod_python/3.3.1 Python/2.7.3 Server at localhost Port 80</address>
if apache displays the installed/enabled modules depends on the setting of a config-option, called ServerTokens; from the config:

#
# ServerTokens
# This directive configures what you return as the Server HTTP response
# Header. The default is 'Full' which sends information about the OS-Type
# and compiled in modules.
# Set to one of:  Full | OS | Minimal | Minor | Major | Prod
# where Full conveys the most information, and Prod the least.

# examples
# ServerTokens Full
Server: Apache/2.2.22 (Debian) mod_fcgid/2.3.6 PHP/5.4.4-14+deb7u8 mod_python/3.3.1 Python/2.7.3

# examples
# ServerTokens OS
Server: Apache/2.2.22 (Debian)

# examples
# ServerTokens Minimal
Server: Apache/2.2.22

# examples
# ServerTokens Minor
Server: Apache/2.2

# examples
# ServerTokens Major
Server: Apache/2

# examples
# ServerTokens Prod
Server: Apache

additionally, not all loaded modules are displayed with the server-header (compare SeverTokens Full vs the following extract from apache2ctl  -S -M from the same server

Loaded Modules:
 core_module (static)
 log_config_module (static)
 logio_module (static)
 version_module (static)
 mpm_prefork_module (static)
 http_module (static)
 so_module (static)
 alias_module (shared)
 auth_basic_module (shared)
 authn_file_module (shared)
 authz_default_module (shared)
 authz_groupfile_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 cgi_module (shared)
 deflate_module (shared)
 dir_module (shared)
 env_module (shared)
 fcgid_module (shared)
 headers_module (shared)
 mime_module (shared)
 evasive20_module (shared)
 negotiation_module (shared)
 php5_module (shared)
 python_module (shared)
 reqtimeout_module (shared)
 rewrite_module (shared)
 setenvif_module (shared)
 status_module (shared)
Syntax OK

examples, full headers

google-headers

[+] sending now:

GET / HTTP/1.1
Host: www.google.com
Connection: close
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; fr-FR; rv:1.7.3) Gecko/20040910

[+] lines ins answer: 17
[+] www.google.com :: 173.194.69.104

HTTP/1.1 302 Found
Cache-Control: private
Content-Type: text/html; charset=UTF-8
Location: http://www.google.de/?gfe_rd=cr&ei=GzpBU8fYBIGKtQaAo4GYCA
Content-Length: 258
Date: Sun, 06 Apr 2014 11:27:23 GMT
Server: GFE/2.0
Alternate-Protocol: 80:quic
Connection: close

server-headers, leaking php-version, vulnerable to php easter egg

[+] sending now:

GET / HTTP/1.1
Host: www.cs.utexas.edu
Connection: close
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.8) Gecko/20020204

> ssl-info
('128.83.120.139', 443)
('DHE-RSA-AES256-SHA', 'TLSv1/SSLv3', 256)
> do you want to check with openssl? [y|N] :

[+] lines ins answer: 14
[+] www.cs.utexas.edu :: 128.83.120.139

HTTP/1.1 200 OK
Date: Sun, 06 Apr 2014 12:36:16 GMT
Server: Apache/2.2.14 (Ubuntu)
X-Powered-By: PHP/5.3.2-1ubuntu4.23
Set-Cookie: SESScf56....; path=/; domain=.cs.utexas.edu
Last-Modified: Sun, 06 Apr 2014 12:33:53 GMT
ETag: "4eb53eded35299af56b68617202f579c"
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Cache-Control: must-revalidate
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=utf-8

server-headers, reverse-proxy infront of possibly rails, leaking rack-version, possibly outdated and vulnerable to some already release exploits

[+] sending now:

GET / HTTP/1.1
Host: XXXXX.COM
Connection: close
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; de-AT; rv:1.3b) Gecko/20030210

> ssl-info
('1.2.3.4', 443)
('ECDHE-RSA-AES128-SHA256', 'TLSv1/SSLv3', 128)
> do you want to check with openssl? [y|N] :

[+] lines ins answer: 18
[+] XXXXX.COM :: 1.2.3.4

HTTP/1.1 200 OK
Date: Sun, 06 Apr 2014 12:38:02 GMT
Server: Apache
Strict-Transport-Security: max-age=31536000; includeSubDomains
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: Fri, 01 Jan 1990 00:00:00 GMT
X-Runtime: 11
X-Powered-By: rack 1.2
Set-Cookie: _mailservice_session=BAh7BzoPc...-; path=/; HttpOnly; secure
ETag: "813d4fb6faa576ffd22fbbe44abfa0d9"
Content-Length: 17654
Status: 200 OK
Vary: Accept-Encoding
Connection: close

  edit 2

headers might tell way more; the following snippet, gathered during a blackbox-security-analysis, lead to identifying additional servers that shouldn be visible, which lead to detecting an old-forgotten, outdated firewall with a vulnerable smtp-service running; full-root-access to that box and access to the internal network within 30 minutes

    X-Cache: MISS from proxy232.xxxx.com
    X-Cache-Lookup: MISS from proxy232.xxxx.com:80
    Via: 1.1 proxy232.xxxx.com:80 (squid/2.7.STABLE3)


Isolate Virtual Machines on host-only adapter

If you put host-only, your VMs can access, well, only the host. Your host machine is not isolated, but the opposite: it's the only machine they can access.

To isolate the VMs, you must use Internal Network. Using this network means:

The host can't access the guests
Guests can't access the host
Guests can't access the internet
Guests can access each other

If you use Host Only, the guests access the host. If you use NAT or bridge, they can access your entire network.


When using VeraCrypt, can't someone just tell I have a hidden container by sheer file size?

You've just described Rubber-hose cryptanalysis. And yes, someone can force you to do all sorts of nasty, nasty things to your containers. think of it this way -- how do you defend against a malicious actor who wants to smash your laptop hard drive to bits? Backups, and lots of them.

Every program has its limitations. But backing up your containers frequently (or simply making the data in your hidden containers disposable) can mitigate the risk. Or get really good at bluffing.


Is Cloudflare Flexible SSL PCI Complaint

No, Flexible SSL does not meet PCI requirements.  Flexible SSL (emphasis mine):

  Flexible SSL encrypts traffic from Cloudflare to end users of your
  website, but not from Cloudflare to your origin server.

which conflicts with PCI DSS §4.1 (emphasis mine):

  Use strong cryptography and security protocols to safeguard sensitive
  cardholder data during transmission over open, public networks

You would need the Full SSL option from Cloudflare to be PCI compliant:

  Full SSL mode provides encryption from end users to CloudFlare and
  from CloudFlare to your origin server. This requires an SSL
  certificate on your origin server. In Full SSL mode, you have three
  options for certificates to install on your server: one issued by a
  Certificate Authority (Strict), one issued by Cloudflare (Origin CA),
  or a self signed certificate. It is recommended that you use a
  certificate obtained through Cloudflare Origin CA.

A self-signed certificate won't cost you anything, and CloudFlare's Origin CA is also free and tries to simplify the certificate management.


Secure Electronic Transaction (SET Protocol)

That seems like a question that can be answered by looking at the specification of the SET protocol. The Wikipedia page for SET:

en.wikipedia.org/wiki/Secure_Electronic_Transaction

lists several official-looking documents at the bottom under "References". You can probably find your answer in there.


Can my IT department read my Google Hangouts chats while at work?

You should assume that they can. There are various ways they can do it, but whether they actually do it depends on company's standards and practices. Some of the options:

It's possible to install additional root certificates on company's machines
and use that to MITM all the traffic (traffic goes through company's
gateway/proxy anyway, and having friendly root certificate on user's
PC allows to do a full MITM);
It's possible to install "employee monitoring software", which is essentially a key logger + process monitor + screen grabber. Some tools have capacity to locally intercept received messages in chats.
It's possible to use remote access/collaboration tools to monitor what's happening on the screen of a particular PC.

In short, if you don't have control over the PC you're working on (and with company's workstations you typically don't), you cannot assume it's free from such surveillance implants.

Hope that's not too scary :)


How secure is my DPAPI Master Key if I enable biometric login?

If you don't log with a password, but instead with a fingerprint, then DPAPI plays an elaborate charade of encrypting keys with other keys, but the tower of encryptions must still end at some point. So what really happens in that case is that someone who steals your laptop will be able to extract all your secrets -- albeit with a substantial amount of reverse-engineering and cursing (though it can be widely automated, of course).

Or possibly quite easily. Indeed, right beside the fingerprint reader are 90+ keyboard keys, each of which adorned with a copy of the fingerprint of one of your fingers. Fooling the fingerprint reader with a printout of one of your fingerprints might be easier than wading through the swamp of encryption layers produced by the Microsoft developers. The raw truth remains that all these encryption layers are just smokes and mirrors: since the fingerprint itself cannot be converted into information suitable for cryptography (you cannot reliably turn a fingerprint into a key, contrary to a password), then your laptop with fingerprint-based login really contains, as it is, all the information needed to recover your DPAPI secrets.


If you have suffered some sort of harm from the calls (e.g. death threats or harassment), it is in theory possible to do this but it is an incredible amount of work, and is in practice near impossible unless your police get involved, which they will not do unless it is a serious matter.

You would need to obtain court orders from each ISP or telephony provider you require information from, which may be in several different countries, which would require showing cause, i.e. that some sort of criminal offence or tort had occurred, and that it is reasonable for you to demand cooperation from them as a third party.

This will cost tens of thousands of dollars/euros/pounds at least. You may also be required to pay the ISP costs of complying with the order, in addition to the very high costs of lawyers who work in this area.

And all to find out that it was a random phisher.

On the other hand if you have suffered no harm, and you cannot show a crime was committed, you will not be able to get the court orders and ISP cooperation you need.


Your calls are fine as long as they don't send JSON arrays with sensitive information as referred to in your sources. Perhaps you could use normal HTTPS requests for that info instead.


This exploit is totally broken as of today and no updates to the course materials whatsoever...

At least the official offsec forums provide some hints on how to get this working.

Some people say, it'll work, using an older java version (prior 1.8.0_144).
Unfortunately this didn't work out for me.

So I had to try another "fix" to get it working:
Adding permission java.security.AllPermission; to the grant section in C:\Program Files\Java\jre7\lib\security\java.policy on the target box.

Unfortunately I totally dislike this workaround, as I feel the exploit to be worthless, when I have to modify the security settings on the target box in a way, I normally just can't do.

Hope this helps, anyway :-)


Where do I get started in terms of learning how to exploit Java and Flash vulnerabilities? or browser exploitation in general

Targeting sandboxed platforms like Flash and Java will be excessively difficult if you're just starting out, so I suggest you learn to walk before you try to run.

Some stuff you'll want to know:

How to code in a low level language like C.
What the stack, registers, heap, etc. do, and what happens when you overflow them in various ways.
At least basic x86 assembly.
Most of the API suite for your platform (e.g. Win32 APIs)
What an executable file really contains / how one works. For Windows, this is a PE file, for *nix it's ELF.
Exception handling mechanisms for your platform, e.g. native exceptions, SEH, VEH,

A few resources to check out:

Buffer overflows on Wikipedia
CoreLAN Exploit Writing Tutorials
x86 opcode reference (incredibly useful when manually writing payloads)
Smash The Stack CTF (especially io, which focuses on reverse engineering)

From there, you'll be on your way to understanding how browser vulns work. There aren't really any direct tutorials for that kind of thing, because the environment is so varied dependent on your browser and the plugins it is using.


First thing: unless the CORS headers also allow credentials or are on a server that isn't supposed to be accessible from arbitrary IP addresses (or returns different content depending on the request source), this isn't really a vulnerability at all. If the browser cannot make authenticated requests (or at least not see the responses), then it can't do anything that the attacker couldn't do by just using curl on their own computer.

Next, the Origin header is only controlled by the browser, not the user. An attacker cannot cause a request to be sent with a custom origin, nor is there any circumstance where the browser would send an origin containing a path (protocol, port (if non-default), and domain only). As such, the server properly ought to be rejecting your requests as invalid, but what you've demonstrated is not exploitable in any way.


DOM based XSS: jQuery("#HiddenReferral").val(jQuery(location).attr('href'));

No, I don't think you can use it for XSS. Since the possibly unsafe object is passed to val() you should be fine. That function sets the value attribute. Whatever you set the value attribute to, you can not make it execute code. Since it manipulates the DOM and not the HTML source, something like this is completely safe in JavaScript:

obj.value = '" onClick="evilCode();';
obj.value = '"><script>evilCode();</script>';

The main (but probably not only) jQuery DOM based XSS danger you should be on the lookout for is the html() function.

That said, don't trust the value of #HiddenReferral. An attacker could easily manipulate the value to be something else than what your code set it to.


What security does an ISP provide for its customers?

ISP will routinely do the following for their customers:

Block incoming connections on some well-known ports (e.g. port 139, the classic port for Windows file sharing).
Block spam, virus and other malware sent over email.
"Block" some sites by removing the DNS mappings (the customer can still access them, but the ISP DNS server will not resolve the names).
Block outgoing connections to random external sites over port 25 (not all ISP do that, but many do).

Remember that, ultimately, the ISP do not protect customers; an ISP protects itself. The customer is always viewed with a bit of suspicion, and ISP engage resources on the protection of a customer mostly because they want to prevent the customer from becoming an active enemy. For instance, the blocking of outgoing connections to port 25 is a method to prevent a customer's machine from sending spam, in case that machine became part of a botnet: the ISP does not want to appear to be a haven for spammers. On a similar basis, some ISP will automatically detect or even block P2P protocols.

A good ISP will also apply a number of controls on its own infrastructure (firewalls, intrusion detection, redundancy...) in order to maintain its service, which can be viewed, indirectly, as a "protection" for its customers.


No, it is not secure.

First of all, you're suggesting a MAC-then-encrypt, which is known to be vulnerable to "chosen ciphertext" attacks (i.e. an attacker can take a valid message, modify it, and observe the result to gain information about the plaintext).

Secondly, you're suggesting the use of a hash rather than a MAC or even better a digital signature. A hash is not designed to verify the sender of information, only that the information has not been modified since being sent. A MAC can verify that the message came from the sender. A digital signature can verify that the sender is who it claims to be. You want a digital signature.

Finally, you're relying on symmetric encryption, a.k.a. "shared key" encryption. How is that key determined? You mentioned not wanting to do RSA (an example of asymmetric/public key encryption) which means you probably plan to keep the encryption key on your device, or hand it out to those who purchase/maintain the device. This means that the key is discoverable. Since this is a symmetric key, this furthermore means that once discovered the key can be used to create messages that appear valid using your scheme. There are certainly hardware modules that can help make it MUCH more difficult and expensive to extract the key (maybe even impossible) but the key may still be stolen from YOU, in which case you will need a way to change the key, and update all devices previously using that key, if you want to maintain security in such an event.

Why exactly do you think your device is not capable of using standard technology like public key cryptography? You really should just use proven methods instead of rolling your own.


You can plug your USB drive on a virtual machine based on Linux. Before that, you can stop the automatic mount of externals drives.

After, you verify the recognition of your drive with:fdisk -l

You note his path: /dev/sdX, don't mistake with another drive !!!

You note his blocks count and their sizes (512 by default)

You can erase all datas on the drive with:

dd if=/dev/zero of=/dev/sdX count=<blocks count> bs=<blocks size>

After that, your drive will be totally erased. If you are paranoid, you can delete you virtual machine too. This method doesn't clean the potential infected firmware of your drive.


Sending the client certificate with the client hello to the server

TL;DR: This is not possible with a standard conforming implementation.
The TLS 1.2 and TLS 1.3 standards clearly describe the sequence of communication inside the TLS handshake. A client certificate can not be send inside the ClientHello since the structure of the ClientHello record does not have a place for it. It is instead sent within a Certificate record, similar to how server certificates are sent. Only a Certificate record from the client is supposed to be sent only after the server explicitly requested it with a CertificateRequest. (see TLS 1.3 spec, sections CertificateRequest, and Certificate for the definition of this behavior)
Note that in order to prove that the client actually owns the certificate it needs to sign some challenge - and this signature (CertificateVerify) can be then checked by the server (see CertificateVerify). The challenge should not be set by the client itself since this would allow replay attacks. Therefore the challenge must at least in part be defined by the server - similar on how the same kind of challenge for the server certificate is partially defined by the client. To have this kind of input the client must have data from the server first, i.e. the CertificateVerify can not be send w/o an initial data exchange.
Even if the protocol allowed you to send a Certificate message along with your ClientHello, it would not save you round-trips on a successful handshake. This does not mean that the protocol could be designed in a way that the certificate is sent immediately but verified only later. This way the server could early reject a certificate which would be not acceptable no matter if the (later) validation failed or not. Only, the protocol is not designed this way. On reason might be that the server wants to notify the client which CA are acceptable so that the client can select the appropriate certificate. Other reason might be that using a valid but still wrong certificate is unlikely, so an optimization for this case is not actually needed.


There are several possible ways that Google could have found this information.

Demographics

There is a chance that Google has records of all your searches and data, and uses this data to group you with a demographic of users. For example, if you look up things like "bikes" and "scooters" - Then when you type in "ska" - Google may predict that you're going to type in "Skateboards" because many people who type in "bikes" and "scooters" also look up "skateboards."

History

There is a chance that Google has record of you searching about Garlic from years before, and something about the parameters was unique enough to allow Google to make the appropriate guess.

Keystrokes

Theoretically, this is possible but unlikely. Google is installed on your computer though, and with the appropriate permissions, it could read your data.


How to deal with this denial of service attack on an Apache server?

This is a classic SYN flood attack, preventive measures include

hashing syn packets, implementing syn cookies
checking if the client properly sends RST after an invalid packet sent back to him
ddos mitigation software often offer to time out specific syn packets based on advanced filtering
not storing the whole syn packet for further reference, only the IP and sequence number (also requires additional firewall/software to be installed on your part)


...but I have to know what does it mean to verify/validate an extension...

There is no generic rule how an extension should be verified. The rules depend instead on the specific extension and are usually documented in the standard where the specific extension is defined.

Thus, if the certificate contains an extension which is marked as critical and which is not specifically addressed by either the TLS library or by your application according to the rules specific to this extension type than you should not accept the certificate.


I think you are misunderstanding some things. GET, POST, PUT etc. are HTTP request methods, used to send data to the server from a client. They are not used to send data to the client, nor do they affect how it is done.

This token is sent via a hidden field

Your quote describes one way a token may be sent to the browser, in a hidden HTML input field that will be submitted with the form. There are also methods that involve sending it to the browser in a cookie in addition to the form field, as in the stateless "double submit" method. I suggest you see the OWASP cheat sheet for CSRF to see more details.
Usually, CSRF protection isn't needed on GET requests not because it's a security risk itself, but because there isn't any CSRF risk in a GET request if it doesn't change state.


How can I protect my computer from my potentially malicious colleagues?

Yes.  Your colleagues, if they really wanted, could probably access your computer, your personal files, your passwords, your banking account, etc.  That's just the way of it.

There are any number of ways they could do this, if they wanted to be dishonest and malicious.  One simple way would be to install a keylogger (or other spyware) on your machine at some point when no one else is around.  Another way would be to boot up your computer (possibly with a Linux LiveCD, to bypass any password protections) and look at all files stored on your computer, including passwords saved by your browser, etc.  Password protections on your accounts will basically keep honest people honest, but won't stop dishonest co-workers.

In general, it is hard to protect yourself against a knowledgeable attacker when the attacker has (1) physical access to your machine, and (2) authorized access to your local network.  You cannot prevent it.  And, you cannot reasonably detect it; there is no way you'd reasonably be able to reliably detect tampering by looking in the log files.  (I mean, it might be possible, but it's way too hard and complicated, and life is much too short.)

Generally, this is primarily a social problem, not a technical problem.  There are any number of ways that your co-workers or roommates could mess with you.  Fortunately, the overwhelming majority of people are generally honest (or at least, like to think of themselves as honest), especially if you avoid giving them an overwhelming motivation to screw with you.  So I would not spend too much time worrying about the technical issues.  Just avoid putting anything too sensitive on your work machine, and get on with your life.

In other words, here is my recommendation: Don't use your work machine for highly sensitive personal stuff like online banking, porn, or highly sensitive things you wouldn't want your employer to know (e.g., side consulting jobs, controversial activities in your free time, etc.).  Apart from the security risks, you are giving your employer authorized access to all of that information.  Do you really want your employer to have access?  And do you want all that information stored in the company's backups?  It's probably not a great idea.  And, don't piss off your co-workers so badly that they'd be tempted to engage in nasty kinds of revenge (always good advice, regardless of computer security issues).

Personally, I wouldn't worry too much about the computer security risks.  On the other hand, if this has you worried and you want to protect yourself against some kinds of mischief, here are a few modest steps you could consider taking:

install full-disk encryption, and use a hard-to-guess passphrase -- this will make it harder for someone who has physical access to your machine to get at your personal files.
when you leave your machine unattended, log out of the full-disk encryption, and re-type in your password when you come back
make sure the user account you usually use does not have administrator privileges
turn on automatic updates and make sure your browser is fully updated
back up your machine regularly
if you use Firefox, install the HTTPS Everywhere extension (unfortunately it isn't available for other browsers).

These are far, far, far from perfect, and if a co-worker wanted to mess with you, they probably still could.  But if it makes you feel more comfortable, go for it.


Are there any frameworks that work this way?

Sure. Twig or Django would be two examples.

  The inverse of this is clearly a far more secure default, ie. all dynamic data is escaped, unless you specifically tell the framework not to.

Yes, this is a lot more secure.

  Is there something I'm missing?

The one downside is that XSS is context-sensitive. Default encoding may not be enough[*], and it may thus lead to a false sense of security.

On the other hand, just HTML-encoding ', ", <, and > will catch the vast majority of XSS vulnerabilities, so I would say that it is always a good idea to encode by default and provide an option to disable the encoding by default if needed.

  Why don't web templating frameworks HTML escape all data by default?

JSP for example is from 1999. XSS wasn't even called XSS until 2000. My feeling is that newer engines are more likely to encode per default, because the prominence of XSS is higher, and more care is put on security (by default). Older engines likely do not want to break backwards compatibility and thus do not change the existing behavior.

[*] very simple example: <script>var x = foo.[USERINPUT]();</script>.


This assumes many other components of the system are secure. Likewise it doesn't protect the API from direct attack by a bad actor who can register for an account (may or may not be an issue for you). It is also always wise to have in-band protection for connections to any service. Maybe look at something like a Web Application Firewall (WAF) or something like mod_security to add additional controls. Some of it depends on how secure you want things but there are lots of additional security controls depending on your application.

See the OWASP REST Security Cheat Sheet for more information about REST specifically and don't forget to harden your servers and secure your network as well.

https://www.owasp.org/index.php/REST_Security_Cheat_Sheet


Serval other softwares using AES 256 encryption support any key length such as a 10char insted of the 16. how is that possible (such as winzip's aes encryption)?
the same way the other way. how can the encryption depend on the key strength when the key has to be 16 chars what i was thinking was if the passharse was less than 16 then fill the remaining chars with a predefined seed if the passharse was longer than 16 then use the overlapping chars as a salt.

They are transforming the passphrase into a key, by using the hash of the password or other key stretching mechanism.
Of course, any other software wishing to interoperate with your software shall implement it the same way. Just like your program should be using an IV or using AES in some cipher mode (EBC, CBC, CFB, CTR…).
Concretely, zip specification will combine the user-provided passphrase with two salt bytes and use 1000 rounds of HMAC-SHA1-based PBKDF2.

am i missing something completely? how can the encryption strength be based on how good the passharse is when its required to be 16 chars regardless
how would i go about securely using AES256 yet still beable to encrypt other peoples files (who uses the same software)

You have to follow the zip AES encryption specification.
Alternatively, use a library which already handles that for you, like 7-zip

and last question is there anyway to notice what type of encryption is used? do they have a patten that can be seen in the hex ? would having multiple encryption types (with same passharse or predefined modification) do any good?

zip files have a field indicating the kind of encryption used.

NSA has stated they can crack nearly anything with a farm of super computers is a 16 char passharse really that hard to brute with a datacenter full of super computers

A 16-byte key is a 128-bit key, which nowadays is considered. Note that this is quite different to a 16-character password, which would be ~70 bits.


No. Unless there's a vulnerability in the File Stream reader (unlikely), you'll never be executing the malware in order to validate the hash. You are simply reading the contents of the executable to verify whether or not the MD5 hash is a match.

Reading is not the same as execution, and neither is writing.

Note that it's quite possible to fake the MD5 hash value because of collisions. This also doesn't help against an attacker that adds/renames methods in a virus program's source code, and who then recompiles the executable, thus producing an entirely different hash output.


Email address used by someone else to order on line

The first question that comes to mind is why someone would order something, using your son's email address and ship the order product(s) to your address.

In my opinion, fraudsters can be ruled out because there is nothing gained by shipping the products to your address.

Second, how sure are you that the old email address is no longer used by your son? Does it show "last logged in from" information? If so, does this match your IP address / location?

How is the email address protected? Meaning only by a username and password or is there also two factor authentication in place?

Is your son's old email's password used in other places? If so, change the passwords for all of the accounts that use the same password as his account could be compromised.

Deleting the email address will destroy any evidence, however, changing the password to his old account would perhaps be a better option.

Why this happens? Well that's just a wild guess. Could be anything from your son trying to see what happens to a friend who's pulling a "joke" on him. As mentioned before, I doubt it's a fraudster because it doesn't make sense to ship product to your address.

This is perhaps not what you wanted to "read", but I've seen crazier things happening.


Can a MiTM essentially block a connection?

In the common understanding of a man in the middle attack, the attacker can actively tamper with the traffic, i.e. not only passive sniffing. There are typically no limits assumed of what exact modifications the attacker can do, which also means that they could simply drop the traffic and thus block communication.


Whether or not the client is vulnerable depends on the version of jQuery and on whether or not they are also loading jQuery migrate. I built this test site a while back, where I test different versions of jQuery against two of these bugs:
http://research.insecurelabs.org/jquery/test/

Retire.js (free open source tool maintained by me) will tell you if the versions of jQuery you have on that site are vulnerable or not: http://retirejs.github.io/retire.js/
The chrome version of Retire.js may be you preferred choice.


how to protect my USB stick from Viruses

Since you don't want to change USB sticks to one with a write-protect switch (don't know why, they're cheap), perhaps you should look into getting yourself a USB write-blocker (aka a Forensic disk controller).

These are generally used by forensics experts when gathering data from a suspect's drive, where they're not ALLOWED to write back to the drive or it will spoil the validity of the evidence, so they have these devices to prevent the computer form writing back to the USB device.

Here's one for example.

  The UltraBlock Forensic USB Bridge brings secure, hardware-based write blocking to the world of USB mass storage devices. The UltraBlock USB Write Blocker supports USB2.0 High-Speed (480 Mbit/s), USB 1.1 Full-Speed (12 Mbit/s) and Low-Speed (1.2 Mbit/s) devices conforming to the USB Mass Storage "Bulk-only" class specification. The UltraBlock USB Write Blocker works with USB thumb drives, external USB disk drives, even USB-based cameras with card-reader capability.


Can a domain administrator read my search queries?

You'd need to discuss specifics with Google and your domain admin, especially since much depends on the exact set up of you apps account, but it is a safe assumption that the domain administrator will be able to see almost as much as google can when it comes to your apps account activity. After all, they're paying for it.

(Also, good chance they are paying for the network and the computer you're using as well, so they may well be able to see everything being done with those resources as well.


Why do so many cracking attempts originate from China?

First, China has lots of people. It has more than 4 times as many inhabitants than USA. Then lots of them are young and well educated and smart enough to do hacking. And while I'm sure that China has tough laws against hacking of chinese infrastructure, it might even profit from hacking outside infrastructure. This way of thinking is not specifically chinese, just remember privateers or recent hacks against brazil by anonymous with the help of the FBI.


Is it really true that Google knows most of the worlds wifi passwords

The article is a huge amount of FUD and scaremongering, but even if you take the basic info outlined in it then there is only a small worry and it is very easy to protect yourself.

if you have your android device set to backup online then yes, it will back up known wifi passwords. This is the same as iPads and other devices that give this cloud backup option.
assume most people do these online backups- so there is a lot of this sort of data stored. The connection the article makes is that Google knows these passwords. This is not really true. It's like saying that Google knows all your data. It may store it, but that is very different to knowing it.
potentially, if this data is stored in the clear and Google is hacked then it could be a worry, but to be honest, there are far better ways to attack me than access my WiFi.

Solutions:

Use SSL or other encryption when using 3rd party networks, even on encrypted networks. This should be default behaviour anyway.
Turn off online backup on any device that uses your WiFi

And of course - as Joshua says: If you have something you don't want anyone else to see, never share it with anyone (this includes never putting it on someone else's servers)


How reliable is ASP.NET's Request Validation feature?

As a penetration tester I have found that "Request Validation" fails in a number of situations.  Developers tend to believe that "Request Validation" == "magic",  and it protects them completely from XSS,  when in fact this false sense of security results in in very serious problems.  All forms of DOM based XSS and Persistent XSS will bypass "Request Validation",  and there are other cases where it fails:

In this next case the attacker does not need to write an HTML tag,  by simply writing a JavaScript URI an attacker can execute JavaScript:

xss

In this case the attacker is already writing within a script tag:


Brute force a password with a lot of hash (of the same password)

The latter - you just need to hash each word in your password guess list with one of the salts and then compare each resulting hash.

Note that the salt is not considered private - all that a long list of different salts against the password gives you is a small number possible representations of that password in a DB. It does not make it easier to guess the password.


What does Encryption at REST and HTTPS mean?

HTTPS is one form of "encryption in transit", which means that data passing over the network to or from the application is encrypted. "Encryption at rest" means that the data the application stores on its local storage is encrypted, so that an attacker who can access the storage but not the application itself can’t read the data.


log user IP address per api call or per session

If you're simply trying to grab the IP for analysis of location, then you only need that once.  Grabbing the IP multiple time, per connection will not add more information to aid in an investigation unless you're expecting the target user's IP to renew at every connection.

If you are concerned about the level of information then you may want to consider grabbing the MAC, username and or system name, if possible, in your setup.  All of these can easily be spoofed and changed, but it may provide more valuable information in the case that a target user IP is coming from a NAT'd public IP.


SSH key-type, rsa, dsa, ecdsa, are there easy answers for which to choose when?

In practice, a RSA key will work everywhere. ECDSA support is newer, so some old client or server may have trouble with ECDSA keys.  A DSA key used to work everywhere, as per the SSH standard (RFC 4251 and subsequent), but this changed recently: OpenSSH 7.0 and higher no longer accept DSA keys by default.

ECDSA is computationally lighter, but you'll need a really small client or server (say 50 MHz embedded ARM processor) to notice the difference.

Right now, there is no security-related reason to prefer one type over any other, assuming large enough keys (2048 bits for RSA or DSA, 256 bits for ECDSA); key size is specified with the -b parameter. However, some ssh-keygen versions may reject DSA keys of size other than 1024 bits, which is currently unbroken, but arguably not as robust as could be wished for. So, if you indulge in some slight paranoia, you might prefer RSA.

To sum up, do ssh-keygen -t rsa -b 2048 and you will be happy.


Untrusted connection visiting https://www.opensource.apple.com/

Looks like the certificate is only valid for opensource.apple.com, not www.opensource.apple.com:

  www.opensource.apple.com uses an invalid security certificate.

  The certificate is only valid for opensource.apple.com

  (Error code: ssl_error_bad_cert_domain)

You can simply use the former.


Where is my missunderstanding in how digital signatures are used with licence files to allow program to run?

Let's state things clearly: there is such a thing called asymmetric encryption. There is another, completely different thing called digital signatures. Whenever you see some text that talks about "decryption with the public key", then that text is really talking about signatures, and is trying to explain signatures as if it was some kind of encryption, which:

works only for a specific algorithm called RSA;
does not a actually work for RSA, when looked at closely.

So it is much better to talk to things under their true names.

What a signature can do for a license file is to guarantee that a piece of data is genuine:

The vendor owns a key pair that consists in elements that are mathematically linked together: the public key and the private key. They are called that way because though they are facets of the same mathematical object, there is no known method to rebuild the private key from the public key; thus, the public key can be made public, since this does not reveal the private key.
The vendor uses the private key to compute a signature on the license file. The signature generation algorithm uses as inputs the data to be signed (license file contents) and the private key, and outputs the signature.
The application verifies that the signature is correct. The application can do that because it embeds a copy of the vendor's public key: the signature verification algorithm uses as inputs the data which was signed (the license file contents), the public key, and the signature; and that algorithm returns "that's OK" when the three elements match.

By the magic of the cryptography in the signature algorithm, only the private key owner (the vendor) can produce signature values that the verification algorithm will accept as "correct" with regards to the vendor's public key. Outsider, who do not know the private key, cannot do that.

It is still up to the application to enforce whatever the license file says. What the signature on the license file guarantees is that the license file really comes from the vendor. The rest is up to the application.

Of course, signed license files do not really prevent piracy. The critical part, here, is that the application must still include a copy of the vendor's public key, verify the signature, and apply the rules contained in the license file. Someone who wants to copy the application and run it elsewhere may still do a bit of reverse engineering and do one of the following:

Replace the public key embedded in the application with his own public key, for which he has the corresponding private key, allowing him to produce his own fake license files that the application will blindly accept.
Patch the application code that checks the signature on the license file so that an invalid signature is accepted nonetheless. This is not hard to do; ultimately, in the compiled code, there is a conditional jump opcode that sees what the signature verification algorithm returned (a boolean value that says "signature is valid" or "signature is not valid") and jumps to the relevant piece of code. It suffices to replace that conditional jump with either a nop, or an unconditional jump.
Remove the whole license file processing code altogether. Wherever the application contains a call to the license-checking system, simply remove the call.

Since that kind of reverse engineering is easy, it would be wrong to imagine that a signed license file really prevents software piracy. What it helps with, though, is legal qualification. When some reverse engineering is involved, intent is made plain. The software pirate can no longer be casual about it; by altering the application code to circumvent the license file checks, he clearly demonstrates that he knows what he is doing. Depending on the jurisdiction, such a legal qualification can matter a lot when it comes to police raids and trials.

Your code appears to create a 512-bit RSA key, which is very weak. A 512-bit RSA key was cracked in 1999, with the computing power that was available to academics at that time (by "cracking" I mean "reconstructing the private key from the public key"). Nowadays, it can be done with a single desktop computers in a couple of months; alternatively, it can be done in a few days with about 75$ of rented computing power from some cloud vendor like Amazon.

Similarly, using MD5 as companion hash function (the RSA signature algorithm uses a hash function as additional element) will get you bad points, since that function is considered "broken" (actually, it can still be used securely in the context of RSA signatures, but one has to be careful about it, and it still looks bad during audits).

You seem to sign just the "expiry date", which makes your license files generic -- applicable to all application instances. This is problematic because it suffices of a single leak of a valid license file to allow everybody to use it. Usually, people who make signed license file design the file contents so that the signed data includes a unique identifier for the application instance: the application, when it installs on the computer, create a unique, random identifier, sends that to the vendor, and the vendor signs a license file that contains that identifier. That way, a license file can be made specific to each instance, and not usable to unlock any other instance. Alternatively (or complementarily), the license file may contain the customer name so that leakages can be traced back to the culprit (and thus, hopefully, deter wannabe leakers).


What risk can untrusted WS-Federation metadata pose?

Well, more accurately it says that untrusted relying parties pose a risk.

If you accept token requests from any RP then an attacker could easily gather a fair bit of information about a user. That is the risk. If you only repond to requests from RP's that you know and trust then the liklihood that an attacker can gather the same information is less likely.

Untrusted metadata on its own isn't really all that risky. It only becomes risky if you start to consume it.

If someone compromises the metadata of a trusted RP then they can do a few things. They can modify the default set of requested claims (but it's still up to the STS to fulfill that request), they can modify the signing key or the encryption key, allowing for man in the middle or related attacks, they can modify the contact details of the administrator, or they can modify the endpoints that tokens are sent to.

The biggest threat IMO is changing the keys. This doesn't necessarily affect the security of the STS directly though, just the RP. Of course, you could be held responsible because you accepted the change of keys, blah blah blah.

The only time I allow metadata to be automatically refreshed is during development. For production deployments I copy the metadata locally and verify it before adding it.


Can Central Authentication Service (CAS) do authorization?

No, CAS is just an Authentication Service, but you can surely impose Authorization using the mechanism, which is the base of doing authentication for your CAS.

Say, if you are using LDAP to authenticate the Accounts for CAS. Then, for the requirement like yours.....

You can create UserGroups in LDAP and assign respective User IDs to their groups.

Now, at web application you keep the log-in via CAS which on success contacts LDAP (or whatever Auth-Mechanism you have at backend) and fetches the UserGroups assigned to the User.

Now, on the basis of UserGroups fetched, you can allow/disallow access to web-app features.


Is a mail secure if it's PGP-encrypted, but unsigned when sent with DKIM?

First, DKIM only gives you the assurance that:

  a DNS administrator was involved in the process of signing this message.

That DKIM signature is intended for a reputation to be built with a "selector".  A selector (signing key) is issued:

per user
per groups of users
per domain.

The granularity of that signing is undefined in the RFC and up to the DNS admin.

If you're OK with that flexible, possible anyone-can-sign assurance, then you are OK, but I'm not sure what that will give you.

Next, DKIM has three modes:

Full
Headers only
Partial signing (with the -L (length) parameter.)

The latter two means the encrypted content can be replaced in its entirety with another payload.

Unless you have a very strict implementation of DKIM, it's not a substitute for authenticating an end user (unless all you care about is the DNS name)

I spent time on the RFC working group but left in the late draft stage, so I'm 99% sure that this stuff is still true.


If I use a VPN, who will resolve my DNS requests?

Depending on how your VPN is configured, you might or might not use the same DNS for your VPN and for Internet. VPN's are (typically) like an additional IP stack on your system, and can have a separate DNS server address configured. But not all systems do this.

If your VPN does not assign a new DNS for the VPN session then you will continue to use the DNS server(s) configured in your main Internet IP Stack. This can present a problem if the external DNS cannot resolve internal addresses (or as you indicate, if you don't want internal addresses to be known externally).
If your VPN does assign a new DNS - for example by using DHCP option 6 "DNS Server" - then you can have different DNS servers for the VPN and for Internet. Your OS must support this, as must the VPN service. If you send traffic out both stacks at once this would be "Split Mode".
A final option is that you might operate your VPN in Tunnel Mode, sending all communications (including Internet) through the VPN stack. In this case, when you are on the VPN all DNS would use the VPN's DNS. This is probably the most secure way since all internal traffic is sure to stay in the VPN.


One system I've seen is to use dynamic license codes.

Each time the software is run, it connects back to the vendor's server. It submits the current license code, and is issued a new one. The old license code is invalidated. If the VM is cloned, then only one clone will have the new license code.

Drawbacks with this system:

Internet access is required to run the software.
Legitimate users can lose the license code, for example, if they use System Restore.
It is still vulnerable to cracking - someone modifying the application code to tamper with license checks.

In the example I saw, the need for Internet access and vulnerability to cracking were considered acceptabe. However, the System Restore issue was not, and led to them stopping using this approach.


Check ModSecurity - it's quite decent approach, it does include anomaly as well collective scoring system. You can have a look at Core Rules, there are anomaly entries too. You just load Core Rules to ModSecurity, and there you go, all you need is to test applications and eventually delete, add, modify some rules.

Anomaly entries protect mainly from automated bots or other suspicious clients doing very unsual requests. Without rules made for specific applications (there are rules for popular cmses), what it does prevent is eg requesting web content with non-standard set of headers.

When there are rules for specific applications, it prevents some requests which are not typical for specific application, however how this specifically works and to what level you would need to have a look at Core Rules.

These rules are not some super-specific, but they have more practical approach the way that with no big philosophy they just score anomalies based on rules, and it requires a lot of tuning and changing to get this to work with any specific app, so basically it does what is in the rules, plus what you can do yourself.

They don't protect from bad words, but that's easy to add, they also don't protect from well obfuscated and designed attacks.

Here is a list of protections from Core Rules, which are part of ModSecurity:

HTTP Protection - detecting violations of the HTTP protocol and a locally defined usage policy.
Real-time Blacklist Lookups - utilizes 3rd Party IP Reputation
Web-based Malware Detection - identifies malicious web content by check against the Google Safe Browsing API.
HTTP Denial of Service Protections - defense against HTTP Flooding and Slow HTTP DoS Attacks.
Common Web Attacks Protection - detecting common web application security attack.
Automation Detection - Detecting bots, crawlers, scanners and other surface malicious activity.
Integration with AV Scanning for File Uploads - detects malicious files uploaded through the web application.
Tracking Sensitive Data - Tracks Credit Card usage and blocks leakages.
Trojan Protection - Detecting access to Trojans horses.
Identification of Application Defects - alerts on application misconfigurations.
Error Detection and Hiding - Disguising error messages sent by the server.

ModSecurity is used in vast space of Internet - for example, Akamai, the biggest CDN has this installed on many servers, since they integrated it / or somewhat forked it to their own software. This is because it is cloud friendly - anomaly detection which is collective based - the information comes from several servers, hence it detects anomalies which are geographically distributed between your own servers.


Is an unencrypted log in android's storage considered insecure?

Encrypting log data is only one way to obfuscate parts of the system. If a malicious application already installed on your Android has root on the phone, then they it already has access to everything on the system. For example, the app that has root can install a keylogger, or a screen capture and by pass the need to read a log file. But overall yes, encrypting a file can slow down an attacker from getting all of the log data at once vs getting it in screen captures.


WPAD (badWPAD vulnerability) should I disable or not?

Short Answer: NO, as a home user, unless you misconfigured your DHCP network (or your ISP is doing bad things).

Long answer:
You are not supposed to run your HOME/Enterprise network under an valid internet subdomain name. Depending on your ISP, your computer should have received from DHCP server parameters giving it a FQDN like mylovelyPC.ISPName.loc. or something like that.

If you are running an Enterprise network, you are either using split brain DNS (eg your contoso.com enterprise network is not using the same DNS server and zones from the inner side and the outer side), or two different domains (contoso.loc for LAN and contoso.com) for internet facing servers.
All theses attacks relies on the fact that the PC is using a FQDN which is a subdomain of an REAL internet domain and that the LOCAL DNS is unable to respond to WPAD host query.

Example: You named your network contoso.org.uk, PCs will search for wpad.contoso.org.uk (should reply,) wpad.org.uk (you do not control that one,)
 wpad.uk (you do not control that one either.)
So, if your IT mis-configured your enterprise DNS configuration, you may be at risk, IF someone manage to register wpad.uk or wpad.org.uk.

Looks like they are a lot of people in Poland (.pl) who run mis-configured DNS infrastructure. 8)

By the way, on Windows DNS Servers, the option to block has been there for 10 years, is enabled by default and is called globalQueryBlockList.

Example: dnscmd /info /enableglobalqueryblocklist


How to redirect someone packets connected over the same wifi into my computer using Wireshark?

What is the step by step approach to redirect other people's packets
  into my computer using Wireshark?

For this you need to poison the arp cache of target machine , as you are on windows you can use a very powerful tool CAIN for that , that you will be able to watch traffic

you need to add your PSK in wireshark 802.11 setting in preference list

WPA/WPA2 Enterprise/Rekeys

As long as you can somehow extract the PMK from either the client or the Radius Server and configure the key (as PSK) all supported Wireshark versions will decode the traffic just fine up to the first eapol rekey.

Eapol rekey is often enabled for WPA/WPA2 enterprise and will change the used encryption key similar to the procedure for the initial connect, but it can also be configured and used for pre-shared (personal) mode. Wireshark 2.0 (v1.99.6rc0-454-g1439eb6 or newer) is needed if you want decode packets after a rekey. that as you mentioned you have

  How to prevent the man in the middle to capture packets from my
  computer?

Add a static arp entry of your Local network gateway  in your arp table , it will prevent you from arp MIMT for your outbound traffic

But with Client isolation and tempory keys poisoning is that that easy , you need to use a packet craft to posion other client  by broadcasting arp using AP mac and gtk key for your broadcast encryption

  Is it illegal to sniff other people's packets?

yes , it not a legal deed


You can save the decoded base64-code to a new file with

$ openssl enc -base64 -d < signature > signature.dec

and use der-ascii

$ ./der2ascii -i signature.dec

to get the desired output.

You can also check the plaintext-message-digest by hand.


Security risks using tmpfile() for sensitive data in PHP

The data must be assumed to be flushed when it is written to a file. In theory it might stay in the buffers and never be flushed, but you can't rely on that and you have no way to tell if it did. The temporary file location might be a RAM-mounted disk (like tmpfs in Linux), but you probably don't have access to that information and, again, you can't rely on that being the case. The worst-case (and most likely ) scenario is that it is written to the hard disk, in which case anyone with raw disk read privileges, like the admin, could then search through the raw sectors of the hard drive and examine the data. This isn't as hard as it sounds, I've recovered deleted text files before using a simple chaining of the NIX tools dd and grep.
I don't think that's an issue. The file created from tmpfile() should be auto-deleted when you close the file, regardless of where it was created. (At least, so says the manual and experience.)
Sure. The admin could monitor the temporary directory and makes a copy of any file he sees created. This should be doable at the user-mode level, and it is certainly doable at the driver level (if they wrote a file-stealing driver and put it in the filesystem stack) if they are very dedicated to swiping every temp file.

As a rule of thumb, any data that needs to be encrypted should not be written to a file unencrypted. File contents aren't under your direct control, and unencrypted data needs to be.

Encryption should be possible on-the-fly with standard encryption schemes. It might be a bit more complicated than doing one big encryption call, but it should definitely be possible using any competent encryption library.


Your best bet is to install a HIPS (Host Intrusion Prevention Application) such as Samhain or AIDE. There are far too many files to monitor and an attacker can (and usually will) try to modify whatever they can. Not to mention there are plenty of people who play/tinker with Linux/BSD/OSX viruses, exploits, and proofs of concepts

EDITED FOR AN EXPLANATION AS TO WHAT TO MONITOR AND WHY

Every system differs, one can follow guidelines, baselines, but at the end of the day, the importance of what to monitor as at the discretion of the systems administrator, the data custodian, and a range of other people, or just one person. On any system I have been an administrator on, it is my function to maintain that system. I prefer to know as much as I can about the entire system.

When I install Host Based Intrusion Prevention, I choose to monitor everything EXCEPT log files. Logfiles change, therefore they'd generate many false positives. As an attacker/pentester, I am aware that many professionals who've followed best practices and guidelines, tend to focus on what they perceive (based on risk) as important. This will usually (and mostly ONLY) include directories where binaries are installed. Under Linux/BSD/Solaris:

/bin/
/sbin/
/usr/sbin/
/usr/bin/
/usr/local/bin/
/usr/local/sbin/
/opt/bin/
/opt/sbin/
/etc/

These are not the only places to store files, to hide programs, etc. For example, knowing these are the "usual suspects" being monitored, I have no time as an attacker shoving something into /usr/lib, /usr/share, /tmp, and so forth. These files are not going to be detected because no application is watching what is occurring.

The time and space to monitor these files/directories is minimal. I would rather be safe than sorry. There may be false positives initially, but this is where you can ween out what are legitimate alerts, and what aren't, building from there.


Encrypting configuration on shared IIS7 hosting that uses load balancing

Encryption is possible however at some point you must have a private key or a password that you need to use to decrypt the encrypted data. So the question is where do you put it?

In IIS you could store a certificate private key in a certificate store but in a shared hosting environment you probably don’t have that type of access. Also if you are trying to protect the data from the hosting provider they can easily get access to the key. If you are trying to protect a database connection password, being a hosting provider they probably host you database too so that won’t help.
I would however always salt and hash any passwords that would be entered in a login prompt stored in the web.config. Remember you don’t actually need to decrypt them, only salt+hash in the same sequence and compare.

You may still choose to encrypt the data as it may not be apparent what it is to the casual observer, however it would be trivial to break if they is what they intended.

Hope that helps.


Australia's Legal Do's and Don'ts of Hacking

Do anything you have written, legally binding permission to do. Don’t do anything else.

Those dos and donts apply pretty much everywhere and should be followed. There may be some gray areas such as stumbling onto a bug or glitch on a web facing portal, and you can report those, but don’t start anything intentionally just to have fun. This is where you can get in a lot of trouble really quick.


What can happen if someone gets a hold of a scan of someone else's passport?

If someone gets a scan of your passport they could use it for identity theft. People want a scan of your passport to verify your identity. A scammer could use it for the same purpose if they have other useful information like your address, and government IDs such as social security number.

A copy of your passport has useful data for an attacker, like your birth date and place of birth. Place of birth is often offered as an option for security questions for banking or password recovery. And of course there's your picture as well. So if an identity thief got a copy of your passport they would have a some useful data on you right away.

That being said it's sometimes unavoidable to give out a copy of your passport or other identity documents. It may be a requirement for a job, for example. The best you can do is offer more secure ways to send the data (faxing, snail mail, hand delivery, etc), and be vigilant for identity theft. Don't use anything available on your passport as security questions either.


Is it safe to reinstall Windows without first decrypting the whole drive?

I wouldn't have a clue why you would first need to do a full decryption. It might be that this is a feature for people who are using an OEM version of windows that comes with a special recovery partition. I'd just install windows over your encrypted drive, I don't think that will give you any issues.

The same of course for upgrades for obvious reasons.


When I sign a git commit, what is my signature actually based on?

I took a look at the function "commit_tree_extended" in the git source code for the file "commit.c" (e.g., in this blob).
Based on reviewing this function, when you sign a commit it seems to be signing a string that contains identifiers for the tree object_id, parent object_id, author, committer, encoding (if not utf-8), commit_extra_header, and the commit message.


The link you provided is not a list of trusted root CAs, but a list of trusted Certificate Transparency logs.

Actual lists of CAs for browsers can be found here. Note that chrome does not have its own list, but uses Windows root certificate store.


Algorithms for transaction authentication

Ok, so you want authenticated transactions, so why not just sign each transaction message together with the time. Use asymmetric encryption - my assumption is symmetric encryption is used by multiple users. Once again it's a toss up between computational power and convenience. So symmetric might be a good idea if you're on a low powered system. Then again, if you're on a trusted network, some non lossy compression should also work.

With an OTP, this should also work, in the sense that only the owner of the password should be able to execute up to the number of OTP tokens he has. Usually though OTP is the first step to an authenticated session, after which everything after is considered valid. It's surprising how this paradigm is conserved in many other non related domains.


How long does it take to compute hashes using the MD5 hash algorithm?

1) If one iteration of MD5 takes x seconds, is it safe to assume that n iterations of MD5 takes n * x seconds?

Yes, except that multiple iterations can sometimes be parallelized. So while it takes the same computing time, it may take less wall clock time because more computers can be put to the task.

The key derivation function PBKDF2 relies on this slowdown. It does several iterations of a hash in order to make the whole function slow.

  2) Will salted and unsalted versions of md5 hash algorithms take approximately the same amount of time to compute?

Yes. A typical way to add a salt is to concatenate it to the password, so hashing it will take just a little bit longer to add the extra bytes to the hash.

In case of a password hashing function, you want it to be slow in order to slow down brute force attacks. So a password hashing function such as PBKDF2, bcrypt, scrypt or Argon2 should be used to create a function that takes tens of milliseconds. These slow functions are often made up of fast functions such as SHA1.


History of the CERT secure coding standards?

Not to be too snarky, but did you try googling "cert secure coding history"? First hit:
https://www.securecoding.cert.org/confluence/display/c/History

I believe the first paragraph covers "when and why":

  The idea of a CERT secure coding standard arose at the Spring 2006 meeting of the C Standards Committee in Berlin, Germany. The C Standard is an authoritative document, but ... its language is obscure and often impenetrable. A secure coding standard would be targeted primarily toward C language programmers and would provide actionable guidance on how to code securely in the language.


How does a user get authenticated on server B if they are already authenticated on server A through OAuth2?

First I would define all the roles of all the nodes you have. Looking at your architecture I would pretend that gate Server(C) acts as an Authorization API Gateway which is responsible for managing the tokens which are needed for all authentication and authorization. WebServer (A) and GameSever(B) are the resources which require authorized user to access (using OAuth2 access token or other JWT)

I would define the flow like this:

User opens client desktop which directs him to sign-in using Google
account.
Google responses with identity token (i.e. JWT token) and Desktop client send to Gate Server (C) with information of his client_id and resource he wants to have access (in form of scopes - i.e. game_server)
Authorization API Gate server (C) takes the identity token and on behalf of this creates an access token (or another authoriozation token in form of JWT) and sends to the client desktop which securely saves this.
On every call to Game Server (B) Client Desktop sends the
authorization token and Game server checks that to authorize the
request.

The important thing here is that you have to store the authorization token securely on the client side. This is not easy so I would recommend using something like a reference tokens. On this solution after Game Server (B) gets the authorization token he has to send it to Authorization API to get the token's content (claims). So, in this case, every request from Client Desktop to Game Server (B) results in additional request from Game Server(B) to Authorization API Gateway (C).


What is this URL that loads each time Google Chrome spawns?

It's the URL used to download the Chrome Cast extension for Google Chrome.


How can I recover my exploited android phone?

Check your CO detectors.
Jokes aside, I'd like to preface my answer with this: I find it highly unlikely that your neighbor is using remote exploits against you. The risk model doesn't support it. Unless you work for the government or are part of an international organization (legal or otherwise) no one is going to burn very valuable exploits on you. This is the sort of thing the CIA pulls. I don't believe you have been hacked.
Additionally, the virus scan report does not actually show anything amiss. CANID is a Verizon caller ID service and is not malicious as noted by the report. It "can" be used by attackers, however I've not been able to find any public reports of how this exploit works so I'm assuming it's either very old or just an incorrect flag in the database.
But to answer your question as asked:
Identifying the source
This is very unlikely in your situation as you don't actually have proof of comprise (and so have no where to start). Android does not log network traffic and so you don't have anyway to know where anything you may find came from.
Verifying OS authenticity
Barring exploits against the bootrom, the only way an attacker could have installed a different, patched firmware is through an unlocked bootloader. This status can be checked by rebooting your device to fastboot mode and running fastboot oem device-info with a connected machine. If the bootloader is unlocked, you can be attempt to relock the bootloader. If the device no longer boots/fails chain verification you can know that the firmware is inauthentic.
Additionally, since this is a Samsung device it has a KNOX e-fuse which is an additional indicator for tampering. This fuse, once tripped, is not generally resettable. The fuse is tripped by the bootloader if the bootloader has ever been unlocked. The fuse state can be checked by booting into download mode and pressing volume up.
Recovering
As noted above, I don't think you have been attacked. If you do, however, still believe something is wrong you can reflash the full system image using Odin. Note that this works no matter the bootloader state as these images pass cryptographic verification as they are signed by Samsung and are authentic.


Unless I'm misunderstanding your question, wouldn't you be able to just create a RequireHttpsAttribute (inherit from ActionFilter) that does this, and decorate your controllers/actions with it?

Inside that, check the uri scheme of the request and disallow the request returning forbidden if it doesn't match the right scheme.


When using Hotspot you are protected by strong encryption (128-bit key). Attacking that encryption is effectively impossible. So consider your data sent via Hotspot secure.

If someone is really trying to attack your connection, they will likely have better luck attacking your devices than your network connection. Be sure to have strong passwords on your devices and always apply security patches as soon as possible.


Does Mozilla's Firefox browser repeatedly connect to Google Analytics servers?

Mozilla Firefox does not make connections to Google on it's own. It could be:

One of the add-ons or plugins, but then you would have to look at the full URL string of such request. It's OK to disable all plugins and all add-ons which are not very popular or known to be  malware, or recently turned malware (some organizations are taking over old add-ons and load them with malware)
Website you are visiting can be simply making there requests

There was once "Tracking Protection" initiative in Firefox but today it seems broken. However you can try give it a shot, see here: Firefox Tracking Protection  (you need to enable privacy.trackingprotection.enabled)

Another alternative is to use Private Browsing. Private Browsing

Finally, there's 3rd party add-on uBlock Origin - with this you can be sure no more requests to Google Analytics while keeping the websites working. Of course 3rd party add-ons are not so very safe, and may become a malware in future, so deployment to many users is not recommended.


Why is scanning considered a pre-attack and not reconnaissance?

In an attempt to clear up your confusion, if you think of reconnaissance (or footprinting as you have here) as non-invasive - that is using tools that will contribute to your stock of information about your target without directly communicating with it (and potentially tipping your hand of your interest in the target). Tools that may fall into this category are Google, Bing, Shodan, dig, nslookup, theHarvester, etc.

Scanning is generally an activity that will interact directly with your target - and whilst maybe not informing the target immediately of your interest (if they're not looking), will potentially log your activity on their perimeter or web logs etc., depending on how the logging is configured. Tools that may fall into this category - with varying degrees of noisiness - are nmap, Nessus, Burp Suite, etc.

Scanning is a process that could be argued to bridge the pre-attack reconnaissance phase (i.e. non-interactive) and the more active attack phase (interactive), as it could fall into both. Example - you simply scan a target to find out what ports are listening (which would contribute to your information about the target but interacts, yet still may not trigger any logging alerts) but later on in the test you may scan/probe some of the ports more aggressively which may tell you what version of SQL is listening which may trigger an alert on the target.

To summarise, personally I prefer to define non-interactive and interactive information gathering as logically separate in an engagement, which will hopefully make things clearer for you.

As @eckes mentioned below, the more generally accepted terms for non-interactive and interactive are passive and active respectively.


Ring Oscillator: True Random Number Generator (TRNG) vs Physically Unclonable Function (PUF)

In the TRNG construction, the rings do not have a common enable signal, the only point in time where they are synchronized is at power up. Then they run freely, each at its own pace. This does not create a great deal of randomness per se but that does generate a lot of glitches at the flipflop inputs. The hope is create more randomness out of meta-stability.
For the PUF there is a common enable so the ring oscillators are racing against each other with a common synchronizing point at the start. The challenge input selects which instances are competing. For a given challenge and a given chip, the outcome of the race tends to have always the same outcome as the precise frequency of each ring depends on the precise physical characteristics of each of their stages.

It is not related to how long the RO are running, this is just how the outputs are used which makes the difference. You can even remove the enable signal in the PUF, that will still work because what counts is the difference in the frequencies while for the TRNG this is the actual output values at the time of sampling that matters.

That TRNG may be truly random but it is tricky to get right (to get a high data rate). Other constructions relying on asynchronous rings or chaotic maps are a safer bet.


Generally, there's a long list of servers and protocols vulnerable for UDP amplification. A few command line calls to determine the presence of some of the most prominent amplification vectors might be found here. All the commands should better be invoked remotely. E.g. if your server is 192.0.2.1, then, to check for an NTP amplifier, you do

ntpdc -nc monlist 192.0.2.1

from your laptop or an adjacent datacenter machine.

I'd recommend to check NTP and DNS first, and if there's no match, then to dive into details.

tcpdump -ni any udp on the server itself will definitely help you to dive. If you're able to spot any traffic you don't expect to see in the dump, you can then track down the vulnerable application listening on the port seen in the dump by looking (or greping) at the output of ss -lpn.

EDIT. So now, as you've provided the IP address of your server, I've been able to check it myself, and it turns out you have a PORTMAP amplifier active:

$ rpcinfo -T udp $ip | wc -l
      17
$

So you basically needed to go through the rest of the checks past DNS and NTP ones.

The fix is obviously to disable port mapper (here's how you do it on Debian/Ubuntu) or at least block the access to the port 111/UDP via firewall.


Why Do we Need CAPTCHA? In what case we should use it?

I am not going into basics of CAPTCHAs based security as you can read it from Wikipedia. But what interesting is how accurate they are and what are the evaluating parameters for them. To my knowledge CAPTCHAs has been broken in research with image processing techniques but still requires practical implementation and its just a matter of time i.e. you can read a recent Decaptcha techique  . There are two ways to evaluate CAPTCHAs

Coverage : Number of captchas a user attempts
Precision: Number of captchas answered correctly

A very nice must read paper for understanding use of Captcha based security.


No because the browser dont change anything in the request when sending it over https (It will only encrypt it additionally). An attack with e.g. XSS will work exactly like it would work with http.

https only prevents from another type of attacks like man in the middle reading the session.


How to get GnuPG fingerpints only for specified key name, not for substring matches?

The relevant part of the documentation (man gpg) is the chapter "HOW TO SPECIFY A USER ID", pretty much at the end of the manual page.

The default mode is substring matching, which is what you observe (test2 contains the substring test).

  By substring match.

  This is the default mode but applications may want to explicitly indicate this by putting the asterisk in front.  Match is not case sensitive.

Heine
*Heine

You want to use exact matches instead, where you have the options of matching words, a mail address or the whole user ID string depending on your specific needs:

  By exact match on OpenPGP user ID.

  This is denoted by a leading equal sign. It does not make sense for X.509 certificates.

=Heinrich Heine <heinrichh@uni-duesseldorf.de>

  By exact match on an email address.

  This is indicated by enclosing the email address in the usual way with left and right angles.

<heinrichh@uni-duesseldorf.de>

  By word match.

  All words must match exactly (not case sensitive) but can appear in any order in the user ID or a subjects name.  Words are any
  sequences of letters,  digits,  the  under‐
            score and all characters with bit 7 set.

+Heinrich Heine duesseldorf


How does the DNS-spoofer know the original destination of the packet?

HTTP protocol

For HTTP this could be generalized to

  How does webserver hosting more websites knows which one to host?

This is through technique called Virtual Hosting in which browser appends Host header to every request send and webserver serves the content of the wanted site, deciding via the header. So if I host foo.com and bar.com on the same server and want to visit my foo site, browser will append (determining by URL address in the browser) "Host: foo.com" header.

More info on Wikipedia

Other protocols

Here you have a problem - you do not know. Either you can just capture DNS request (which is also very useful) and send it to it's original destination or you can spoof the destination, but then you need to have some listener on the given port waiting for a specific trafic. This could be used to steal authentication credentials or something like that, but it's very targeted attack.

Otherwise it's very protocol specific.
Maybe the application layer protocol supports something similar to Host header as HTTP.

Lets presume you know the foo.com is also listening on port 21 (FTP protocol). If you knew this, you can spoof the DNS to redirect to your server where your FTP server is listening and steal his credentials.

If you don't have a server listening - by spoofing his traffic, all you can do is DoS him, as your rogue DNS is pointing him to places which don't exist.

Hope this answers your question correctly.¨

M


How do I securely transfer information between airgapped systems?

I don't know the classification/confidentially level of the data that needs to be moved from Computer A to Computer B.  You did state that these systems must be air gapped, so I will assume that the information is critical thus it needs to be protected.

Option 1:
Save the required information to an Iron Key. Mail the Iron Key to Computer B location for data transfer.  Iron Keys are not perfect, but they do use AES 256-bit hardware encryption, have password protection and use onboard anti-virus scanning and active malware defenses.
Pros:
This solution is more secure than a stand USB drive.  The odds of getting infected by malware are low.
Cons:
Requires multiple Iron Keys, which cost about $130 a piece.
Requires mailing costs and potential delays in deliver

Option 2:
Save the required information to a flash memory card in an encrypted format. Mail the memory card to Computer B location for data transfer. Destroy the flash memory card.
Pros:
Flash memory cards are very cheap, so you can use a card once. The odds of getting infected by malware are low.
Cons:
Requires multiple cards.  30 cards cost about as much as a single Iron Key
Requires mailing costs and potential delays in deliver

Option 3:
Save the required information to an [Iron Key.] Use a non-air gapped system to securely transfer the files to a non-air gapped system at Computer B location.  Save the files to another Iron Key.  Upload the files to Computer B and erase the files from the Iron Key.
Pros:
Fastest method to move files between Computer A and Computer B.
Cons:
Requires 2 Iron Keys at both location
Requires a secure non-air gapped system at both location.  This system could a MacBook, which is stored in a safe until needed.  It could also be iPad pro, which could be used to transfer the files.
Overall this method is the most expensive, but it is the fastest and can be highly secure depending on the security controls established.


SSL Connection to the server so no one can sniff passphrases or data
over the network.
Don't forget your backup: it should be encrypted too. The key should be stored independently so if someone gains access to the backup he cannot use the data.
Depending on your country of residence there can be legal requirements for health data protection.
Manage access permissions: make sure that if someone loses access permissions the account gets canceled.
Limit access to certain IP-addresses. In the ideal case the local network. It is pretty unlikely that someone from another continent needs access so don’t be afraid to block whole countries.
Block too easy passwords. Password123 and similar should not be possible! If an attacker gets hold of enough usernames someone will have a weak password. Using multiple IPs / a botnet an attacker can circumvent your brute force protection.


If you accidentally install a malicious OS disk image in a VM, can it cause any harm?

Whilst there is some isolation from the host, your VirtualBox VM may well have established network connectivity on your local network, which may have exposed your local devices e.g. unsecured file shares or insecure router with vulnerabilities or which uses default credentials.


Does connecting from a compromised client affect a VNC server security?

If an attacker has taken control of your client host, and from this client host you connect to the VNC server, expect the attacker to have at the very least the same privileges as you on the VNC server's host and a complete view of your activity during the VNC session (screen content, keystrokes, etc.).

That's typically how an attacker progressively contaminate a full network: he starts by getting his hand on a few unprivileged client machines (through phishing emails or any other mean), then through this machines and using the user's legitimate accesses he can escalate to internal servers not directly accessible from the outside.


What does using Cloudflares WARP app offer that HTTPS (websites) alongside DNS over HTTPS / TLS doesn't?

It looks like Cloudflare WARP uses the Wireguard VPN as the underlying technology to tunnel the traffic between the client and Cloudflare's own servers. This means that everything on this way will be encrypted.
This includes not only DNS and HTTPS content which would also be protected by DNS over HTTPS and by HTTPS. But this includes also HTTPS-level meta data like the target server name (SNI) and IP-level meta data like target IP address. And of course everything not using HTTPS will be encrypted too, but that wasn't your point.
The encryption of these HTTPS-level and IP-level meta data means less visibility in what your are doing for the owner of the Hotspot and your ISP. All they can see is that you connect to Cloudflare and that you are using their VPN. Without the VPN they could still see which sites you were connecting to by analyzing the SNI information in the TLS handshake and/or the target IP address of the connection.

I'm well aware that using WARP is not a substitute for a VPN.

If your goal is primarily to protect yourself from sniffing by your ISP or the owner of a WiFi Hotspot then Cloudflare WARP is a substitute for other VPN. In fact it is a VPN in the classical use case, i.e. to provide protection from sniffing and manipulation when using potential insecure communication lines. It does not address the additional use cases other VPN offer, like  bypassing geo-restrictions of services or providing more privacy by hiding your source IP address.


Are we gossiping in Certificate Transparency?

Doesn't look like gossiping is going to happen at scale
I think Emily Stark is in charge of CT on the Google Chrome side. And I think CT was largely a Google brainchild, so she is probably a good person to listen to.
And she wrote a nice primer on CT last year:

https://emilymstark.com/2020/07/20/certificate-transparency-a-birds-eye-view.html

Gossip is mentioned as such:

There has been an attempt to define gossip protocols for exchanging STHs, but they haven’t been widely deployed yet. Most likely, centralization will turn out to be key. It’s not particularly likely that every browser user will gossip STHs with every other browser user, but it is more feasible for a handful of browser vendors to gossip with one another and then distribute these gossiped STHs to their users.

And she posted a CT thread on Twitter yesterday:

https://twitter.com/estark37/status/1367179923845128193

There gossipping is NOT mentioned. Instead it's about SCT auditing. Which, if I understand correctly, does mostly the same job as gossipping: It verifies consistency.
Most relevant tweet there:

4/ While SCT auditing has been talked about for years, no browser that I know of has ever actually deployed it.

Something a little older: Andrew Ayer blogged in 2018:

https://www.agwa.name/blog/post/four_years_of_sslmate

and he mentioned this:

In March 2017, SSLMate started operating the world's second Certificate Transparency gossip endpoint (Graham Edgecombe gets credit for the first) to provide further resiliency to the Certificate Transparency ecosystem.

And he points to Graham Edgecombe's site:

https://ct.grahamedgecombe.com/

And there's only three gossip monitors listed in total. So not a lot. (But maybe I'm confusing the centralized vs. decentralized gossip again, here.)


What is the difference between HTTPS and EAP-TLS?

no, they don't.
HTTPS is HTTP over SSL/TLS. It is HTTP payload encapuslated in TLS transport.
EAP is credential authentication protocol which is encapsulated in TLS.
They both serve very different tasks. What is common between them is TLS transport. But TLS doesn't care what is encapsulated inside, HTTP, EAP, SMTP, whatever else. Everything can be encapuslated into TLS. But HTTP and EAP are very different payloads and can work without TLS.


Why run ondemand scanners in failsafe mode when the virus could have encrypted itself?

This is a very broad question. As you have not really talked about the type of encryption whether it be file based or memory based and so on.

Short answer:
No, Just because it uses encryption doesn't mean it will be undetectable.

Long answer:
It will however be likely to be undetectable until the AV vendor manually reverse engineers and generate some form of signature to detect (Byte signatures, checksums and so on)

Let's talk about your self encryption. This can be done in many ways.
I am going to guess that you're talking about file encrypting.

So, Virus.exe encrypts itself which is highly complexed as you'll have to encrypt all sections (.text, .data and so on) and change OEP (Original Entry Point) to a self decrypt routine. The whole file has changed checksum but it won't change any more.

You could even go more advanced and encrypt itself each execute (Polymorphic code) which encrypt itself but self decrypt routine which will now be at the EP (Entry Point) can be used as byte signature to detect the malware as this has to be static regardless of the key you use to decrypt it. Otherwise, how would it know how to decrypt itself?

You could even go more in-depth into different forms of polymorphic code, metamorphic code, obfuscated code and so on but I don't know what exactly you're asking for. Either way regardless of what method you use to encrypt any form of itself will leave signatures for AVs vendors to manually reverse engineer and eventually to detect. The question is how long the wild malware will remain undetected for before it get send to a AV vendor to get reverse engineered and how long it will take the reverse engineer team to find static signatures they can use to identify the malware.

If this doesn't answer your question, leave a comment or update your question with the actual type of encryption you're talking about and I'll update my answer.


Is it reasonable to make mandatory inside an organization (in the internal network) that all traffic were encrypted?

Since this question is primarily opinion based - in my opinion :) - my answer will be primarily opinion based.

First, if there's one thing I've learned in the years I've worked in professional IT/security, it's this:  It doesn't really matter if you agree or disagree with a company policy or if you think it's reasonable for them to encrypt traffic as a specific example; it's THEIR (insert company name here) company and they can enforce any policy they want so long as it doesn't break local, state, or federal law/regulation.  If you don't like the policies then you have two choices:  suck it up and continue to work there, or find another employer; it's really that simple.

Now on to my personal opinion of the matter.  I don't think it's a question of whether it's reasonable to encrypt all traffic, even internally, but it's more of a question of why would your leadership want to do this.  I work for a federal agency that has several enclaves (we'll call them islands), one of which deals with SCADA and Industrial Control Systems (ICS).  These ICS enclaves/islands have way more sensitive data than the general enclave that almost all other users are on and in my opinion would be justified encrypting all traffic.  This could help against potential attackers that would try sniffing the network as an example for any helpful information they could obtain.  It could also help prevent a myriad of other things, but when it comes down to it there is a good business case/justification for this.  The business case/justification is that if an attacker gained access to the regular non-ICS/SCADA enclave there isn't much that they could do to damage the systems out in the field controlling important infrastructure.  If they, on the other hand, gained access to SCADA/ICS data from something as simple as a network protocol analyzer they'd have the keys to the kingdom and could take down some seriously critical infrastructure that would affection a lot of people.  That right there is justification to be at least a little paranoid as well as more cautious and take measures such as encrypting all of the traffic internally and externally.  Not all networks would have a good justification for encrypting all traffic.

To answer your specific question, I do think it should depend on the network segment as you've put it, however it may be easier operationally to encrypt all traffic rather than trying to cut out certain areas to encrypt vs leaving others unencrypted.  But, without knowing your company's leadership I can't say why they'd want to do this across the board.


web services: how prevent illegal accesses

You need to define with high precision what it is that you exactly want.

Here, you want to allow accesses from you, personally. The business with the secret key means that access will be granted to whoever/whatever knows the secret key. Embedding the key in the application means that the application knows the key, not you; and, as you note, secrets embedded in a widely published application are not really secret.

So, you have to be clear with yourself. First of, define who should be granted access, and by "who" I mean "the humans". Every human in this set should "know" a secret value which is used by the server to authenticate the said human. If several humans use the same secret value, then the management of this secret becomes complex, because you cannot enforce forgetfulness: you cannot evict a user from the set of people who "know the secret" because he will remember it nonetheless.

Therefore, you should have user-specific secrets. Each human should have his own secret value, and send it to the server to be granted access (since we are talking about sending secrets over a network, I assume that all of this happens under the aegis of SSL). Then comes the question of how technically a user will store his secret value. If he stores it in his head, and make it available to the application he uses by typing it when required, then this secret is a password. But other models are possible, e.g. the secret could be a bunch of randomly generated bytes which the user stores in a file along his app.

You cannot prevent a user who has access to your server from "sharing" that access with anybody else; but with user-specific secrets you can at least:

know on the server who is (allegedly) connecting, and thus modulate the set of operations which the server will allow or disallow;
evict specific users, by removing the secret server-side, without impacting other users.

What you cannot do is to have an app that everybody in the world could download and install and use to access your server, while reliably preventing any access which did not use the exact app that you published. This would be the Holy Grail of piracy prevention, and it proves as elusive as its theological counterpart.


Why is not safe to use the same public key in RSA?

The modulus is usually bound to the key pair. If somebody would want to sign or decrypt anything he/she would basically have to use the same private key. Obviously you cannot generate a valid private key if you only have knowledge about the public key, that would defeat RSA.

If you want a more theoretical answer, then I wish you luck and a good mathematical background.


How easy is it to find a password in a huge text file?

A cryptanalyst would probably just do this by hand;

This is a text file.
All printable characters.
Frequency analysis shows 2 * '<' and 2 * '>' which is true of all plaintexts, whereas all other character frequencies change, which probably means something interesting is going on.

I would say less than an hour to figure out your password scheme. Significantly faster if we have multiple text files.


Nothing here indicates for me a DNS tunnel and all the arguments you present yourself are against this too. The kind of URLs you see are not untypical for CDN or advertisement networks.

Note that *.msn.com is specifically documented in the document you link to as "Windows Spotlight related traffic" and Windows Spotlight is according to Wikipedia "...a feature included by default in Windows 10 that downloads pictures and advertisements automatically from Bing and displays them when the lock screen is being shown on a computer running Windows 10.".

This pretty much explains for me why you see pattern similar to CDN and advertisement networks here. And the trigger for this traffic is likely not the start of Firefox but the start of your computer, i.e. I expect it to happen even without Firefox getting started.


Is there a place where I can upload my honeypot logs to?

One comment by Luc raises an interesting concern. The problem for any site that would accept honeypot logs is to tell whether you're a trusted source or just full of it. They don't want you to accidently/maliciously include legitimate traffic in an attempt to ruin those user's reputations or simply "dilute" the pool by flooding it with meaningless traffic that is not malicious.

I would suggest you just start your own site, publish logs and follow up manually on the more interesting attacks you've found, possibly by disassembling their malware or trying to track down/shut down the C&C. Try to break the news about newer threats never seen before. You would slowly build yourself a reputation and be recognized as a trusted source by the infosec community.