
Тестирование на проникновение веб-приложений на Go
GOWAPT — младший брат wfuzz, швейцарский армейский нож WAPT, который позволяет пентестерам выполнять масштабные действия без какого-либо стресса, просто настройте его, и всё будет в несколько кликов.
Чтобы установить gowapt, просто введите:
make
sudo make install
Из меню -h
Usage of gowapt:
-H value
A list of additional headers
-a string
Basic authentication (user:password)
-c string
A list of cookies
-d string
POST data for request
-e string
A list of comma separated encoders (default "plain")
-f string
Filter the results
-from-proxy
Get the request via a proxy server
-fuzz
Use the built-in fuzzer
-p string
Use upstream proxy
-plugin-dir string
Directory containing all scanning module
-scanner
Run in scanning mode
-ssl
Use SSL
-t string
Template for request
-threads int
Number of threads (default 10)
-u string
URL to fuzz
-w string
Wordlist file
-x string
Extension file example.js
Примеры
Сканировать http://www.example.com и отфильтровать все запросы с кодом 200 OK
gowapt -u "http://www.example.com/FUZZ" -w wordlist/general/common.txt -f "code == 200"
Сканировать http://www.example.com, фаззинг GET-параметра vuln в поисках XSS (предполагается, что у него было 200 тегов с легитимным запросом)
gowapt -u "http://www.example.com/?vuln=FUZZ" -w wordlist/Injections/XSS.txt -f "tags > 200"
Сканировать http://www.example.com, фаззинг POST-параметра vuln в поисках XSS (предполагается, что у него было 200 тегов с легитимным запросом)
gowapt -u "http://www.example.com/" -d "vuln=FUZZ" -w wordlist/Injections/XSS.txt -f "tags > 200"
Сканировать защищенный аутентификацией http://www.example.com и отфильтровать все запросы с кодом 200 OK
gowapt -u "http://www.example.com/FUZZ" -w wordlist/general/common.txt -f "code == 200" -a "user:password"
Сканировать http://www.example.com, добавив заголовок Hello: world, и отфильтровать все запросы с кодом 200 OK
gowapt -u "http://www.example.com/FUZZ" -w wordlist/general/common.txt -f "code == 200" -H "Hello: world"
Сканировать http://www.example.com, используя базовую аутентификацию с пользователем/паролем guest:guest
gowapt -u "http://www.example.com/FUZZ" -w wordlist/general/common.txt -a "guest:guest"
Сканировать http://www.example.com, добавив расширение
gowapt -u "http://www.example.com/FUZZ" -w wordlist/general/common.txt -x myextension.js
Сканировать http://www.example.com через прокси (например Burp):
gowapt -p "http://localhost:8080" -u "http://www.example.com/FUZZ" -w wordlist/general/common.txt
Сканировать http://www.example.com (получен от прокси) и отфильтровать все запросы с кодом 200 OK
gowapt --from-proxy -w wordlist/general/common.txt
Запустить режим сканера на http://www.example.com (получен от прокси) с плагинами по умолчанию
gowapt --from-proxy --scanner --plugin-dir plugin/
Затем откройте BurpSuite, отправьте запрос, который хотите фаззить, в Repeater и установите исходящий прокси на 127.0.0.1:31337. Когда будете готовы, нажмите «Отправить». Если всё сделано правильно, в ответ вы увидите Request received by GOWAPT
Расширения — это простой способ расширить возможности gowapt. Виртуальная машина JavaScript отвечает за загрузку и выполнение файлов расширений.
Ниже приведен список реализованных на данный момент API
* PS: При использовании setHTTPInterceptor метод обратного вызова получает 3 параметра:
Из-за синхронной природы sendRequestSync он будет замедлять движок, поэтому используйте его умеренно
Более подробная информация в примере расширения ниже:
example.js
/*
* Create a custom encoder called helloworld
*
* This encore just add the string "_helloworld" to every payload
* coming from the wordlist
*/
addCustomEncoder("helloworld", myenc);
/*
* Define the callback method for the helloworld encoder
*/
function myenc(data) {
return data + "_helloword";
}
/*
* Create an HTTP interceptor
*
* The interceptor will hook every request / response
* is possible to modify request before send it, anyway the respose item
* it's just shadow copy of the one received from the server so no modification
* are possible
*
*
* request_response is an object which may contains both http.Request
* or http.Response , to know which on is contained check is_request flag
*
* REMEMBER! request_response is an http.* object so you must interact with
* this one just like you would do in golang!
*
* dumpResponse is a built-in function which dump full request-response to
* disk.
* result is an object filled with stats about the response it contains some fields
*
* result.tags => Number of tags in the response
* result.code => HTTP Response status
* result.words => Number of words in the response
* result.lines => Number of lines in the response
* result.chars => Number of chars in the response
* result.request => Full dump of the request
* result.response => Full dump of the response
* result.response => The injected payload
*
*/
setHTTPInterceptor(function(request_response, result, is_request){
if(is_request){
request_response.Header.Set("Hello", "world")
}else{
dumpResponse(request_response, "/tmp/dump.txt")
/*
* Send an HTTP request in a synchronous way
*
* This API accept 4 parameters:
* method => GET | POST | HEAD | PUT | PATCH | UPDATE
* url => The url of the HTTP service
* post_data => The content of request bodyBytes
* headers => A javascript dictionary {headerName => headerValue}
*
* The response object may be null or undefined or an http.Response from golang
*/
var response = sendRequestSync("GET", "http://example.com/", null, {"Fake": "Header"})
}
})
В последнем коммите был представлен новый режим Scanner, который позволяет пользователям создавать полностью настраиваемые плагины для активного сканирования веб-приложений. Дополнительную информацию читайте в Wiki!
Wordlists взяты из проекта wfuzz! Большое спасибо ребятам!
Ниже приведен список доступных кодировщиков
Вы можете применять фильтры по следующим переменным
gowapt распространяется под лицензией GPL 3.0 и является копилефтом Daniele 'dzonerzy' Linguaglossa.
| Метод | Количество параметров | Описание | Параметры |
|---|
| addCustomEncoder | 2 | Создать пользовательский кодировщик для использования с wordlist | Param1 -> EncoderName (string) Param2 -> EncoderLogic (function) |
| panic | 1 | Для отладки вызывает аварийное завершение приложения | Param1 -> PanicText (string) |
| dumpResponse | 2 | Сохранить дамп полного запроса/ответа на диск, полезно для сохранения тестовых сценариев | Param1 -> ResponseObject (http.Response) Param2 -> Path (string) |
| setHTTPInterceptor | 1 | Создать перехватчик для исходящих HTTP-запросов и входящих ответов | Param1 -> HTTPCallback (function) * |
| sendRequestSync * | 4 | Отправить HTTP-запрос синхронным способом | Param1 -> Method (string) Param2 -> Url (string) Param3 -> PostData (string) Param4 -> Headers (Object{Name:Value}) |