"Security by Obscurity" is among the most commonly used (sometimes misused) phrase in security industry. The phrase is supported by giving examples like, leaving the back door of your house open, as nobody knows about it or like keeping the key of your house under the door mat or in a flower pot next to the door.

As per wikipedia, the origin of the phrase can be traced back to the Kerckhoff's principle, "a system should be secure because of its design, not because the design is unknown to an adversary".

One such example I can remember is encryption and authentication process in Whatsapp messenger (though in case of encryption, it could be a case of ill-informed cryptographic implementation, but considering it is a well funded company and still lacking on such important aspect, makes me think on lines of "security by obscurity" as well).

As per wikipedia, NIST in its document on "Guide to General Server Security" talks of this security principle. Bruce Schneier in this article talks about it as well. There are many other references on wikipedia like, Peter Swire, Jay Beale etc.

This brings to the important part of the question, does it prove that open source is better than closed source. In my view, it depends on the size of the project, how many developers are working, background of developers, and quality control practiced. There is no way to tell which one is more secure than the other one, just by looking at the model of development used. Historically, both the camps have chequered history.


How to get a Network's WIFI Password through CMD?

Windows stores these encrypted in the following locations:

In Windows XP, wireless keys are stored in the Registry under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WZCSVC\Parameters\Interfaces\[Interface Guid]. The [Interface Guid] is a unique GUID value the represents your wireless network card. The keys are well-encrypted by Windows operating system, so you cannot watch them with RegEdit.
In Windows Vista, wireless keys are stored in the file system under c:\ProgramData\Microsoft\Wlansvc\Profiles\Interfaces\[Interface Guid]. The [Interface Guid] is a unique GUID value the represents your wireless network card. The keys are stored and well-encrypted inside the .xml files that you can find in the above path.

Via Nirsoft


Setting up a wildcard certificate, question about generating CSR?

What you are supposed to generate is the cryptographic key pair. You keep the private part; the certificate request (CSR) contains the public key. The CA (godaddy) wants your public key since that's what they will put in your certificate.

Theoretically, the best place where you can generate the key pair is on the server itself: the value of the private key is that it is private, and the more it travels, the more it risks to be exposed. However, it seems that you want to send the certificate "as a PFX file", which means the certificate and the private key, bundled together as an archive (which is password-protected). Thus, the private key will travel. Under these conditions, you may as well generate the key pair on a machine where it is most comfortable for you.

In the Microsoft/Windows world, the tool to generate certificate requests is certreq.exe. That tool works with a configuration file (that they call an "INF file", though there is no actual need that its name ends with ".inf"). The configuration file sets the fine details of key generation (key type, key length, name in the CSR,...). The CA, or the vendor who ask for a PFX file, should help you with that (I mean, I cannot guarantee that they will help you, but it is their job to do so).


How to scan Javascript for malicious code?

One approach would be to define a safe API for the extensions to use, by declaring objects implementing that API in the scope of execution for the extension. Then require the extension code to be written in a sandboxed version of Javascript, so the extension code can invoke only the safe API methods you defined and nothing more.

So, if your API consisted of an object stored in a variable api, then the code:

var x = api.frob();
x.bar();

would be allowed extension code, because api is part of your safe API, and the safe Javascript variants allow you to invoke the API that is exposed to extension code.

However, the code:

document.createElement("img");

would not be allowed, because document is not part of your safe API.

In designing the API, make sure that no exposed object has properties that could be used maliciously. To give limited access to a resource, use closures to make functions that privately reference the resource.

There are a number of projects out there that have defined a sandboxed version of Javascript you could use for this purpose: SES, Caja, ADsafe, FBJS, and others.  SES and Caja let developers write code with the fewest restrictions: it feels a lot like just writing Javascript, with a few minor restrictions (e.g., no eval, no with).  ADsafe and FBJS require the developer to learn a variant of Javascript.  SES, ADsafe, and FBJS have the best performance.  SES requires support from a very recent Javascript engine, and thus is not compatible with some older web browsers.  If the extension code will be executed on the server side, then SES may be the best bet, because you can ensure your Javascript engine is up-to-date.  If the extension is going to be executed on the user's browser, you might consider Caja if the extension is not performance-critical, or ADsafe/FBJS if it is.


What is the difference between the many identifiers in GnuPG?

Information regarding the key fingerprint/key id calculation is available in RFC4880 (and RFC4880bis). For RSA-only v3 keys (now deprecated), key id was low 8 bytes of RSA modulus, and fingerprint was MD5 hash of the key-specific data.
For v4 keys key id is rightmost 8 bytes of the fingerprint, which itself is SHA1 hash of some key-specific data + key material.
For v5 keys fingerprint will use SHA256 hash.
Key grip is used internally in GnuPG, and it is SHA1 hash of key material with some additional formatting, but without OpenPGP-specific data.
Grip is used to build filename of the secret key(s) in GnuPG keyring, and probably it's the only usable information about it :)


WAF (Web application firewall) is meant to protect an already deployed application independently of the underlying application.

SAST (Static Application Security Testing) is meant to scan your code and find known vulnerabilities based on code.

DAST (Dynamic Application Security Testing) is meant to scan your already deployed application and find known vulnerabilities based on a live running instance.

SCA (Software Composition Analysis) is meant to analyze third party dependencies for known vulnerabilities.

Don't mix them up, there is no WAF vs SAST/DAST. WAF is meant to be application independent, you could potentially have a vulnerable application, but because you have a WAF in front of it, you still are protected.

An ideal devops environment would involve all of the tools mentioned, although, a potential debate here could be DAST vs SAST, but this is out of scope of the question.


How to verify website owner behind CloudFlare SSL?

In this case, you'll have to rely solely on the Browser trust model. Here's a couple reasons why.

CloudFlare as Proxy

CloudFlare operates by acting as a TLS-terminating proxy. That is - you connect to CloudFlare, and they connect to whatever server their customer has configured to fetch the page. Your TLS session is with CloudFlare, and they may or may not have a separate session with the origin server.

Since CloudFlare is the termination for your TLS connection, whether you like it or not you'll need to trust CloudFlare to use this service. The connection maintains no trace of what was on the back-end connection of the proxy except for the page contents of the result.

Here's the part I don't like about CloudFlare personally: since CloudFlare provides an option for customers to operate without TLS on the backend, you effectively have no assurances when connecting to CloudFlare that this connection was encrypted between CloudFlare and the origin server.

On the flip side - one could argue that it's not CloudFlare's responsibility to secure the connection to the origin if the customer has chosen to use insecure settings.

CloudFlare as Certificate Authority

The certificate is issued to CloudFlare, and they manage the Private Key for their proxy servers. So if you want to use this website, you'll need to trust that CloudFlare is not going to allow the compromise of one of their customers' websites by issuing certificates for a domain they have not validated to be controlled by their customer/user.

The protections against them issuing false certificates are partly technical - as there are watchdog organizations that run crawlers looking for rogue CAs, and we also have Certificate Transparency Logs which can be monitored by domain owners to see if a CA they don't work with has issued a certificate on their domain.

But the main protection against this misbehaviour from CloudFlare is human. The CA/Browser Forum is a collaboration between Certificate Authorities and Browser vendors to set some baseline rules for who is allowed to have a Root Certificate included in the Browser's trust store. If CA's are found to be issuing rogue certificates - or are otherwise in breach of industry best practices - the Browsers may punish them by revoking their status as a trusted CA.


Use this command: ssh-keygen -o -p -f keyfile

Changing the private key's passphrase without changing the key


Storing customer data securely (compliance)

This White Paper from SANS discusses network architecture and the use of a DMZ: https://www.sans.org/reading-room/whitepapers/bestprac/infrastructure-security-architectureeffective-security-monitoring-36512

The PCI DSS is related to cardholder data but, if you substitute 'sensitive' for cardholder, the guidance is pretty good - see requirement 1.3.6 Place system components that store cardholder data (such as a database) in an internal network zone, segregated from the DMZ and other untrusted networks.

Similarly, the PCI DSS discusses the use of encryption:

3.4 Render PAN unreadable anywhere it is stored (including on portable digital media, backup media, and in logs) by using any of the following approaches:

One-way hashes based on strong cryptography, (hash must be of the entire PAN).
Truncation(hashing cannot be used to replace the truncated segment of PAN).
Index tokens and pads (pads must be securely stored).
Strong cryptography with associated key-management processes and procedures.

In relation to storage of production data the following is also required within PCI DSS:

Development/test environments are separate from production environments with access control in place to enforce separation.
A separation of duties between personnel assigned to the development/test environments and those assigned to the production environment.
Production data (live PANs) are not used for testing or development.


Secure Azure to Data Centre Web Service Calls via Trusted IP?

Securing by IP is a great first step. It severely limits your attack surface. But, as you point out, the source IP in PAAS deployments has limited trust value.

Adding a (reverse) proxy server between the outside world & the inside (local) server will also make things more difficult for an attacker. In business settings, having a reverse proxy separate from the application server also allows you to give the developers & the IT security team their own "box". The proxy server can then be hardened & closely monitored (making IT security happy) without much affect on the application (making the developers happy).

Finally, setting up a secure IP transport (e.g. SSH tunnel, VPN, or HTTPS with a limited set of certificates) between the Azure servers & the internal network will greatly limit the attack surface. This may be difficult with the Azure platform, which is why I have it last.


Does SNI reveal the virtualhost during the CONNECT query to a HTTPS proxy?

The raw answer to your question is: yes, SNI reveals the target host name to the proxy. But, to be more complete:

As @Steffen indicates, the CONNECT method usually works with host names. The client could ask for a connection with a target IP address, or another host name which happens to resolve (through the DNS) to the same IP address, but clients don't usually do that.
Once the connection is established, the proxy is supposed to forward all data bytes back and forth, which implies, in particular, that the proxy sees all the bytes. If SNI is used, then the ClientHello handshake message from the client will contain the target server host name.

