peda | PEDA - Python Exploit Development Assistance for GDB | Hacking library

 by   longld Python Version: 1.0 License: Non-SPDX

kandi X-RAY | peda Summary

kandi X-RAY | peda Summary

peda is a Python library typically used in Security, Hacking applications. peda has no vulnerabilities and it has medium support. However peda has 4 bugs, it build file is not available and it has a Non-SPDX License. You can install using 'pip install peda' or download it from GitHub, PyPI.

PEDA - Python Exploit Development Assistance for GDB.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              peda has a medium active ecosystem.
              It has 5430 star(s) with 793 fork(s). There are 205 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 40 open issues and 55 have been closed. On average issues are closed in 101 days. There are 22 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of peda is 1.0

            kandi-Quality Quality

              OutlinedDot
              peda has 4 bugs (1 blocker, 0 critical, 2 major, 1 minor) and 267 code smells.

            kandi-Security Security

              peda has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              peda code analysis shows 0 unresolved vulnerabilities.
              There are 2 security hotspots that need review.

            kandi-License License

              peda has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              peda releases are available to install and integrate.
              Deployable package is available in PyPI.
              peda has no build file. You will be need to create the build yourself to build the component from source.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi has reviewed peda and discovered the below as its top functions. This is intended to give you an instant insight into peda implemented functionality, and help decide if they suit your requirements.
            • Gets a shell code .
            • Retrieve the vmmap map .
            • Formats a disasm code into a nicely formatted string .
            • Generate cyclic pattern charset .
            • Search for a specific keyword .
            • Converts an nasm code to an external shell
            • Creates a cyclic pattern with the given size .
            • Removes leading and trailing whitespace from each line .
            • Performs cyclic pattern search .
            • Duplicate basename .
            Get all kandi verified functions for this library.

            peda Key Features

            No Key Features are available at this moment for peda.

            peda Examples and Code Snippets

            shellex,Paste & Execute shellcode in gdb-peda
            Cdot img1Lines of Code : 5dot img1License : Permissive (MIT)
            copy iconCopy
            "\x6a\x17\x58\x31\xdb\xcd\x80"
            "\x6a\x0b\x58\x99\x52\x68//sh\x68/bin\x89\xe3\x52\x53\x89\xe1\xcd\x80"
            
            shellex -h 6A 17 58 31 DB CD 80 6A 0B 58 99 52 68 2F 2F 73 68 68 2F 62 69 6E 89 E3 52 53 89 E1 CD 80
            
            patch $eip "\x6A\x17\x58\x31\xDB\xCD\x80\x6A\  
            vagrant_pwn
            Shelldot img2Lines of Code : 3dot img2no licencesLicense : No License
            copy iconCopy
            git clone https://github.com/dariosharp/vagrant_pwn
            vagrant up
            vagrant ssh
              
            CTF,Useful Tools,Dockerfile
            Pythondot img3Lines of Code : 3dot img3no licencesLicense : No License
            copy iconCopy
            $ docker pull frozenkp/pwn
            $ docker run -it {--name pwn_env} {-v /??/data:/root/data} --privileged frozenkp/pwn /bin/bash
            $ docker exec -it pwn_env /bin/bash
              
            copy iconCopy
            [+] b'input: '
            [+] write is at 0x203a647663657220
            [+] libcbase is at 0x203a64766355ff70
            [+] system is at 0x203a6476635a5300
            [+] sending system address
            [+] sending '/bin/sh' string
            [+] try to open a shell via telnet
            
            why will my buffer overflow exploit open a user shell only instead of a root shell?
            Pythondot img5Lines of Code : 17dot img5License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            zaphoxx@zaphoxx /usr/local/src/ghostInTheShell $ gcc -fno-stack-protector -o ghost ghost.c ; sudo chown root:root ghost ; sudo chmod 4755 ghost; ll ./ghost;
            -rwsr-xr-x 1 root root 8816 Oct 18 12:22 ./ghost*
            zaphoxx@zaphoxx /usr/local/src/g
            GDB python API - getting the python API of gdb to print the offending line number
            Pythondot img6Lines of Code : 30dot img6License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            def show_last_exception():
                """Display the last Python exception."""
                print("")
                exc_type, exc_value, exc_traceback = sys.exc_info()
                print(" Exception raised ".center(80, horizontal_line))
                print("{}: {}".format(Color.color

            Community Discussions

            QUESTION

            c++ segmentation fault and Trace/breakpoint trap when using Dynamic memory allocation
            Asked 2021-Jan-26 at 12:26

            I am practicing Dynamic memory allocation in C++. I wanna enter some word which length is less than 10, and when I enter "-1", it will print the word I have entered before.

            But when I enter more than three words, it will give me an Trace/breakpoint trap or segmentation fault. I use gdb-peda to check my code, it said "double free detected in tcache 2", I think the problem is the "delete" part in my code, but I dont know how to correct it.

            the gdb-peda reply

            this is my code:

            ...

            ANSWER

            Answered 2021-Jan-26 at 12:26

            First of all, try not to use using namespace std;.

            I have also found a memory leak in your code. You allocate the word pointer every iteration but did you make sure to delete it when you get to the next iteration? What you need to do is, delete the word buffer at the end of the iteration. Plus you also have two variables dict and cpdict which you allocate memory for no reason, delete them later on in the while loop only to assign a new block of memory. Try to avoid unwanted allocations as it'll only slow things down. Frankly its hard to debug your code (mainly because your working with a lot of pointers) so ill show you a good implementation (ill add comments to show important notes).

            Source https://stackoverflow.com/questions/65899973

            QUESTION

            Show more text after a

            field
            Asked 2020-Dec-23 at 14:17

            I have a script to show more text but in my structure Show more link comes just after the text.

            What i want that Show more text must come just at the end of the text. As ı will be using Tinymce to create the text i can not make changes at the text part.

            How i can show"... Show More" is on this image

            My example is on Show More Example

            Here is my HTML/JavaScript

            ...

            ANSWER

            Answered 2020-Dec-23 at 13:50

            the p tag is a block display element that's why the "show more" starts at new line, try changing it to span, I tried it on developer tools and it worked.

            Source https://stackoverflow.com/questions/65424975

            QUESTION

            Why does my data section appear twice in the compiled binary? Ubuntu, x86, nasm, gdb, reaelf
            Asked 2020-Jul-14 at 14:38

            A prior related question was answered. Thank you! However this creates a new question for me. Why does nasm put data bytes at two different memory locations? I include program information and other data dump below.

            ...

            ANSWER

            Answered 2020-Jul-14 at 14:38

            Let's look at the LOAD segments:

            Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
            LOAD 0x000000 0x08048000 0x08048000 0x0009d 0x0009d R E 0x1000
            LOAD 0x00009d 0x0804909d 0x0804909d 0x00010 0x00010 RW 0x1000

            The first one instructs the loader to mmap 0x9d bytes from file offset 0 into virtual memory at address 0x08048000.

            The loader can't do exactly that, because memory mapping only works at one page (4096 bytes) granularity. So it mmaps the .text, and everything that follows it in the file, up to one page, at address 0x08048000.

            This means that whatever .data followed .text in the file after offset 0x9d will appear at address 0x0804809d and later, but with wrong permissions (Read and Execute).

            The second LOAD segment instructs the loader to mmap file contents, starting at offset 0x9d at virtual address 0x0804909d.

            The loader can't do exactly that either for the same "page granularity" reason.

            Instead, it will round down the offset and the address, and mmap file contents starting from offset 0 at address 0x08049000.

            That that means that whatever .text preceded .data in the file will appear at address before 0x0804909d, again with the wrong permissions (Read and Write this time).

            You can confirm that that's what's happening by using GDB x/10i 0x8049080 -- you will see exactly the same instructions as with x/10i 0x8048080.

            You can also observe the actual mmap system calls the loader performed with strace.

            Source https://stackoverflow.com/questions/62885381

            QUESTION

            Why Segment fault when writing to writeable .data section? Using Ubuntu, x86, nasm, gdb, readelf
            Asked 2020-Jul-12 at 03:04

            I'm learning to write a simple shell code using assembly. I get a Segment fault when the mov opcode executes to write over the db data. Why? Any guidance appreciated! Debugging with gdb confirms the data is contiguous with the code at run time and readelf analysis of the program confirms the data segment is writeable.

            ...

            ANSWER

            Answered 2020-Jul-11 at 00:34

            Debugging with gdb confirms the data is contiguous with the code at run time and readelf analysis of the program confirms the data segment is writeable.

            You are expecting db '...' to immediately follow CALL one.

            That does not actually happen, your .data section is in a different segment (because it needs different permissions):

            Source https://stackoverflow.com/questions/62841443

            QUESTION

            i hope access the symbol table in python
            Asked 2020-Jun-16 at 10:21

            First of all, since the writing is long, I say the apology first.

            I'm studying symbol table in Python and trying to extract the memory address of symbols by directly accessing the symbol table (without id()).

            So I referenced Eli bendersky's blog. I understand that PySTEntry_Type manages the symbol table(or itself). So, I thought that by using the contents of PySTEntry_Type, the memory address of symbols could be found without id().

            And I started to analyze memory. But the value in memory doesn't match what I know.

            First, I investigated the symtable and _symtable_entry structures.

            ...

            ANSWER

            Answered 2020-Jun-16 at 10:21

            If you want to examine a CPython symbol table, use the symtable module. What you're doing doesn't make sense.

            Assuming you're actually looking at PySTEntry_Type and not some completely unrelated section of virtual memory, what you're looking at is the type object for low-level symbol table entry objects. This thing is to symbol table entries as int is to 12. It does not represent a symbol table or a symbol table entry. It contains information about the operations symbol table entries support.

            CPython does not preserve symbol tables beyond the bytecode compilation phase. You cannot examine the symbol tables for a running program, because they don't exist. You can use symtable to create symbol tables for a string representing Python code.

            Source https://stackoverflow.com/questions/62405801

            QUESTION

            Loaded glibc base address different for each function
            Asked 2020-May-02 at 03:08

            I'm trying to calculate the base address of the library of a binary file. I have the address of printf, puts ecc and then I subtract it's offset to get the base address of the library. I was doing this for printf, puts and signal, but every time I got a different base address. I also tried to do the things in this post, but I couldn't get the right result either.

            ASLR is disabled.

            this is where I take the address of the library function:

            ...

            ANSWER

            Answered 2020-May-02 at 03:08

            I was expecting base_with_signal_offset = base_with_puts_offset = 0xf7dd8000

            There are 3 numbers in your calculation:

            Source https://stackoverflow.com/questions/61542544

            QUESTION

            Problems with encoding during buffer overflow exploit
            Asked 2020-Apr-08 at 22:09

            I am on Ubuntu Linux 16.04/Intel with ASLR turned off.

            The below programme is exploited.

            ...

            ANSWER

            Answered 2020-Apr-08 at 22:09

            That's because Python by default encodes strings by sys.stdout.encoding before writing the bytes. You can directly write bytes to sys.stdout.buffer to avoid encoding:

            Source https://stackoverflow.com/questions/61110652

            QUESTION

            SQL, query to check and list distinct entries that occur in another table within a specific time frame
            Asked 2020-Jan-21 at 14:08

            I'm using Oracle.

            I have two tables. One contains users and the other is an access log of sorts. I need to list all users whose latest log entry appears in the log within a specified time frame including the timestamp of the latest entry. A single user can have several entries in the log.

            Here are simplified versions of the tables:

            Users

            ...

            ANSWER

            Answered 2020-Jan-21 at 14:08

            You can use aggregation:

            Source https://stackoverflow.com/questions/59842803

            QUESTION

            Why I cannot single stepping into aeskeygenassist instruction in self-modifying code?
            Asked 2020-Jan-02 at 15:01

            I tried implementing aes128 encryption using assembly language, my final goal is to find out the final value. when debugging (using single stepping), the debugger stops at the 0x8048074 address.

            Here the code :

            ...

            ANSWER

            Answered 2020-Jan-02 at 05:48

            I assume you forgot to link with --omagic to make the .text section writable.

            So mov BYTE PTR ds:0x804807f,ah segfaults, and it's right before aeskeygenassist. You can't keep single-stepping after your program crashes. (You have no handler for SIGSEGV, and the default action is to terminate your program).

            When I tried this on my desktop out of curiosity, I can imagine interpreting the behaviour as single-stepping getting "stuck" before aeskeygenassist, if I ignore the segfault message!!! and the fact that trying again says "the program is no longer running".

            From a GDB session:

            Source https://stackoverflow.com/questions/59557183

            QUESTION

            Why i see RCX register in my Ubuntu, but the tutorial im watching shows a register called ECX?
            Asked 2019-Dec-19 at 22:33

            I'm watching a tutorial about debugging an executable, he is using gdb-peda and I'm using gdb from Ubuntu 19.10 for debug, i was confused for a moment because i thought it would be a problem if i can't find a register with the exact same name, anyway i continued with the debugging learning, but now i have a doubt: What is the reason his registers differs from mine?

            His registers:

            Screenshot

            My registers:

            ...

            ANSWER

            Answered 2019-Dec-19 at 22:33

            You have compiled your code for a 64-bit target machine, so you are seeing 64-bit registers. To use 32-bit registers, as ECX, you must compile your code with the -m32 flag.

            Source https://stackoverflow.com/questions/59417651

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install peda

            You can install using 'pip install peda' or download it from GitHub, PyPI.
            You can use peda like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • PyPI

            pip install peda

          • CLONE
          • HTTPS

            https://github.com/longld/peda.git

          • CLI

            gh repo clone longld/peda

          • sshUrl

            git@github.com:longld/peda.git

          • Download

            Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link