# have\_a\_shell

HAVE\_A\_SHELL

## Windows

systeminfo <---list system info. also use the winsploit script against the results to find exploits

wmic product get /format:csv > Software\_%Computername%.csv

^^^^^ get products installed

## Linux

TTY shells

python -c 'import pty;pty.spawn("/bin/bash")' echo os.system('/bin/bash') /bin/sh -i perl -e 'exec "/bin/bash";'

find hidden files find . -type f -name '\*.py' <----you can edit this to find php, py, html, txt, whatever file you want.

Find writeable files in a linux box IE, if you want to download an exploit etc etc

find / -writable -type d 2>/dev/null # world-writeable folders find / -perm -222 -type d 2>/dev/null # world-writeable folders find / -perm -o w -type d 2>/dev/null # world-writeable folders

find / -perm -o x -type d 2>/dev/null # world-executable folders

find / ( -perm -o w -perm -o x ) -type d 2>/dev/null # world-writeable & executable folders


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://0xdecaf2bad.gitbook.io/red-team-notes/08-commands/have_a_shell.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
