Is there a brute-force attack similar to what they demonstrate in movies Since I was a teenager (that's 20 years ago) and till now-days you see movies with professionals stealing a super-computer and use it to crack a password or a home security system using brute-force (I assume). However they always demonstrate by showing them trying to crack a pin or a password that consists of many digits/characters and the super-computer cracks the fields one by one

The green digits on the left have been cracked, the ones on the right yet to come. The super-computer tries to figure out the first digit then the second and so on, you see the numbers keeps fluctuating till it's get locked on the right digit.

Does such attack even exist?

What you see in the movies is a plot device to ratchet up tension, every time a character is determined it gives the audience a kick. Reality is a bit different.

Brute-force attacks do exist, however it's all or nothing - you either get the whole passcode right or wrong. There's no way to know whether you have guessed a correct character. Passcodes are typically hashed, where changing a single digit will return a completely different cryptographic result. You could get all but a single character right and you wouldn't have any indication you came close.

So real password cracking might be a bit boring from a movie point of view, where you need to show progression to maintain audience interest. What they could do is show a progression bar for the calculation of all possible permutations of a hash, but it wouldn't have a predictable end time - you could get lucky and hit it right away, or get it towards the end of your brute force range. Not necessarily good for a movie but a good director could pull it off.


How should we mitigate threats that are keep coming to our security monitoring system? We have continuous cybersecurity threat feeds that coming to our SOC on a daily basis from different sources that provide all the new CVEs, new malware variations and more. We just don't know how to handle these alerts in the right way and not only that, we are lost on choosing to what will be the action to follow on those threats. What will be a good process in a bank to follow up on these threats if we can assume that there no major financial restrictions?

Threat intelligence has a common issue today which is a large volume of data generated & coming to the consuming enterprise IT set up & threat intelligence feed bundle has three different usages.

Using threat intelligence data for blocking risks & unwanted connects to your communication to your enterprise setup.
Using threat intelligence data to create new rules set in your security generation & threat monitoring solution including SIEM.
Using threat intelligence indicates to discover the presence of existing hidden threats within your enterprise.
Using threat intelligence data to analyse & visualize the threat landscape as it applies to your company

Each one of these four usages have their own set of actions which needs to be taken.
For organization such as banks threat intelligence data can be save the Zero days kind of threats if it is contextualized properly.

Contextualization of threat intelligence data is next stage of threat intelligence consumption which needs new processes, new technology & organization cooperation to work.


location of msfconsole generated executable in Kali linux I am new to security and pen testing. I am using metasploit to generate my payload. I have generated a payload using generate -t exe -f shell.exe.
But I cant find the location of the shell.exe anywhere in kali linux. I have tried find / -name 'shell.exe'. But still no luck.

You're going to want to give the -f flag a fully qualified path
generate -t exe -f /root/shell.exe
should drop it in your root directory
You can read more about Generating Payloads on the Offensive Security Website
Here is an example they give
generate -b '\x00' -e x86/shikata_ga_nai -f /root/msfu/filename.txt


Windows 2003 Enterprise infected by Conficker; post-infection problems continue I used various tools to remove Conficker, and I pretty much succeeded, but I've had recurring problems afterward.

It won't update anymore (with the following error message: 0x800706B5)

I tried everything I found on Google, such as forcing re-installation of the update utility and what-not. Funnily enough, it works on the same user via RDP, but after downloading the updates it fails to install. I've had to download each update manually and update it myself.

Keep finding these weird infections

Keep receiving incoming connection from all over the globe

Machine became a little sluggish

Can anyone help me out here?

Your server has been infected with a virus. Stop trying to hunt down the problem and just nuke it from orbit. Do a full reinstall of your system and restore from a known safe backup point.


How does PKI help prove a site is legitimate? Apologies if this sounds like a newbie question!

PKI is often stated as being able to prove a site is legitimate, i.e. Amazon.co.uk is the real Amazon.co.uk

Can someone help explain how PKI/SSL makes this happen?

Thanks!

It's easy to open an encrypted SSL/TLS channel with someone using asymmetric cryptography; your browser just grabs the site's public key. The hard part is knowing who you're actually talking to. Someone could be using a man-in-the-middle attack and you wouldn't know you've been given the wrong key, and thus are talking to an imposter.

That's where PKI comes in. The idea is that a mutually trusted third party, known as a Certificate Authority (CA), is has vouched for the fact that the public key you've been handed actually belongs to the owner of the domain you browsed to. For example, if you click on the lock icon next to this site's URL, you'll see that DigiCert has vouched for stackexchange.com's certificate. This means that stack exchange purchased a certificate from DigiCert and had to prove ownership of the domain as part of that purchase. The certificate is just a bunch of identifying info, including domain name, paired with a public key, and then digitally signed by the CA.

You browser comes pre-loaded with certificates from a bunch of CAs. When you browse to a web site, if the site's certificate is signed by a CA on your browser's trusted list, then everything just works. If it's not, your browser will throw an error.

In practice, the system sorta works, but there are several problems. There are way too many CAs, including companies with lousy security and governments who engage in espionage. Also, users may ignore the error their browser throws when the certificate isn't right, because most of the time, the problem is a misconfiguration, not an attack. If you want to get a better understanding of the practical problems and mitigations, check out the research of Moxie Marlinspike and Google "certificate pinning".


How could someone exploit the OS an ATM is running? As I'm sure many of you have heard, the end of support for Windows XP is the supposed apocalypse for ATM's worldwide. I am cognizant of the fact that this ensures that no more patches are issued, and that banks need to take that threat seriously. I'm having a hard time identifying potential attack vectors and to me it seems as though this is being sensationalized.

We know that the majority of attacks against ATM's are against the environment of the ATM (ie Card Skimming) and not with the software itself. This threat may never completely be eradicated. That said, can someone point out how the software running the software could serve as an exploit?

Perhaps I'm being naive, however the machine itself offers limited physical interfaces to exploit - No USB or other bus ports, access to a serial port, etc. The network is (theoretically) locked down with means outside the OS running on the ATM, and the only vector I could see possibly being exploited is the card slot itself.

How could someone exploit the OS the ATM is running on?

Well there's a couple of potential attack vectors which could be relevant.

First up ports.  Surprsingly some ATMs do indeed have USB ports and have been attacked via them (more info here as an example and also this CCC presentation on infecting ATMs with malware).  However you'd hope that ATMs have decent physical security to help mitigate that class of risk.

Then there's attack over the network.  One of the downsides to windows XP is that services like SMB are running and pretty much impossible to disable without making it very hard to manage the system.  You could obviously firewall off the ATMs but there still needs to be some network connectivity for management and to transmit transactions.

Now you'd hope that everyone's ATM network is physically separate and not contactable from any other network, but the idea that companies will maintain good air-gapping is not likely to hold 100% of the time in the real world (look at all the SCADA problems that people thought would not happen due to all SCADA systems being Air-gapped!)

So the answer really is that ATM software will be attacked the same ways that other Windows XP systems will be, it may be harder to carry out but not impossible.


What are the best practices for anti-virus / anti-malware when using containers? One of the SOC 2 controls is apparently around ensuring antivirus/anti-spam/anti-malware is running on production servers. I've been googling to see if there are any recommendation/best practices for this in the container world. I'm not sure if it's a good practice to run AV on the host OS? Some materials I found in my Googling seem to indicate that if you do something like that, you would need to exclude the files used by the container to avoid locking up the container. Which sounds like it would defeat the purpose.

In our particular case, we're running on GKE using Google's pre-made container OS. Anyone have experience with this?

The general insistence of some security standards on anti-malware software running on every host, without exception, is a bit... dubious in a lot of cases (IMO).

That said, if it's a standard you need to comply with you need to either have a control or a well thought through mitigating control if you can't comply fully.

Here there's two aspects to the issue.  First is scanning the images themselves, second is scanning data placed into the images (for example user uploads).

The second case is actually easier to handle.  as containers are ephemeral you'll be mounting volumes from outside the container for any data you need to be persistent.  So you can just enable anti-malware on your external data stores (if you have any) and that addresses the issue here.

For the files from the container images themselves, I'd say that scanning running images (which would have a performance hit) can be avoided reasonably with some mitigating controls :-

Images should be scanned in the registry on build and periodically after that to ensure that they're not running outdated, vulnerable packages
As images are meant to be ephemeral, they should be able to be mounted with a read only root file system (via readOnlyRootFilesystem: true in the security context for the containers).  With this configuration the attacker can't write files inside the running container, so there's no real need for A-V scanning.


Own attributes openssl Is there a way to include my own attributes into an openssl certificate?

e.g
...
Country Name (2 letter code) [GB]:

State or Province Name (full name) [State]:

Locality Name (eg, city) [City]:

Organization Name (eg, company) [My Company Ltd]:

Organizational Unit Name (eg, section) [Section]:

Common Name (eg, your name or your server's hostname) []:

Extra Stuff (eg, dunno) []:

Extra Stuff2 (eg, dunno2) []:
.....

Yes. There are two options: set this in the request and make sure it's preserved when signing (something a commercial CA will be disinclined to); or explicitly set during the signing.

The DN (distinguished name) is a single field in a request or certificate. It's an X.500 name, so it has one or more typed attribute/value pair components. This meaning of "attribute" isn't exactly the same as an "attribute" used in a request, this part of the documentation explains some of the distinction.

(There is also a distinction between X.509 attributes, and extensions, here's my answer that shows how to go about adding arbitrary extensions to a certificate when signing, which might be what you need if you want to add something that's not in the DN.)

If you want extra components in the subject name (DN) then it's easiest to use the -subj option when generating the request, or when signing it. If the types are not already known to OpenSSL you can use OIDs directly, or add them via an oid_file, or oid_section in openssl.cnf .

Note however that the attributes that are widely supported in a DN are limited, see RFC 5280 §4.1.2.4 (these are the constraints for the Issuer field, but §4.1.2.6 for the Subject field refers to this for its requirements).

If you want to be prompted for these during the normal openssl req process you can add them to either [ req_distinguished_name ] (where they will become part of the DN) or to [ req_attributes ] (where then will become an extra attribute in the request, which is probably less useful to you). There are some examples in the req documentation and in the extensions documentation.


Is it possible a scammer stole my credit card details and made a new card from it? So I'm abroad at the moment, yet I've just had a cash withdrawal made on my credit card from my country of origin, even though I'm not there and the card IS with me abroad.

I called the card issuer and they have cancelled the card and are sending me a replacement.  They told me that this was definitely a bank machine withdrawal with a physical card so my card must have been copied at some point.

What's odd is that it's actually months since I last used this card in a physical transaction back in my home country so it's odd that if it was copied all the way back then that it's only being tested now.

Anyhow, it got me thinking, is it possible that the card wasn't copied some months back but instead a copy card was compiled using data a scammer obtained about my card and its security codes via another source such as an online shop ?   Is that technically possible or is there info in the card that is required that isn't ever part of an online transaction?

Credit card fraud is very common and very easy to perpetrate when dealing with magnetic swipe cards.

Credit cards can be duplicated very easily. All it takes is a machine that can read and store the data on the magnetic stripe; writing that data to a blank card can be done later. This process is often called skimming, and it can happen almost anywhere. The necessary hardware is very cheap and easy to find.

Skimmers can tamper with credit card machines at merchants, or they tamper with ATMs. With ATMs, they often capture the PIN entry with a small camera. Unattended machines such as gas stations and standalone ATMs are most frequently targeted, but almost any machine could be affected. It is also possible for service staff such as waiters/waitresses to carry hand-held skimmers.

This is why most banks are switching to chip-enabled cards. While there is no such thing as perfect security, it is significantly more difficult to compromise the chip. The cryptographic secret stored on the chip is never transmitted, so it cannot simply be read by an attacker.


Should we rethink our entire password strategy? Passwords get discussed a lot on this site, and there's quite a lot for both users and sites to do, to stay in line with "best practice".

Web sites need a password strength policy, account lockout policy, and secure password storage with a slow, salted hash. Some of these requirements have usability impacts, denial of service risks, and other drawbacks. And it's generally not possible for users to tell whether a site actually does all this (hence plaintextoffenders.com).

Users are supposed to pick a strong password that is unique to every site, change it regularly, and never write it down. And carefully verify the identity of the site every time you enter your password. I don't think anyone actually follows this, but it is the supposed "best practice".

In enterprise environments there's usually a pretty comprehensive single sign-on system, which helps massively, as users only need one good work password. And with just one authentication to protect, using multi-factor is more practical. But on the web we do not have single sign-on; every attempt from Passport, through SAML, OpenID and OAuth has failed to gain a critical mass.

But there is a technology that presents to users just like single sign-on, and that is a password manager with browser integration. Most of these can be told to generate a unique, strong password for every site, and rotate it periodically. This keeps you safe even in the event that a particular web site is not following best practice. And the browser integration ties a password to a particular domain, making phishing all but impossible To be fair, there are risks with password managers "putting all your eggs in one basket" and they are particularly vulnerable to malware, which is the greatest threat at present.

But if we look at the technology available to us, it's pretty clear that the current advice is barking up the wrong tree. We should be telling users to use a password manager, not remember loads of complex passwords. And sites could simply store an unsalted fast hash of the password, forget password strength rules and account lockouts.

I'd dispute that changing passwords regularly is really a "best practice". It is more a "widespread practice" which can be traced to military procedures dating from, at least, the times of Julius Caesar. Applicability to computer systems is, at best, questionable.

Password managers are all fine and dandy, but they are actually at odds with the core principle of passwords: a password is something that fits in the brain of the user. Relying on a password manager is a paradigm shift. To state things simply, you no longer authenticate the human user, you authenticate the user's smartphone. This may be considered as befitting modern times; indeed, it seems that the square technological appendices have fused with their hosts, and many humans can no longer be considered as completely defined, let alone happy, if deprived of their favourite gadget. Yet this is a shift that we shall be aware of, and which requires some thorough thinking.

From a pure security point of view, the password manager implies an extension of the user's responsibilities: with a password, the user must keep the password secret and not write it down or reveal it; with a password manager, the user must maintain the integrity of the password manager hosting system as well. In many cases, this does not change much (if the user's machine is infected, a keylogger will grab all the data anyway), but the shift is not completely negligible either. This can be seen from a usability point of view: a password-in-brain naturally travels with the user; a password manager implies a dependency with some software and synchronization procedures.

Besides, as @schroeder explains, recommending an actual product is a delicate matter; this would look like an endorsement, and it complicate things when the product disappears, either through lack of support, or more spectacularly like TrueCrypt.


Where are the symmetric keys stored when using ssh? The use case is this: Imagine you have two systems, A and B. If system A ssh's into system B and begins transferring over files back to A, I want to be able to decrypt the content of the message being sent.

I understand that in SSH, there is a shared symmetric key that can be used for decryption. If I'm at system B, where can I find this symmetric key?

With SSH, TLS and similar protocols the symmetric key is created during a handshake phase using key exchange protocols like Diffie-Hellman Key Exchange. The generated key is kept in memory for the duration of the session, i.e it is not written to disk. Thus to get access to the key you would need to dump the memory of the client or server or would need to rely on functions to explicitly export the key, if available.


Image steganography and tracking We are running an online-press media-library. On this site many brands are uploading images and track press users download and views per image.
But some brand now want to add unique code in image so they can track their own images.

We tried some steganography tools:

http://www.outguess.org/info.php (support JPG)
http://www.imagemagick.org/Usage/transform/#stegano (support PNG)

Both works fine, but issue is that secure code disappeared after image resize or crop.

Simple way would be watermark, but we don't want to disturb images, because images are being used in press printing.

Is there any way to put secure code in JPG format image and track that code after resize or cropping of that image?

Update

Our brands want to publish them as web image(light version), so press users could use images on blog and forums.

We will target press blog / forum site from crawler engine(~4500 blogs) and check if our image exist on these blogs.

You can add information to JPEG images in two ways:

you add information out of any image data, that is to say the JPEG headers
you add information in the image data, that is to say you modify the image

The first technique can be easily bypassed by simply removing the relevant data from the header.

The second technique can be broken down into:

Watermarking
Steganography

Steganography is used when you want to distribute information in images and want to remain as stealth as possible. You don't say you are putting information into the images and you try by all mean to minimise your impact on the image statistics.

Watermarking is used mostly for DRM purposes, you want to put information in the image and ensure it stays when modifications are made to this image (it is called a robust watermark). Robustness usually comes at the price of image alteration (we can say degradation here), there is no actual way of achieving a robust watermarking without "disturbing" the image as you say. There are many, many techniques of watermarking (which are off-topic for this question) with different type of robustness (cropping and resizing included) with different impact on quality. You should ask google scholar about that.

You'd probably better have two copies of the image, one for online display (with watermark) and one for printing (without watermark).

Edit: since you're not convinced yet, here is some link to relevant articles:

A Comprehensive Survey of Contemporary Researches in Watermarking for Copyright Protection of Digital Images
Geometric attacks on image watermarking systems
A Survey of Digital Watermarking Scheme
Semi fragile watermark with self authentication and self recovery

they should give you a good overview of the state of watermarking and its properties and possible attacks on it.

For further inquiry see at : https://scholar.google.com/


How to make Firefox ignore the X-XSS-Protection response header? I have two questions:

How can I make Firefox ignore the X-XSS-Protection header? I have a website which sends an X-XSS-Protection: 1 header and I want my Firefox to ignore that header, because it destroys my reflected XSS tests.
I know Chrome has a directive --disable-xss-auditor to ignore it but I can't find anywhere how to do the same in Firefox.
How to disable XSS protection from web browser itself (Firefox + Chrome). I'm now not saying about header from a server, but how to disable built into web browser protection against reflected XSS?

This question is old and was answered in the comments, maybe it is time to close it. The answers to your questions should be:

Quoting Neil McGuigan, "Firefox doesn't have an XSS filter like Chrome and IE do, therefore it already ignores that header" (link). In the meantime also Chromium removed their XSS Auditor (link).

Being there no such thing as XSS protection, you probably refer to automatic URL encoding, which is mandatory and cannot be disabled:

"All unsafe characters must always be encoded within a URL" (RFC
1738)
"The URI producer will transform the local encoding to one that is
suitable for a public interface and then transform the public
interface encoding into the restricted set of URI characters
(reserved, unreserved, and percent-encodings)" (RFC 3986)


Replacing username and password screen with a PIN code screen for easier mobile access I have an Android mobile app which currently asks the user for a username and password to login. For security reasons, the session token expires in 2 hours so it has to ask for the username and password often which can be frustrating and annoying for mobile for users. I'd like to replace the username and password screen with a PIN code screen to make it easier for the user to login often. What are some best practices and standards for PIN code implementation without compromising the security of the application?

At first login, the app will ask the user to input a preferred PIN code after they have logged in successfully.

What you want would require the token to be valid indefinitely. However, that WOULD compromise the app security. Therefore, you have to find a way to get 2 tokens onto the device, one valid for 2 hours, the second one indefinitely. However, anyone who gains access to the mobile device can access the token as well, leading to an account compromisation. To prevent that, you could encrypt the token. A token encrypted by 4 digits might still not be strong for your use case, but that is outside my knowledge.


intrusion prevention system detected "et policy pe exe" should i worry I have a UniFi Security Gateway (USG Pro 4P) and just enabled IPS (intrusion prevention system). I am seeing many "ET POLICY PE EXE or DLL Windows file download HTTP" alerts. I have not been able to find any more information on that alert. Should I worry about this alerts or white list it? The destinations are all over the world so I am concerned

The "ET POLICY" part of the alert is telling you that it's a 'Policy' rule: i.e. it's not an attack per se, it's just something which might violate a corporate policy.

That particular alert is just telling you that someone has downloaded a Windows executable file or DLL over HTTP. In most cases this is just noise, unless you've prohibited downloading of executable files in your environment.


Could this kind of authentication be attacked? I'm not a cybersecurity expert but just a webmaster and I wonder if this kind of authentication would be dangerous. I test the password like this on the server side using PHP:

if (isset($_POST['pass_word']) AND $_POST['pass_word'] ==  $passwd)

$passwd comes from my PostgreSQL DB. I thought at least I don't risk SQL injection. Do I risk some other kind of injection? If it's a hazardous way to authenticate please explain why.

This looks like you're storing passwords in the clear, which is a bad idea. You should ensure passwords are protected using, at minimum, password_hash() and password_verify(), which use bcrypt under the hood. This is simple, easy, safe, and perfectly acceptable for most scenarios.

Alternatively you can use a slightly more secure method such as Argon2, which won the Password Hashing Competition and is resistant to CPU and GPU cracking, and also aims to minimise the potential for side-channel attacks. There's an article which explains how to use Argon2 as part of libsodium's PHP wrapper, or directly using Paragon's "Halite" library, which offers Argon2 with symmetric encryption on top to prevent database-only access from providing usable hashes, due to the fact that the symmetric key is stored on the server's disk as a file. This option is more complicated, but it does offer some additional security if you're truly paranoid. I'd suggest avoiding this if you're unfamiliar with secure development, though, as the chances of you messing something up are increased.

I'd also recommend using === in order to avoid weird cases of false equality using arrays in URL queries or nulls.


Decrypting TLS Traffic Context:
I want to reverse engineer a protocol in place for the Nintendo 3DS. The implementation however, uses TLS, which makes it difficult to reverse engineer. I'm currently able to sniff packets to/from my 3DS because I have a spare router being used for a "testing wifi" that runs through my desktop's ethernet, and then through my desktops wireless card to the actual internet.
What I've investigated:

MITM
Proxies

Roadblocks:

I can't force the 3DS to accept a questionable certificate.
I can't forge the certificate.
I won't attempt thieving the actual private key ( I have little interest for it once I know the protocol ).
I'm unable to read the session key from my console's RAM, due to lack of hardware.

Potential solution:

I'm almost 100% positive that the protocol is some form of HTTP ( Probably through headers, mostly ). So if the encryption is XOR based, I may be able to get part of the key, at least? I don't know a lot about cryptography.
I've thought about setting up a proxy, a CA server instance [ and pointing my desktop's host file to this server instance ], installing Nintendo's certificate and then overwriting their public key with my own private key, and then using my 3DS's certificate on the proxy to communicate with Nintendo. I'm not for certain that this will work as I honestly don't have a complete grasp on how TSL works beyond that it's not something you can break easily.
Is brute-strength a viable option if I am able to generate more encrypted data?

