Skip to content

Commit

Permalink
Merge pull request #1496 from yaklang/luoluo/feature/new-port-scan
Browse files Browse the repository at this point in the history
Luoluo/feature/new port scan
  • Loading branch information
b1rdfree authored Mar 22, 2024
2 parents 56816bc + c16afd4 commit 71f6f38
Show file tree
Hide file tree
Showing 46 changed files with 2,483 additions and 1,710 deletions.
6 changes: 6 additions & 0 deletions app/protos/grpc.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3306,6 +3306,12 @@ message PortScanRequest {
bool EnableBrute = 26;

string SynScanNetInterface = 27;

// 联动插件的配置
HybridScanPluginConfig LinkPluginConfig = 28;

// 爬虫是否启用 JS 解析
bool BasicCrawlerEnableJSParser = 29;
}

message DeletePortsRequest {
Expand Down
27 changes: 27 additions & 0 deletions app/renderer/src/main/src/assets/icon/outline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5113,3 +5113,30 @@ const OutlinePaintbrush = () => (
export const OutlinePaintbrushIcon = (props: Partial<IconProps>) => {
return <Icon component={OutlinePaintbrush} {...props} />
}

const OutlineStore = () => (
<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'>
<path
d='M20.25 8.55938V19.5C20.25 19.6989 20.171 19.8897 20.0303 20.0303C19.8897 20.171 19.6989 20.25 19.5 20.25H4.5C4.30109 20.25 4.11032 20.171 3.96967 20.0303C3.82902 19.8897 3.75 19.6989 3.75 19.5V4.5C3.75 4.30109 3.82902 4.11033 3.96967 3.96967C4.11032 3.82902 4.30109 3.75 4.5 3.75H15.4406C15.538 3.74966 15.6345 3.76853 15.7246 3.80553C15.8147 3.84253 15.8966 3.89694 15.9656 3.96563L20.0344 8.03438C20.1031 8.10341 20.1575 8.18532 20.1945 8.27541C20.2315 8.36549 20.2503 8.46199 20.25 8.55938V8.55938Z'
stroke='currentColor'
strokeWidth='2'
strokeLinecap='round'
strokeLinejoin='round'
/>
<path
d='M7.5 20.25V14.25C7.5 14.0511 7.57902 13.8603 7.71967 13.7197C7.86032 13.579 8.05109 13.5 8.25 13.5H15.75C15.9489 13.5 16.1397 13.579 16.2803 13.7197C16.421 13.8603 16.5 14.0511 16.5 14.25V20.25'
stroke='currentColor'
strokeWidth='2'
strokeLinecap='round'
strokeLinejoin='round'
/>
<path d='M14.25 6.75H9' stroke='currentColor' strokeWidth='2' strokeLinecap='round' strokeLinejoin='round' />
</svg>
)

/**
* @description Icon/Outline/存储
*/
export const OutlineStoreIcon = (props: Partial<IconProps>) => {
return <Icon component={OutlineStore} {...props} />
}
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ export const ConfigNetworkPage: React.FC<ConfigNetworkPageProp> = (props) => {
</Divider>
<Form.Item label={"网卡"} tooltip='为SYN扫描选择网卡'>
<YakitSelect
showSearch
// showSearch
options={netInterfaceList}
placeholder='请选择...'
size='small'
Expand Down
2 changes: 1 addition & 1 deletion app/renderer/src/main/src/components/yakChat/chatCS.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ import {
import {YakitCheckbox} from "../yakitUI/YakitCheckbox/YakitCheckbox"
import {
HybridScanRequest,
PluginBatchExecutorTaskProps,
apiCancelHybridScan,
apiHybridScan,
apiStopHybridScan,
Expand All @@ -106,7 +107,6 @@ import {HybridScanControlAfterRequest} from "@/models/HybridScan"
import useHoldBatchGRPCStream from "@/hook/useHoldBatchGRPCStream/useHoldBatchGRPCStream"
import {
PluginBatchExecuteExtraFormValue,
PluginBatchExecutorTaskProps,
defPluginExecuteTaskValue
} from "@/pages/plugins/pluginBatchExecutor/pluginBatchExecutor"
import {cloneDeep} from "bizcharts/lib/utils"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@
.dragger-help-active {
color: var(--yakit-primary-5);
cursor: pointer;
margin: 0 4px;
.upload-icon {
width: 16px;
height: 16px;
svg {
width: 16px;
height: 16px;
}
}
}

.dragger-help-active-disabled {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import classNames from "classnames"
import {YakitInput} from "../YakitInput/YakitInput"
import {useMemoizedFn} from "ahooks"
import {failed, yakitNotify} from "@/utils/notification"
import {OutlineUploadIcon} from "@/assets/icon/outline"

const {Dragger} = Upload

Expand Down Expand Up @@ -621,8 +622,9 @@ export const YakitDraggerContent: React.FC<YakitDraggerContentProps> = React.mem
})}
onClick={onUploadFile}
>
点击此处上传
<OutlineUploadIcon className={styles["upload-icon"]} /> 点击此处
</span>
上传
</label>
</div>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@
.ant-input-number-handler {
border-color: var(--input-number-border-color);
}
.ant-input-number-group-addon{
border-color: var(--input-number-border-color);
}
}
}
.yakit-input-number-wrapper-small {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {SolidViewgridIcon, SolidPaperairplaneIcon} from "@/assets/icon/solid"
import {SolidPaperairplaneIcon} from "@/assets/icon/solid"
import {ExportExcel} from "@/components/DataExport/DataExport"
import {TableVirtualResize} from "@/components/TableVirtualResize/TableVirtualResize"
import {ColumnsTypeProps, SortProps} from "@/components/TableVirtualResize/TableVirtualResizeType"
Expand All @@ -8,10 +8,7 @@ import {YakitDropdownMenu} from "@/components/yakitUI/YakitDropdownMenu/YakitDro
import {YakitMenuItemType} from "@/components/yakitUI/YakitMenu/YakitMenu"
import {showByRightContext} from "@/components/yakitUI/YakitMenu/showByRightContext"
import {CopyComponents, YakitTag} from "@/components/yakitUI/YakitTag/YakitTag"
import {PaginationSchema, QueryGeneralResponse, genDefaultPagination} from "@/pages/invoker/schema"
import {RouteToPageProps} from "@/pages/layout/publicMenu/PublicMenu"
import {YakitRoute} from "@/routes/newRoute"
import emiter from "@/utils/eventBus/eventBus"
import {QueryGeneralResponse, genDefaultPagination} from "@/pages/invoker/schema"
import {formatTimestamp} from "@/utils/timeUtil"
import React, {useState, useMemo, useEffect, useRef, useImperativeHandle} from "react"
import {QueryPortsRequest, portAssetFormatJson, PortTableAndDetail} from "../PortAssetPage"
Expand All @@ -20,15 +17,10 @@ import {defQueryPortsRequest, apiQueryPortsBase, apiQueryPortsIncrementOrderAsc}
import {
useDebounceFn,
useMemoizedFn,
useSelections,
useInterval,
useCreation,
useControllableValue,
useLatest,
useUpdateEffect,
useWhyDidYouUpdate,
useInViewport
} from "ahooks"
useUpdateEffect} from "ahooks"
import styles from "./PortTable.module.scss"
import {PortTableProps} from "./PortTableType"
import ReactResizeDetector from "react-resize-detector"
Expand Down

This file was deleted.

23 changes: 21 additions & 2 deletions app/renderer/src/main/src/pages/plugins/funcTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1436,7 +1436,7 @@ export const OnlineRecycleExtraOperate: React.FC<OnlineRecycleExtraOperateProps>

/** @name 标题栏的搜索选项组件 */
export const FilterPopoverBtn: React.FC<FilterPopoverBtnProps> = memo((props) => {
const {defaultFilter, onFilter, refresh, type = "online"} = props
const {defaultFilter, onFilter, refresh, type = "online", fixFilterList = []} = props

const excludeFilterName = useMemo(() => {
return ["tags", "plugin_group"]
Expand All @@ -1448,6 +1448,10 @@ export const FilterPopoverBtn: React.FC<FilterPopoverBtnProps> = memo((props) =>

// 查询筛选条件统计数据列表
useEffect(() => {
if (fixFilterList.length > 0) {
setFilterList(fixFilterList)
return
}
if (type === "online") {
apiFetchGroupStatisticsOnline().then((res) => {
const list = (res?.data || []).filter((item) => !excludeFilterName.includes(item.groupKey))
Expand Down Expand Up @@ -1513,7 +1517,22 @@ export const FilterPopoverBtn: React.FC<FilterPopoverBtnProps> = memo((props) =>
let isActive = false
valueArr.forEach((key) => {
if (value[key] && value[key].length > 0) {
isActive = true
if (fixFilterList.length > 0) {
const groupData = fixFilterList.find((ele) => ele.groupKey === "key") || {data: []}
const list = (value[key] || [])
.map((ele) => ele.value)
.sort()
.join(",")
const defList = (groupData.data || [])
.map((ele) => ele.value)
.sort()
.join(",")
if (list && list !== defList) {
isActive = true
}
} else {
isActive = true
}
}
})
setIsActive(isActive)
Expand Down
3 changes: 3 additions & 0 deletions app/renderer/src/main/src/pages/plugins/funcTemplateType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {DropDownProps} from "antd"
import {PluginFilterParams, PluginSearchParams} from "./baseTemplateType"
import {YakitPluginOnlineDetail} from "./online/PluginsOnlineType"
import {OnlinePluginAppAction} from "./pluginReducer"
import {API} from "@/services/swagger/resposeType"

export interface TypeSelectOpt {
/** 唯一标识符 */
Expand Down Expand Up @@ -318,6 +319,8 @@ export interface FilterPopoverBtnProps {
refresh?: boolean
/** 筛选组件的类型-商店|审核|我的 */
type?: "check" | "online" | "user" | "local"
/**固定的过滤条件,有的话就不去请求接口获取,传了该参数后type无效 */
fixFilterList?: API.PluginsSearch[]
}

/** 插件源码评分模块 */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export const LocalPluginList: React.FC<PluginLocalGroupsListProps> = React.memo(
const queryFilters = filters
const querySearch = search
const query: QueryYakScriptRequest = {
...convertLocalPluginsRequestParams(queryFilters, querySearch, params),
...convertLocalPluginsRequestParams({filter:queryFilters, search:querySearch, pageParams:params}),
ExcludeTypes: ["yak", "codec"] // 过滤条件 插件组需要过滤Yak、codec
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ export const PluginsLocal: React.FC<PluginsLocalProps> = React.memo((props) => {
const queryFilters = filtersDetailRef.current ? filtersDetailRef.current : filters
const querySearch = searchDetailRef.current ? searchDetailRef.current : search
const query: QueryYakScriptRequest = {
...convertLocalPluginsRequestParams(queryFilters, querySearch, params)
...convertLocalPluginsRequestParams({filter:queryFilters, search:querySearch, pageParams:params})
}
queryFetchList.current = query
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {yakitNotify} from "@/utils/notification"
import {YakitPluginOnlineJournal} from "@/pages/yakitStore/YakitPluginOnlineJournal/YakitPluginOnlineJournal"
import {executeYakScriptByParams} from "@/pages/invoker/YakScriptCreator"
import {showYakitModal} from "@/components/yakitUI/YakitModal/YakitModalConfirm"
import {AddToMenuActionForm, LocalPluginExecutor} from "@/pages/yakitStore/PluginOperator"
import {AddToMenuActionForm} from "@/pages/yakitStore/PluginOperator"
import {isCommunityEdition} from "@/utils/envfile"
import {CodeGV} from "@/yakitGV"
import {getRemoteValue} from "@/utils/kv"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.plugin-list-right-wrapper {
display: flex;
flex-direction: column;
flex: 1;
height: 100%;
overflow: hidden;
}

.details-filter-extra-wrapper {
display: inline-flex;
align-items: center;
gap: 4px;
path {
stroke-width: 1.5;
}
.loading-icon {
width: 26px;
text-align: center;
color: var(--yakit-primary-5);
svg {
width: 16px;
height: 16px;
}
}
}
Loading

0 comments on commit 71f6f38

Please sign in to comment.