network scanners – is the UDP or TCP protocol best suited for a so called stealth counter scan for open or closed ports

network scanners – is the UDP or TCP protocol best suited for a so called stealth counter scan for open or closed ports – Information Security Stack Exchange

firewalls – Scan nmap through iptables restrictions

I need to find port and read info from this port. But there are iptables config, that blocks scans. Can you help to understand how find these port?

first:

ipset create scanned_ports hash:ip,port family inet hashsize 32768 maxelem 65536 timeout 1

iptables -A INPUT -p tcp -m state --state INVALID -j DROP
iptables -A INPUT -p tcp -m state --state NEW -m set ! --match-set scanned_ports src,dst -m hashlimit --hashlimit-above 1000/hour --hashlimit-burst 1000 --hashlimit-mode srcip --hashlimit-name portscan --hashlimit-htable-expire 10000 -j SET --add-set port_scanners src --exist
iptables -A INPUT -p tcp -m state --state NEW -m set --match-set port_scanners src -j DROP
iptables -A INPUT -p tcp -m state --state NEW -j SET --add-set scanned_ports src,dst


nohup python -mSimpleHTTPServer $_PORT > /dev/null &

second:

ipset create scanned_ports hash:ip,port family inet hashsize 32768 maxelem 65536 timeout 1

iptables -A INPUT -p tcp -m state --state INVALID -j DROP
iptables -A INPUT -p tcp -m state --state NEW -m set ! --match-set scanned_ports src,dst -m hashlimit --hashlimit-above 1000/hour --hashlimit-burst 1000 --hashlimit-mode srcip --hashlimit-name portscan --hashlimit-htable-expire 10000 -j SET --add-set port_scanners src --exist
iptables -A INPUT -p tcp -m state --state NEW -m set --match-set port_scanners src -j DROP
iptables -A INPUT -p tcp -m state --state NEW -j SET --add-set scanned_ports src,dst

iptables -I INPUT -p tcp --tcp-flags ALL SYN -j REJECT --reject-with tcp-reset --dport $_PORT

nohup python -mSimpleHTTPServer $_PORT > /dev/null &

postgresql – Slow index scan on postgres12

I have a table like that should enable index only data to be used
(Postgres-12)

CREATE TABLE sensor_values_2021q2
(
  ts             TIMESTAMPTZ(35, 6)                    NOT NULL,
  value          FLOAT8(17, 17) DEFAULT 'NaN' :: REAL  NOT NULL,
  sensor_id      INT4(10)                              NOT NULL,
);
CREATE UNIQUE INDEX sensor_values_2021q2_sensor_id_timestamp_index
  ON sensor_values_2021q2 (sensor_id, ts);
CREATE INDEX sensor_values_2021q2_sensor_id_timestamp_value_index
  ON sensor_values_2021q2 (sensor_id, ts, value);

This is one table that exists among many partition tables but I am just querying this one to help debugging why things are slow.

Ultimately I want to get the latest value for each sensor_id. To begin that I started with trying to get the last 10 minutes of data with a query like

EXPLAIN ANALYSE SELECT DISTINCT ON (sensor_id) sensor_id, ts, value FROM sensor_values_2021q2 sv
  WHERE sv.ts::TIMESTAMPTZ >= (NOW()::TIMESTAMPTZ + INTERVAL '-10 minute');

This seems really slow ? On first run I get

Unique  (cost=0.57..2372662.06 rows=2322 width=20) (actual time=116.977..106197.413 rows=2376 loops=1)
  ->  Index Scan using sensor_values_2021q2_sensor_id_timestamp_index on sensor_values_2021q2 sv  (cost=0.57..2372616.47 rows=18234 width=20) (actual time=116.973..106185.193 rows=17074 loops=1)
        Index Cond: (ts >= (now() + '-00:10:00'::interval))
Planning Time: 0.128 ms
Execution Time: 106198.833 ms

On the second run I get

Unique  (cost=0.57..2372774.91 rows=2322 width=20) (actual time=3.898..8260.538 rows=2412 loops=1)
  ->  Index Scan using sensor_values_2021q2_sensor_id_timestamp_index on sensor_values_2021q2 sv  (cost=0.57..2372729.33 rows=18235 width=20) (actual time=3.895..8255.034 rows=17477 loops=1)
        Index Cond: (ts >= (now() + '-00:10:00'::interval))
Planning Time: 0.159 ms
Execution Time: 8261.139 ms

The second run is acceptable I guess.

1, Why is the first run so slow ?

2, If its using the index scan both times why is it so much faster on the second run ? Should the index not be kept up to date ?

3, Why does it use the sensor_values_2021q2_sensor_id_timestamp_index and not sensor_values_2021q2_sensor_id_timestamp_value_index ?

Thanks

photos – Auto scan or manual capture in ID verification case

The case is to verify users’ ID documents (ID, drivers licence, passport) via smartphone. The goal is to get a clear and sharp photo of their ID for this step.

