0%

vi /etc/sysconfig/network-scripts/ifcfg-enp0s3 
    onboot=no 改为 yes
shutdown -h now
cp /etc/sysconfig/network-scripts/ifcfg-enp0s3 /etc/sysconfig/network-scripts/ifcfg-enp0s8
uuidgen enp0s8 >> /etc/sysconfig/network-scripts/ifcfg-enp0s8
vi /etc/sysconfig/network-scripts/ifcfg-enp0s8
    修改网卡名称,MAC地址
systemctl restart network
reboot

服务间的通信,通过TCP协议,排查问题时用
netstat -pantu | grep 2230
netstat -pantu | grep :2230

书签搜索,b
书签,历史记录搜索, o, O
刷新页面, r

运行报错
AttributeError: module 'threading' has no attribute 'Thread'
原来是我的文件名叫做threading.py,所以import的就是本文件
python3 /tmp/pycharm_project_570/threading.py 

https://stackoverflow.com/questions/19717402/attributeerror-of-threading-thread-in-python-2-7-5

wget下载最新的Python包,比如3.7
解压
安装依赖
yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel libffi-devel
cd Python-3.7.3
./configure --prefix=/usr/local/python37
make
make install

 ln -s /usr/local/python37/bin/python3.7 /usr/bin/python3
ln -s /usr/local/python37/bin/pip3 /usr/bin/pip3

参考
https://www.cnblogs.com/progor/p/8445694.html
https://stackoverflow.com/questions/27022373/python3-importerror-no-module-named-ctypes-when-using-value-from-module-mul

在开发环境把运行内存调小
-XX:NativeMemoryTracking=summary -Xms128m -Xmx128m -XX:MaxDirectMemorySize=64M
让它溢出,根据报错的调用桟确定原因
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
    at java.util.Arrays.copyOf(Arrays.java:3332)
    at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:124)
    at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:448)
    at java.lang.StringBuilder.append(StringBuilder.java:136)
    at org.slf4j.helpers.MessageFormatter.arrayFormat(MessageFormatter.java:230)
    at ch.qos.logback.classic.spi.LoggingEvent.getFormattedMessage(LoggingEvent.java:298)
    at ch.qos.logback.classic.spi.LoggingEvent.prepareForDeferredProcessing(LoggingEvent.java:208)
    at ch.qos.logback.core.OutputStreamAppender.subAppend(OutputStreamAppender.java:212)
    at ch.qos.logback.core.OutputStreamAppender.append(OutputStreamAppender.java:103)
    at ch.qos.logback.core.UnsynchronizedAppenderBase.doAppend(UnsynchronizedAppenderBase.java:88)
    at ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:48)
    at ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:273)
    at ch.qos.logback.classic.Logger.callAppenders(Logger.java:260)
    at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:442)
    at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:396)
    at ch.qos.logback.classic.Logger.warn(Logger.java:725)
    at com.to8to.server.db.DefaultConnectionHook.onQueryExecuteTimeLimitExceeded(DefaultConnectionHook.java:97)
    at com.jolbox.bonecp.StatementHandle.queryTimerEnd(StatementHandle.java:280)
    at com.jolbox.bonecp.PreparedStatementHandle.executeUpdate(PreparedStatementHandle.java:210)
    at com.shejiben.sync.DmpSync.saveData(DmpSync.java:243)
    at com.shejiben.sync.DmpSync.syncDmpData(DmpSync.java:179)
    at com.shejiben.sync.DmpSync.run(DmpSync.java:104)
    at com.shejiben.sync.DmpSync.main(DmpSync.java:299)

这里是业务代码,
    at com.shejiben.sync.DmpSync.saveData(DmpSync.java:243)
搜索发现
https://blog.csdn.net/ismr_m/article/details/50999917#
忘了close()

The authenticity of host '[192.168.1.154]:10086 ([192.168.1.154]:10086)' can't be established.
RSA key fingerprint is SHA256:ehS4wKub7nvCZtPNZjeGCb8PM4tYj+zi+TcA2hdNhB0.
RSA key fingerprint is MD5:6c:b0:36:1c:68:3d:12:96:87:3f:0a:32:b2:13:ba:c0.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[192.168.1.154]:10086' (RSA) to the list of known hosts.
    
    |-----------------------------------------------------------------|

    | This system is for the use of authorized users only.		  |

    | Individuals using this computer system without authority, or in |

    | excess of their authority, are subject to having all of their	  |

    | activities on this system monitored and recorded by system      |

    | personnel.						          |

    |							          |

    | Anyone using this system expressly consents to such monitoring  |

    | and is advised that if such monitoring reveals possible	  |

    | evidence of criminal activity, system personnel may provide the |

    | evidence of such monitoring to law enforcement officials.	  |

    |-----------------------------------------------------------------|

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0650 for '/root/.ssh/id_rsa' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "/root/.ssh/id_rsa": bad permissions
Password: 

解决:id_rsa密钥降低权限,降为600
[root@to8to java_run]# ll /root/.ssh/id_rsa
-rw-r-x---+ 1 root root 1675 May 15 10:07 /root/.ssh/id_rsa
[root@to8to java_run]# chmod g-r /root/.ssh/id_rsa
[root@to8to java_run]# ll /root/.ssh/id_rsa
-rw---x---+ 1 root root 1675 May 15 10:07 /root/.ssh/id_rsa
[root@to8to java_run]# chmod -x /root/.ssh/id_rsa
[root@to8to java_run]# ll /root/.ssh/id_rsa
-rw-------+ 1 root root 1675 May 15 10:07 /root/.ssh/id_rsa

参考
https://www.cnblogs.com/softidea/p/6208725.html

git pull == git fetch + git merge
git fetch origin master
git log -p master..origin/master
git merge origin/master

下载metasploitable
http://220.112.193.194/files/1109000004D2DC0A/101.110.118.19/nchc.dl.sourceforge.net/project/metasploitable/Metasploitable2/metasploitable-linux-2.0.0.zip
解压,里面有vmdk文件
在virtualbox创建虚拟机,linux, other linux, 64位
创建硬盘时选择已有硬盘,选择 vmdk文件
完成
配置双网卡
启动,账号密码都是 msfadmin
第二块网卡还没IP,改网络配置
改成
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp


# The primary network interface
auto eth1
iface eth1 inet dhcp

sudo /etc/init.d/networking restart