Different ContentType will affect the effect seen by the client. The default ContentType is text/html, which is the web page format. The code is as follows: What is displayed is a web page, and The original html code will be displayed.The following are some commonly used ContentTypes GIF images JPEG images TIFF images MICROSOFT WORD […]
Tag: tty
[AIGC] Quickly master Netty and build a high-performance IM server!
Foreword: Netty is a very excellent network application framework that supports high concurrency and high performance network communication. It is suitable for developing various server programs, such as instant messaging, games, Internet of Things, etc. Using Netty can greatly improve the performance and reliability of server programs. This article will introduce the basic principles and […]
Implement privilege escalation by reusing TTY structures
Foreword UAF is a common vulnerability in user mode. There are also UAF vulnerabilities in the kernel. This is due to improper handling of the released space, resulting in the released heap blocks remaining The vulnerability created can be exploited. LK01-3 Let’s look at the UAF vulnerability based on the topic Project address: https://github.com/h0pe-ay/Kernel-Pwn/tree/master/LK01-3 open […]
netty websocket unsafe
Initialization // org.yeauty.standard.WebsocketServer#init public void init() throws InterruptedException {<!– –> EventLoopGroup boss = new NioEventLoopGroup(config.getBossLoopGroupThreads()); EventLoopGroup worker = new NioEventLoopGroup(config.getWorkerLoopGroupThreads()); ServerBootstrap bootstrap = new ServerBootstrap(); bootstrap.group(boss, worker) .channel(NioServerSocketChannel.class) .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, config.getConnectTimeoutMillis()) .option(ChannelOption.SO_BACKLOG, config.getSoBacklog()) .childOption(ChannelOption.WRITE_SPIN_COUNT, config.getWriteSpinCount()) .childOption(ChannelOption.WRITE_BUFFER_WATER_MARK, new WriteBufferWaterMark(config.getWriteBufferLowWaterMark(), config.getWriteBufferHighWaterMark())) .childOption(ChannelOption.TCP_NODELAY, config.isTcpNodelay()) .childOption(ChannelOption.SO_KEEPALIVE, config.isSoKeepalive()) .childOption(ChannelOption.SO_LINGER, config.getSoLinger()) .childOption(ChannelOption.ALLOW_HALF_CLOSURE, config.isAllowHalfClosure()) .handler(new LoggingHandler(LogLevel.DEBUG)) .childHandler(new ChannelInitializer<NioSocketChannel>() {<!– –> @Override protected void […]
[1227] Run the command line ttyd in the browser
Article directory Web Terminal Install use Basic usage Bind port Basic Auth Automatically open browser Docker support SSH terminal SSL support More Public network exposed Summarize Web Terminal ttyd: https://github.com/tsl0922/ttyd, a tool that can transfer the command line to web execution, written based on C. gotty: https://github.com/yudai/gotty, the same as ttyd, but written in Go […]
Impact of Netty MaxDirectMemorySize configuration on services
The impact of Netty MaxDirectMemorySize configuration on services Direct buffer memory OOM caused by MaxDirectMemorySize configuration once, analyze the cause through debugging. Application scenario: Using the Netty framework to process market push in a production environment Phenomena Error log java.lang.OutOfMemoryError: Direct buffer memory at java.nio.Bits.reserveMemory(Bits.java:175) ~[?:?] at java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:118) ~[?:?] at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:318) ~[?:?] at io.netty.buffer.PoolArena$DirectArena.allocateDirect(PoolArena.java:632) ~[netty-buffer-4.1.63.Final.jar!/:4.1.63.Final] […]
netty pipeline
Netty abstracts the pipeline data structure to process or intercept channel-related events. Events are divided into ChannelHandlers lists of inbound events (inBound events) and outbound events (outBound events). ChannelPipeline uses an advanced Intercepting Filter pattern that gives users complete control over how events are handled and how ChannelHandlers in the pipeline interact with each other. […]
Netty (3) Netty model
1. Netty model Netty has made certain improvements mainly based on the master-slave Reactor multi-thread model, in which the master-slave Reactor multi-thread model has multiple Reactors. Simplified layout: illustrate: BossGroup thread maintains Selector and only focuses on Accept When the Accept event is received, the corresponding SocketChannel is obtained, encapsulated into NIOSocketChannel and registered to […]
Netty data reading and writing source code reading
Data reading and writing write Let’s start with writing on the client side After the client establishes a connection with the server, it can get the connected channel object from the future. The channel here is the io.netty.channel.Channel object. Call its channel.writeAndFlush(msg); method to send data. writeAndFlush will call the writeAndFlush method of the pipeline […]