We currently can do 2 options:
A. auto scan, which records a range of photos when they pointing the camera to their ID and we select the best shot to verify.

B. we can do the traditional 1 button camera shot to capture the single shot. We add a confirm window asking whether the photo is clear and sharp.

Should I use the auto scan or manual capture?
What are the best practices?

tls – Why does nmap scan from a Window machine then a Kali machine give different outputs for the same target?

tls – Why does nmap scan from a Window machine then a Kali machine give different outputs for the same target? – Information Security Stack Exchange

scanning – Correct exposure negative scan

I’ve just started scanning my families negatives. When I get the scan, it’s a bit brighter than the print that was made that I can compare it to, but the print has less details in the dark areas.

Alas, if I bring down the exposure in post, I get an image more in line with the print, but instead those before mentioned shadows swallow some detail. Is there a right way do do it. Which is the “true” image?

azure – Fortify Static Scan – Upload FPR throws Access Denied

I have installed Fortify latest version(20.2) in my Agent and trying to run scan in pipeline(Azure DevOps). THe scans are working fine but when Im trying to upload the FPR file it throws the below error.

Error:
fortifyclient uploadFPR -url https://*********/ssc -authtoken *** -f /home/ec2-user/Agent01/_work/83/a/sca_artifacts/Es-Curator.fpr -application “10367:CAT Digital Platform” -applicationVersion Es-Curator
(2021-06-07T10:44:46 INFO) Log4j2 was configured successfully
(2021-06-07T10:44:48 INFO) Properties file does not exist in user directory fortify.properties
(2021-06-07T10:44:48 INFO) Properties file does not exist in user directory /server.properties
(2021-06-07T10:44:48 INFO) Properties file does not exist in user directory /server.properties
(2021-06-07T10:44:49 ERROR) Error -1: Access Denied. – Caused by: Access Denied.
Access Denied.
Access Denied. Please check your credentials and make sure the user has appropriate permissions. Please ensure the requested application exists, if any.

I check on credentials & Service connections everything looks fine.

Steps did:

  1. Generated new CI credentials, AzDO Credentials type, Upload Credentials. THen updated the Service connection
  2. Hard Coded and tried to execute the FortifyUpload with latest code that is mentioned using Command Line task
  3. Upgraded the Fortify static scan version to 5,6,7 in Azure DevOps

Tools:

  1. Azure DevOps
  2. Fortify Agent with 20.2
  3. Running on a Private Agent that has connectivity to our Fortify Server
  4. Fortify Static Code Assessment Task

Till last week it was working fine

query performance – In PostgreSQL, how can I make Bitmap Index Scan parallelized?

I want to improve the performance of an SQL statement.

I am on version 13.
Here are the sample codes and the query I am interested in.

drop table ords;
CREATE TABLE ords (
ORD_ID INT NOT NULL,
CUST_ID VARCHAR(10) NOT NULL,
ORD_DATE DATE NOT NULL,
ETC_CONTENT VARCHAR(100));

ALTER TABLE ords ADD CONSTRAINT ORDS_PK PRIMARY KEY(ORD_ID);

CREATE INDEX ORDS_X01 ON ORDS (CUST_ID);

INSERT INTO ORDS
SELECT i
      ,lpad(mod(i,1000)::text,10,'cust')
      ,date '2021-06-07'+mod(i,624)
      ,rpad('x',100,'x')
  FROM generate_series(1,1000000) a(i);

drop table delivery;

CREATE TABLE delivery (
ORD_ID INT NOT NULL,
VEHICLE_ID VARCHAR(10) NOT NULL,
START_DATE DATE NOT NULL,
END_DATE   DATE NOT NULL,
ETC_REMARKS VARCHAR(100));

INSERT INTO DELIVERY
SELECT i
     , MOD(i,1000)
     , date '2021-01-01' + mod(i,1000)
     , date '2021-01-05' + mod(i,1000)
     , rpad('x',100,'x')
  FROM generate_series(1,1000000) a(i);

ALTER TABLE DELIVERY ADD CONSTRAINT DELIVERY_PK primary key (ORD_ID);
CREATE INDEX DELIVERY_X01 ON DELIVERY(END_DATE, START_DATE);
CREATE INDEX DELIVERY_X02 ON DELIVERY(VEHICLE_ID);
select pg_relation_size('ords'), pg_relation_size('delivery');
analyze ords;
analyze delivery;
EXPLAIN(ANALYZE, BUFFERS, COSTS OFF)
SELECT A.*, B.*
  FROM ORDS A LEFT JOIN DELIVERY B
    ON (A.ORD_ID = B.ORD_ID
        AND (B.START_DATE <= DATE '2021-07-12' AND B.END_DATE >= DATE '2021-07-10'
             OR (B.VEHICLE_ID > '990')
             )
        )
 WHERE A.ORD_DATE BETWEEN DATE '2021-06-01' AND DATE '2021-07-10'