tl;dr- Is there a way for me to decrypt this data without the server's private key, or cracking into the RAM to find the session key? I do have the server's certificate as well as my 3DS's client certificate.

Can you install a CA certificate on the 3DS? In that case, this might work:

Install Owasp ZAP
Install the Owasp ZAP CA certificate on the 3DS
Configure the 3DS to use OWASP ZAP as its proxy
Inspect traffic in OWASP ZAP

If the device implements Pinning then this still won't work. In that case your project might be kinda doomed.

If it turns out not to be HTTP, you can try a full MiTM attack, which involves setting up a fake CA, using mitmproxy and routing all traffic from the 3ds through it.


Are my passwords saved in Google Chrome safe when I'm logged out? I understand that Chrome uses the OS's password storage mechanism to protect passwords on your computer. 1  I also understand that these passwords can be (in my case, are) protected with a passphrase of my choosing, for syncing them in the cloud.

Are my passwords safe when I'm logged out of my local Linux / Windows account?

There exist a means on both Linux2 and Windows3 for  clearing / changing user account passwords. Can an attacker simply reset my local account password, log into it, open Chrome, and be able to use my passwords? Or does the OS password protection mechanism prevent this?

There are several sources that indicate that Keyring / Windows DPAPI derive the password store decryption key from your account password. 4

