frontedn updates and backend test without unknown in packet parser
All checks were successful
Build and Deploy MITM Webserver / build (push) Successful in 10s
All checks were successful
Build and Deploy MITM Webserver / build (push) Successful in 10s
This commit is contained in:
@@ -24,6 +24,7 @@ import {
|
||||
SnifferStartRequest,
|
||||
SnifferStartResponse,
|
||||
SnifferStatusResponse,
|
||||
SnifferStopRequest,
|
||||
SnifferStopResponse,
|
||||
} from '../types/sniffer';
|
||||
|
||||
@@ -104,21 +105,50 @@ export const removeBridge = async (req: BridgeRemoveRequest) => {
|
||||
Sniffer
|
||||
------------------------- */
|
||||
|
||||
/**
|
||||
* Start a sniffer session. Provide exactly one of { bridge, interface }.
|
||||
* Returns a session_id that you can use to stop the session later.
|
||||
*/
|
||||
export const startSniffer = async (payload: SnifferStartRequest): Promise<SnifferStartResponse> => {
|
||||
const res = await api.post<SnifferStartResponse>('/sniffer/start', payload);
|
||||
return res.data;
|
||||
};
|
||||
|
||||
export const stopSniffer = async (): Promise<SnifferStopResponse> => {
|
||||
const res = await api.post<SnifferStopResponse>('/sniffer/stop');
|
||||
/**
|
||||
* Stop sniffer(s).
|
||||
* - If you pass a body with { session_id }, it will stop that specific session.
|
||||
* - If you call without body and without query params, it will stop all sessions.
|
||||
*/
|
||||
export const stopSniffer = async (body?: SnifferStopRequest): Promise<SnifferStopResponse> => {
|
||||
const res = await api.post<SnifferStopResponse>('/sniffer/stop', body ?? {});
|
||||
return res.data;
|
||||
};
|
||||
|
||||
/**
|
||||
* Stop sniffing for a specific interface across sessions.
|
||||
* Calls: POST /sniffer/stop?interface=eth0 (empty body)
|
||||
*/
|
||||
export const stopSnifferByInterface = async (iface: string): Promise<SnifferStopResponse> => {
|
||||
const res = await api.post<SnifferStopResponse>(`/sniffer/stop?interface=${encodeURIComponent(iface)}`, {});
|
||||
return res.data;
|
||||
};
|
||||
|
||||
/**
|
||||
* Stop sniffing for a specific bridge across sessions.
|
||||
* Calls: POST /sniffer/stop?bridge=br0 (empty body)
|
||||
*/
|
||||
export const stopSnifferByBridge = async (bridge: string): Promise<SnifferStopResponse> => {
|
||||
const res = await api.post<SnifferStopResponse>(`/sniffer/stop?bridge=${encodeURIComponent(bridge)}`, {});
|
||||
return res.data;
|
||||
};
|
||||
|
||||
/**
|
||||
* Fetch the sniffer status (per-interface).
|
||||
*/
|
||||
export const fetchSnifferStatus = async (): Promise<SnifferStatusResponse> => {
|
||||
const res = await api.get<SnifferStatusResponse>('/sniffer/status');
|
||||
return res.data;
|
||||
};
|
||||
|
||||
/* -------------------------
|
||||
Packets
|
||||
------------------------- */
|
||||
|
||||
Reference in New Issue
Block a user