Python loop port scan script stops without error on port 80

I have a python script which scans ports. I scan a host which has 2 open ports (22 and 80). When my script reach port 22 I get an message with “Open port + running services”. Then the scripts continues … When it reach port 80, it’s get stuck. I don’t know why, I don’t get an error.

Can somebody review my code because I can’t find the issue. Thankss

    for port in range(1,82):             s = socket.socket()             result = s.connect_ex((ip, port))             s.close()             if result == 0:                     s = socket.socket()                     s.connect((ip, port))                     data = str(s.recv(1024))                     s.close()                     print ("Port {}: Open  --  ".format(port) + (data))             else:                     print ("Port {}: Closed".format(port)) 

How is it possible to scan the internal network to perform lateral movement without being detected by a firewall?

How is it possible to scan the internal network to perform lateral movement without being detected by a firewall? I’m trying to do a decent scan on the internal network for days. I have a meterpreter shell, add subnet, set proxychains port 1080 and do a slow scan with nmap. I would like to know what other techniques that Pentesters use in their day to day that are effective.

WebServer is an ubuntu, but the internal network is packed with Windows and Linux machines, thus bringing a realistic environment for training. I am doing these studies in a controlled environment.

My router is getting port scan attacks

My internet suddenly cut out yesterday, i checked the router and it looked like nothing is wrong. I looked at the logs and i see this

2019-08-18 12:50:39 Security Warning Detect UDP port scan attack, scan packet from 212.2.127.253 2019-08-18 12:43:19 Security Warning Detect UDP port scan attack, scan packet from 212.2.96.53 2019-08-18 03:59:04 Security Warning Detect UDP port scan attack, scan packet from 212.2.96.53 2019-08-17 19:08:37 Security Warning Detect UDP port scan attack, scan packet from 212.2.96.53

When every attack happens my internet cuts out so how do i stop it?

sane-find-scanner does not detect Brother DS-720D but simple scan and xsane does

I have Brother DS-720D and connected it on a newly installed ubuntu 16.04. I installed the drivers libsane-dsseriesfrom Brother’s website. The scanner works and xsane and simple scan detects it. However using sudo sane-find-scanner does not detect it and simply outputs the #No USB scanners found. I verified that the libsane-dsseries.so files are in the /usr/lib/x86_64/sane folder. I tried other solutions like:

  1. Reinstalling the drivers
  2. Verifying that from lsusb it is detected
  3. Editing the /etc/udev/rules.d/60-libsane.rules and adding the lines:

    #Brother ATTRS{idVendor}=="04f9", ENV{libsane_matched}="yes"

HTTP response splitting from Checkmarx scan

Checkmarx keeps throwing http response splitting of the following code:

public void getFile(HttpServletRequest request, HttpServletResponse response) {     String date = ESAPI.validator().getValidInput("date", request.getParameter("date"), "Date", 8, false);      String jsonStr = fileService.getFile(date);     JSONObject rtn = JSONObject.fromObject(jsonStr);     String fileContent = rtn.getString("fileContent");     String fileName = rtn.getString("fileName");      if (!fileName.contains("\n")) {         byte[] backByte = Base64.decodeBase64(fileContent);         ByteArrayInputStream bInput = new ByteArrayInputStream(backByte);         response.setContentType("application/pdf");          response.setHeader("Content-disposition", "attachment; filename=" + fileName);         OutputStream out = response.getOutputStream();         IOUtils.copy(bInput, out);         bInput.close();         response.setHeader(Set-Cookie", "fileDownload=true; path=/; HttpOnly");         response.getOutputStream().close();         response.flushBuffer();     } } 

I’ve validated my input and also checked to see that filename doesn’t include “\n”, stuck now as problem still persists.

18.04 and Samsung: Scan to PC not available

I’m using Samsung XPress 2070FW over WiFi and I cannot get the printer to scan using the on-the-printer scan to pc function. The error message is “Scan to PC not available”. However, scanning using the PC (sane) works fine. The driver is the unified one for the model, but there’s no interface like the one of windows so I cannot tweak scanning on Ubuntu.

Anyone encountered a similar problem?

PHP Storm XML scan result : redundant default attribute value assignment

I ran a PHP Storm XML scan

https://magento.stackexchange.com/a/227343/70343

The part you are interested in is ‘How to use PhpStorm code inspector to validate project xml-files’

And I just spotted a load of ‘redundant default attribute value assignment’ errors

Many of these point to the use of the translate="true" value

For example

https://github.com/magento/magento2/blob/2.3/app/code/Magento/Catalog/etc/widget.xml#L12

Has this been deprecated or is this a false positive?

NMAP discovery scan reporting host offline, pinging the same host gets ICMP responses

I ran an nmap -sn scan on a host, and nmap reported the host as down. I then pinged the same host with ping and got ICMP responses. I’m confused, because I was sure that -sn among other things, did an ICMP echo request.

Output from my two commands:

~ $   nmap -sn 192.168.1.237   Starting Nmap 6.40 ( http://nmap.org ) at 2016-08-16 09:35 BST Note: Host seems down. If it is really up, but blocking our ping probes, try -Pn Nmap done: 1 IP address (0 hosts up) scanned in 3.00 seconds  ~ $   ping 192.168.1.237 PING 192.168.1.237 (192.168.1.237) 56(84) bytes of data. 64 bytes from 192.168.1.237: icmp_seq=1 ttl=128 time=9.82 ms 64 bytes from 192.168.1.237: icmp_seq=2 ttl=128 time=5.25 ms 64 bytes from 192.168.1.237: icmp_seq=3 ttl=128 time=2.95 ms 64 bytes from 192.168.1.237: icmp_seq=4 ttl=128 time=9.10 ms ^C --- 192.168.1.237 ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3004ms rtt min/avg/max/mdev = 2.957/6.785/9.826/2.810 ms 

Any ideas why NMAP could be confused? I’m running the scan from my Ubuntu 16.04 box, the target is a Windows 10.