I have to build SCTP packets in scapy, however it seems that SCTP does not exist in scapy folders. So I searched on the net and I found the sctp.py script:
https://github.com/jwiegley/scapy/blob/master/scapy/layers/sctp.py
I tried to copy this file in all folders that contains "/scapy/layers" but unfortunately SCTP is still undefined in scapy. ie: when I write
sctp=SCTP(dport=2500,sport=2600) I got this error message :
NameError: name 'SCTP' is not defined
How can I solve this problem; Is there any command that I missed to run ? Thanks in advance.
Not sure why you get an error ... I try this
scapy
s=SCTP(dport=2500,sport=2600)
>>> s.show()
###[ SCTP ]###
sport= 2600
dport= 2500
tag= None
chksum= None
Which looks good to me.
s.pdfdump("sctp.pdf")
This requires Gnu-Plot and some other package but this also works.
SCTP works !!
Hope this helps.
Related
I have implemented custom object detector using YOLO for offline on CPU.
When I run this command on CPU:
!./darknet detector demo data/obj.data cfg/yolov4-obj.cfg yolov4-obj_final.weights -dont_show MVI_1615_VIS.avi -i 0 -out_filename results.avi
I get the following error:
GPU isn't used
OpenCV version: 3.2.0
names: Using default 'data/names.list'
Couldn't open file: data/names.list
Kindly help.
I came across this error recently. For me, it was a simple mistake in the obj.data file.
Instead of the correct version which is:
names = obj.names
I had:
names - obj.names
Hence why it couldnt find the obj.names file
Make sure there aren't any errors in the obj.data file. For more info, check out: https://github.com/AlexeyAB/darknet#how-to-train-to-detect-your-custom-objects
I know SPIKE is already outdated, but I have to do it in SPIKE.
I am trying to do this generic_send_tcp 0.0.0.0 8080 check_post.spk 0 0
bu I get that generic_send_tcp: undefined symbol: s_string
Should I add sth or remove. I will add that two weeks ago it worked perfectly.
My script looks like this:
s_string("POST");
s_string(" ");
s_string("/");
s_string(" ");
s_string("HTTP/1.1");
s_string("\r\n");
s_string("Content-Length:");
s_blocksize_string("block1", 5);
s_string("\r\n");
s_string("Content-Type: application/x-www-form-urlencoded\r\n");
s_string("\r\n");
s_block_start("block1");
s_string("login=");
s_string_variable("a");
s_string("&password=");
s_string_variable("a");
s_block_end("block1");
s_string("\r\n");
I had the same issue. I know it's simple but 'sudo apt-get install spike' fixed the issue for me. Thanks
I am using MT7688 module with openWRT OS, version 15.05. I did install usbip into the device with:
#opkg install http://downloads.lede-project.org/releases/17.01.1/targets/ramips/mt7688/packages/kmod-usbip-client_4.4.61-1_mipsel_24kc.ipk
#opkg install http://downloads.lede-project.org/releases/17.01.1/targets/ramips/mt7688/packages/kmod-usbip-server_4.4.61-1_mipsel_24kc.ipk
#opkg install http://downloads.lede-project.org/releases/17.01.1/targets/ramips/mt7688/packages/kmod-usbip_4.4.61-1_mipsel_24kc.ipk
Failure scenario:
root#mylinkit:/# usbip
-ash: usbip: not found
So, looks like something broken at user space. Do any one know the solution for it?
Below are the logs which shows kernel module is installed:
root#mylinkit:/# lsmod|grep usbip
usbip_core 4768 2 vhci_hcd
usbip_host 11256 0
root#mylinkit:/# find -name *usbip*
./etc/modules.d/usbip-server
./etc/modules.d/usbip
./etc/modules.d/usbip-client
./lib/modules/3.18.23/usbip-core.ko
./lib/modules/3.18.23/usbip-host.ko
./overlay/upper/etc/modules.d/usbip-server
./overlay/upper/etc/modules.d/usbip
./overlay/upper/etc/modules.d/usbip-client
./overlay/upper/lib/modules/3.18.23/usbip-core.ko
./overlay/upper/lib/modules/3.18.23/usbip-host.ko
./overlay/upper/usr/lib/opkg/info/kmod-usbip-server.postinst-pkg
./overlay/upper/usr/lib/opkg/info/kmod-usbip.control
./overlay/upper/usr/lib/opkg/info/kmod-usbip-server.prerm
./overlay/upper/usr/lib/opkg/info/kmod-usbip-client.postinst
./overlay/upper/usr/lib/opkg/info/kmod-usbip.list
./overlay/upper/usr/lib/opkg/info/kmod-usbip-client.prerm
./overlay/upper/usr/lib/opkg/info/kmod-usbip-server.list
./overlay/upper/usr/lib/opkg/info/kmod-usbip-server.postinst
./overlay/upper/usr/lib/opkg/info/kmod-usbip-client.control
./overlay/upper/usr/lib/opkg/info/kmod-usbip.postinst
./overlay/upper/usr/lib/opkg/info/kmod-usbip.prerm
./overlay/upper/usr/lib/opkg/info/kmod-usbip-server.control
./overlay/upper/usr/lib/opkg/info/kmod-usbip.postinst-pkg
./overlay/upper/usr/lib/opkg/info/kmod-usbip-client.postinst-pkg
./overlay/upper/usr/lib/opkg/info/kmod-usbip-client.list
./sys/bus/usb/drivers/usbip-host
./sys/devices/platform/vhci_hcd/usbip_debug
./sys/module/usbip_core
./sys/module/usbip_core/parameters/usbip_debug_flag
./sys/module/usbip_core/holders/usbip_host
./sys/module/usbcore/holders/usbip_host
./sys/module/usbip_host
./sys/module/usbip_host/drivers/usb:usbip-host
./usr/lib/opkg/info/kmod-usbip-server.postinst-pkg
./usr/lib/opkg/info/kmod-usbip.control
./usr/lib/opkg/info/kmod-usbip-server.prerm
./usr/lib/opkg/info/kmod-usbip-client.postinst
./usr/lib/opkg/info/kmod-usbip.list
./usr/lib/opkg/info/kmod-usbip-client.prerm
./usr/lib/opkg/info/kmod-usbip-server.list
./usr/lib/opkg/info/kmod-usbip-server.postinst
./usr/lib/opkg/info/kmod-usbip-client.control
./usr/lib/opkg/info/kmod-usbip.postinst
./usr/lib/opkg/info/kmod-usbip.prerm
./usr/lib/opkg/info/kmod-usbip-server.control
./usr/lib/opkg/info/kmod-usbip.postinst-pkg
./usr/lib/opkg/info/kmod-usbip-client.postinst-pkg
./usr/lib/opkg/info/kmod-usbip-client.list
I spend much time to figure out the solution. And in the end, doubt was correct. The installer ipk from release branch, as mentioned in query post, does not have user space binaries.
Solution: To get rid of it, I took complete source from official openwrt
- `git clone https://github.com/openwrt/openwrt`
- `make menuconfig`
- *Enabling from menuconfig*
- `networking->usbip` `networking->usbip-client` and `networking->usbip-server`
And after compiling I got two binaries in sbin
/usr/sbin/usbip
/usr/sbin/usbipd
Which was needed and I was looking for. It works perfectly now.
When I try send an email using Net::SMTP::TLS from perl script I am getting below:
invalid SSL_version specified at /usr/local/share/perl5/IO/Socket/SSL.pm line 598
OS:Linux
You know what the problem is and what I have to do to fix it?
Thank you!
Net::SMTP::TLS is not maintained since 10 years and it is broken in that it causes exactly the error you describe. If you insist of using this broken module you need to fix it. Change the code in line 182 to remove the invalid setting of SSL_version:
if(not IO::Socket::SSL::socket_to_SSL($me->{sock},
- SSL_version => "SSLv3 TLSv1")){
+ )){
croak "Couldn't start TLS: ".IO::Socket::SSL::errstr."\n";
}
Instead of using the broken and unmaintained Net::SMTP::TLS or its successor but again unmaintained Net::SMTP::TLS::ButMaintained I suggest you use the latest version of Net::SMTP which has built in support for both kinds of SMTP+SSL and for IPv6 too. It comes already by default with newer Perl versions.
If using a new Net::SMTP is not possible you might use Net::SSLGlue::SMTP which monkey patches older Net::SMTP version to add SSL support. And there is also Net::SMTPS which provides a similar functionality.
Let me summarize as I had just fixed my problem (Thanks to the contributors above)
Open [Perl_dir]/site/lib/Net/SMTP/TLS.pm
Look for line 182, which looks like
if(not IO::Socket::SSL::socket_to_SSL($me->{sock}, SSL_version=>"SSLv3 TLSv1")){
Changed to line below by removing "SSL_version=>"SSLv3 TLSv1"
if(not IO::Socket::SSL::socket_to_SSL($me->{sock})){
Save [Perl_dir]/site/lib/Net/SMTP/TLS.pm
Other ref URL:
http://www.pclinuxos.com/forum/index.php/topic,143156.msg1223280.html#msg1223280
I try to rewrite the destination ipv6 of pcap with below command:
tcprewrite --infile=v6Capture_d80095.pcap --outfile=test.pcap --dstipmap=[ff02::16],[fe80::20c:29ff:fe4c:84f2]
But got the error message:
Fatal Error: Unable to parse args: From parse_args.c:tcpedit_post_args() line 89:
Unable to parse --dstipmap=[ff02::16],[fe80::20c:29ff:fe4c:84f2]
Any suggestion?
Thanks in advance!
Should be:
--dstipmap=[ff02::16]:[fe80::20c:29ff:fe4c:84f2]
In this problem you need to translate once to layer 2 and then re-translate to layer 3:
sudo tcprewrite --infile=in.pcap --dlt=enet --outfile=out.pcap --enet-dmac=00:55:22:33:AA:27 --enet-smac=00:44:66:AC:H9:AF
and then just change the ip address with:
sudo tcprewrite --infile=out.pcap --outfile=new.pcap --dstipmap=192.168.20.20:192.168.50.50 --srcipmap=172.10.10.5:172.20.20.12
Here's an example for IPv4:
tcprewrite --dstipmap=111.111.111.111:127.0.0.1 --infile=in.pcap --outfile=out.pcap
Reference documentation: https://tcpreplay.appneta.com/wiki/tcprewrite#changing-networks-via-pseudo-nat-sourcedestination-ip-map