Is the Google Chrome "session" protected in this same way?

I'm just hesitant to "trust" that everything is safe without understanding what's going on under the hood.

It would feel good if Chrome would ask me for a master password, but they don't want to implement that feature. 5 I'm okay with that, as long as I know my data is protected by my OS account login.

In cases where a password store key is derived from the account password, it is impossible to get access by force-resetting the account password. When that's happening, the password store is encrypted with a key derived from the password. Decrypting it requires the password; the password isn't just used to tell the OS you have permission to view it (like normal file permissions), it's the only way to decrypt the store, because the decryption key isn't stored anywhere on disk (it's re-derived whenever you enter your password). That's the big difference between encryption and access control: access control can generally be bypassed because it relies on the OS letting you access something or not letting you do it, but encryption cannot because the only way to get the data is by something found only in the user's head.

The OS doesn't know your password: it stores a hash of the password, but it doesn't store the password and doesn't store the key. Someone who gains access to your account in any way except entering your password can't decrypt the password store. That includes resetting the password. If you change it normally, the OS can decrypt the store with your old one (which you either supplied to log in or supplied to change the password) and save it re-encrypted with the new one. If you change it with password reset tools, what the OS does is overwrite the password hash, but it can't decrypt the store to re-encrypt it. It sometimes keeps the old one around in case the user knew their password but had to reset it for some reason (in which case they can enter it in when they next log in to their account to change the encryption key), but the data remains inaccessible until the original password is entered to decrypt it.


How does software developer protect their code against binary patching? Supposing we have a software that checks on a remote server online if the input entered by a user (a license key) is valid.

The server sends in a socket to the client True or False if the license is correct or not.

In the binary, a jump (jz...) is made depending of the result.

I think that this implementation is common to software (please correct me if I'm wrong on that point).

The problem is that nothing can prevent a malicious user to patch the binary in order to change the "jump" above and bypass the check validation of the license key.

So how does software developer prevent that situation ?

You can't prevent people toying around with your exe, if you check if it wasn't tempered then they'll patch the code that checks that to. One thing you can do is not distribute the whole program but a version missing core functionality in the exe, then when they enter the cd key patch that in memory with data you download from an url that contains the cd key. That or send encrypted code to each client that requires the matching key to decrypt.


IBAN with too few blanked digits? It is customary for websites, messages, or other documents to sometimes display data (credit card numbers, phone numbers, ...) with some numbers blanked (e.g., replaced with asterisks) so that the legitimate reader can recognize what full number is behind it, but an adversary cannot.

My bank uses this in to obfuscate the bank account number of wire transfer recipients in mTAN confirmation messages. However, they hide only the three last digits of an IBAN.

Given that IBAN involves a modulo 97 checksum, this is in effect not much better that hiding a single digit of "real" data, thus allowing an adversary a significant chance of guessing right. Given the additional fact that certain banks have somewhat predictable local account numbers that form the right end of the IBAN (e.g., often ending in 00, or maybe there was already some kind of checksum in it), I find this practise not very comforting.

Should I be worried / ask the bank for clarification?

EDIT: I am aware of How to mask SEPA (IBAN and BIC) information correctly?, but that question and answer aim at a very different direction, namely: How much of an IBAN should be exposed in order to recognize it from a handful of "my" IBANs to use in a planned transaction? The answer states that typically the last 3-4 digits are enough. My question however is concerned with the opposite scenario, that an IBAN is transmitted with almost all digits visible. It makes sense to display many digits in this scenario so that I can be somewhat confident that the IBAN is indeed the arbitrary IBAN I typed in before (and not the account of someone intercepting the mTAN). While "IBAN numbers are not secret" may apply here as well (thus questioning the need to obfuscate at all), I am also more concerned with the implications that the strong checksum spoils the obfuscation almost completely.

The reason for stating (part of) the IBAN in the mTAN message is to protect you from an attacker such as rogue browser plugin modifying the destination account. The more you hide, the greater the chance the attacker can use a collision - i.e. he has a full access to an account where the numbers not hidden match your intended transfer. As the plugin would only change the account for transactions it knows it can exploit, the bank wants to show as much as possible to lower the chance. The probability of someone intercepting the mTAN itself is probably regarded as too small to bother.

  E.g., in Germany, one could buy goods/services just knowing your name and bank account number (IBAN)

Well, this is the real problem that one should ask your bank for a clarification. An account number is neither secret nor unpredictable and should be treated as publicly accessible information. If one account number is known, one can usually also generate other valid account numbers quite easily, so one can only hope the name is checked as well.


Is it possible to specify multiple values for failure condition (F=) using Hydra? I want to brute-force a site using Hydra (https-post-form) that I don't know valid login credentials for, so I cannot specify a value for success condition (S=).

Failed logins result  in a redirect to one of two different failure pages with no words in common.

How can I specify multiple values to F=, e.g., F=(fail)|(tak) (regular expression)?

Assuming Hydra was compiled with PCRE (regular expression) support, the pattern you supply should be treated as a regular expression.  You should be able to use | as a pattern "or" operator.

Here's the relevant source code: https://github.com/vanhauser-thc/thc-hydra/blob/eb064c4222964ecac9dc757ad8c847b130c43deb/hydra-http-form.c#L563-L567

You can tell if Hydra was not compiled with PCRE support because it will specifically mention "regex support" on the "These services were not compiled" list: https://github.com/vanhauser-thc/thc-hydra/blob/eb064c4222964ecac9dc757ad8c847b130c43deb/hydra.c#L2142-L2146

If you don't have PCRE support, you'll need to recompile Hydra from the repository.


Erasing a hard-disk, encrypting it as alternative? I was pondering about this, sometimes people ask me to erase data on their drive. So I use a shredding program, which takes a long time. However what if instead of shredding all the files, I'd just use truecrypt to encrypt them. The disk would be useless then no? Would the data still be recoverable for someone without the password? It would be faster no?

I'd use a strong password. I just want to make the data unusable.

Modern research seems to indicate that performing a single zero-pass of a hard drive is sufficient for most data dispositions. In which case, no, performing a file or partition encryption would not be faster. Except in the case of hardware accelerated encryption (such as the newer Intel i series processors) encryption speed is CPU bound, whereas a single zero-pass would be I/O bound. Even in the face of hardware acceleration, we still run into the problem of performing an I/O bound function, making it no faster.

Sometimes there are specific policies, laws, or regulations that require something more stringent. In these cases you will often have very specific disposition requirements, which you should be following anyway.


TLS 1.3 HKDF-Expand references to Hello messages I am looking into TLS 1.3 implementations and am a little confused about what is being referenced in the HKDF functions. Specifically the last argument in the Dervice_Secret wrapper function. From RFC 8446:
 PSK ->   = Early Secret
             |
             +-----> Derive-Secret(., "ext binder" | "res binder", "")
             |                     = binder_key
             |
             +-----> Derive-Secret(., "c e traffic", ClientHello)
             |                     = client_early_traffic_secret
             |
             +-----> Derive-Secret(., "e exp master", ClientHello)
             |                     = early_exporter_master_secret
             v

In this example ClientHello is the argument; however, it is unclear what specifics bytes that refers to:

It is the whole client hello message?
Is it just a field or extension in the hello message? like ClientHello.random?

The Derive-Secret function is defined this way in § 7.1:
Derive-Secret(Secret, Label, Messages) =
     HKDF-Expand-Label(Secret, Label,
                       Transcript-Hash(Messages), Hash.length)

§ 4.4.1 specifies that the transcript hash is generally just the hash of the messages concatenated (although there is an exception), so in this case, it's a hash of the entire message.  Specifically:

This value is computed by hashing the concatenation of each included handshake message, including the handshake message header carrying the handshake message type and length fields, but not including record layer headers.

TLS 1.3 specifically uses the transcript hash in many cases because it foils certain techniques that could be used to cause different sessions to derive the same secrets.  These had been used in attacks on the protocol in the past, and they were also used by MITM devices in the past.  Since the only way now to derive identical secrets is to perform an identical key exchange and we assume the attacker doesn't know the key exchange private key, these attacks are no longer possible.


What do you search for in Open Source code to be sure there isn't malicious code? I realize the answers will be language specific, but I am curious what terms you would look for when checking something out on Github? I was looking for a remote administration tool that I could use with clients, and found some awesome ones, that happen to be "viruses"

Take https://github.com/rsmudge/vncdll (associated with metasploit), or the QuasarRAT project for example: https://github.com/quasar/QuasarRAT

Now I have seen enterprise high priced tools like SolarWinds MSP Connect, Dameware, and so on that do most of those same things, but QuasarRAT is listed as a virus when I try compiling it.

I was playing with the idea of taking the QuasarRAT program apart, segmenting each feature into plugins, remove any that may be malicious only, but then I am not sure it still wouldn't be listed as a virus.

In PHP I would look for obfuscated code that was using base64_decode(), exec() and so on, but I am curious what terms I should be on the lookout for with C#, C++ C, Bash - specifically those that may involve keylogging, transmitting data to a remote host, or downloading additional things to the computer?

Things I can think of are TcpListener, AcceptTcpClient, stream, bind, sockets, http, wget, curl, ftp, ssh, rsync. Since I am not fluent in C++, C, and I know I have more to learn in Bash and C#, I would love suggestions for those fun Easter eggs that people have hidden that you have found.

While I realize that just because these terms are used, it doesn't mean it IS malicious, but at least I can focus some time on that function and decide what it is doing, what else is calling it, and if it is approved.

IF we can get a good list together, I will try to come up with a script that will automatically search and bring back the matches for review.

If you want to be 100% sure that some git repo doesn't contain malicious code, write it yourself; anything else will be an uphill battle.

If someone's really truly trying to hide malicious code in plain sight, then you probably won't notice it. Take for example, the infamous 2003 nearly-a-backdoor in the Linux kernel where this harmless code:

if ((options == (__WCLONE|__WALL)) && (current->uid == 0))
    retval = -EINVAL;

was turned into a backdoor like so:

if ((options == (__WCLONE|__WALL)) && (current->uid = 0))
    retval = -EINVAL;

(hint: instead of checking if you're root uid == 0, it turns you into root uid = 0. So pass in the flags _WCLONE|_WALL to whatever system call this is and BAM! you're now root.)

This example isn't directly relevant, but shows that malicious code in C/C++ can be really subtle. So if you think there's a chance that someone is playing hide-and-seek games in the code, move on and find a different project.

I often deal with a softer version of your question, "Is this open source library / tool ok to use?". My approach is to see if it has a good reputation; is it actively maintained? Do their github tickets give the impression that they follow a proper dev process? Do they publish regular changelogs, including security fixes? Does it have unresolved CVEs against it? If there are binaries, are they properly code-signed?

It's not foolproof, but it weeds out seedier projects. (if anyone has a better way of vetting open source projects, I'd love suggestions!)


Does OAuth2 state parameter need to be cryptographically secure? In OAuth2, as part of the authorization request, we generate a random string and pass it with the state parameter, so that when we get the response, we can ascertain that the response is a result of our request.

In some examples, I've seen this generated using normal pseudorandom functions. Would there be any benefit in using cryptographically strong random number generators instead?

It's all dependent on what you're doing with that state information after authorization and what could happen if an attacker modified it.

If you're using it to reassociate a session then you need to make sure an attacker can't just randomly guess the session ID. Or conversely ask yourself what happens when an attacker randomly guesses it?

If you're storing a bit of data like final-sales-price=$142.32 then you need to make it tamper evident through (say) signing so an attacker can't modify.


Wireshark displays sql calls - Prevention So I was analysing a new application that is being written. I noticed that on the app server level there are sql calls that are being made from C# code. These calls can be seen in wireshark by following the TCP stream from my machine.

Is there any way to prevent a MITM from seeing this? The calls look something like this after wireshark reconstructs it:

S.E.L.E.C.T. .V.A.R. .F.R.O.M. .T.A.B.L.E...

Im not sure the protocols being used but clearly being able to see the plain text sql calls with variable names and table names is a problem.

This is a configuration issue with the database. Most modern databases offer transport encryption, though many are not enabled by default.

Here are some links for setting up SSL on popular SQL databases:

6.3.6 Using SSL for Secure Connections

How to enable SSL encryption for an instance of SQL Server by using Microsoft Management Console


Does firefox sync master password? I'm using Firefox with Sync on different PC's and master password is set from very beginning when I first started to use Firefox.

Today I installed Firefox for Android, authorized in Firefox Sync, opened logins tab, pressed "Show password" button expecting input form for my master password and.. I saw my password. And all others.

The master password was never typed on the android's keyboard. Firefox was never installed on the phone before. How does this possible? How to prevent this?

There's two different concepts at play here:

You Firefox Sync account
The master password (the login manager)

Number 2 is independent of whether you use Sync or not. It's a password protection for the local storage of saved passwords.

It used to be that when you had a master password on a device, Sync would not synchronize saved passwords on that device.

This was changed around Firefox 34. Apparently now when your MP is unlocked it will sync the saved passwords to your account. When it's not unlocked it will silently do nothing unless you explicitly ask it to "Sync Now".

So think about the master password as a local-only protection, the synced data is already protected by other means on Firefox Sync's servers (your account credentials).

As pointed out by @Ben:

  It's worth noting explicitly here that the synced passwords are not
  just "protected" with your sync password; it's encrypted using them.
  So be sure the sync password is strong! The other thing that means is
  that you will lose any synced passwords if you reset your sync
  password via "forgot my password", because Mozilla cannot decrypt them
  without your sync password. But the assumption in that case is, that
  you still have your local copy, so you should be OK

This applies to all sync data, not just passwords, and is thoroughly documented at Mozilla's GitHub.

If you want you can disable saved password sync from Sync's options.


How to find the pharmacy hack in a Joomla website? We've discovered today that our Joomla website has been hacked by a pharmacy trojan.

It was difficult to discover because most users don't see it when visiting our website.

One user reported about 2 weeks ago that our site contains viagra/pharmacy spam.
We've looked into it, but found nothing. The conclusion was that the users computer was infected.

Yesterday another user reported this problem, so I've started to investigate again.

One hour later I've discovered that the site is indeed infected.

When I visit this webpage with my web browser all if fine:

http://www.outertech.com/en/bookmark-manager

But, if I do a google translate of this webpage I see the infection (viagra and cialis links):

http://translate.google.com/translate?sl=en&tl=de&js=n&prev=_t&hl=de&ie=UTF-8&u=http%3A%2F%2Fwww.outertech.com%2Fen%2Fbookmark-manager

The same happens if I use curl:

curl -L -A "Googlebot/2.1 (+http://www.google.com/bot.html)" http://www.outertech.com/en/bookmark-manager

As a next step I made a backup (Akeeba) of the website and transferred it to a local xampp installation for further investigation.

The local xampp installation with the website has also the same problem, so indeed the Joomla installation is infected.

a visit of

http://localhost/en/bookmark-manager

shows no problems, but a

curl -L -A "Googlebot/2.1 (+http://www.google.com/bot.html)" http://localhost/en/bookmark-manager

contains the viagra links.

I've looked for hours at the (mostly php) files, did a lot of greps etc, but I cannot find anything suspicious.

Virus Total and Google Webmaster report the site as clean.

I did an audit on myjoomla.com, but no malware was found.

I would be really grateful if someone could point me in the right direction.

Where to look inside my Joomla installation for this hack?

We've discovered today that our Joomla website has been hacked by a pharmacy trojan.

nope; your page delivers that trojan, but how your site has been hacked ... well ...

  Where to look inside my Joomla installation for this hack?

did you checked your page with sucuri? when you see the malicious/infected stuff do you find this at the top/bottom or, lets say, within every link? please make a pastebin of your infected html-code

it could be .htaccess, or an require() ontop / end of your index.html or sql-injection or ...

please see this answer (first two links) for the most recent joomla-security-fckp


How to keep track of passwords and avoiding password-reuse I have lurked for a time on security websites and similar. I came to wonder, with the number of passwords we have (or websites that need a password) how to manage this.

Since I have well over 400 sites where a password is used, how can I keep track of all the passwords and avoid reuse?

I have a password manager but still have passwords that are used way too many times. Is the best solution to just make 400 different passwords and let the password manager deal with the issue and look them up every time I want to login?

Or is reusing for minor accounts the best alternative in terms of usability?

Yes - let your password manager handle all of them.

400 sites is not a lot to have in your password manager - I have many more than that. Most I generated randomly. Some I created on other systems and then transferred them in. But most importantly, I don't worry what they are, because my password manager handles them.

Before I used a password manager, I tried patterns, but they are relatively easily guessed once a couple end up leaked and brute-forced, and yes, I have had the haveIbeenpwned alerts on occasion and had to change things. Trust me, doing that is much worse if you have used any pattern, as you have to change them all!!!


Are there any Windows permissions management applications? I am currently dealing with permission issues with an IIS app pool.  I am tired of clicking through window after window to set permissions on folders for domain and local users.

Also, I would like the ability to see what permissions are on sub folders and parent folders to see which permissions are inherited or not.

Are there any good solutions or shortcuts? Is there a better way?

What you are looking for is Windows Powershell. It is the windows equivalent to the unix terminal. Using the command line for administrative task is so much more efficient compared to using GUIs once you get past the learning curve.

In Powershell, the dir or ls command allows you to list files and directories together with the permissions. I am not that familiar with the PowerShell commands, but this post from Microsoft is a good starting point.

You can easily write scripts to automate larger task as well, just as one can do on Linux/Unix systems.


Sqlmap dumping all tables without data Is it possible to see all columns of all tables of a database without the data using sqlmap

I don't want to use -D database -T table manually for all the tables

The following queries can be used to retrieve (MySQL):

the list of all tables: SELECT table_name FROM information_schema.tables
the list of all columns: SELECT column_name FROM information_schema.columns


What is the website checking about my browser to protect the website from a DDoS? Some sites I visit take me to a page that says roughly, "Checking your browser before accessing example.com. DDoS attack protection by CloudFlare".

What exactly about my browser is being checked and how will that help protect against a DDoS attack?

Most Denial-Of-Service (DOS) attacks rely on some asymmetry between the resources involved on attacker side and on target side. In other words, to be successful, a DOS needs an action to require very few resources client-side (so the each clients can send a lot of requests) while involving larger resources server-side (so the server(s) will be unable to handle the load).

Due to this, DDOS attacks (the "Distributed" version of DOS attacks) are obviously not engaged by real humans clicking on links in a browser tab, but by bots sending massive amount of parallel requests to the target. The consequence of this is that the DDOS "client" is not a real browser, but a tool which may more-or-less simulate one.

Cloudflare DDOS protection system is quickly described on their website as follow: "an interstitial page is presented to your site’s visitors for 5 seconds while the checks are completed".

Two things trigger my attention here:

The checks: the most obvious way to sort real website users from automatic DDOS bots is to check whether the HTTP client is a real browser or not. This can go through testing the client's behavior against a panel of tests (see the post "bot detection via browser fingerprinting" for instance) and compare the result with the one expected from a genuine instance of the browser the client claims to be (for instance if the client claims to be a Firefox version 52 running on a Windows 10 machine, does it present the same characteristics?).
5 seconds: Executing JavaScript tests and redirecting the visitor could be a very fast and almost transparent operation, so I believe that this "5 seconds" timeout is not there by accident but is meant to revert the computational asymmetry back in favor of the server.

The most light version of such principle would simply be to ask the client to wait (sleep) 5 seconds before resubmitting the same request (with a unique identifier stored in a cookie, as described on Cloudflare page). This would force the DDOS client to somehow handle a queue of pending redirections, and would finally make the overall DDOS process less effective.
A more brutal alternative would be to request the browser to solve some mathematical challenge which would require a few seconds to be solved on an average home system. In such a case, attackers would have no other choice than spend computational power to solve these challenges if they would like to proceed, but doing so will completely void the asymmetry since all the attacker's resource will be busy in solving challenges instead of sending requests, finally "DOSing" the attacker's system instead of the target's one.


Metasploit Wifi Modules Asking for lorcon2 I'm using Metasploit Framework for Wifi Exploiation, on Backtrack R2, but I'm getting this error:

The Lorcon2 module is not available: no such file to load -- Lorcon2

But actually, I have installed Lorcon2, still I'm getting this error.

I have Installed this Lorcon2 - http://802.11ninja.net/svn/lorcon/tags/lorcon2-200911-rc1/

There are lots of questions regarding the same but not even one proper answer.

If the first link is unable to work for any reason, an alternative solution might be found here as well:
BackTrack Forums
Cheers,


Custom CSRF protection mechanism without persisting tokens I have had this functionality (csrf protection) for quite some time now. The thing I never liked about it is that it saved csrf tokens in the session file. While it may not be a real problem I see it as a pain because eventually tokens may build up so I need to utilize a gc mechanism and keep track of what was issued when and it all just seems too much for me.

So I spent the last couple of days working on improving this "imperfection" and here's what I've come up with. I will not be posting any real code I'll just explain the idea.

When a form is issued, by default a token is generated. The token consists of some data unique to the user, like session id or user id, combined with the current datetime string in format YmdHi. All of this is encrypted using password_hash and I have thought of further obfuscating the hash by swapping parts of it but haven't done that yet.

The validation was kind of tricky and turned out to be quite a disappointment. In order to validate a token I create a loop that hashes the same information about the user with the date and subtracts 1 minute on each iteration. Number of iterations is equal to the amount of minutes the token is valid for, which is not stored in the token therefore all tokens must be valid for the same amount of time, which doesn't seem like a disadvantage to me, yet.

I want to ask you if you see any possible flaws and exploits with this concept.

The only possible problem I see is that tokens are not actually kept by the server so theoretically anyone can assemble a valid token, however I think it's highly unlikely anybody would spend days in collecting tokens and would happen to have a super-computer in their basement to run statistical analysts on, which is again no guarantee that they would be able to crack the encryption.

Anyway I guess I should stop exposing my incompetence and let the smart people decide what's up.

Personally, I've never seen someone roll their own alternative to an industry standard for security and have it turn out as an acceptable solution.  One phrase I hear thrown around a lot in the security community is "Don't roll your own".

Reading over what you are doing it seems like you might be too smart for your own good.  This seems like a complex solution that could be less secure than just creating a CSRF token.  If someone inherits your code their head will likely explode.

I'm not sure sure where you are storing the token you are creating, but if it's in a cookie there is no protection at all.  If you are placing your token into a hidden field in the form then you are essentially using a weirdly modified version of double submit cookie CSRF protection.

My advice - don't go down this road.  At best it will be more complex and as secure.  At worst it will be more complex and won't work.


TPM bootstrap process Assume that the file partition where the PC operating system and user data reside are sealed by a number of PCRs (Platform Configuration Registers) dedicated to BIOS measurements. What happens during the boot process if the BIOS is infected by a root kit?

Bootstrapping Trust with a TPM:
When the machine is powered on, the root of trust for measurement automatically measures the BIOS, and extends a PCR register inside the TPM with that measurement. Then, control is transferred to the BIOS. The BIOS next measures the boot loader before transferring control to it. This process continues with the loading of the OS kernel. The kernel then measures all code that is loads for execution before transferring control to it.

This means, the first attestation of BIOS (computed hash is not the same as before, because the BIOS is infected by a root kit) will fail. Therefore the control is not transferred to the boot loader and the operating system will not start?

The TPM doesn't stop the boot.  The boot will still continue, but the PCRs will have a different value in them than they used to (since now the BIOS is different than it was before).  As a result, the system will be unable to unseal the sealed data.  Of course, if the bootloader or kernel is unable to unseal the sealed partition, depending on how it is written, it may or may not be able to continue execution without access to the sealed data.

Background: When you seal data, the data gets encrypted under a key associated with a particular state of the TPM.  Subsequently, you can only unseal the data if the TPM is in the same state.  When I say "state", I mean the state of the PCRs.

Example: Suppose you encrypt your drive using BitLocker.  BitLocker seals the data on your hard drive, associated with a particular state of the TPM (i.e., associated with a particular BIOS, bootloader, and kernel).  Now suppose you later change your BIOS.  Then the state of the TPM after boot will be different.  BitLocker will no longer be able to unseal the data, and you won't be able to access the data on your hard drive any longer.  You'll need to use BitLocker's recovery key to access your data.  If you've forgotten your recovery key... well, sucks to be you.

Further information:

The Trusted Platform Module (TPM) and Sealed Storage.  Bryan Parno, 2007.
Understanding and Configuring BitLocker with TPM, Microsoft Certified Professional Magazine, 2008.  (See especially the section on "BitLocker Recovery Password".)
Anti Evil Maid, Joanna Rutkowska, 2011.  (See especially the first few paragraphs, where she explains that the TPM cannot prevent modifications to the BIOS; it can merely retrospectively detect that there was a modification.  At that point, it will refuse to allow the modified software to access sealed data that was sealed by the previous software.)


Reasons for gathering MAC address list Suppose there is a password-secured WiFi network that exists to provide users with Internet access only. Edit: Consider a guest/mobile-BYOD network as an example.

Since filtering access to a WiFi network by MAC address is of dubious security benefit (as has been discussed here in detail) and involves certain inconvenience for administrators (a visitor would not be able to use the network at all without admin intervention) and possible privacy concerns for users, what other reasons might there be for gathering a list of MAC addresses from all users of portable devices etc.?

If there are, say, 30 people, each with several devices, that's a lot of MAC addresses to deal with.

Unmodified MAC address lists are useful when discovering the type of hardware used on the network. MACs contain the vendor info and can be used to narrow down into the types of hardware used (iPhone, Laptop, etc.).

For me, this is useful to know if an employee has hooked up their personal mobile device on the company network instead of the guest network (as per policy). Although MAC addresses can be spoofed, it's a little harder with things like phones and tablets, and is reliable enough for my purposes.


Do modern cryptographers / cryptoanalytics need the knowledge of historical cryptography It makes a lot of sense for people to know the history of their profession from various points of view and I suppose especially in cryptography because people can still use old ciphers and no one likes inventing the wheel.

So I am wondering does it happen in modern life that crytpo specialist have to deal with Vigenère cipher or anything else from the history, or nowadays it's just interesting stories?

If you're doing reverse engineering, penetration testing, or generally involved in looking at things someone else has built, for some strange reason, folks always try coming up with their "own" encryption schemes, which are either flawed or embarrassing mis-interpretations of old ciphers, or just vanilla implementations of old algorithms.

Beyond that, you must be familiar with history, or you're doomed to repeat its mistakes.


Does NTP leak local system time? As I understand the paper An Improved Clock-skew Measurement Technique for Revealing Hidden Services (6/23 = pdf page 3), it implies that a NTP client leaks the system's local time because of TCP sequence numbers.

Is this the case or does that paper mean something else?

Regardless of what is contained in the paper a standard ntp request datagram does contain a timestamp that represents the time the datagram was sent. From page 22 of the RFC:

Origin Timestamp (org): Time at the client when the request departed
for the server, in NTP timestamp format.

The answer to the question "Does ntp leak system time?" is "Yes. A standard ntp installation will leak local time to all of servers that have been configured for time syncronization."

RFC 5905: https://www.ietf.org/rfc/rfc5905.txt

Addendum: As far as the paper goes the reference to NTP is whether NTP skew adjustments affect the timer in question. From the paper

  ICMP timestamps have a fixed frequency of 1 kHz. Their disadvantage is that they are affected by clock adjustments done by the Network Time Protocol (NTP)  [9], which makes estimation of variable clock skew more difficult.


CSRF tokens in cookies? I've seen some websites use CSRF tokens in the cookie field like

_csrf=123abc

and not as a separate header or as part of POST data. My question is, when a attacker's website makes a CSRF request with those cookies to the victim's website, how is CSRF token useful here? Doesn't CSRF token go with the cookie!? I'm confused.

Yeah, the cookie will be sent automatically with all requests by the browser. So only using a token in a cookie defeats the whole purpose of CSRF defence.

So... Are all sites where you see CSRF tokens in cookies vulnerable? No. Most likely, the value in the cookie is included somewhere else as well, e.g. in a header or hidden form field. This is known as the "double submit cookie" pattern, and it has the advantage that it requires no server state. As usual, OWASP got you covered:

  When a user authenticates to a site, the site should generate a (cryptographically strong) pseudorandom value and set it as a cookie on the user's machine separate from the session id. The site does not have to save this value in any way, thus avoiding server side state. The site then requires that every transaction request include this random value as a hidden form value (or other request parameter). A cross origin attacker cannot read any data sent from the server or modify cookie values, per the same-origin policy. This means that while an attacker can force a victim to send any value he wants with a malicious CSRF request, the attacker will be unable to modify or read the value stored in the cookie. Since the cookie value and the request parameter or form value must be the same, the attacker will be unable to successfully force the submission of a request with the random CSRF value.


What are the risks in returning digitally signed payloads over an insecure HTTP connection? Let's say I own a service and a client needs me (for the sake of this question) to provide an endpoint over HTTP (not HTTPS) that doesn't use cryptographically secure authentication. Further, there's no limit on who's authorized to call the endpoint.

This endpoint will accept some parameters in its request body and return digitally signed payloads in its response. The client would have my public key certificate prior to calling the endpoint.

What are the risks in returning digitally signed payloads over an insecure HTTP connection?

It depends on the requirements.

If you send public data on unauthenticated connections, and the only requirement is that the recipient can make sure that the data has not been tampered, then digital signature on the data is enough.

The pilars of security are Confidentiality, Integrity and Availability. Encryption helps for the C part, signature for the I part. As you do not use any encryption, nothing protect confidentiality, so you should not authenticate clients on such a system (the password could be intercepted), nor send confidential data.

An example use case could be the delivery of revocation lists.


How to verify that someone is who they say they are online? I am working on an online job application web app and the question has come up about how we will verify that someone submitting an application is who they say they are.

For example, we don't want Jon Smith submitting an application for Abe Miessler.

We talked about making people create profiles on our site in order to submit an application, but in reality this would only require that they have an email address.

When I have seen this done in the past, the organization verifying already knows about you.  For example, to create an online account with your bank you may need to know your SSN, Mailing address and account number.  The bank can then compare what you entered against what they have in their record to see if you are who you say you are (in a perfect world).

In my situation I know nothing about who is applying so there is nothing to verify against.

Are there any standard approaches out there for establishing that someone is who they say they are?

Identity is a malleable concept with an irksome tendency to morph whenever you look at it too closely. What I understand from your description is that you want to be able to track back some actions (i.e. "applying for a job") from a random network user back to the actual individual, in such a way that, should the job application be fake in some way, you have enough leverage to appropriately punish the perpetrator. Or, more accurately, you need to convince a priori the users that you will be able to track them down and, at least metaphorically, break their kneecaps.

Whatever the way you take the problem, part of it lies in the "physical world" (outside of the computers) so it is going to be hard and expensive.

The complete theoretical solution is to have some detectives do the tracking, which is feasible for the Long Arm of the Law but usually not for private business entities, because basic "network users" are identified solely by the incoming IP address, and to link that to a physical identity you must have a look at the ISP log files -- which requires a warrant, or indelicate accomplices. This is said not counting issues with connections from foreign countries (once you know that the connection came from China, well... you do what, exactly ?).

Thus, due to the impractibility and cost of true detective work, you will have to leech on an existing infrastructure which provides the authentication you need. My first thought is about banks. It goes thus: have job applicants pay you a minute sum (say 0.01$) with their credit card (or through Paypal or any other similar banking system). This has several benefits:

The payment operation leaves traces in many places.
Since a transaction was implied, it could help to legally qualify fake job applications as "fraud" (ask your lawyers, they will tell you that this is very good, with a gleam in their eye and a bit of frothing).
Credit card numbers are routinely stolen but you can get insurance against that.

and, last but not least:

People (at large) already know that "you don't mess with the banks". This makes the detection system proactive (you would like to authenticate people, but, even more, you would really prefer that they do not try to lie in the first place).

A conceptual note: as you say, you "know nothing about who is applying". That's the root issue: how can you define a proper identity notion if there is nothing to identify (to be precise, you do know something about the applicants: their IP addresses; but that's not much). Hence the path to the solution: have the applicants commit some information about them. This is what the banking solution explained above is about.


