Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
K
koishi-plugin-hisoutensoku-jammer
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
koishi-plugin-hisoutensoku-jammer
Commits
f690af6c
Commit
f690af6c
authored
May 06, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update identify
parent
b74b4390
Pipeline
#3177
passed with stages
in 1 minute and 54 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
5 deletions
+34
-5
src/index.ts
src/index.ts
+34
-5
No files found.
src/index.ts
View file @
f690af6c
...
...
@@ -18,6 +18,34 @@ const defaultConfig: HisoutensokuJammerConfig = {
addressWhitelist
:
[],
};
const
chineseCharacterList
=
[
{
character
:
'
零
'
,
value
:
0
},
{
character
:
'
〇
'
,
value
:
0
},
{
character
:
'
洞
'
,
value
:
0
},
{
character
:
'
一
'
,
value
:
1
},
{
character
:
'
壹
'
,
value
:
1
},
{
character
:
'
二
'
,
value
:
2
},
{
character
:
'
贰
'
,
value
:
2
},
{
character
:
'
两
'
,
value
:
2
},
{
character
:
'
三
'
,
value
:
3
},
{
character
:
'
叁
'
,
value
:
3
},
{
character
:
'
四
'
,
value
:
4
},
{
character
:
'
肆
'
,
value
:
4
},
{
character
:
'
五
'
,
value
:
5
},
{
character
:
'
伍
'
,
value
:
5
},
{
character
:
'
六
'
,
value
:
6
},
{
character
:
'
陆
'
,
value
:
6
},
{
character
:
'
七
'
,
value
:
7
},
{
character
:
'
柒
'
,
value
:
7
},
{
character
:
'
拐
'
,
value
:
7
},
{
character
:
'
八
'
,
value
:
8
},
{
character
:
'
捌
'
,
value
:
8
},
{
character
:
'
怕
'
,
value
:
8
},
{
character
:
'
九
'
,
value
:
9
},
{
character
:
'
玖
'
,
value
:
9
},
{
character
:
'
勾
'
,
value
:
9
},
]
class
HisoutensokuJammer
{
log
:
Logger
;
targetCtx
:
Context
;
...
...
@@ -35,18 +63,19 @@ class HisoutensokuJammer {
}
async
handleMessage
(
message
:
string
)
{
const
messageMatch
:
RegExpMatchArray
=
message
.
match
(
/
(
\d{1,3}([^\d]\d{1,3}){3})
.+
?(\d{3,5})
/g
const
messageMatch
:
RegExpMatchArray
=
message
.
trim
().
match
(
/
(
[
1-2
]?
?\d?
?\d
?)(([^\d][
1-2
]?\d{1,2}){3})[^\d]
+
?([
1-6
]
?\d
?\d
?\d
?\d)
/
);
if
(
!
messageMatch
)
{
return
;
}
const
attackPromises
=
messageMatch
.
map
((
pattern
)
=>
{
const
patternMatch
=
pattern
.
match
(
/
(
\d{1,3}([^\d]\d{1,3}){3})
.+
?(\d{3,5}
)
/
/
(
[
1-2
]?
?\d?
?\d
?)(([^\d][
1-2
]?\d{1,2}){3})[^\d]
+
?([
1-6
]
?\d
?\d
?\d
?\d
)
/
);
const
address
=
patternMatch
[
1
].
split
(
/
[^\d]
/
).
join
(
"
.
"
);
const
port
=
parseInt
(
patternMatch
[
3
]);
const
firstDigit
=
patternMatch
[
1
].
replace
(
/ /g
,
''
);
const
address
=
`
${
firstDigit
}
.
${
patternMatch
[
2
].
trim
().
split
(
/
[^\d]
/
).
join
(
"
.
"
)}
`
;
const
port
=
parseInt
(
patternMatch
[
4
].
replace
(
/ /g
,
''
));
return
this
.
startAttack
(
address
,
port
);
});
const
results
:
boolean
[]
=
await
Promise
.
all
(
attackPromises
);
...
...
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