顯示具有 screen 標籤的文章。 顯示所有文章
顯示具有 screen 標籤的文章。 顯示所有文章

2024/11/09

5種在linux透過 serial 連接設備 console的方法

先找出 serial port

 dmesg|grep ttyS

[    0.818900] 00:03: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
[    0.841214] 0000:00:03.3: ttyS4 at I/O 0x2248 (irq = 17, base_baud = 115200) is a 16550A

開放存取權限

sudo chmod 666 /dev/ttyS0

sudo chmod 666 /dev/ttyS4


screen

screen /dev/ttyUSB0 115200

crtl+a   /      quit

cu
tip
minicom
putty

2018/04/21

今天找到honeyports
程式碼是2013年的 用python寫
拿來當陷阱看來還不錯用

拿這個檔來修改
honeyports-0.4.py

預設執行時若偵測到try port的ip
會下iptables 並在畫面上出現訊息問管理者是要列出還是清掉加上的iptables
改一下程式
首先把出現訊息的地方mark掉
再來把加iptables的地方改成寫到log去
另外還有一個就是原作者在連線的回應訊息寫的是

nasty_msg = "\n\n***** Fuck You For Connecting *****\n\n"

這就看個人要不要改了

程式中的這些行因為是直接產生訊息在畫面上

Got connection from
Blocking the address: 
Creating a Linux Firewall Rule

I just blocked: 

如果不拿掉 在背景執行會有問題
不想拿也可以 就用screen來跑

改完後執行

sudo python honeyports-0.4.py -p 21
-p是監聽的port
可以多執行几次起在不同的port
大於1024可以不需要使用sudo
目前想到的是

21
22
23
137
138
139
445
1433
3389
3306
5800
5900

網卡多bind几個ip
然後.......就可以在log檔拿到這些ip了
接下來要作什麼
自己想


https://github.com/adhdproject/adhdproject.github.io/blob/master/Tools/HoneyPorts.md

https://github.com/ethack/honeyports