Security considerations for setting up remote access on a PC I need to setup Microsoft remote access for a PC on our network, we have an AV installed on the PC, all the users are standard users (apart from 1 admin account that is used only to manage users). There is VPN into the building which links 2 buildings together on a LAN to LAN. The VPN is setup on the rotuer a draytek 2860.

The VPN is setup for LAN to LAN only using IPsec and a unique random generated password. No users have dial in VPN access.

We dont have any additional security like a hardware firewall.

Is there anything else i should make sure is in place security wise ?

You have not provided some key details helpful to answering your question such as whether the computer accessing your company network is company owner and centrally controlled and how the VPN is configured.

There are several best practices that you can do to better secure remote access:

  Implement multi-factor authentication (MFA) for remote users

Using MFA would strengthen security by requesting the user for another form of credentials in the form of something they have with them, or a biometric such as a fingerprint. Without MFA enabled, the security of this account would rely on the strength and safekeeping of its credentials.

  Restrict VPN access to company owned machines if at all possible

A VPN connection provides confidentiality and integrity for the data passing between the client computer and your corporate network, but the remote computer itself can be a serious threat. If the remote computer is not owned and centrally managed by your company IT department, then you are essentially allowing an untrusted computer access to your internal company intranet. If an attacker were to compromise the remote computer, he / she can use this computer to directly access your company network. In addition, given the data in transit is encrypted, it would be much more difficult for security technologies such firewalls / IDS to properly inspect the incoming traffic.

  Configure the VPN connection to timeout after a certain interval with no activity

