12.5K subscribers
550 photos
27 videos
24 files
889 links
This channel discusses:

— Offensive Security
— RedTeam
— Malware Research
— OSINT
— etc

Disclaimer:
t.iss.one/APT_Notes/6

Chat Link:
t.iss.one/APT_Notes_PublicChat
Download Telegram
Git-Secret

Go scripts for finding an API key / some keywords in a github repository

https://github.com/daffainfo/Git-Secret

#bugbounty #bugbountytips #pentest #api #infosec
API Guesser

A simple website to guess API Key / OAuth Token

When you do pentest / Github recon and find API key / OAuth token but you don't know what API key it is, you can use my website that I built from javascript

https://api-guesser.netlify.app

Source:
https://github.com/daffainfo/apiguesser-web

#api #token #osint #bugbounty
Bypass Rate Limits in Web Applications and API's.

— What is Rate Limit

Rate limiting is a process to limiting the number of request an user can make to a web server in an span of time. This can be achieved by implementing IP based, Session Based rate limits on web server.

—Where to Look for Rate Limit Bugs

Place like :
— Login/Signup pages
— Register Pages
— 2FA codes
— Confirmation Codes

...and any other request which if bruteforce will allow attacker to achieve anything malicious should be check for "No Rate Limit" issue.

[Bypass 1] - Using Null Chars

%00, %0d%0a, %09, %0C, %20, %0

Example:
— Bruteforce with [email protected]
— After some time you will be blocked
— Now Bruteforce with [email protected]%00 and check if you are able continue bruteforce it

[Bypass 2] - Adding Spaces

A webserver may strip off extra spaces added to email/username at the backend, Which may allow you to bruteforce the same email by appending an extra space every time you are blocked.

[Bypass 3] - Host Header Injection

Try Modifying Host header of the request after being blocked by the server

Change Host: www,newsite,com
Change Host: localhost
Change Host: 127.0.0.1

[Bypass 4] - Changing Cookies

Try changing Session cookie after being blocked by the server. This can be achieved by figuring out which request is responsible to set session cookies to the user and then use that request to update session cookie everytime you are blocked.

[Bypass 5] - X-forwarded-For

— dig target,com
— Change The X-Forwarded-For: IP Address

This may confuse WAF/server/loadbalancer, as if requests are being forwarded to another host but will be forwarded to same target host hence will allow you to bypass the rate limit.

[Bypass 6] - Confuse server with correct attempts

If the server is blocking you after 20 attempts, Try bruteforcing with 19 attempts and use your credentials to login to your account on 20th attempt and then repeat the process.

[Bypass 7] - Updating target Paths

Appending random param=value may sometimes bypass rate limit on the endpoint

Eg:
— Bruteforce /api/v1/users/<id>
— Got blocked after 200 attempts
— Now Bruteforce /api/v1/users/<id>?xyz=123
— Change the param=value after each 200 attempts

[Bypass 8] - IP based Rate limits

IP based rate limits can be easily bypassed by changing the Ip address of your machine. The alternative would be using IP Rotate Burp Extension.

#web #api #rate #limit #bypass
👍5🔥1
Forwarded from Пост Импакта
#api #params

> Ничего не могу найти на сайте, может ещё что-то посмотреть?

Иногда встречается сайт, на котором всего лишь несколько конечных точек. Казалось, все параметры были проверены на уязвимости, а в чек-листе отмечены любые возможные проверки на инъекции и логику.

Однако, бывают уязвимости, которые не видны с первого взгляда. Например (CAPEC-460) HTTP Parameter Pollution или (CWE-472) External Control of Assumed-Immutable Web Parameter. Данные ошибки возникают из-за неожиданного поведения в функциях обработки параметров.

Давайте рассмотрим первую атаку HTTP Parameter Pollution, она состоит из возможности добавления повторяющихся параметров с помощью специальных разделителей запроса.

Например, у нас открыт сайт по продаже арбузов в браузере

