Сообщения переведены на английский, исправлена грамматика

This commit is contained in:
serega6531
2020-03-16 23:52:16 +03:00
parent bcbe983704
commit 573142deeb
9 changed files with 37 additions and 37 deletions

View File

@@ -24,10 +24,10 @@
## Клонирование
Поскольку этот репозиторий содержит фронтенд как git submodule, его необходимо клонировать так:
```bash
git clone --recurse-submodules https://gitlab.com/binarybears_ctf/Packmate.git
git clone --recurse-submodules https://gitlab.com/packmate/Packmate.git
# Или, на старых версиях git
git clone --recursive https://gitlab.com/binarybears_ctf/Packmate.git
git clone --recursive https://gitlab.com/packmate/Packmate.git
```
Если репозиторий уже был склонирован без подмодулей, необходимо выполнить:

View File

@@ -14,7 +14,7 @@ Advanced network traffic flow analyzer for A/D CTFs.
* Binary substring
* Can make certain streams favorite and show only favorite streams
* Supports several simultaneous services, can show streams for a specific service or pattern
* Allows to navigate streams using shortcuts
* Allows navigating streams using shortcuts
* Has the option to copy packet content in the required format
* Can concatenate adjacent packets
* Can urldecode text automatically
@@ -22,12 +22,12 @@ Advanced network traffic flow analyzer for A/D CTFs.
![Main window](screenshots/Screenshot.png)
## Cloning
As this repository contains frontend part as git submodule, it has to be cloned like this:
As this repository contains frontend part as a git submodule, it has to be cloned like this:
```bash
git clone --recurse-submodules https://gitlab.com/binarybears_ctf/Packmate.git
git clone --recurse-submodules https://gitlab.com/packmate/Packmate.git
# Or if you have older git
git clone --recursive https://gitlab.com/binarybears_ctf/Packmate.git
git clone --recursive https://gitlab.com/packmate/Packmate.git
```
If the repository was already cloned without submodule, just run:
@@ -39,23 +39,23 @@ git submodule update --init --recursive
## Preparation
This program uses Docker and docker-compose.
`packmate-db` will listen port 65001 at localhost.
Database files do not mount as volume, so upon container recreation all data will be lost.
`packmate-db` will listen to port 65001 at localhost.
Database files do not mount as volume, so upon container recreation, all data will be lost.
### Settings
This program retreives settings from environment variables,
so it would be convenient to create env file;
This program retrieves settings from environment variables,
so it would be convenient to create an env file;
It must be called `.env` and located at the root of the project.
Contents of the file:
```bash
# Interface to capture on
PACKMATE_INTERFACE=wlan0
# Local ip on said interface to tell incoming packets from outgoing
# Local IP on said interface to tell incoming packets from outgoing
PACKMATE_LOCAL_IP=192.168.1.124
# Username for web interface
# Username for the web interface
PACKMATE_WEB_LOGIN=SomeUser
# Password for web interface
# Password for the web interface
PACKMATE_WEB_PASSWORD=SomeSecurePassword
```
@@ -67,8 +67,8 @@ sudo docker-compose up --build -d
If everything went fine, Packmate will be available on port `65000` from any host
### Accessing web interface
When you open web interface for the first time, you will be asked for login and password
### Accessing the web interface
When you open a web interface for the first time, you will be asked for a login and password
you specified in the env file.
After entering the credentials, open the settings by clicking on the cogs
in the top right corner and enter login and password again.
@@ -76,18 +76,18 @@ in the top right corner and enter login and password again.
![Settings](screenshots/Screenshot_Settings.png)
All settings are saved in the local storage and will be
lost only upon changing server ip or port.
lost only upon changing server IP or port.
## Usage
First of all you should create game services.
First of all, you should create game services.
To do that click `+` in the navbar,
then fill in service name, port and optimization to perform.
then fill in the service name, port, and optimization to perform.
System will start automatically capture streams and show them in a sidebar.
Click at stream to view a list of packets;
The system will start automatically capture streams and show them in a sidebar.
Click at a stream to view a list of packets;
you can click a button in the sidebar to switch between binary and text views.
For a simple monitoring of flags there is a system of patterns.
For simple monitoring of flags, there is a system of patterns.
To create a pattern open `Patterns` dropdown menu, press `+`, then
specify the type of pattern, the pattern itself, highlight color and other things.

View File