One may note, in particular, that a proxy could "delay" the sending. As per the RFC, when the proxy answers to the CONNECT request, it is supposed to have already talked to the target server; but a slightly cheating proxy could claim that the server was contacted, and wait for the client's ClientHello message to do the actual connection. This (theoretically) allows for dispatching requests to different actual servers depending on the target host name.
In any case, the server will answer with handshake messages of its own, including its Certificate. This is sent, necessarily, prior to any encryption taking place. The server's certificate will contain the server's name (the client verifies it) so, regardless of SNI, the server's name cannot be considered a well-preserved secret.

What is encrypted is whatever is sent after the handshake, i.e. the HTTP headers. But all the proxy stuff happens before, and the SSL handshake itself contains unencrypted data.

Now maybe your question is about situations where the connection to the proxy uses SSL, and the enemy is an eavesdropper between the client and the proxy, not the proxy itself. In that case, the enemy won't see the target host name. The enemy will see the SSL handshake, with SNI, between the client and the proxy, and SNI will show the proxy name at that level. Once the tunnel is established, anything that occurs between client and proxy is quite opaque to the adversary (though he will still be able to make a good guess about the size of the data exchanges).

As was pointed out, DNS requests may be revealing. A typical client will first need to resolve the target name to decide whether it is a "local" or "non-local" server, the latter being handled through the proxy. Thus, chances are that the client will first shout the target server name, unencrypted and out of any SSL context. It is probably possible to configure proxying so that such leaks do not occur, but it can take some effort. A more comprehensive proxying solution (VPN, SOCK proxy over SSH...) may be more effective at hiding the names of the sites you browse from your coworkers / fellow students / whatever.


Self-decrypting archives are a bad idea.

They are a self-inflicted security exposure. You're sending an executable file to someone and asking them to execute it?  And then, just to add gravy on top, you're asking them to type their password into this untrusted program they got from who-knows-who? Nuts!  That is effectively training people to behave in an insecure manner.  Using self-decrypting archives is just asking for problems down the line.

Using a self-decrypting archive is a statement that you have a file so sensitive that it needs to be encrypted, but so harmless that you are asking the recipient to throw caution to the wind and disregard standard security practices.  That doesn't make sense.

Personally, I think that GPG's lack of support for SDA's is a feature, not a bug.

Further resources:

Don't use self-decrypting files.  "Self-decrypting files are not cool at all."  "Self-decrypting files are a man-in-the-middle attacker's dream come true."
Is creating SDA's possible with GnuPG?  "These are an incredibly bad idea. So,
no."


What kind of privacy leakage do stuff printed to stdout pose?

Printing to stdout is pretty safe, since it's not logged anywhere by default. The data will be lost when the console session dies, though bits might end up remnant in memory. Piping to a file is a different issue, since once it hits disk it might end up being left on slack sectors.

Keep in mind that the command itself will usually be logged into your bash history. You can clear this using history -c, or you can stop the command from being logged by prefixing it with a single space. Commands prefixed with a space aren't stored in your bash log, and aren't kept in your session's command history.

If you're really worried, just pipe it to /dev/null and it'll be immediately discarded.


Authorize the access ability to a user in Oauth 2.0?

The answer is yes. Why? Because it is what OAuth is intended to fulfill: delegation of (a secure) access to a user (B) for a resource on behalf of a resource owner (A).

I think the description in this draft will be quite straightforward to you:

  (A)  The client requests authorization from the resource owner.
  The authorization request can be made directly to the resource owner
          (as shown), or preferably indirectly via an intermediary such as
          an authorization server.

  (B)  The client receives an authorization grant which represents the
          authorization provided by the resource owner.  The authorization
          grant type depends on the method used by the client and
          supported by the authorization server to obtain it.

  (C)  The client requests an access token by authenticating with the
          authorization server and presenting the authorization grant.

  (D)  The authorization server authenticates the client and validates
          the authorization grant, and if valid issues an access token.

  (E)  The client requests the protected resource from the resource
          server and authenticates by presenting the access token.

  (F)  The resource server validates the access token, and if valid,
          serves the request.


What is the difference between a Hash Function and a Cryptographic Hash Function?

Every cryptographic hash function is a hash function. But not every hash function is a cryptographic hash.

A cryptographic hash function aims to guarantee a number of security properties. Most importantly that it's hard to find collisions or pre-images and that the output appears random. (There are a few more properties, and "hard" has well defined bounds in this context, but that's not important here.)

Non cryptographic hash functions just try to avoid collisions for non malicious input. Some aim to detect accidental changes in data (CRCs), others try to put objects into different buckets in a hash table with as few collisions as possible.

In exchange for weaker guarantees they are typically (much) faster.

I'd still call MD5 a cryptographic hash function, since it aimed to provide security. But it's broken, and thus no longer usable as a cryptographic hash. On the other hand when you have a non cryptographic hash function, you can't really call it "broken", since it never tried to be secure in the first place.


How to intercept an application that bypasses local proxy

Well, if your application won't work through a proxy, then you're obviously going to have to use non-proxy based analysis.

Note that this will probably not be anything like as user friendly as the proxy tools you are using. For example, Web Scarab knows that an application is communicating over HTTP/HTTPS (simply because it is working over an HTTP proxy) and so it can tell a lot about what it going on. If you have to use a low level sniffer like Wireshark then you are going to be looking at individual packets that could be anything and, while Wireshark will try to decode them as much as possible, you're going to have to do a lot more work.

You're going to miss fiddler even more if you were using it to modify the data going through - at the packet level you're going to use something like Nemesis which is heavy going.


Why limit request variable name and value lengths

In a word, yes.

To elaborate, by limiting the size of variables, you reduce the chances that an attack will be successful.  This is because the limit reduces the chance that the information passed can trigger an overflow, the chance that the variable will be able to hold an effective payload, and the chance that the system can be overwhelmed when processing overlong variables.

If it's a legitimately long variable, you should be possible to increase the limit, but keep in mind the larger the limit, the greater the amount of space potential attackers will have to play with.


You do not specify what version of Jboss you are referring to, or if you're talking about EAP from Redhat, or the Community Edition.

The configuration is quite different from for instance Jboss CE 6 to 7.

These are some starting resources for both EAP and CE:

https://docs.jboss.org/author/display/AS72/Hardening+Guidelines

https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/6.3/html/Security_Guide/index.html


Recover Server 2008 R2 Domain Admin Password

If you've got a local account but not a domain admin, IIRC you could try metasploit with the psexec payload to put meterpreter down on the server and then use the getsystem command to try and get admin on the box.

EDIT Per @void_in this won't work with W2K8 and UAC, to you'd need to use an exploit to elevate privileges, e.g. the MS12-042 one linked in comments

if that's succcessful you can dump the domain password hashes and try and crack them (this will be easier if you can remember anything about the password like length or character set that you did/did not include).

What I'm not sure about, but which might work is, if you can use getsystem on the domain controller whether you can then use meterpreters add user commands to add a new domain admin, may be worth a try :)


David's answer and further research has led me to the EKE (Encrypted Key Exchange) protocol described by Bellovin & Merritt here:

https://www.cs.columbia.edu/~smb/papers/neke.pdf

and by Wikipedia here:

http://en.wikipedia.org/wiki/Encrypted_key_exchange

EKE is specifically designed for this sort of task -- amplifying a short shared password into a fully secure link.  The protocol was patented but the patent expired in 2011.  There is now an RFC for using EKE with EAP:

http://tools.ietf.org/html/rfc6124


Comodo firewall: why an app set to "blocked" is in the "listen" state in network?

The firewall blocks network traffic. Any process can be active and listening for network traffic regardless of what's going on with the firewall. It's like hoping for the phone to ring, but it never does.

If the firewall blocks traffic, then the listening process will never make any connections, but that does not stop the process from listening.

So, there is no bug and nothing is wrong. That process, if the firewall works, will simply never reach an 'established' state.


Swatch installation's issue to detect intrusion

By default, swatch uses sendmail. Check to make sure sendmail can successfully send messages from a bash prompt. The second step to debugging this issue would be to actually read your /var/log/snort/alert file to see if any helpful information exists there. The solution to this issue is very likely a need to configure sendmail properly. There is the chance that it could be sitting in your queue, but not delivered, according to this user's case.


Snort rules to detect Meterpreter sessions

I know this is an old question, but searching I found this interesting post. There are the hints you need. Extracted from there

You can do as Snort rule to detect Meterpreter sessions for external connections. I mean, reverse Meterpreter shells trying to connect to outside. Doing this:

alert tcp $HOME_NET any -> $EXTERNAL_NET $HTTP_PORTS (msg:"Metasploit Meterpreter"; flow:to_server,established; content:"RECV"; http_client_body; depth:4; fast_pattern; isdataat:!0,relative; urilen:23<>24,norm; content:"POST"; pcre:"/^\/[a-z0-9]{4,5}_[a-z0-9]{16}\/$/Ui"; classtype:trojan-activity; reference:url,blog.didierstevens.com/2015/05/11/detecting-network-traffic-from-metasploits-meterpreter-reverse-http-module/; sid:1618008; rev:1;)

For other kind of scenario changes should be done on the rule, but is a beginning.


Why doesn't public or open WiFi use unique encryption for each client (like GSM)?

cellular data is uniquely encrypted for each user

Yes, because every cell phone have a SIM (Subscriber Identity Module) card. This SIM card holds, among other things, the identity of the user, and identifies him to the operator. This would be more or less analogous to username and password on a WPA2 wireless network. You buy a SIM, you have right to access the operator network, until you stop paying and the company disables your record on their databases, and your SIM cannot connect anymore.

  Why does't something similar happen in public/open WiFi