;

Below is the execution plan.

 Gather (actual time=86.645..101.685 rows=54501 loops=1)
   Workers Planned: 2
   Workers Launched: 2
   Buffers: shared hit=13615 read=23995, temp read=1196 written=1272
   ->  Parallel Hash Left Join (actual time=83.360..87.135 rows=18167 loops=3)
         Hash Cond: (a.ord_id = b.ord_id)
         Buffers: shared hit=13614 read=23995, temp read=1196 written=1272
         ->  Parallel Seq Scan on ords a (actual time=0.047..34.335 rows=18167 loops=3)
               Filter: ((ord_date >= '2021-06-01'::date) AND (ord_date <= '2021-07-10'::date))
               Rows Removed by Filter: 315166
               Buffers: shared hit=4968 read=14263
         ->  Parallel Hash (actual time=42.999..42.999 rows=5333 loops=3)
               Buckets: 32768  Batches: 8  Memory Usage: 608kB
               Buffers: shared hit=8450 read=9732, temp written=280
               ->  Parallel Seq Scan on delivery b (actual time=0.069..40.615 rows=5333 loops=3)
                     Filter: (((start_date <= '2021-07-12'::date) AND (end_date >= '2021-07-10'::date)) OR ((vehicle_id)::text > '990'::text))
                     Rows Removed by Filter: 328000
                     Buffers: shared hit=8450 read=9732
 Planning:
   Buffers: shared hit=20
 Planning Time: 0.357 ms
 Execution Time: 103.282 ms

I had expected that two Bitmap Index Scans using the delivery_x01 and delivery_x02 would appear followed by the BitmapOr operation when fetching rows from the DELIVERY table. Unlike what I thought, the planner chose to do a table scan with the parallelism.

To compare the execution plan I expected with the plan PostgreSQL chose, I set the parameter max_parallel_workers_per_gather to 0 and re-ran the SQL statement.

set max_parallel_workers_per_gather = 0;

–I re-ran the query and here is the resulting execution plan.

Hash Right Join (actual time=100.080..119.375 rows=54501 loops=1)
   Hash Cond: (b.ord_id = a.ord_id)
   Buffers: shared hit=3304 read=18847, temp read=903 written=903
   ->  Bitmap Heap Scan on delivery b (actual time=1.374..4.277 rows=16000 loops=1)
         Recheck Cond: (((end_date >= '2021-07-10'::date) AND (start_date <= '2021-07-12'::date)) OR ((ve
hicle_id)::text > '990'::text))
         Heap Blocks: exact=2182
         Buffers: shared hit=2919
         ->  BitmapOr (actual time=1.108..1.109 rows=0 loops=1)
               Buffers: shared hit=737
               ->  Bitmap Index Scan on delivery_x01 (actual time=0.809..0.810 rows=7000 loops=1)
                     Index Cond: ((end_date >= '2021-07-10'::date) AND (start_date <= '2021-07-12'::date)
)
                     Buffers: shared hit=726
               ->  Bitmap Index Scan on delivery_x02 (actual time=0.298..0.298 rows=9000 loops=1)
                     Index Cond: ((vehicle_id)::text > '990'::text)
                     Buffers: shared hit=11
   ->  Hash (actual time=98.373..98.374 rows=54501 loops=1)
         Buckets: 32768  Batches: 4  Memory Usage: 2331kB
         Buffers: shared hit=384 read=18847, temp written=697
         ->  Seq Scan on ords a (actual time=0.122..85.072 rows=54501 loops=1)
               Filter: ((ord_date >= '2021-06-01'::date) AND (ord_date <= '2021-07-10'::date))
               Rows Removed by Filter: 945499
               Buffers: shared hit=384 read=18847
 Planning:
   Buffers: shared hit=12
 Planning Time: 0.232 ms
 Execution Time: 120.843 ms

By using Bitmap Index Scan and BitmapOr operations I could drop the number of block I/Os, but the execution time increased from 103 ms to 120 ms. It seems that the parallelism is the main factor of the execution time gap. So I infer that if parallelism kicks in in the Bitmap Index Scan operation, the query would become faster.

Finally, My question is:
How can I make the Bitmap Index Scan operation parallelized?

DreamProxies - Cheapest USA Elite Private Proxies 100 Cheapest USA Private Proxies Buy 200 Cheap USA Private Proxies 400 Best Private Proxies Cheap 1000 USA Private Proxies 2000 USA Private Proxies 5000 Cheap USA Private Proxies ExtraProxies.com - Buy Cheap Private Proxies Buy 50 Private Proxies Buy 100 Private Proxies Buy 200 Private Proxies Buy 500 Private Proxies Buy 1000 Private Proxies Buy 2000 Private Proxies ProxiesLive.com Proxies-free.com New Proxy Lists Every Day Proxies123.com Proxyti.com Buy Quality Private Proxies