🌐 example.com/profile.jsp?client_id=1

Для кнопки "Открыть профиль" устанавливается динамически в ответе от сервера html:

<a href="profile.jsp?client_id=1&action=view

А теперь изменим запрос добавив в него параметр и закодировав разделитель & как %26:

🌐 example.com/profile.jsp?client_id=1%26action%3Ddelete

В результате для кнопки "Открыть профиль" задаётся html:

<a href="profile.jsp?client_id=1&action=delete&action=view

При нажатии на кнопку — профиль пользователя будет удалён. Для того чтобы заставить жертву удалить свой аккаунт, нам нужно отправить ей ссылку и подождать.

Это происходит, потому что Apache Tomcat 🐈 при анализе двух одинаковых параметров (action) берёт значение первого:

&action=delete&action=view

Вот так выглядит код на стороне сервера:

String client_id = request.getParameter("client_id");
GetMethod get = new GetMethod("https://example.com/profile");
get.setQueryString("client_id=" + client_id + "&action=" + action);
href_link=get.URL;

Разработчик должен был учесть такое поведение и проверить возможность внедрения параметра action в client_id

Вообще, приоритет и процесс обработки параметров можно взять из этой таблицы ниже:

Technology/HTTP backend        | Parsing Result    | Example         |
---------------------------------------------------------------------
ASP.NET/IIS | All occurrences | par1=val1,val2 |
ASP/IIS | All occurrences | par1=val1,val2 |
PHP/Apache | Last occurrence | par1=val2 |
JSP Servlet/Apache Tomcat | First occurrence | par1=val1 |
JSP Servlet/Oracle Application | First occurrence | par1=val1 |
IBM HTTP Server | First occurrence | par1=val1 |

Так, для Server: Apache Tomcat будет взято значение из первого совпадения action=delete
А для Server: Apache значение уже будет action=view — последний параметр

Но не все сервера используют приоритет порядка, так, например, ASP.NET/IIS конкатенирует значения. Поэтому в случаях, когда выполнению XSS мешает санитизация или WAF, можно составить следующий payload:

example.com/search?param=<audio/n="&param="src/onerror=alert()>

В результате на странице html будет <audio n="," src/onerror=alert()> и XSS успешно сработает 💣

Помимо приоритетов, нужно также вспомнить о разделителях для параметров. Существует не только привычный & (амперсанд) и , (запятая) но и ряд других символов, тут нужно обратиться к стандартам и поискать реализации. Если открыть (rfc6570) URI Template можно найти Path-Style Parameter

Обычный URL будет следующим:

example.com/users?role=admin&firstName=N

А теперь преобразуем его в вид Path-Style:

example.com/users;role=admin;firstName=N

Использование в качестве разделителя ; (точки с запятой) не повсеместно. Это приводит к различиям обработки во фреймворках и как следствие к уязвимостям, в частности, на микросервисных архитектурах:

CVE-2021-23336 — Python библиотека urllib.parse.parse_qsl не игнорирует точку с запятой.

ParseThru — Go библиотека net/url не игнорирует точку с запятой и выводит предупреждение http: URL query contains semicolon...

Следует помнить, что уязвимость HTTP Parameter Pollution может возникать не только в URL, но и в любой части POST/GET запроса, а также в теле JSON.

{"client_id":4, "client_id":17, "action":"delete"}
👍4🔥4
😎 Gigaproxy — One Proxy to Rule Them All

If you’re looking for a powerful tool to help you bypass Web Application Firewalls (WAFs) during external penetration tests and bug bounty programs, you’re in the right place. Gigaproxy tool is designed to rotate IPs using mitmproxy, AWS API Gateway, and Lambda. Fireprox is great but has one major downside. You can only target a single host at a time. Gigaproxy solves this.

🔗 Research:
https://www.sprocketsecurity.com/resources/gigaproxy

🔗 Source:
https://github.com/Sprocket-Security/gigaproxy

#ip #rotate #aws #api #gateway #proxy
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥10👍51