@@ -140,7 +140,7 @@ public class PcapWorker implements PacketListener {
UnfinishedStream stream = addNewPacket(sourceIp, destIp, time, sourcePort, destPort, ttl, content, Protocol.TCP);
if (log.isDebugEnabled()) {
log.debug("tcp {} {}:{} -> {}:{}, номер пакета {}",
log.debug("tcp {} {}:{} -> {}:{}, packet number {}",
serviceOptional.get(), sourceIpString, sourcePort, destIpString, destPort,
unfinishedTcpStreams.get(stream).size());
}
@@ -179,7 +179,7 @@ public class PcapWorker implements PacketListener {
UnfinishedStream stream = addNewPacket(sourceIp, destIp, time, sourcePort, destPort, ttl, content, Protocol.UDP);
if (log.isDebugEnabled()) {
log.debug("udp {} {}:{} -> {}:{}, номер пакета {}",
log.debug("udp {} {}:{} -> {}:{}, packet number {}",
serviceOptional.get(), sourceIpString, sourcePort, destIpString, destPort,
unfinishedUdpStreams.get(stream).size());
}
@@ -207,7 +207,7 @@ public class PcapWorker implements PacketListener {
final var streams = (protocol == Protocol.TCP) ? this.unfinishedTcpStreams : this.unfinishedUdpStreams;
if (!streams.containsKey(stream)) {
log.debug("Начат новый стрим");
log.debug("New stream started");
}
streams.put(stream, packet);

View File

@@ -30,12 +30,12 @@ public class TimeoutStreamsSaver {
public void saveStreams() {
int streamsClosed = pcapWorker.closeTimeoutStreams(Protocol.UDP, udpStreamTimeoutMillis);
if (streamsClosed > 0) {
log.info("Закрыто {} udp стримов", streamsClosed);
log.info("{} udp streams closed", streamsClosed);
}
streamsClosed = pcapWorker.closeTimeoutStreams(Protocol.TCP, tcpStreamTimeoutMillis);
if (streamsClosed > 0) {
log.info("Закрыто {} tcp стримов", streamsClosed);
log.info("{} tcp streams closed", streamsClosed);
}
}

View File

@@ -57,7 +57,7 @@ public class PatternService {
final Optional<Pattern> optional = repository.findById(id);
if (optional.isPresent()) {
final Pattern pattern = optional.get();
log.info("Удален паттерн {} со значением {}", pattern.getName(), pattern.getValue());
log.info("Removed pattern {} with value {}", pattern.getName(), pattern.getValue());
for (Stream stream : pattern.getMatchedStreams()) {
stream.getFoundPatterns().remove(pattern);
@@ -83,7 +83,7 @@ public class PatternService {
final Pattern saved = repository.save(pattern);
patterns.put(saved.getId(), saved);
log.info("Добавлен новый паттерн {} со значением {}", pattern.getName(), pattern.getValue());
log.info("Added new pattern {} with value {}", pattern.getName(), pattern.getValue());
subscriptionService.broadcast(new SubscriptionMessage(SubscriptionMessageType.SAVE_PATTERN, saved));
return saved;
}

View File

@@ -59,14 +59,14 @@ public class ServicesService {
}
public void deleteByPort(int port) {
log.info("Удален сервис на порту {}", port);
log.info("Removed service at port {}", port);
services.remove(port);
repository.deleteById(port);
subscriptionService.broadcast(new SubscriptionMessage(SubscriptionMessageType.DELETE_SERVICE, port));
}
public CtfService save(CtfService service) {
log.info("Добавлен или изменен сервис {} на порту {}", service.getName(), service.getPort());
log.info("Added or edited service {} at port {}", service.getName(), service.getPort());
final CtfService saved = repository.save(service);
services.put(saved.getPort(), saved);
subscriptionService.broadcast(new SubscriptionMessage(SubscriptionMessageType.SAVE_SERVICE, saved));

View File

@@ -209,7 +209,7 @@ public class StreamOptimizer {
IOUtils.copy(gzipStream, out);
byte[] newContent = ArrayUtils.addAll(httpHeader, out.toByteArray());
log.debug("Разархивирован gzip: {} -> {} байт", gzipBytes.length, out.size());
log.debug("GZIP decompressed: {} -> {} bytes", gzipBytes.length, out.size());
return Packet.builder()
.incoming(false)
@@ -218,7 +218,7 @@ public class StreamOptimizer {
.content(newContent)
.build();
} catch (ZipException e) {
log.warn("Не удалось разархивировать gzip, оставляем как есть", e);
log.warn("Failed to decompress gzip, leaving as it is", e);
} catch (IOException e) {
log.error("decompress gzip", e);
}

View File

@@ -62,7 +62,7 @@ public class StreamService {
);
if (serviceOptional.isEmpty()) {
log.warn("Не удалось сохранить стрим: сервиса на порту {} или {} не существует",
log.warn("Failed to save the stream: service at port {} or {} does not exist",
unfinishedStream.getFirstPort(), unfinishedStream.getSecondPort());
return false;
}
@@ -72,7 +72,7 @@ public class StreamService {
packets.removeIf(packet -> packet.getContent().length == 0);
if (packets.isEmpty()) {
log.debug("Стрим состоит только из пустых пакетов и не будет сохранен");
log.debug("Stream consists only of empty packets and will not be saved");
return false;
}
}
@@ -149,7 +149,7 @@ public class StreamService {
Stream saved;
if (stream.getId() == null) {
saved = repository.save(stream);
log.debug("Создан стрим с id {}", saved.getId());
log.debug("Saved stream with id {}", saved.getId());
} else {
saved = repository.save(stream);
}

View File

@@ -31,12 +31,12 @@ public class StreamSubscriptionService {
public void addSubscriber(WebSocketSession session) {
subscribers.add(session);
log.info("Подписан пользователь {}", Objects.requireNonNull(session.getRemoteAddress()).getHostName());
log.info("User subscribed: {}", Objects.requireNonNull(session.getRemoteAddress()).getHostName());
}
public void removeSubscriber(WebSocketSession session) {
subscribers.remove(session);
log.info("Отписан пользователь {}", Objects.requireNonNull(session.getRemoteAddress()).getHostName());
log.info("User unsubscribed {}", Objects.requireNonNull(session.getRemoteAddress()).getHostName());
}
void broadcast(SubscriptionMessage message) {