By implementing this rule, you would lessen the likelihood of an unauthorized user from taking advantage of the VPN connection to access the company internal network.

  We dont have any additional security like a hardware firewall.

Please consider implementing a firewall before setting up remote access. As you are using remote access, ideally the firewall should support remote authentication features such as RADIUS or TACACS+ that centrally confirms the identity of remote users.


What is the security risks of increasing the maximum number of HTTP parameter? I want to increase the maximum number of HTTP parameters (maxParameterCount) from 10000  to 20000 in the Tomcat configuration:
https://tomcat.apache.org/tomcat-8.5-doc/config/http.html

What is the security risks of increasing the maximum number of HTTP parameters?

As someone said in a comment, this reeks of bad design.

Anyway, in the past there have been denial of service attacks against server software done by using many parameters that share the same hash as used by the hashing function in the server to convert the parameter list to a dictionary/hashmap. These hash collisions would lead to a wildly increased load in bad server software (that was, most prominent example of that category, the PHP interpreter).

That problem can be mitigated by using an unknown salt for that hash function, so that the attacker can't predict which parameters would lead to a hash collision.

With that many parameters, however, chances are that you generate hash collisions if you just pick random parameter names.

Anyway, the assumption that someone would still be able to DOS a server with that is purely hypothetic.


Reporting vulnerable sites Take this scenario:

You browse the web and find a website that is vulnerable to SQL Injection. Being a good guy/gal you report the vulnerability to the site owner (if you are able to find contact details).

What do you do if no one replies back or they say thanks, but never get to fix the problem?

Start by reading the answers to these questions:

How to disclose a security vulnerability in an ethical fashion?
How should I escalate ...

Start by trying again, possibly with a different email address (unless you received a personal confirmation, you can't be sure someone actually read your email).

If that doesn't work, I would say it depends:

If it's a big, famous site with high visibility, there are sites to
publish this to. (http://isc.sans.edu/diary.html?storyid=8701 lists
some, but I'm not completely comfortable with that.)
If it's a
smaller unknown site - there's no reason to publicize the
vulnerability, it will just draw attackers that otherwise would not
even know or bother with them.

There's really not much else to do - you've already performed your civic duty.


Determining which encryption algorithm was used to encrypt a particular drive? Is there a way to determine which encryption algorithm (AES, Serpent, etc) was used on a particular VeraCrypt drive?

This depends on what information you have available. If you have the encryption key, you can select the volume name in the VeraCrypt dialog and click the Volume Properties button. This will tell you information about the volume, such as the size, mode, and encryption algorithm. If you do not have the key and only the opaque, encrypted data, then there is no way to detect the encryption algorithm in use. VeraCrypt encrypts the header, which includes metadata such as the algorithm. The way it is able to decrypt without knowing the encryption algorithm beforehand is by trying each possible algorithm with the provided key. If the header decrypts correctly, then it uses that algorithm. If none of the algorithms work, then it assumes you entered an incorrect key and tells you such.


Will Let's Encrypt allow a custom workflow? The Let’s Encrypt management software will:

  Automatically prove to the Let’s Encrypt CA that you control the website
  Obtain a browser-trusted certificate and set it up on your web server
  Keep track of when your certificate is going to expire, and automatically renew it
  Help you revoke the certificate if that ever becomes necessary.

That's all great, but let's assume that I'm running a custom webserver or arcane configuration that the management tool doesn't understand. Will I still be able to get a certificate from Let's Encrypt by going through the motions manually? Without reverse engineering, that is, because otherwise the answer would be 'yes, of course'.

Yes, you can use LetsEncrypt with complex configurations that the command-line tool cannot modify.  There are two ways to do so:

The hard way: Write your own client that follows the ACME specification and does whatever it is that you want to do with the certificates.
The easy way: Use the LetsEncrypt client in "Standalone Authenticator" mode.  In this mode, the verification will be done using a standalone webserver that runs inside the LetsEncrypt tool and the certificate will be saved in a folder for you to use as you see fit.

The Quick Start has an example of using the command-line tool (via Docker) in this standalone mode, which saves the certificate into /etc/letsencrypt/certs.

sudo docker run -it --rm -p 443:443 --name letsencrypt \
              -v "/etc/letsencrypt:/etc/letsencrypt" \
              -v "/var/lib/letsencrypt:/var/lib/letsencrypt" \
              quay.io/letsencrypt/lets-encrypt-preview:latest

I extracted the command that is run from that Docker image so that you can run it outside of Docker on a machine that has the client installed directly:

letsencrypt --text

Yes, that should be all it takes! (In fact, the --text part probably isn't required either.)


How hard is it to hack into a webmail account with a strong 8 character password? Assume the hacker starts with only your email address and he has high incentive to gain access.

UPDATE:
Also assume the password is unique (never used elsewhere) and it is NOT a guessable word like you dog's name with a few odd characters thrown in.
Your unique password in question might be something like: q*b!oss0.

If an 8 character password length is problematic, assume a length increased to 10 chars.

What are the concerns, attacks, and mitigations that a webmail provider might consider in regards to preventing password cracking?

EDIT 2:
Also assume two-factor authentication is used. Would this make the webmail account extremely secure?

"Eight digits" means 108 = a hundred million possible passwords. At best, you selected your password fully randomly, implying that the attacker, on average, will have to try half of them before hitting the right one (so fifty million connection attempts).

(The "at best" means here that the attacker always has the option of trying passwords in a random order, so there is no password selection strategy, however nifty it may look, that can make things harder than that for the attacker. Some selection strategies may make things easier, though. Therefore, in password generation, randomness rules.)

The important term above is "average". On any specific case, an attacker may get especially lucky or especially unlucky. However, the attacker can perform the same kind of computations and will decide to attack or not to attack based on his perceived, a priori chances of success. Also, not all attackers are completely rational in their decision-making.

How many authentications the attacker may attempt depends on the context and server behaviour. If the server uses "typical" hardware, implements inexpensive password processing (e.g. single SHA-1, not bcrypt), and does not limit authentication rates, then an attacker can hope for, say, 1000 authentication attempts per second, thus reaching the 50 millions in about 50000 seconds, i.e. about 14 hours. On the other hand, if the server locks out the account after 10 failed successive authentication attempts, then the attacker won't be able to try more than 9 attempts between any time you connect; if you connect on a daily basis, then the attacker's expected breaking time will be about 15210 years.

Since there is a lot of variation in how servers implement authentication, and in particular how hard they try to detect brute force attempts and how thoroughly they react to it, the only possible answer to your question can only be "it depends".


Methods for remembering passwords around the web What's the least painful way to manage passwords for user accounts that you have on various sites?

I see only 3 options:

Password manager. Passwords can be different and strong, but the downside is that you still need a master password, which should be weak so you can remember it, like JohnDoe45. If someone gains access to it, all your passwords are compromised. Also, if the password data file gets lost, you're screwed.
A single password for every site that you can easily remember. The downside is that if someone finds it, all your accounts from other sites are compromised.
Different passwords using a personal algorithm. Like first two characters of the site + first two characters of your name + last character of the site + whatever.

The last option seems the best choice for me. What do you think? Are there better methods which I'm missing?

For managing passwords, see this answer: the trick is not to remember them, but to store the passwords in some "reasonably secure" storage area.

If you really want to remember passwords, with your brain, then my advice would be to force yourself to type them often, at least daily. Fingers are better than brain cells at this kind of job (it is called muscle memory). Of course, this is not practical for Web passwords "at large". What you can do is split your passwords in two categories:

the passwords which you use very often, and store in your brain;
the passwords which you use rarely, and store in a file.

(Various storage systems exist, but a plain file can be secure enough, if you do it properly; again, see the previous response I link to.)


Lost my PGP private key, what's next? I have created a PGP key using GPGTools, and published it a while ago. Things are: I have no longer access to my secret key. Indeed, I unfortunately formatted the wrong drive (encryption was and is enabled).

And because I'm that kind of guy, I have no backup.

Well I know that I can't do anything about it:
Lost PGP private key and want to remove it from keyserver.ubuntu.com

However, I would like to know what I can do now. The expiration date was set (4 years), but there must be better way than to wait that long.

Generate a new pair of keys
Make a backup
???

If you don't have the private key, and you don't have the revoke certificate, then there is nothing you can do about the existing key.

You should:

Generate a new pair of keys
Publish your new public key to a key server
Let anyone who uses the old key know you have a new one
Take the time to generate a revoke certificate and make and store backups.

One option to mark the lost key as revoked on the key server is detailed in this answer here


Can a CMS generated HTML Document from an admin be considered trusted, and not vulnerable to XSS? Currently, I am working on a CMS/Framework I developed that is similar to Wordpress, in that it is a platform for admins to create/post content for users.

I am saving the HTML that is generated by editor fields in my database, and binding the HTML within my JSON response in the client to be displayed once it is retrieved. However, often times, a lot of sanitization is done in order to display the HTML to protect against XSS attacks. Which I definitely understand why.

However, in this case where the site administrator is generating the content. As long as the administrators takes other good security actions (Such as securing their accounts with strong passwords, and securing their servers), and are not malicious themselves, it could be safe to say that the HTML is trusted, and should not be considered vulnerable to XSS correct? I am going to write documentation on the framework soon, and would like to bring up any of the caveats the framework may have, so that developers are aware.

Any advice would be appreciated. Or if there are any other major security holes I should look out for, please let me know.

Thank you!

If by "administrator" you mean the person with all the rights, then this is fine and not considered a vulnerability. If you also have a more privileged "superadministrator", then the administrator could elevate their privileges to superadministrator via XSS.

There are some vulnerabilities whose impact would be increased by this. For example CSRF would now have the full power of XSS.

You should also document this - WordPress eg documents this as well - , so that people are aware of it (and so you don't get reports about issues which you do not consider vulnerabilities).


CSRF with OAuth or Bearer Authorization headers I am designing a RESTful API which is to be accessible from a web browser. The API is protected by Basic authentication.

I understand the concept of CSRF, and the mitigations proposed (I found both Wikipedia CSRF entry and OWASP CSRF page good explanations). They generally introduce some state that the client needs to keep and present back to the server, so the server knows requests still come from the right client.

I am facing, though, that the client implementation becomes very "dirty" because of that and I was wondering if there could be cleaner solutions. Specifically, one that would not require handling additional state.

One solution I am thinking of, but wanted to check out with you, is to use some Authorization header that is not Basic.

According to RFC 2617, section 2, regarding Basic authentication scheme, the username and password may be cached by the browser and re-sent without asking to the user under certain conditions, and that's what it makes it vulnerable to CSRF:

A client SHOULD assume that all paths at or deeper than the depth of
the last symbolic element in the path field of the Request-URI also
are within the protection space specified by the Basic realm value of
the current challenge. A client MAY preemptively send the
corresponding Authorization header with requests for resources in
that space without receipt of another challenge from the server.

I also verified that Authorization: OAuth (used in OAuth 1.0 authenticated endpoints) and Authorization: Bearer (used in OAuth 2.0 authenticated endpoints) are not automatically sent by the browser.

So, my question is: would you consider that an endpoint protected by OAuth/Bearer authorization headers should take additional precautions to prevent CSRF?

As long as you are not using using a built-in browser authentication scheme like Basic (or client certificates, digest, NTLM in some browsers, etc) or cookie authentication for your API you do not need to worry about CSRF.


What's the point of rejecting a cookie? When you access a website, lynx provide the option to reject a cookie, what's the point of doing so?

All I thought about is that if you don't accept a cookie, you cookie won't be stolen during a XSS attack, is that everything?

Cookies can be used to keep you logged in to a website, track your browsing history, log your activity and preferences on a website, and some other things. Rejecting cookies prevents this information from being tracked and easily available to the site owner or third-party affiliates. It will also, of course, prevent attackers from accessing or abusing the data through a number of means such as XSS, CRSF, DNS cache poisoning, traffic sniffing, local system exploitation, etc.

I suggest you read more about HTTP Cookies on Wikipedia, and search the web for further details as well. The following sections of the Wiki entry will probably be of particular interest to you:

Uses
Privacy and third-party cookies
Cookie theft and session hijacking

There are some down-sides to rejecting some cookies.

Your authentication to a website will not persist across sessions - you will have to log in again every visit.
Your preferences on a website may not be saved, or may not be available until you login.
You may not be able to use a shopping cart on e-commerce websites.
Other site features that rely on cookies will not function.

Just like any security measure, the choice of allowing or rejecting cookies for any site, or for third-party hosts, comes down to how you want to balance security vs. usability.


What security mechanisms are used in BGP and why do they fail? I just read about Indosat trying to take over the Internet by mistake. I read on a Polish infosec-related website that most of their announced routes failed to propagate, but some of them reached the whole internet. This made me wonder - what security mechanisms protect the BGP protocol and why did they fail for these few particular routes, hurting Akamai and others?

A word on BGP

BGP is the routing protocol that makes the internet work. The current revision is BGP v4, and has been in use since 1995. Internet Service Providers (ISPs) are in control of one or many networks, and they use BGP to advertise their networks to their peers by exchanging routing information (internet routes) about the network they control. Those networks are independent routing domains called Autonomous Systems (AS). Each AS is attributed a unique identifier (AS Number, or ASN), and there are about 40'000 ASN allocated today. The process of routing between those ASes is called interdomain routing, and BGP is the protocol used to achieve this.

Each BGP router contains a Routing Information Base (RIB) which stores the routing information. When a router decides to update its RIB, it will subsequently propagate this information to all of the other neighboring BGP routers to which it is connected by saying "Hey, I can route to network 1.2.3.0/12 via AS numbers X,Y,Z". They will in turn decide whether to update their own tables and propagate the information further.

Note that there is no automatic peers discovery in BGP, instead peers have  to be manually configured to exchange routing information.

BGP exposure to attacks

The BGP protocol itself doesn't provide many security mechanisms.

BGP design did not include specific protections against attacks or deliberate errors coming from peers or outsiders that could cause disruptions of routing behavior. Examples of such attacks include:

As stated in BGP-VULN (RFC4272), there are no  mechanisms internal to BGP that protect against attacks that modify,  delete, forge, or replay data, any of which has the potential to  disrupt overall network routing behavior. As a TCP/IP protocol, BGP is subject to all  TCP/IP attacks, e.g., IP spoofing, session stealing, etc. Any outsider can inject believable BGP messages into the communication  between BGP peers, and thereby inject bogus routing information;
When a router advertise new routing information, BGP does not ensure that it uses the AS number it has been allocated, which means a BGP router can advertise routes with any AS number;
An AS can advertise a prefix from address space unassigned by or belonging to another AS. This is called prefix hijacking and it can be used to perform man-in-the-middle attack which was initially demonstrated at DefCon 16 by Alex Pilosov and Anton "Tony" Kapela;
BGP does not provide a shared, global view of correct routing
information that would make it much easier to detect invalid or
malicious routes.

In short, BGP is highly exposed to false route advertisements and there is no plan today to remediate this situation.

BGP Security protections

So it looks pretty bad on a security standpoint. But on the other hand, there are also some positive security aspects in BGP:

BGP peering associations tend to be long-lived and static. This means
that those associations between peers and route advertisment can be
monitored efficiently, and allows for a quick reaction from the
various stakeholders in case of an internet hijacking. There are a
lot of services providing BGP monitoring (some free and
open-source and commercial products);
BGP routers can implement route filtering, which allows to perform
inbound announcement selection, although there is no largely deployed standard for that and this is up to each ISP to decide if and how they want to implement it;
BGP implements a TCP MD5 signature option (a MAC, as defined in
RFC 2385) to protect BGP sessions    against TCP Reset (RST) Dos
attacks. It is currently supported by most router manufacturers (e.g.
Cisco) and open-source OSes (e.g. FreeBSD). But this
protection only cover a limited number of attacks, and relies on weak
technologies;
The lack of cumbersome security protection measures also allows quick
reactions against DDoS and malware spreading via sinkholes and
blackhole routing.

Future improvements

Recent efforts within the standards bodies and in the research community have attempted to provide new architectures for BGP security. This includes:

Using Public Key Infrastructure to share public cryptographic keys
between peers and allow routers to establish the integrity of BGP
announcements on a global scale, as well as attesting that an entity is authorized to advertise a particular resource;
Using IPsec to secure the BGP session and messages passed between peers;
Establishing an independent authority for validating interdomain
route information. This third-party authority would be used by BGP
routers to verify the announcements they receive.

A major update to BGP would be required to remediate those issues and offer an adequate level of protection against sophisticated BGP attacks. RFC 4278, a maturity study of BGP security mechanisms, considers the marginal benefit of such schemes in this situation would be low, and not worth the transition effort.

Additional resources you might find interesting:

Implementing the TCP authentication option TCP-AO
and The TCP Authentication Option RFC

What is the purpose of BGP TTL security?

BGP Looking Glass: As per their website:

  BGP Looking Glass servers are servers on Internet which can be
  accessed remotely for the purpose of viewing routing info.
  Essentially, the server acts as a limited, read-only portal to routers
  of whatever organization is running the Looking Glass server.
  Typically, publicly accessible looking glass servers are run by ISPs
  or NOCs.


HTML Copy Paste To Get Info From Infected Computer I saw this popular question and I was wondering if my solution was secure/would be of any help for trying to save any source code written on the machine and prevent attacks:

Run the computer on a local network.
Copy the code into a file with possible html formatting if you're feeling fancy
Host the page to be visible to the local network as a static page
Copy and paste the code from the page onto a clean computer

I considered posting this as an answer/comment but I wasn't sure if it would work/keep the receiving computer clean. Would you put the local network at risk?

The goal here is to avoid actually exposing the receiving computer to any malware that could be sent to the "clean" computer. I am looking at this as a way to send text information in a sanitized way from an infected machine to a clean one without allowing for the possibility of malware from traveling between the machines. It's possible for emails/scp's from an infected machines to include extra malicious traffic right?

You still risk your network but I think most modern browsers should have protections. You avoid using a usb all together.

It depends on the possible malware and the files. Generally I would open the computer case, remove the HDD, attach it to another PC readonly (there are writeblockers) and copy the binary files. This could be one simple and comfortable solution.