25
votes
Accepted
Will resize of an image execute the file?
Unless you have a bug in your image handling tools code the image gets only read and no code executed which might reside somewhere in the image. But note that in the past there were bugs in image ...
14
votes
Accepted
Execute a PHP function that returns an array from an XSL file
I am also a noob when it comes to XSL. To be honest, I had no idea it could be this powerful... and dangerous. But I will have a shot at this anyway.
I don't know if it is possible to get the output ...
13
votes
Accepted
Special characters in filename leads to starting virus executable
The trick is the right-to-left override character. Languages such as Arabic write right-to-left instead of left-to-right. To embed such text in a string, you can switch the direction of the text, and ...
10
votes
Accepted
Can a CSV contain malicious code?
Yes, there are some examples of malicious CSV files causing random "code" execution. People choose to open CSV files in MS Excel or Open Office or such software which have macro execution capabilities....
8
votes
How to put executable code in files?
The field that you're nibbling at is called Digital Rights Management (DRM), and it's a big field. Protecting your documents and music, for example, fall under Content Restrictions.
There are ...
7
votes
Accepted
Difference between Code Injection, Command Injection and Remote Code Execution
Hmm let me try:
Code injection consists of modifying an executable / compilation unit / script so that it contains malicious code on top of it´s intended functions. Code can be injected locally into ...
7
votes
Accepted
Can I inject a shell command here in PHP?
At least, the newline is not escaped, so, you can bypass it via /index.php?arg=%0Als (it should list all files from the current directory).
Also, there is a possibility to get a Full Path Disclosure ...
6
votes
What can an attacker do in this scenario? (unwritable bashrc, profile, etc.)
Path is defined in bash profile so that ~/bin comes last, so running "firefox" should run the default firefox and not a custom "firefox" installed by the user in their home directory.
Variables can ...
5
votes
Accepted
Is PHP's eval() function vulnerable to code injection when executing a string built from an array?
No, this is not vulnerable to PHP code injection.
The string passed to eval() is simply not user-controlled. There is no path from the source $_GET["cmd1"] to the sink eval():
The argument to eval() ...
5
votes
Accepted
Bash: Why would sourcing a file be less safe than bashing it (executing in another session)?
I don't know the exact statement and its context so I can only guess what was meant: if a script gets sourced instead of executed in a separate shell then any variables or functions defined in this ...
4
votes
Accepted
Understanding preg_replace Filtering & Exploitation
There are two issues here, both of which you can solve.
How preg_replace e works, and how to exploit it
The first problem is that preg_replace with e doesn't just execute anything you pass to it. It ...
4
votes
Accepted
Removing execute permissions on `/tmp` or mounting it with `noexec` flag?
You are actually discussing three separate hardening techniques.
Separate Partitions
Separate partitions does two things for you. It first isolates systems. This can be beneficial in many ways not ...
4
votes
Can a CSV contain malicious code?
Yes, it may contain arbitrary system commands that will be executed on the machine where you are opening the CSV file. Your spreadsheet software will render the CSV values as the injected commands and ...
4
votes
How can I disable execution of programs from Downloads directory in Windows 10?
Changing permissions on the directory is probably the best way to go, yes. In addition to being relatively easy, it has the perk of acting more like the way most Unix-like systems work, where new (in ...
4
votes
Executable files in email attachments on UNIX
UNIX alike systems like Linux or MacOS do not run any executable files just because they have a specific extension. To make a file directly executable it needs to have the executable-bit set (chmod +x ...
4
votes
Accepted
Running a brief asm script inline for dynamic analysis
Is there a reason you can't just study the code? 30 lines of ASM should be easy to understand. Just add comments explaining what each line does, and you'll understand it in no time. This will be even ...
4
votes
Security Implications from Base64 Image
There's nothing magic about base64. It's just a way of storing arbitrary binary data in a character set that is safe for printing and transmission as pure text (ASCII).
It's no more dangerous because ...
3
votes
Hacked: Can a UTF-8 encoded script execute non-UTF-8 characters?
In short, the answer is yes to the use of UTF-8 characters in an attack chain. There are a few cases that have crossed my path. What I have read about this method of attack, is that this it is the ...
3
votes
Accepted
Adding network drive to trusted intranet sites security hole?
This error dialog is there to make users aware of the potentially dangerous source from where the file comes.
When you say
[B]ut currently, a user would just click run or open in the dialog box ...
3
votes
Accepted
How to execute PHP file after uploading it?
Is there any way to execute the PHP shell on this server?
Probably not. For that to happend, the server has to have a PHP engine installed and be configured to respond to request for PHP files by ...
3
votes
Accepted
How to find which program encrypted my files?
.lin Extension Virus is quite a bad worm, file-encrypting virus.
It is known to delete users encrypted data after if receiving the ransom money, so the ransom is a no-go anyway.
SpyHunter is a known ...
3
votes
Is there any way to estimate the safety of arbitrary binaries, which are usually released with unofficial patches?
I suppose that it is hardly possible to include malware by arbitrarily changing a few bytes in the executable; so this should be safe;
Viruses can easily be as small as about 50 bytes of code, so ...
3
votes
What are some examples of known scenarios of network attacks?
A bunch of network packets does not usually reside in code execution. It can though result in code execution if the software dealing with these packets (i.e. the OS kernel, a specific driver or some ...
3
votes
Accepted
What are some examples of known scenarios of network attacks?
If it's really a bunch of network packets, the target computer has to be somehow vulnerable: there has to be something that interprets these packets in a way it's not supposed. The requirements for ...
3
votes
Is it possible to detect malicious software just by analyzing the code structure?
No you can't, not all the time reliably. To detect viruses simply by static analysis would likely contradict Rice's Theorem which says that such problem is undecidable.
3
votes
Accepted
Safe usage of Runtime.getRuntime.exec(String[])
I ran your program, linked to a checkfileindirectory.sh that looks like this:
#!/bin/bash
echo $1 > param1.txt
echo $2 > param2.txt
As a test, I changed "<file_to_find>" to "<...
3
votes
Accepted
Can't execute shell i uploaded with cURL
You get the file contents in curl because you are accessing the file directly without the server executing the contents.
You are not getting the shell in the browser because the PHP server is trying ...
2
votes
Functions in common server-side languages which are used to execute code
Minor ranting
This is a bit broad, and there may be some that are unknown at present, but there's usually good references out there if you're willing to search for them.
Code execution isn't the ...
2
votes
Trusted (sealed) execution environment in Linux
No, this is not possible. Not in Linux and not in any other computer environment. It isn't a limitation of Linux, it's a limitation of physics.
If you run your code on someone else's computer… it's ...
2
votes
Verify "blind" code execution works
The sleep command works on both Linux and Windows. The time for the software to respond normally vs when using the sleep command would indicate that the code execution works.
This would also not ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
code-execution × 92php × 17
web-application × 10
malware × 9
injection × 9
exploit × 6
python × 5
shellcode × 5
binary-code × 5
windows × 4
linux × 4
java × 4
buffer-overflow × 4
network × 3
web-browser × 3
javascript × 3
webserver × 3
memory × 3
file-upload × 3
reverse-engineering × 3
pdf × 3
bash × 3
secure-coding × 3
email × 2
xss × 2