It's because a public WiFi lacks the central entity responsible for handling out usernames and password, like the telecom company does with a SIM card. To work the same, someone would have to be physically available around the router to register people, giving them usernames and passwords. And that would very much look like a protected WiFi network.

But with WPA3 it will be possible to have passwordless mutual authentication, so it will be possible to encrypt data between each client and the AP, but that will not prevent someone to employ an Evil Twin attack against the clients.


Twitter's HTTP response vs Google's HTTP response

Google is not using HSTS enforcement. Neither in preloading nor headers. The preloaded HSTS entry in Chrome is set to "OPPORTUNISTIC" which basically means "unenforced", though it contains a set of allowed certificate hashes to prevent MITM.

Google's redirect to https depends on browser detection criteria, such as user-agent. I don't know precisely what criteria they check, but for example browsing google.com using Links does not redirect to https, and searching over unencrypted channels is still allowed, though browsing from Chrome will redirect (with a 302) to https. Furthermore, many URLs on the domain are not redirected to https no matter what browser you use. For example: http://www.google.com/services/

Their reason for not requiring SSL is not explicitly documented anywhere, but it probably has to do with the fact that doing so might "break things" -- albeit poorly-written things, most likely. The current trajectory seems to point toward migrating all of Google over to SSL, but they're doing so one piece at a time. My best guess would be to expect HSTS enforcement within 5 years.

The cache-control difference reflects the fact that Google's homepage is static, while Twitter's is constantly updated with new tweets. Google allows the browser to (privately) cache the search box splash page for a limited time, but twitter requires a reload in order to fetch the latest batch of deep philosophical insights from all your Twitter friends.

As for cache-related information disclosures; I'm not aware of any. The Google homepage contains no personal information unless delivered over HTTPS (in which case you get that bar at the top), which limits disclosure potential.


Session sync between two web apps on the same domain

I definitely sure , we can have one jwt token server in php.
also i think we can have central token server in multi language env. like nodejs laravel lumen Django and etc.
im sure that here in this video you can find some basic informations about this concept.( in second half of this video)
if you like, case study samples, like me, you can watch and enjoy.
the concept is:

jwt use keys named private key.

if we have single private key and then use it in two separate server, you can do what you want.

i think this answer help you. https://stackoverflow.com/a/47329159/308578


Can you hide a server's existence on the internet?

You can set your server to normally drop all incoming packets and only open a port after it gets/sees a set of packets that specify a specific sequence of ports (this is called port knocking). I use this technique with my server; you cannot normally see the server because it drops all incoming packets. Once the port knocking packets reach the server, the server will then accept packets from the 'knocking' address but continue to drop packets from other addresses.

Security is better with this method because IP scans and attempted brutes won't be much of an issue to you. In order to hack a server there must be recon, to find out what services are running, what kind of OS you have, etc. By denying an attacker this info, it makes it harder for him to craft his attack for your device. The weakness of this defense is that if an attacker can see the incoming knocking packets, they can then open that port as well.


Visiting the U.S. for a security conference

I've travelled to several countries to give speeches at security conferences. IMHO, the right approach is not in lying, but in not saying more than necessary. When asked about the purpose of my trip at the border, I truthfully tell that I am on a business trip, going to an IT conference. Nobody ever asked me details of the conference, and nobody ever asked if I'm a visitor or a speaker. And if one day they interrogate me more deeply, everything I said was 100% true.

For technical measures, Gruqq's post on Medium is right, most of the advise given is bullshit and will only get you into trouble.

However, we all have things to hide. Be it trade secrets from our business, naked pictures of our girlfriends or our personal diary. The best way to hide the things you want to hide is, of course to not have them on the device you travel with. Store them encrypted in the cloud or on a file server.

At the same time, keep your not-very-secret-secrets on the device. Hide only what really needs to be hidden. If your device is checked, the best result for you is not that it appears blank or freshly installed or securely encrypted, but that it appears boring and ordinary.


"is email a trusted way to carry such sensible data" No.

Do many websites do it? Yes.

A saving grace is to make the link one-time-use-only and require the user to choose a new password immediately. That way, if an attacker does intercept the email and use it to hijack the account, when the legitimate user clicks on the link later, they will get an error message and know that something is wrong. As mentioned by @Xander, this is far from ideal, but at least it's something.

If you want better security, think about adding a second factor to the password reset tool, like sending a code to the user's SMS, or "where was your mother born?" type security questions, or any of the other standard second factor methods (should be able to get a good list by Google).


How to suspend a silent oberserver from Facebook account?

One possibility is that her passwords are being synced through the browser. If this is true then even if she changes her password it can be updated on any synced device (convenient for someone who is not in this situation). To remedy this, she will need to change her browser sync settings and password, then change her facebook password (and others) again.

I personally use Firefox and I know the sync settings need to be specially setup, but I believe it is easy to do this even by accident if you are using Chrome, though I may be wrong.


Hashcat mask attack getting error "seperator unmatched"

$6$ is definitely part of the hash. It indicates the hash type (sha512crypt). The $ as field separator is a long-standing hash idiom and is part of many modern password hashes.

Instead, the issue here is that hashcat's parameters are positional in a way that may not be intuitive. Masks always appear after the target hash or hashfile:

$ hashcat -O  -m 1800 -a 3 -o ans.txt nils2.txt ?u?l1234
hashcat (v5.1.0-1651-g050f6b0e) starting...

[snip]

Session..........: hashcat
Status...........: Cracked
Hash.Name........: sha512crypt $6$, SHA512 (Unix)
Hash.Target......: $6$3q88Up7LX1RFIlRU$gVzo1NvtuV4SmJ2SNv6mcLLc9rWtzNs...7kprI1
Time.Started.....: Wed Feb  5 06:11:40 2020 (1 sec)
Time.Estimated...: Wed Feb  5 06:11:41 2020 (0 secs)
Guess.Mask.......: ?u?l1234 [6]
Guess.Queue......: 1/1 (100.00%)
Speed.#1.........:     1265 H/s (0.98ms) @ Accel:64 Loops:256 Thr:1 Vec:2
Recovered........: 1/1 (100.00%) Digests
Progress.........: 650/676 (96.15%)
Rejected.........: 0/650 (0.00%)
Restore.Point....: 0/26 (0.00%)
Restore.Sub.#1...: Salt:0 Amplifier:24-25 Iteration:4864-5000
Candidates.#1....: Ua1234 -> Uq1234

Started: Wed Feb  5 06:11:36 2020
Stopped: Wed Feb  5 06:11:41 2020

$ cat ans.txt
$6$3q88Up7LX1RFIlRU$gVzo1NvtuV4SmJ2SNv6mcLLc9rWtzNsI6u3TKEkKVXb3gNQKhcK/C6y1DW6q4ODNIJrjf1ondgZ7RHqD7kprI1:Ul1234


"VPN -> Tor: Go to jail" - What's the logic behind this?

Where did you get the concept that using VPN to connect you to tor will send you to jail?

First of all, you shouldn't be sent to jail (in a decent country) if you don't do anything illegal. I'll take that as a metaphor for someone is able to identify you but you should be precise.

You can connect through a VPN and TOR in two ways:

Connect to Tor, then to VPN

In this way third parties will see the connection as coming from the VPN. This has the downside that your ip will consistently come from the VPN, while tor frequently changes the ips you are exiting from.

The VPN operator will be able to log everything (unencrypted) you did.

I see two reasons for wanting this:

You want to hide your real location to the VPN service. However, the VPN is probably a paid service, and they probably have your name and credit card data already. So it's unlikely to be much useful.
You want to hide from your ISP that you are connecting to the VPN (eg. it's blacklisted). It's not clear that they would be much happier when they find you are connecting to tor (you could use a hidden bridge instead of a public entrypoint, but still it's probably risky).

Finally, you'll need to use TCP mode for the VPNs (as Tor only routes TCP) and the tor project reports that In our experience, establishing VPN connections through Tor is chancy, and requires much tweaking.

Connect to a VPN, then to Tor

In this way the VPN will only see that you are connecting to Tor. While the Tor exit node you get at each time can log everything (unencrypted) you do.

If someone broke the Tor path they would only discover you are using that VPN (for which they may be able to warrant or not, depending on power/jurisdiction), which probably already has your payment details.

On the other hand, it's more likely that they could discover who you are because of something you leaked (eg. a http:// url to something leading to you).

Also take a look at https://trac.torproject.org/projects/tor/wiki/doc/TorPlusVPN describing the different options and some of the drawbacks.


While you do not produce enough information about the target system to be certain, this behavior is often seen with connections that are not actually meterpreter sessions (i.e. when a nc connects to your listener, for example).

My best guess would be that a firewall or antivirus on the host suspended the process after the initial connection because the meterpreter payload got detected.


Could a VPS provider have access to the content of their users?

When you host your data on other people's servers, then these people have full access to it.
With a virtualized server, the data is written to the hard drive of the host system. The server administrators could look at that hard drive image at any time and thus get access to the data of your users. They can also monitor the network traffic.
You could prevent access to the hard drive image by using full disk encryption. When the virtual machine encrypts all the data it writes on its virtual hard drive, that data is also encrypted when written on the physical hard drive of the host.
To prevent monitoring of network traffic, you could make sure all traffic - both administrative and user-traffic - is strongly encrypted.
But with some criminal energy, they can still monitor your data.

When you reboot your machine, you will have to enter the disk encryption password through the remote administration console. That console is under their control, so they could use that to log your disk password.
They can make a snapshot of your VM at any time, which dumps the whole RAM content to disk. This gives them access to all data currently in memory, including the decryption key of the virtual disk.
When they control the VM hypervisor, they also control all the computations the virtual machines make. It's not easy to do, but it is theoretically possible to use this to break any cryptography which happens on it.

Solution: Host your servers on your own premise where you have full access.
But will Digital Ocean do that? This is what their privacy policy says:

Server Data
DigitalOcean does not have access to its users’ server data. The backend is locked away from the users’ support staff and only engineering staff has access to the physical servers where users’ virtual machines reside. DigitalOcean does not store users’ passwords or private SSH keys. DigitalOcean also does not request user login information to their servers. DigitalOcean does not review or audit any user data.

This is what they say. Can you trust their words? Your decision to make. By the way, their Law Enforcement Guide might also be worth reading in this regard. It describes what information they suddenly do have access to when pressed by government officials.


Malware that can survive BIOS re-flashing

As for how it may happen that reflashing the BIOS does not eradicate the malware, we can hazard a few guesses:

The reflash operation is under control of... the BIOS, so the infected BIOS only pretends to do the reflash (or reinfects the new BIOS immediately afterwards).
Another flashable firmware in the machine is also infected, and when either it or the BIOS is reflashed, the still infected firmware reinfects the other one. Any device with DMA can hijack the live machine at any point, and most devices with a firmware have an onboard CPU which would be up to the task (GPU, hard disks...).
The disk firmware is infected, and inserts malicious code in the boot code which reinfects the BIOS. (Not sure it matches the symptoms, but that's a possibility.)

The common theme here is that all the reflashing is done while part of the machine is live, so there is a chicken-and-egg: you cannot securely reflash from a machine which runs infected code (even indirectly, in the case of a DMA-able device with its own CPU), but if the machine is off you cannot reflash either. Ideally, the BIOS chip would be removed from the machine, reflashed from another device (without booting it, of course), and then plugged back. But these chips are usually soldered... We know how to make pluggable chips -- e.g. none other than the CPU, so it is doable without killing I/O performance. But I imagine that soldering is cheaper for the manufacturer.

Maybe manufacturers could add some JTAG-like ports which would allow reflashing a chip soldered in a powered-off board (really powered off, with the power cord physically removed).


Is it common for malwares to use public-key cryptography to authenticate their C2 commmunications?

In 2017, security researchers at Cyren discovered that over 1/3 of malware was using HTTPS for their C2 activities.

"Breaking those protocols" is never the answer, it is equivalent to when Kazakhstan forced a MITM attack on the entire country.


What format does an .htpassword file use for checking passwords?

From Apache's documentation:

  htpasswd is used to create and update the flat-files used to store usernames and password for basic authentication of HTTP users.

Examples:

  htpasswd /usr/local/etc/apache/.htpasswd-users jsmith

  Adds or modifies the password for user jsmith. The user is prompted
  for the password. The password will be encrypted using the modified
  Apache MD5 algorithm. If the file does not exist, htpasswd will do
  nothing except return an error.

  htpasswd -c /home/doe/public_html/.htpasswd jane

  Creates a new file and stores a record in it for user jane. The user
  is prompted for the password. If the file exists and cannot be read,
  or cannot be written, it is not altered and htpasswd will display a
  message and return an error status.

  htpasswd -db /usr/web/.htpasswd-all jones Pwd4Steve

  Encrypts the password from the command line (Pwd4Steve) using the
  crypt() algorithm, and stores it in the specified file.

This is misleading as the password is not encrypted but rather hashed, and bad because it's using md5 (iterated 1000 times) by default. You should use htpasswd -B to use bcrypt instead.


Using a Firewall to Trigger Truncation in DNS UDP Response

Truncated simply means that the packet was larger then the client expected. E.g. if the client expects only 512 bytes by doing recv(fd,buf,512,0) but the message is larger the recv will fail because the message does not fit. With the flag MSG_TRUNC the client can get the truncated message, but not the full message because it does not fit in the allocated buffer.

That means truncated is not a property of the packet itself and can thus not be set at the firewall. At most you could generate a response which is larger than the client probably expects and thus trigger the truncation. But to do this you would need some application level code which generates a response which matches the DNS question, a simple packet filtering firewall can not do this.

EDIT:
There is a TC flag in the message header which indicates that the message was too large for the indicated transport and was thus truncated (i.e. greater than 512 byte for UDP unless EDNS is used). Thus it should be possible to create such a packet. But to make the response packet match the request packet you still need application level filtering, that is a simple packet filter is not enough.

Apart from that the whole question sounds more like either a constructed problem without practical relevance or like an XY problem, i.e. the real problem your are trying to solve is something different.


Brute force time estimation - random sequence

The calculation is simple. First, figure out how many "tries" a computer can do per second, minute, or hour, etc. Obviously it depends on the computers. For example, let's say 1000 calculations per second.

So time in seconds = 2^1000 / 1000 = 1.071509e+298

Then you can convert in minutes by dividing that number by 60, and so on.

The formula is: timeInUnit = nbCombinations / (CombinationsPerUnit * nbComputers)

The time to try all combinations is the number of combinations divided by the number of combinations the computer can do in that time unit, again divided by the number of computers you have.

HOWEVER, to reach a particular sequence, you can, on average, divide that time by 2. Because in a real scenario, you don't have to try every combination, you stop when you get the one you want. On average, you will hit it after having exhausted half the possibilities. You could get lucky and hit it on your first try, or you might have to go through every combination.

Now, to hit a certain number of sequences, say 3, how much time does this take on average? Not three times as much, because at most trying every combination will guarantee you hit those 3. But it has to be more than half the time, right? Well, that's a fun probability problem, I'll let you figure it out.


Yes, if a path containing script tags is resolved to the page containing this code on your server (for example, via a rewrite rule) then script could be rendered in your page. This will be DOM based XSS as it will be your client-side code that is adding the script tag.

e.g. https://www.example.com/foo/bar/<script>alert('foo')</script>


What should a job description for a developer focused on secure coding practices look like?

I'd look up the 'security engineer' or 'security architect' roles for various companies and try to distill the expectation for such a role. Of course, it needs to be tailored to your company's environment and stack etc.

To quote a few, these are some of the expectations from such a role (taken from a few job postings for the aforementioned categories):

Understanding of the SDLC, as well as tools such as Git, RPM or DPKG, Chef, ansible or Puppet
Deep technical understanding of common security vulnerabilities and risks, as well as countermeasures and compensating controls
Experience with UNIX and Windows application controls and tooling
Usage of source code analysis tools Fortify, Coverity, Clang, or others
Proficiency in reading, writing, and auditing >languages used in your company< and the ability to pick up new languages/technologies
Knowledge of ubiquitous encryption technologies (PGP, SSH, SSL, etc.) and common protocols (RADIUS, LDAP, KERBEROS, SAML, etc.)
Some experience with Continuous Integration and development automation frameworks
Knowledge of common web application and mobile frameworks
Strong business sense (specially applicable for small startups)
5 (or more) years of demonstrated experience in product development, strategy, and market research
Previous professional information security experience, with penetration testing or "breaker" experience
Experience breaking down complex systems and applications to find flaws
Good interpersonal and communication skills
Ability to work well with designers and engineers
An analytical and metrics driven work style


Any concern for not locking or even closing the rack door inside private cage of DataCenter?

If you decide to allow this, make sure you cover your own ass. Make sure you have a written and signed statement from the customer about this arrangement. Make sure the statement states that you've advised them not to do so, and have explained to them what the risks are, and that the customer will take full responsibility of any losses incurred to them and/or to you due to the non standard procedure. Make sure the statement is signed by key decision makers on the customer's company, which should include the key technical personnels, security officers, and executives.

Ultimately, the customer's security and risks appetite is their own responsibility. If they are willing to put up with the risks against your advice, then that's on them. If the customer has their own security requirements, it's ultimately on them to make and break.

Also, if you yourself had your own compliance standards that you're subjected to. Ask them what they think about it. Make sure you won't get dragged into problems due to this.


Append should not allow you to delete the original content, so where this works is in environments where the original is the core, and any additions are read with the original in mind.

Write access may let you delete the original, so you could replace data with something new. This may not be the behaviour you want.


Is there a reason why ARP spoofing would be used for spying instead of sniffing promiscuously?

On modern networks, passive sniffing (e.g. an interface in promiscuous mode) is typically not enough to sniff traffic of other devices on the network.

On a wired network, switches are generally used to link multiple devices together at layer 2. Switches learn what MAC addresses are connected to each port, and will only send frames out of the port that has the destination device attached. Therefore, an attacker who is connected to a switch will not receive traffic destined to other devices while in promiscuous mode. Here, ARP spoofing is necessary to convince the other devices to send their traffic to your MAC address, which will allow the switch to forward it to you.

If a hub is used instead of a switch (i.e. an old network), it sends all frames out of all ports, regardless of where the destination is. In this case, sniffing in promiscuous mode is sufficient.

Wireless networks get a little more complicated. On WPA2 networks, you simply cannot receive packets destined for other devices (since they each have their own encrypted session), and even on open networks, your wireless card shouldn't receive/process other traffic, promiscuous mode or not. In this case, you'd need ARP spoofing to sniff.

However, some wireless cards can be put in monitor mode, which allows all 802.11 frames on the current channel to be captured while not associated to any given network. If you capture a client's 4-way WPA2 handshake and have knowledge of the network's pre-shared key, you can decrypt the traffic. ARP spoofing is not needed here for sniffing.

So as you can see, there are different network scenarios that may or may not require an active attack like ARP spoofing in order to sniff.


Key rotation benefits of a multi-key hierarchy

It occurs to me that perhaps I'm conflating key rotation with key replacement due to compromise and that in a simple rotation (where all keys are still assumed to be secret) rotating the KEK is sufficient. Is that the piece that's got me confused?

Seems that you've found the issue yourself. Key rotation is the periodic rotation of the keys to prevent possible future compromise. Key replacement due to key compromise would require the replacement of all keys which may have been compromised, which would include all keys encrypted by those keys.


DDoS attack related charactaristics:

This definitely has the characteristics of Distributed Denial of Service (DDoS) attack, and this is the first thing I suspect.  The items that lead me to believe this are:

Wide variety of sources (distributed)

  I'm seeing a bunch of these requests with tons of different agents

(it appears in your log post the xxx.xxx.xxx.xxx would indicate that they are from a wide variety of IP addresses)

Similarity of requests

  I'm also seeing a bunch of requests from various WordPress sites

The similarity of the requests also leads me to believe Distributed Denial of Service.  For example, the owner of a botnet could be issuing the command to attack your server with this specific type of request.

"Flooding volume" of requests (denial of service)

Furthermore, the requests are of such volume that they are maxing out your resources.  If this is a sharp increase of volume, it is likely to be an attack, or possibly a bug.  It could also be that your site is becoming popular and you need more resources (especially if it has been a steady increase, and not a sharp spike in traffic).

How a DDoS attack can be performed:
In a DDoS attack, oftentimes a botnet of innocent user's computers taken over by malware is employed by the malicious botnet user to attack a specific site.  The flood of some type of request from many different sources is a characteristic of a DDoS attack.

Other possibilities:

Note: Your case appears to be a DDoS attack, and none of these other possibilities, based on your clarifications (especially since the guy said he was going to do it!)

Bug in code: As TidalWave mentioned, it could possibly be something wrong in your code, but I tend to lean toward it really is a genuine DDoS attack, especially since it wasn't happening before (unless you just recently put your site online).  One example I can think of where it could be your code is that your code sends something out to a bunch of sites that would make them send this traffic back to you.  Perhaps you could be sending something out over broadcast when it shouldn't be broadcast.  One thing to note is if this started happening right after you did an update, it would be more likely to be an issue in the code.
Increase in website traffic: Your site may becoming more popular!  This is more likely to be the case if your traffic has gone up steadily, and is finally maxing out your resources.  However, a sharp spike in activity (not related to a specific "event" on your website, such as a contest drawing being held now) would more likely indicate a DDoS attack.
It could be something else none of us have considered.

Mitigations:

Here are a few sites I found while researching preventing DDoS attacks:
http://www.itbusinessedge.com/slideshows/show.aspx?c=96534
http://www.cisco.com/c/en/us/support/docs/security-vpn/kerberos/13634-newsflash.html
http://www.networkworld.com/article/2170051/tech-primers/four-ways-to-defend-against-ddos-attacks.html

Here is what I gathered from them, as far as potential mitigations go:

Use an Internet Service Provider (ISP) that provides protection against DDoS, and that does not charge per bandwidth usage.
Adjust firewall settings (especially logging it for law enforcement)
Do it yourself (DIY) (probably not so good unless you are an expert in this area)
Enterprise DDoS prevention solutions (costly, and may still not work)
Cloud services designed to prevent DDoS attacks


Hash algorithm that provides less than 10 bytes

That question is impossible to answer without understanding your requirement for the hash function.

Since we're in security.se, though, I suppose that you're asking for a secure hash function. In that case, I'm afraid the answer is: it can't be done.

You see, a hash function is just a mapper: it persistently maps data of arbitrary size to a fixed-length key. Nothing more. For instance, a function that takes a string and returns a constant number is a perfectly valid (if somewhat useless) hash function.

Now, a cryptographic hash functions are a class of hash functions that have additional properties. The ideal cryptographic hash function has the following properties:

It is pre-image resistant: you can't easily find an input that will give you a specific output faster than brute-forcing in input space.
It is second-preimage resistant: given a specific input, you can't easily find a second input that will give you the same output.
Is resistant to collisions: You cannot easily find two messages that will result in the same output, even given a large number of different inputs.

All this more or less rely on the fact that, even if the key space is smaller than the input space, it is still too big to be exhaustively mapped. Otherwise, you could spend a lot of time writing a reverse-mapping table and then you'll have a simple way to break 1.

That is why you need to explain what properties you expect from a 10-byte hash function: the standard secure hash functions will not work for you while retaining their secure properties. That doesn't mean, however, you cannot use them if your requirements are different.


How do I destroy references to wiped files?

I'm assuming you are using Windows and NTFS?
The problem with wiping file names is that the Master File Table (MFT) is never deallocated, so writing fill data to unallocated space only effects a single MFT entry for each file regardless of the file size. Writing a gazillion tiny files will have a bigger effect on the MFT, but even then it's semi-random.
It would be possible to over-write available unused MFT entries with a custom program, but not from within the running Windows OS, it won't let you. I'm not aware of an existing utility to do this, but it shouldn't be that difficult for an experienced programmer.
For most mere mortals, the easiest thing to do is to encrypt your drive. The data is not destroyed but it's effectively out of reach.
I've seen some claims that Eraser can clean MFT entries, but have not personally verified that.


Security of picking unique passwords for users

Forcing the user to pick a password you generated is an efficient way to prevent password reuse. That means both (a) that your passwords will not be usable on an other site if an attacker steals them, and (b) your users accounts will not be breached even if they were all on LinkedIn, MySpace, Sony and Ashley Madison.

On the other hand, it will wake them way harder to remember. Users are therefore more likely to write them down on a post it next to the screen or in an email sent to themself - not very secure practices. They are also more likely to be annoyed at you and don't use your site. If you try to counteract this by generating passwords with less entropy, you might end up making users who would prefer to use a password manager to generate long, unique passwords substantially less secure.

Finally, to the question if there really is any need to hash the passwords: Yes, you should hash them. If your database is leaked (SQLi, lost backup, etc) you do not want the attacker to have all the passwords and be able to login as an administrator.

For how to securely hash passwords, see this question.


Advisories recommend 2048 for now. Security experts are projecting that 2048 bits will be sufficient for commercial use until around the year 2030.

The main downside to using a large cert, such as 3072 or 4096, is that the algorithm is slightly slower (still fractions of a second, though).

Current browsers should all support certs upto 4096.

Some CAs won't issue a cert that large, so if you want a 4096 bit cert, you might have to shop around for a CA that will issue it.


Reasons behind MAC Spoofing on a corporate network?

Common cases for MAC spoofing alarms are:

virtual machines being cloned or reconfigured
people pulling the plug to connect notebooks
DHCP recycling ip addresses
loading different firmware on network cards (especially wireless cards)
(rarely) bit flipping in the PROM of the network card.

It would be interesting to know, if those alarms are for miss matching MAC addresses and switch ports or miss matching MAC addresses and IP addresses. Is only one computer effected or many? Are the difference in old and new MAC address only one or two bits? Are MAC multicast addresses involved?


Alternatives to Common Password Retrieval

Authentication is made by using one of these or their combination:
1- Something you know (Text passwords like everywhere!)
2- Something you have (Tokens, Smart Cards etc )
3- Something you are  (Eye's Retina, Finger Print etc) .

All these methods have their own weaknesses in their nature.
Combining them helps but it also deceases ease of use & availability.
Passwords weakness is that it can be changed without identifying the one who is doing this.
It's vulnerable in it's nature.
Of course your can combine it ie. reset password after verifying finger print or ID card, thinking to availability & normal users, it's actually useless.

Anyway, Personally i rather to answer to my security questions to reset my password, mainly because my answers are like passwords more or less, unguessable & badly typed !

Q:what was your favorite childhood cartoon?
A: h0w d0 u kn0w if i ever w@tch3d 1?


Confidentiality and integrity for web session

Well, you are reinventing the wheel, but at least you are using a circular shape for that, which is better than what most wheel-inventors out there do. And, frankly, there is a bit of a shortage of immediately usable high-quality wheels.

You use CBC with an IV (which must be generated with a strong PRNG), and that's good. You apply HMAC on the encrypted data, and that's good. You do not forget to include the IV in the input to HMAC, which would have been the classic mistake of encrypt-then-MAC. And you are using distinct keys for the encryption and the MAC, which is nice. So, really, not bad at all.

You may want to consider the following points:

In your format, there is no indication of what algorithms are used, so there is no algorithm agility: if tomorrow you want to switch to another encryption algorithm, you cannot do it without breaking compatibility with existing payloads (unless you play with the total length). For clean algorithm agility, you may want to add a header: a single byte with a conventional value, e.g. always 0x01 (subsequent versions of the payload format would use other values). Important note: if you do that, then do not forget to add the header byte in the HMAC input as well.
If having two keys K1 and K2 is inconvenient for you, you may want to store a single key K, and derive keys K1 and K2 from K. As long as the derivation process is one-way and uniform, this will be fine. We want the encryption key and the MAC key to be distinct so as to avoid nasty interactions between the two algorithms; no such interactions are known in the case of AES-CBC and HMAC/SHA-256, but "better safe than sorry". In your case, just hash K with SHA-256, use the first half (128 bits) for K1, the second half (128 bits) for K2.
There are newer authenticated encryption modes which combine encryption and integrity check, and do all the hard work for you. In particular, GCM and EAX are consider secure, and are patent-free. They offer some bonuses: no need for a random IV (a non-repeating IV such as a counter is sufficient), no need for padding (they rely on CTR mode internally), only one key (any "expansion" is handled internally).
If a user can obtain several payloads, then he can switch them and replay old payloads. Depending on your context, this may or may not be a problem for you.
If keys are not user-specific, then colluding users could swap payloads. Depending on your context, this may or may not be a problem for you.


It is difficult to determine what the authoritative source is for SESAME, which is an indication. The best link, which I'm sure you have seen, is from COSIC.

The first paragraph states:

  SESAME (a Secure European System for Applications in a Multi-vendor
  Environment) is a European research and development project, ...

All information and links for SESAME are all pre-2000. There also doesn't seem to be an IETF RFC filed for SESAME, except this draft from 1996.

SESAME is not used, but was an idea that was superseded by improvements to Kerberos RFC 1510.


Why would a website that resets your password to one of their choice be considered a plain text offender?

Because most users do not change their password after such a reset and mindlessly instruct their browser to save the new password and/or the site does not force users to change it after their first login.

Thus they effectivly send the new password in plain text, thus they are offenders.

A better way may be a One-Time-Token for a password reset, preferably sent via snail mail or SMS.


How to configure TPM lockout in Bitlocker when using a PIN

This is from MS10 Bitlocker/TPM documentation:

TPM 2.0

TPM 2.0 devices have standardized lockout behavior which is configured by Windows. TPM 2.0 devices have a maximum count threshold and a healing time. Windows configures the maximum count to be 32 and the healing time to be 2 hours. This means that every continuous two hours of powered on operation without an event which increases the counter will cause the counter to decrease by 1.


How anonymous is it to use Facebook's Tor-site?

How anonymous [...] is it to use Facebook via https://www.facebookcorewwwi.onion/

This depends on what you mean by anonymous. If you use an account which you had previously logged in using your real IP address, or if the account is in your real name and linkable to your identity, then it is not anonymous. If you mean location anonymity (hiding the location from which you are currently connecting), it is fully anonymous whether or not you are using your real name.

  can Facebook identify that these two users are using the same computer and the same network connection if they log in and out without getting a new identity or circuit before logging in again.

Yes. You need to restart the browser by using the New Identity feature. This will clear out tracking cookies and other identifying material. It is not enough to just switch circuits. You must clear the browser state correctly by selecting New Identity. Note that particularly advanced tracking using JavaScript to identify unique browser characteristics may be able to correlate the identity of two accounts that use the same browser, but it requires an active attack.


How is security maintained in session and JWT?

I think your understanding is on par with what the technolgoy does.
Both methods have inherent security risks and security pros. But I think JWT wins for me as it allows you to do without sessions and I deal with session apps everyday, they can be a security nightmare.

There are several articles that can address the security concern for storing refresh/auth tokens if that is your main concern. Here is a JWT article by Auth0.
Here is another Article using nodeJS and JWT.

The point I'm making here is, if you are going to utilize either of these technologies, securing where your sessions or refresh tokens are saved needs to be carefully done as compromising that may lead to a security headache.

Note however in the case of JWT and refresh tokens, they can be easily blacklisted by the authentication server, requiring generating new ones which invalidates your old auth/refresh tokens.


Questions about CAs and certificate requests

You should generate the private key and the derived CSR yourself. This is by design to prevent the CA from knowing your private key (they could generate everything themselves and give you an easy to use .p12, but that would compromise non-repudiation).

Using OpenSSL, you can generate a private key like this:

openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -aes-256-cbc -out mykey.key

This would encrypt the key - you'll need to enter its password each time a program accesses it.

To generate the CSR from the key do the following:

openssl req -new -out mycsr.csr -key mykey.key

Send it to your CA, and you should get a certificate back.

If you do not wish to encrypt the private key you can either omit the -aes-256-cbc argument from the first command or use this all-in-one command to generate a key and a CSR at the same time:

openssl req -new -out mycsr.csr -keyout mykey.key


How are computers identified across networks?

You can be detected even using different network devices. If you connect from home using the Ethernet card, and on a Starbucks using the Wifi card, it's trivial to detect you.

Now how:

Cookies: The cookies on every site you access are independent of the IP address of your computer. So if you accessed Google from home, and accessed again from Starbucks, Google knows for sure that it's you.
Browser Fingerprinting: Your browser is almost unique. The sum of browser version, OS version, plugins installed and updated (or not) is almost unique, and even if you delete all the cookies, you can be more or less identified.
Canvas Fingerprinting: For the same reasons of the browser fingerprinting, the canvas object on HTML5 have a few differences based on a lot of variables, so it's possible to detect you, even if you use a different network card, delete all cookies and use a VPN.

Don't worry about MAC address, it's an address that never leaves the local network and can be easily forged, faked or cloned. But your behaviour cannot be faked, as you type and mistype the same words, access the same sites and so.


LUKS - Too large detached header size when large offset

# losetup --offset 1GiB /dev/loop0 /dev/sdc
# cryptsetup --header header_1GiB --offset $((2**21)) luksFormat /dev/loop0

Header size would be 16777216 bytes.
https://gitlab.com/cryptsetup/cryptsetup/-/issues/452


Should a password generator validate its output against a dictionary?

When creating a password generator, use a cryptographically secure pseudo-random number generator (CSPRNG) and trust in the random properties of that system.

Rather than checking if a randomly generated password contains a substring that humans might recognize as a word, instead check that the entire password has not been part of a data breach.

The current biggest threat to passwords are offline attacks against data dumps.  Passwords should be stored using a key stretching algorithm, such as PBKDF2, bcrypt, scrypt, or Argon2, which makes it impossible to pre-build lookup tables and greatly increase the time that it takes to attack the passwords.

Additionally, these key stretching algorithms have an avalanche effect: A minor change in any of the inputs will make a huge difference in the output. (Caveat: With an infinite input space and a finite output space, there will be collisions.)  Cryptographic hashing algorithms also have this feature.  Thus, attackers can not tell how close they're getting to cracking your password, like they can in movies.

Thus, unless you've somehow told your attackers that password contains the word 'password', then it doesn't matter if there are human readable words that happen to appear in the middle of your generated password.

The current largest threat is from attackers that use dictionary attacks based on previously leaked passwords, because they know that users will reuse passwords, and will use known weak passwords in throwaway accounts.  The way to mitigate this, according to the NIST standards, is to check the whole of the password against a list of known bad passwords, such as dictionary words, expected patterns, and compromised passwords.

The NIST standard puts the onus of keeping users from using known bad passwords on the site owners, but there is nothing preventing your generator from using a service such as the Pwned Passwords API in the astronomically unlikely (but technically possible) event that your generator using a CSPRNG produces a password that has been leaked elsewhere.


What questions should I ask a prospective vendor that handles billing and fulfillment?

First if they claim to be PCI Compliant ask for the latest version of a filled out questionnaire and their current quarters scan results. Based on the depth of how they filled out the questionnaire you should have some understanding of how competant they are.

Also press if they have external audits? Do they employ external companies to do manual pentests and more importantly social engineering?

If they are handling billing and processing they will be handling customer data. Ask them about how they encrypt it. What are their access control policies? Do they use two factor authentication?

Check if there is a training regimen for their order processing staff on security. Typically people doing billing and order processing are not technical or savvy on security. These are low/mid wage users with little care as to your companies data. If I called in and claimed to be customer X how hard would it be for me to get their information?

Also ask for al ist of their senior management. Who is their CTO, CSO etc? Research their backgrounds. See if they have a history in companies that are security oriented or if they hopped around a ton and seem to be fly by night mercenaries.

Ultimately see how willing and comfortable they are to share all this. SOme might hide behind a "We can't show you because it would violate security" excuses but if they are serious about handling your data you have a right to inspect their security on the surface.

A real good quickie is to see if they ask for an NDA or MNDA if they just hand over information chances are they won't be that diligent. If they ask for an NDA before handing all this over at least they have a documented legal process behind the scenes which is always a good first start.


Prevention against Cryptolocker virus by requesting password for all installing apps in Windows 7

UAC is Window's way of handling this. If set to the appropriate level, a pop-up appears that requires the user to provide administrative permissions to install. If the user is not an Admin, it asks for the Admin password.

Just like Linux, Windows users should NOT be running as the local admin ....


In this document explaining Windows Update from 2008 (a bit outdated, but you get the idea), it is stated in the Security Protections section that:

  Windows Update uses the Secure Socket Layer (SSL) protocol to send and receive information. SSL is used to encrypt the information being transferred, prevents hackers from tampering with information being transferred, and verifies that the Windows Update agent is transferring data from an authorized Microsoft server.
  Each update is individually signed using the Secure Hashing Algorithm (SHA-1). This technology allows Windows Update to confirm that the update has been downloaded correctly and hasn’t been changed by anyone. The update signature is also compared to information in the update metadata that was previously downloaded.
  Windows Update also checks for the certificate associated with each update. This certificate provides a means for Windows Update to validate the source of each update. Currently Windows Update will only install updates that have certificates issued by Microsoft or other providers that are trusted by Microsoft.

Therefore, you should not be worried about downloading Windows Update on a public Wi-Fi unless the security provided by Windows itself is broken.


How can I visit a website without the website admin being alerted that someone has visited?

First of all: There is no way to access a website without the website (and the admin) knowing it. This is not possible since you connect to it to retrieve data. If the website e.g. would broadcast or somebody else on your network (not using https) you could simply sniff the wanted traffic. But that is ofc. not the same thing, since a website can behave differently every time someone accesses it!

You can obviously hide in e.g. TOR network to stay anonymous and retrieve the latest content or ask somebody else to retrieve the website's content for you (e.g. Google's Cache or archive.org's Wayback Machine) and get fairly old content.


How to get a certificate from Let's Encrypt for the server which doesn't allows file creation

Should i go for Let's Encrypt or not ?

You may, if you are willing to change it manually every 3 months. But then, its free then why not? You will save a lot of money.

  Is it secure to have a certificate from Let's Encrypt ?

Well they have a pretty clean record, uptill now. You can refer to the link for that. I would suggest they are pretty secure.

  What should i do to get the SSL certificate from Let's Encrypt.

Since you cannot get a downtime and you want to use Let's Encrypt issued certificated. You can do the following to get the certificate:

You would need access to the zone file of your domain, Presuming you would have that.
Download the ACME script give the CSR info to the script, Use link
Use the Use DNS mode of the script, It will ask you to make a txt DNS record.
You will have the PEM files with you, Upload them to the VPN server and thats it you are done.

Update:

OR
Alternatively you can do it in two more ways:

Instead of "Use DNS mode" you can use "Use Standalone server to issue cert"
In this mode Let's encrypt would try to reach your server on port 80.
Whenever anything would try to reach the VPN server on port 80, you can DNAT it to another IP which has the requirements fulfilled. OR you can look out for source of lets encrypt and DNAT whenever the source is lets encrypt.(ofcourse you would need a firewall in between to achieve this)

Hope this helps!


Respond by asking them to prove that they brushed their teeth on the night of March 14th 2013.

From a technical perspective, this isn't possible unless you've explicitly set up directory auditing to log when files are deleted. Since I almost guarantee that you haven't done this: no, there is pretty much no way you can prove such a thing. Even with auditing, you may well have copied the data to a secondary place via other channels - even something as low-tech as a print screen or taking a photo of your monitor.


Reverse shell breaking instantly after connection has been established

TLDR: to catch it with a netcat listener you need to use windows/shell_reverse_tcp, not windows/shell/reverse_tcp. Otherwise you need to use the multihandler.

Take a look at these two payloads from msfvenom:

payload/windows/shell/reverse_tcp
Windows Command Shell, Reverse TCP Stager
Spawn a piped command shell (staged). Connect back to the attacker
Total size: 283

Versus

payload/windows/shell_reverse_tcp
Windows Command Shell, Reverse TCP Inline
Connect back to attacker and spawn a command shell
Total size: 324

Notice how the first one is smaller, but it also says that it is staged. This means that it can be smaller because rather than cram all the necessary code into the payload itself, it just contains the bare minimum needed to connect back to a compatible listener and receive the rest of the code. This is done by msfconsole's multihandler, but not by netcat.

If you don't want to bother with spinning up a multihandler, you can use the stageless version, though it is slightly larger. Just make sure to pay attention when listing payloads to whether or not something is described as staged. You could also just filter staged payloads out of your initial listing: eg msfvenom --list-payloads | grep -v stage[rd]


What are the risks of allowing Web Password Managers on a Corporate Network

You are right that a password manager that has storage online presents the risk that corporate credentials could end up in public if that online storage is breached, so it is normal, even expected, for these to be blocked.

Password managers with local storage, however, can be a benefit in large corporate networks that don't have Single Sign On (SSO) as they reduce the risk of users either writing things down (as they need to remember too many passwords) or forgetting logins and then loading down the help desk for password resets.

We have a number of posts on here around password management, and there is a strong move across industries to make it easier for humans to do the right thing. Password managers can help in this respect, but read the associated questions for a more holistic view of what can be done.


How to verify the authenticity of a download?

I just tried it myself, and the problem is you are trying to verify a public key, not a signed document.

As pointed out in the comments, verify the key with a keyserver and/or trusted source. In this case the key comes from the Bitcoin core's website itself.
First import the key:

gpg --inport laanwj-releases.asc
Then download the tarball with the SHA256SUMS.asc file.
Now you can verify the SHA256SUMS.asc with the previous imported key.

gpg --verify SHA256SUMS.asc
When verified successfully, calculate the sha256 over the tarball.

sha256sum bitcoin-0.13.0-x86_64-linux-gnu.tar.gz
It will output the hash, which you can match with the hash in SHA256SUMS.asc

grep bitcoin-0.13.0-x86_64-linux-gnu.tar.gz SHA256SUMS.asc

When they match, you're good.


You are essentially asking if it is easy to reverse engineer the function which is used to map 96 bits (3x4 bytes) input to 32 bit (1x4 bytes) output, without having any further information about this function.

Given of how many different functions exist which do such a mapping I don't think this is possible. You might try to make some guesses for trivial combinations of various hash functions, shifting, XORing or similar but if anything more complex is involved this black box approach with not having any information about the internals will fail.


Does someone need to be connected to my network to sniff HTTP requests?

Yes. An attacker would need to be on your network - either wirelessly or wired - to intercept an intra-network HTTP request. If it left your network for the broader Internet, the attacker could potentially intercept it anywhere between your property and the server, but with the server on the same local network the traffic won't leave your router. As WPA provides both encryption and replay protection, an attacker wouldn't know what message you are sending, nor would they be able to replay it (although traffic analysis - such as noting the packet size, and/or noting that a message for a particular MAC address is always sent before the garage door opens - would be possible).

However, by implementing your system this way, you're opening yourself up to the massive world of web application / web service security vulnerabilities. As a trivial example, you service right now is almost certainly vulnerable to CSRF; if any machine on your network visits a web page with 256 invisible image tags on it - one each from  to  - your garage door would open. JS could be used to iterate through even much larger spaces very quickly.


I am unable to use an RSA key generated with the -aes-256-gcm option in openssl, help

WRT, "I am unable to generate and use an aes-256-gcm key in openssl":  Understand that openssl genrsa is used to generate an asymmetric RSA key pair. openssl genrsa is not used to generate a symmetric AES key.
The -aesxxx option that you are trying to use with the openssl genrsa command does not change the type of key that openssl genrsa generates.  This option is simply used to encrypt the RSA private key that openssl genrsa generates (using a key derived from a password that it prompts you for).
As for why you are getting the error that you show in your question, it may be related to the fact that -aes-256-gcm does not seem to be a supported option for 'openssl genrsa` according to the documentation for openssl 1.1.1 at https://www.openssl.org/docs/man1.1.1/man1/openssl-genrsa.html.  However, -aes256 is supported.
FWIW, An AES-256 key (regardless of which mode of AES is used, e.g. AES-256-CBC, AES-256-GCM, etc) is just 256 bits.  It's easy to generate a random 256 bit AES key, without even using openssl.  You can do:
head /dev/urandom | sha256sum


How dangerous is the security hole CVE-2014-019?

Let's break this down, first of all have a look at the CVSS score:

 (AV:L/AC:M/Au:N/C:C/I:C/A:C)

So:

Access Vector: Local
Access complexity: Medium
Authentication: None
Confidentiality: Complete
Integrity: Complete
Availability: Complete

The vulnerability can result in privilege escalation, meaning a user with few privileges, might gain access to the root account. However the current exploit, which is readily available only results in a Denial of Service. If someone  is able to port this exploit, (maybe it already has but is not public yet) . Then there is a risk that someone could have used it. On the other hand, you should never allow people onto your machine if you don't trust them.So if you say that you trust your friends, then this shouldn't be an issue,but this does NOT mean you shouldn't patch the vulnerability!


IDP Explicit FTPS False-Positive - "FTP Cmd Telnet Opcode Evasion"

I'm not familiar with Zyxel IDP but this is a known problem with other firewalls too.

My guess is that the specific IDS rule only does only a very shallow inspection at the TCP level and has no deep enough understanding of the FTP/FTPS protocol. And it will thus treat specific binary character sequences as telnet opcodes, no matter if they occur in a place where telnet opcodes could be or if they are accidentally part of the (binary) TLS handshake. Since the TLS handshake contains random data the rule might match sometimes and sometimes not.

This means that this rule has to be disabled to prevent false positives.


SSL is "tamper-proof" in the following sense: no third party may alter the transferred data in any way, without the receiver being made aware of the tampering. Of course, an attacker can always cut the cables, disrupting communications ! But no alteration goes unnoticed, thanks to the use of Message Authentication Codes by SSL.

Note that SSLv2 did not include a "safe end" feature: an attacker could force a connection close at any point, and the receiver could no know whether this closure was from an attacker or really triggered by the peer. This was fixed in SSLv3 and ulterior versions (TLS), which include an explicit administrative message (close_notify) marking the will of one of the SSL parties to close the connection (this administrative message is covered by the SSL MAC, and thus cannot be forged by an attacker).

Among the cipher suites which SSL clients and servers can negotiate are some integrity-only cipher suites, such as TLS_RSA_WITH_NULL_SHA, which use MAC only but not encryption -- so you can have tamper-proofness without confidentiality, if that's what you want (deployed SSL client and server implementations rarely allow for these suites, and certainly not by default, but they are specified by the standard.


How a buffer underflow can lead to remote code execution on 64‐bits?

In general, no, a buffer underflow cannot be used for remote code execution.  Since attacker-controlled data never leaves the space allocated for it, it never has the ability to take over the program's execution flow.

A buffer underflow does have the potential for other types of attacks, such as information disclosure (if the program is counting on the buffer's original contents being wiped out by the new data).


It is not "secret", but it is "tamperproof".  That may not meet your definition of "secure".

Your data is no longer confidential if only AH is used - anyone capturing packets can read your data because it is not encrypted.  It is protected against modification, however; AH ensures that data tampering will be detected and discarded.

AH does not "inherently encrypt"; a "tunnel" does not imply encryption, although often if people are using tunnels they do so mostly so they can use encryption.

You might want to read some high-level descriptions:

AH guarantees connectionless integrity and data origin authentication of IP packets
ESP provides origin authenticity, integrity and confidentiality protection of packets


What security concerns exist in running a glassfish app directly on port 443

You need your Java app to work in e.g. context like http://www.example.com/something/ on port 80 on the local ip number e.g. 127.0.0.1 and apache listening on public ip 1.2.3.4 port 80 and forwarding the requests to the 127.0.0.1 and even without /something you should not have issues.

You can drop mod_security to apache to even further improve security.


security implications of NULL dereference

"The process exiting on SEGV by itself is not a problem in this case": this is already a large assumption. Whatever the process was doing will not be finished; the caller gets an error code; if the process had created temporary files then those files do not get erased. Making sure that there really is no problem is tricky.

Also, what creates the SEGV is the access to a memory area which the operating system has deliberately marked as invalid; namely, the first "page" of the address space (a page being 4096 bytes on a PC). Consider the following:

data = malloc(1000000 * sizeof(struct somedata));
data[800000].a = something;

If struct somedata has length 8 bytes, and the allocation fails, then the code will try to write something at address +6400000. Even if the OS did not map the first 4096 bytes, it is quite possible that the address 6400000 is valid and used for something else, which gets silently overwritten. At that point, anything goes. There again, knowing whether a given NULL returned by malloc() would imply immediate segfault or silent corruption can be difficult.

If the process has no special rights and the attacker already has the power to run executable files with the same privileges, then not checking the value returned by malloc() does not uncover new security issues. It is just sloppy.


Is there a way to make sure my government does not swap out SSL certificates?

If your adversary is a powerful nation-state threat actor, web PKI will not protect you.

Nothing is preventing them from issuing their own certificate. In fact, many governments run their own certificate authorities, such as the US FPKI and affiliates. See a list of CAs currently trusted by Firefox:

Government of France
Government of Hong Kong (SAR), Hongkong Post
Government of Japan, Ministry of Internal Affairs and Communications
Government of Spain, Autoritat de Certificació de la Comunitat Valenciana (ACCV)
Government of Spain (CAV), Izenpe S.A.
Government of The Netherlands, PKIoverheid
Government of Taiwan, Government Root Certification Authority (GRCA)
Government of Turkey, Kamu Sertifikasyon Merkezi (Kamu SM)

While Firefox currently refuses to trust the US FPKI, it still trusts many other government-run CAs, and a sophisticated nation-state actor absolutely has access to some existing, commercial CAs. Chrome, Internet Explorer, and Edge use the system trust store which, for Windows, does include many government certificate authorities, including the US FPKI. Any of these could be used to sign a valid certificate for any website and your browser would happily trust them without batting an eye.

While the new and experimental standard for Certificate Transparency (CT) helps reduce the impact of mistakenly-issued certificates, it does not protect against a dedicated attacker who controls a malicious CA. Once it has seen greater adoption it may, however, make it easier to spot malicious or misbehaving CAs after a short period of time, but it will not prevent the attack immediately as it is performed.

Some browsers use certificate pinning where important and high-profile domains are validated against a hardcoded list of permitted certificate authorities. Signing a fraudulent certificate for those domains would require compromising the CA that they currently use. Unfortunately, this only applies to a small handful of domains and does not protect the web at large.

A partial solution would be to refuse to trust a domain without the .gov TLD whose certificate was issued by a government CA, which could be implemented client-side, but it would likely have little real-world impact. An adversarial government is not going to sign a malicious website with a state-run CA, since that would immediately attribute the attack to them. Rather, they would exploit covert relationships with existing CAs to trick them or force them into signing the certificate. CT, as mentioned in the previous paragraph, would detect this and the attack would be quickly noticed, but it does not prevent it.


Is using TSL/SSL for sending/receiving email the same as encrypting?

No it is not.

You have at least 5 parties at play here, the sender S and their email server T, the recipient R and their email server Q, and an attacker. While TLS does use encryption, the purpose of 'encrypting email' is to prevent anyone but the recipient from reading the message. TLS only protects the message from prying eyes in 2 cases:

Case 1: between the sender and their email server, and between the recipient and their email server (S to T and Q to R)

Case 2: server to server message transfer (T to Q)

Note that once the message arrives at a server, it is no longer encrypted, an attacker with access to either server can read the message. This attacker can be in the form of a system administrator or malware. Proper email encryption is done at S so that only R can decode the message, this is generally done using hybrid encryption and public key infrastructure. Neither T nor Q can see the plaintext in this case.

Your example is slightly different, where you are using a web portal to send your file, it is encrypted with TLS up to the point where it reaches the service, then it is plaintext, and they reencrypt it so that only the correct authenticated user (I assume) can access the file. If the attacker has access to that system, they have access to the files. In this case the service is both T and Q.


According to OpenSSL 1.1.0 release notes:

  CRIME protection: disable compression by default, even if OpenSSL is
       compiled with zlib enabled. Applications can still enable compression
       by calling SSL_CTX_clear_options(ctx, SSL_OP_NO_COMPRESSION), or by
       using the SSL_CONF library to configure compression.

As a consequence, OpenSSL must be compiled with the good option and Apache needs to enable compression the right way...

I suggest you to use an older branch previously compiled with zlib option. For instance using Ubuntu 16.04:

cd /tmp
sudo apt-get build-dep openssl
sudo apt install zlib1g-dev zlibc
apt-get source openssl
cd openssl-1.0.2g/
sed -i -e "s/no-zlib/zlib/g" debian/rules
dpkg-buildpackage -rfakeroot -uc -b
cd ..
sudo dpkg -i libssl1.0.0_1.0.2g-1ubuntu4.2_amd64.deb libssl-dev_1.0.2g-1ubuntu4.2_amd64.deb openssl_1.0.2g-1ubuntu4.2_amd64.deb

This, keeping SSLCompression on in Apache, should do the trick I think.

EDIT: After testing, it appears to be working:

root@test# echo "" | openssl s_client -connect 127.0.0.1:443 | grep zlib
...
Compression: zlib compression
Expansion: zlib compression
    Compression: 1 (zlib compression)
DONE


What benefit is there to Craigslist's phone number masking?

That type of approach does drastically reduce the scraping because it makes it much more complex to do.

Note that there is no ideal way to block it completely since they want the information to be available to the other users.  With OCR systems, even placing it as an image is still far from perfect.


Benefit of signed SSH user certificates?

It's useful so you can grant access to any key signed by that particular CA certificate. For example, you have a server which trusts a CA. You can now allow access to any user by signing their key using the CA without having to add their key to the server itself, which might be impossible (let's say it's an embedded device with read-only storage so any addition to .ssh/authorized_keys will be lost on next reboot).


How to Prove you created IP using a Notary

It is possible to sign a document (using PGP or by other means) and also include a trusted timestamp so that you could technically prove that you had a specific knowledge at a specific time. Or you could do it a non-technical way by writing everything down and give it to some publicly trusted party like a notary who will seal and timestamp the document and store it until you want to prove that you had this knowledge at the specific time.

But of course, somebody else could simply claim that they had this knowledge already earlier. While they can not prove this the same way you do they can get some bribed witnesses or make up some facts. And depending on the specific information it will be hard or impossible to prove that they could not have this knowledge at the time they claim. But whom some boss or judge will finally trust is not a technical thing but an interpersonal or legal thing, i.e. off-topic. With patents it is usually clear though because this is defined by law.


This is kind of like a product recommendation, so it may end up closed however. You should also be careful to distinguish between a checklist and a standard.

If you are looking for some high level checklists to use for your development process, you may want to checks out SANS SWAT, which covers more logical considerations rather then specific code level issues. You may also be interested in the ISO 27000 (i.e., ISO/IEC 27034) series (not just 27001 or 27002). Other methodologies include STRIDE (would not recommend) and DREAD from Microsoft

It's not clear if this is for a specific programming language, but NASA JPL has guidelines for C and JAVA which may be useful to consider as part of security standards. Oracle has their own JAVA secure guidelines. The CERT guidelines already in Jaques answer are also in the same realm.

You will need to clarify your objectives and build upon these tools to create:

Secure coding standards (code will be formatted this way)
Library/platform specific standards (CSRF tokens will use this common function)
Secure development/SDLC practices (code will be put through these scanners, tools, or processes before being committed; pen test before promoted to production)
Ongoing testing and review (regularly occurring application re-certifications; responsible disclosure procedures)

A checklist might be a good way to start as it is clear cut, but bad processes can be just as harmful - e.g., you promote the wrong branch with the buggy code).


How does a DOS attack work when attacking a single server with a single client?

Bandwidth is just one resource that can be targeted. If the server runs some expensive server-side scripts, it is quite possible to exhaust its CPU or RAM resources without putting much strain on the network.


What process would add gdiplus.dll and msdia80.dll at the root of a hard disk

These are commonly the artifact of installing the Visual C++ redistributable package, often installed with many applications and video games. It's worth noting that Steam installs this package with a large number of games.

Some more info: http://support.microsoft.com/kb/927665


The backbone of WhatsApp works like a client/server architecture which is actually based on XMPP(Extensible Messaging and Presence Protocol), where clients do not transact directly with one another.

However, it is possible for WhatsApp calls to reveal one's IP address, as calls connect in a P2P manner and not through a 'middle-man'!


Drive By Download Without User Interaction?

Yes, many client side exploits on browsers (Internet Explorer, for example) and some plugins like Flash (and even some old Java ones I believe) do not acquire user interaction.


Is this machine compromised? (iRedMail server, weird logs)

In Linux (or other Unices), a setuid program is a program that should run with the rights of the program owner, not the one who called it. For example, if you type ping google.com, ping will likely be run as root to allow receiving ICMP packets. This is not a security hole, as ping doesn't allow shell escapes. All the programs listed have a reason to be setuid, and are nothing to worry about.

su needs to run as root to switch its user id.
at needs to run the command as the user it was asked to run as.
passwd needs to read /etc/shadow, and therefore must be root.
wall needs to write to other people's terminals, and therefore must run as that group.

The chkrootkit warning is more concerning, as well as the Python network port incident. Try scanning the ports locally (nmap localhost via SSH), and see if the port is open, as even if it's bound to all interfaces, the port may still be firewalled from the outside. Try using strace to find out what files the Python process is opening, or better yet, use ps to find out the command line arguments Python received, and just locate the script to see what it does.

I'm not an expert in PostgreSQL, but I assume not allowing login from the Internet means replying "unauthorized" to everyone, therefore it may still show up in logs. Some script kiddies always run scans with default passwords to see which servers they can get into. The fact that it says failed login is a good thing.